wrouesnel | is there a way to "shim" or extend a particular upstart script? I'd like to have a script that runs after say, mountall has executed but before it emits any other events or actions | 03:33 |
---|---|---|
jamescarr | how can I stop an upstart job that claims it is running but the program has actually exited | 08:20 |
Aric | I made a .conf file in /etc/init and did start job name, it said started but I don't see it running | 10:04 |
jodh | Aric: can we see the job? | 10:13 |
Aric | sure | 10:14 |
Aric | http://pastie.org/private/jf5xpx4vaceaohig3bd3w | 10:15 |
Aric | status gives > meteor-subh start/running | 10:16 |
Aric | I made 7 of these very similar? like "meteor-ussunnah-www start/running, process 28231" | 10:16 |
jodh | Aric: that "cd /var/www/subh/" won't work - the main stanza that calls meteor will run in '/'. The solution is to remove the pre-start and add 'chdir /var/www/subh/' to your job. | 10:18 |
Aric | so do it in a script end script? | 10:18 |
jodh | Aric: no, do what I've said above. | 10:18 |
jodh | Aric: 'chdir' is an upstart stanza (keyword). so your job can essentially become: | 10:19 |
jodh | chdir /var/www/subh | 10:19 |
Aric | http://pastie.org/private/5q4tgxezkuuxwgffdo0wq | 10:19 |
jodh | exec meteor --port 3400 | 10:19 |
Aric | like that? i haven't used oure bash much | 10:19 |
Aric | pure* | 10:19 |
jodh | Aric: yes | 10:19 |
Aric | ty jodh i'll try that | 10:19 |
jodh | Aric: the 'chdir' is not bash - it's upstart syntax. | 10:19 |
Aric | ok | 10:20 |
Aric | now i'm getting "start: Unknown job: meteor-subh" | 10:29 |
jodh | Aric: run "init-checkconf /etc/init/your-job.conf" | 10:29 |
Aric | ok | 10:29 |
Aric | ERROR: cannot run as root | 10:30 |
jodh | Aric: as it says, run it as a non-root user. | 10:30 |
Aric | ok | 10:30 |
Aric | created a user for it and now on start got: | 10:33 |
Aric | start: Rejected send message, 1 matched rules; type="method_call", sender=":1.19" (uid=1000 pid=29067 comm="start meteor-subh ") interface="com.ubuntu.Upstart0_6.Job" member="Start" error name="(unset)" requested_reply="0" destination="com.ubuntu.Upstart" (uid=0 pid=1 comm="/sbin/init") | 10:33 |
Aric | ERROR: cannot find dbus-launch | 10:34 |
jodh | Aric: looks like you are logged into a server remotely? try running it locally on a system with dbus installe.d | 10:36 |
Aric | i have to ssh to this server, it's my web server | 10:37 |
jodh | Aric: somehow, your changes have invalidated that job. If you cannot run init-checkconf on a system with dbus (any ubuntu desktop say), can you paste the updated job again? | 10:38 |
Aric | this is a server, no gui | 10:38 |
Aric | ubuntu server | 10:38 |
Aric | here is the job | 10:38 |
Aric | http://pastie.org/private/5nu7mljokrgcuwc6688a | 10:38 |
jodh | meteor-subh" | 10:43 |
jodh | Aric: that job is valid. are you sure it's called /etc/init/meteor-subh.conf? | 10:43 |
Aric | root@web:/etc/init# cat meteor-subh.conf | 10:44 |
Aric | was how i got it for the pastie | 10:44 |
Aric | when i run it as root i get no errors but it doesn't work because I'm root | 10:44 |
Aric | root@web:/etc/init# start meteor-subh | 10:44 |
Aric | meteor-subh start/running | 10:44 |
Aric | then: | 10:45 |
Aric | root@web:/etc/init# sudo -u upstart start meteor-subh | 10:45 |
Aric | start: Rejected send message, 1 matched rules; type="method_call", sender=":1.25" (uid=1000 pid=29471 comm="start meteor-subh ") interface="com.ubuntu.Upstart0_6.Job" member="Start" error name="(unset)" requested_reply="0" destination="com.ubuntu.Upstart" (uid=0 pid=1 comm="/sbin/init") | 10:45 |
jodh | Aric: only root can start system jobs, hence it won't work as user upstart. | 10:45 |
Aric | root@web:/etc/init# init-checkconf /etc/init/meteor-subh.conf | 10:46 |
Aric | ERROR: cannot run as root | 10:46 |
Aric | so if i can't start it as upstart or root than? | 10:46 |
jodh | Aric: forget that tool for now - that's not trying to start the job. | 10:46 |
jodh | Aric: your job is running - you've shown us above. | 10:47 |
Aric | hmm but the meteor server never got started | 10:49 |
Aric | if i go to the directory and type meteor --port 3400 | 10:49 |
Aric | it works fine | 10:49 |
jodh | sudo cat /var/log/upstart/meteor-subh.log | 10:49 |
Aric | /usr/local/bin/meteor: line 34: HOME: unbound variable | 10:50 |
Aric | hmm | 10:50 |
Aric | i'll check with the meteor guys | 10:50 |
Aric | ty for your help | 10:50 |
jodh | Aric: that topic is covered extensively in the cookbook. See: http://upstart.ubuntu.com/cookbook/#checking-how-a-service-might-react-when-run-as-a-job, http://upstart.ubuntu.com/cookbook/#see-the-environment-a-job-runs-in, http://upstart.ubuntu.com/cookbook/#determining-why-your-service-fails-to-start | 10:50 |
Aric | ty jodh | 10:51 |
jodh | Aric: if it's just HOME, then add "env HOME=/home/..." to the job. | 10:51 |
Aric | would home be my apps directory right? | 10:51 |
jodh | Aric: if the job is not designed to run as root (and I'm guessing it isn't since it needs HOME), look at the 'setuid' and 'setgid' stanzas in the cookbook or "man 5 init". | 10:52 |
jodh | Aric: I have no idea what meteor expects it to be set to. | 10:52 |
Aric | ok | 10:52 |
blake | my script just hangs on 'service [scriptname] start/stop'... even if the only line in it is 'exec cd .' (ubuntu 12.04 amd64 server) | 15:40 |
=== jamescarr_ is now known as jamescarr | ||
=== jamescarr_ is now known as jamescarr | ||
=== jamescarr_ is now known as jamescarr | ||
=== jamescarr_ is now known as jamescarr |
Generated by irclog2html.py 2.7 by Marius Gedminas - find it at mg.pov.lt!