schnitzl | hi guys. i have some problems with upstart. | 11:37 |
---|---|---|
schnitzl | after adding a scrit to /etc/init | 11:37 |
schnitzl | do i need to add it to the rc.local lile "start foo" ? | 11:38 |
schnitzl | or should it start automatically on every reboot when its palced in /etc/init | 11:38 |
jodh | schnitzl: it auto-starts: http://upstart.ubuntu.com/cookbook/#upstart-s-design-why-it-is-revolutionary | 11:53 |
schnitzl | i wonder what i did wrong :( i used a given script for the irc bounder znc. i just copy& pasted it. doesnt work! https://raymii.org/s/tutorials/Install_the_Lastest_ZNC_from_Source_in_Ubuntu.html | 11:56 |
schnitzl | its /etc/init/znc.conf | 11:56 |
schnitzl | when i sudo reboot it does not auto start. :( | 11:56 |
jodh | schnitzl: run 'init-checkconf /etc/init/yourjob.conf' to check if the syntax is valid. | 12:29 |
schnitzl | k sec. | 12:29 |
schnitzl | ERROR: failed to ask Upstart to check conf file | 12:30 |
schnitzl | jodh: this means the syntax is broken ? | 12:53 |
jY | schnitzl: pastebin your conf | 13:39 |
schnitzl | http://pastebin.com/xSyatNqW | 13:44 |
jY | as root can you su - znc | 13:47 |
jY | then as znc run /usr/local/bin/znc --datadir=/var/lib/znc -f | 13:48 |
schnitzl | so i need a user called znc ? | 13:50 |
jY | yes | 13:50 |
jY | that is what setuid means | 13:50 |
schnitzl | and if i reboot, will it auto start znc ? | 13:50 |
jY | its runnung that command as that user | 13:50 |
jY | yes | 13:50 |
schnitzl | yayyy! :D so znc user is missing. this iwll fix it. | 13:51 |
schnitzl | which line in the script tells it to run it as user znc ? | 13:51 |
jY | setuid | 13:51 |
schnitzl | bamm finally. thank you! | 13:52 |
schnitzl | guess ima kill my bnc now. thanks again :) | 13:52 |
* xnox also uses znc =) | 14:55 | |
rewritten | hello | 17:52 |
rewritten | can anyone help me? | 17:53 |
rewritten | I'd like to configure a number of similar services (similarly to the typical mongrel cluster) | 17:53 |
rewritten | all the services have the same exec, except for the STOUD redirection. But it may perfectly be related to the name of the script file. | 17:54 |
rewritten | so the question is: can I just symlink the conf file to many others, and have each one detect its own name and use it? | 17:55 |
benlangfeld | Good afternoon guys. I'm having some trouble with Upstart and setting PATH. I'm trying to do this: export PATH=~/.rbenv/shims:~/.rbenv/bin:$PATH, but it looks like maybe $PATH is not being interpolated correctly. What am I doing wrong? | 18:58 |
xnox | benlangfeld: can you post your full job? | 19:14 |
xnox | benlangfeld: is that for saucy session init? | 19:14 |
benlangfeld | xnox: https://gist.github.com/benlangfeld/a5bde3e2ba7991a4939d | 19:14 |
benlangfeld | I have no idea what you mean :) | 19:14 |
xnox | benlangfeld: $HOME is not set, so "~" doesn't epand to anything. | 19:15 |
xnox | benlangfeld: upstart jobs are executed as root user without $HOME set. without your user-account environment. | 19:15 |
benlangfeld | xnox: Doesn't make any difference, it's not ending up in PATH in the bin/brain script. | 19:16 |
benlangfeld | xnox: Expanded or not, it doesn't really matter :) | 19:16 |
xnox | benlangfeld: it does matter. since your PATH is invalid and doesn't even have "start-stop-daemon" on it. | 19:17 |
xnox | =) | 19:17 |
xnox | hence exec not able to find "start-stop-daemon" | 19:17 |
benlangfeld | xnox: Ok, I'll clear that up and see what happens. | 19:17 |
xnox | benlangfeld: remove env PATH= line, remove export PATH, remove #source line | 19:18 |
xnox | benlangfeld: and instead use | 19:18 |
xnox | benlangfeld: exec PATH=/full/path/to/home/user/.rbenv/shims:$PATH start-stop-daemon .... | 19:18 |
xnox | benlangfeld: not sure why you make your script so complicated thought. | 19:19 |
benlangfeld | What's complicated about it? | 19:19 |
xnox | benlangfeld: i left a comment on the gist. | 19:21 |
benlangfeld | xnox: I thought use of start-stop-daemon was recommended since upstart won't manage PIDs? | 19:22 |
xnox | benlangfeld: it doesn't need PIDs | 19:22 |
benlangfeld | hmm, ok | 19:22 |
xnox | benlangfeld: start-stop-daemon is discouraged, but so many people cargo cult that from somewhere I really want to know where you find that =) | 19:23 |
xnox | benlangfeld: i don't know what bin/brain is. | 19:23 |
xnox | benlangfeld: if it forks, add "expect fork". If it daemonises add "expect daemon" | 19:23 |
xnox | benlangfeld: logs are storred in /var/log/upstart/adam-brain.log | 19:23 |
xnox | (both stdout and stderr) | 19:23 |
benlangfeld | xnox: Can I configure the log path? | 19:24 |
benlangfeld | As for start-stop-daemon, it's pretty much everywhere you google about upstart config :) | 19:24 |
benlangfeld | For example here: http://stackoverflow.com/questions/9972023/ubuntu-upstart-and-creating-a-pid-for-monitoring | 19:25 |
benlangfeld | I updated the gist. The job no longer validates (upstart's error in that case is awful btw) | 19:26 |
xnox | benlangfeld: no, log path is not configurable. you can configger one with e.g. logger | 19:26 |
benlangfeld | aha, it's setuid | 19:27 |
xnox | yeah, sorry. | 19:28 |
xnox | $ init-checkconf adam-brain.conf | 19:28 |
xnox | ERROR: File adam-brain.conf: syntax invalid: | 19:28 |
xnox | init:adam-brain.conf:9: Unknown stanza | 19:28 |
xnox | $ init-checkconf adam-brain.conf | 19:28 |
xnox | File adam-brain.conf: syntax ok | 19:28 |
xnox | with setuid. | 19:28 |
benlangfeld | It still doesn't like having PATH after the exec | 19:30 |
benlangfeld | I think I need to export it | 19:30 |
benlangfeld | gist updated again, I'm not sure what's going on here | 19:33 |
benlangfeld | Using env and specifying the full path works, it's just the interpolation that doesn't. That'll do for me for now. Thanks for your help xox. | 19:42 |
xnox | benlangfeld: i thought it would work. Seems to work here if I replace "exec" with "script .. end script" | 20:19 |
xnox | benlangfeld: see new commend | 20:19 |
jY | http://www.buttpaste.com/products/original-butt-paste | 22:49 |
Generated by irclog2html.py 2.7 by Marius Gedminas - find it at mg.pov.lt!