/srv/irclogs.ubuntu.com/2013/10/30/#upstart.txt

crankharderany way I can tell uptstart to load init files in a given path?14:40
crankharderinclude directive of sorts14:40
jodhcrankharder: what are you trying to achieve?14:43
crankharderI want puppet to set up and configure a directory full of init scripts14:44
crankharderI can't tell puppet to monitor /etc/init since it'll delete all the scripts that puppet doesn't own14:44
crankharderso if upstart monitored /etc/init/puppet just like /etc/init we'd be good to go14:44
jodhcrankharder: it does14:45
crankharderheh, hmm. ok14:45
crankharderjodh: https://gist.github.com/crankharder/4fa79577333ca89bd54614:47
crankharderseems to not like that job14:47
jodhcrankharder: What does 'init-checkconf <your_job>.conf' say?14:52
crankharder$ init-checkconf resque_worker_50.conf14:52
crankharderERROR: file resque_worker_50.conf does not exist14:52
jodhcrankharder: init-checkconf '/full/path/to/file.conf'14:53
jodhcrankharder: your 'start on' should probably be 'start on runlevel [2345]' and your 'stop on' is currently wrong (unless you are emitting shutdown somewhere?) - it should be 'stop on runlevel [016]'.14:56
jodhcrankharder: also, you don't need to do your own redirection/logging - upstart does it for you, logging all job output to /var/log/upstart/.14:57
crankharderhad some perms issue, but now getting this:14:57
crankharder$ init-checkconf /etc/init/puppet/resque_worker_50.conf14:57
crankharderERROR: failed to ask Upstart to check conf file14:57
crankharder/etc/init/puppet is 755 and the job is 74414:57
crankharderjodh: okay, those points may be fair -- but I have the same job (named differently) in /etc/init and it works14:57
jodhcrankharder: what distro version is this?14:58
crankharderubuntu 12.0414:58
crankharderI get this too:14:59
crankharder$ init-checkconf /etc/init/resque_worker_5.conf14:59
crankharderERROR: failed to ask Upstart to check conf file14:59
crankharderfor someone not in my nested path14:59
crankhardersomething14:59
jodhcrankharder: copy the file to /tmp, ensure it is readable, then 'init-checkconf -d /tmp/foo.conf'15:01
jodhcrankharder: if that still fails, I'm guessing you have a dbus issue - is dbus-launch available?15:01
jodhcrankharder: your job can also use use 'setuid', 'setgid' and 'chdir' to simplify the main job to be just 'exec rake environment resque:work QUEUE=high,medium RAILS_ENV=production PIDFILE=/tmp/resque_worker_50.pid VERBOSE=1' I think.15:04
jodhcrankharder: putting pid files in /tmp looks like a bad idea btw.15:04
crankharderyea, looks like dbus issues.  no, i dont have dbus-launch15:06
crankharderoutput here: https://gist.github.com/crankharder/1ee1e4cb50cc8353a3e415:08
crankharderit's a bit weird init-checkconf doesn't work on scripts in /etc/init/ ? -- maybe this isn't the issue?15:09
jodhcrankharder: maybe copy your job to a desktop system with a full dbus setup and run init-checkconf on it there. I wonder if you have any odd whitespace chars in that job - copied from windows maybe?15:20
crankharderso, testing on a more barebones ubuntu 12.04 isntance I have w/o my jobs in it... installing dbus-launch now15:21
jodhcrankharder: another way to check the job without using init-checkconf is: sudo initctl log-priority debug;sudo touch /etc/init/foo.conf;sudo initctl log-priority message' and look at dmesg/syslog to see what messages upstart logged about foo.15:21
crankharder$ init-checkconf /etc/init/acpid.conf                                                                                                         │15:22
crankharderERROR: failed to ask Upstart to check conf file15:22
crankharder-d shows samee waiting for dbus issues15:22
jodhcrankharder: init-checkconf won't work unless dbus-launch works.15:23
crankhardernot really familliar with dbus launch.  define works?  https://gist.github.com/crankharder/53351450db600a15252e15:24
jodhcrankharder: let's forget init-checkconf - I've run it locally and your job as pasted is syntactically valid. I've given you another option above to syntax check anyway. I suspect the job on disk is not the same as pasted - it might contain '\r's or similar if you copied it from a windows machine maybe?15:26
jodhcrankharder: try the technique above and see what upstart logs to the system log - it will tell you where it is failing to parse the job.15:27
crankharderokay, so i'm on a new system w/o my custom jobs and I still see the same issue.  It's not related to my custom job.15:29
jodhcrankharder: which issue? the job or init-checkconf?15:29
crankharderhttps://gist.github.com/crankharder/cd04bcb4d80259ba58d315:29
jodhcrankharder: 'sudo status puppet/tty6'15:29
crankharderokay, that works15:30
crankharderunfortunately I see nothing in syslog or dmesg from this:  sudo initctl log-priority debug ; sudo touch  /etc/init/cron.conf ; sudo initctl log-priority message15:32
jodhcrankharder: are you by chance running in a cloud environment that uses overlayfs?15:33
crankharderi'm running ubuntu in virtualbox... but i dont know what overlayfs is, so certainly didn't set tha tup15:33
jodhcrankharder: mount|grep overlay15:34
crankhardernothing15:34
crankharderokay, I removed all my custom init scripts and moved tty6 into this puppet path.  giving my unknown job puppet/tty6 on this system (but it worked on the more barebones one)15:38
jodhcrankharder: this makes no sense - your system sounds broken.15:38
crankharder/etc/init/puppet is 755 on both /etc/init/puppet/tty6.conf is 744 on both15:39
crankharderI can test this at different points as puppet sets up the system to see if that helps15:41
crankharderjodh: thanks for the help -- i'll post here if I can track down what change makes this break15:43
jodhcrankharder: you said this job runs fine in /etc/init/ but not in /etc/init/puppet/ - is that now resolved now you know how to start a job in a sub-directory?15:44
crankharderthe subdirectory thing works on a box that hasn't had all my puppet configs (lots of them) applied.  same version of ubuntu tho15:45
crankharderso I assume it's something puppet is configuring that's causing this15:45
jodhcrankharder: I'd certainly make sure you have a pristine server environment available (ie no puppet) for testing the basic upstart jobs.15:48
CharlieSuI've got an UpStart task that I'd like to print a message to the console once run..  'start job' should produce something on the users screen..  How can I do this?  I've tried 'console output' 17:04
xnoxCharlieSu: at boot "console output" will print to the active console / boot messages. If run interractively it will print where-ever it's run.17:07
CharlieSuxnox: doesn't seem to be doing that for me..  I just use "logger 'message'" right?17:31
xnoxCharlieSu: no, just do "echo"17:38
xnoxlogger will go whever logger logs, e.g. syslog.17:38
xnoxCharlieSu: "console " stanza controls where job's stdout and stderr is redirected, default is "log" which is under /var/log/upstart/, "output" is to normal stdout and etc.17:39
=== JanC_ is now known as JanC

Generated by irclog2html.py 2.7 by Marius Gedminas - find it at mg.pov.lt!