[03:33] 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 [08:20] how can I stop an upstart job that claims it is running but the program has actually exited [10:04] I made a .conf file in /etc/init and did start job name, it said started but I don't see it running [10:13] Aric: can we see the job? [10:14] sure [10:15] http://pastie.org/private/jf5xpx4vaceaohig3bd3w [10:16] status gives > meteor-subh start/running [10:16] I made 7 of these very similar? like "meteor-ussunnah-www start/running, process 28231" [10:18] 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] so do it in a script end script? [10:18] Aric: no, do what I've said above. [10:19] Aric: 'chdir' is an upstart stanza (keyword). so your job can essentially become: [10:19] chdir /var/www/subh [10:19] http://pastie.org/private/5q4tgxezkuuxwgffdo0wq [10:19] exec meteor --port 3400 [10:19] like that? i haven't used oure bash much [10:19] pure* [10:19] Aric: yes [10:19] ty jodh i'll try that [10:19] Aric: the 'chdir' is not bash - it's upstart syntax. [10:20] ok [10:29] now i'm getting "start: Unknown job: meteor-subh" [10:29] Aric: run "init-checkconf /etc/init/your-job.conf" [10:29] ok [10:30] ERROR: cannot run as root [10:30] Aric: as it says, run it as a non-root user. [10:30] ok [10:33] created a user for it and now on start got: [10:33] 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:34] ERROR: cannot find dbus-launch [10:36] Aric: looks like you are logged into a server remotely? try running it locally on a system with dbus installe.d [10:37] i have to ssh to this server, it's my web server [10:38] 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] this is a server, no gui [10:38] ubuntu server [10:38] here is the job [10:38] http://pastie.org/private/5nu7mljokrgcuwc6688a [10:43] meteor-subh" [10:43] Aric: that job is valid. are you sure it's called /etc/init/meteor-subh.conf? [10:44] root@web:/etc/init# cat meteor-subh.conf [10:44] was how i got it for the pastie [10:44] when i run it as root i get no errors but it doesn't work because I'm root [10:44] root@web:/etc/init# start meteor-subh [10:44] meteor-subh start/running [10:45] then: [10:45] root@web:/etc/init# sudo -u upstart start meteor-subh [10:45] 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] Aric: only root can start system jobs, hence it won't work as user upstart. [10:46] root@web:/etc/init# init-checkconf /etc/init/meteor-subh.conf [10:46] ERROR: cannot run as root [10:46] so if i can't start it as upstart or root than? [10:46] Aric: forget that tool for now - that's not trying to start the job. [10:47] Aric: your job is running - you've shown us above. [10:49] hmm but the meteor server never got started [10:49] if i go to the directory and type meteor --port 3400 [10:49] it works fine [10:49] sudo cat /var/log/upstart/meteor-subh.log [10:50] /usr/local/bin/meteor: line 34: HOME: unbound variable [10:50] hmm [10:50] i'll check with the meteor guys [10:50] ty for your help [10:50] 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:51] ty jodh [10:51] Aric: if it's just HOME, then add "env HOME=/home/..." to the job. [10:51] would home be my apps directory right? [10:52] 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] Aric: I have no idea what meteor expects it to be set to. [10:52] ok [15:40] my script just hangs on 'service [scriptname] start/stop'... even if the only line in it is 'exec cd .' (ubuntu 12.04 amd64 server) === jamescarr_ is now known as jamescarr === jamescarr_ is now known as jamescarr === jamescarr_ is now known as jamescarr === jamescarr_ is now known as jamescarr