/srv/irclogs.ubuntu.com/2013/08/22/#upstart.txt

wrouesnelis 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 actions03:33
jamescarrhow can I stop an upstart job that claims it is running but the program has actually exited08:20
AricI made a .conf file in /etc/init and did start job name, it said started but I don't see it running10:04
jodhAric: can we see the job?10:13
Aricsure10:14
Arichttp://pastie.org/private/jf5xpx4vaceaohig3bd3w10:15
Aricstatus gives > meteor-subh start/running10:16
AricI made 7 of these very similar? like "meteor-ussunnah-www start/running, process 28231"10:16
jodhAric: 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
Aricso do it in a script end script?10:18
jodhAric: no, do what I've said above.10:18
jodhAric: 'chdir' is an upstart stanza (keyword). so your job can essentially become:10:19
jodhchdir /var/www/subh10:19
Arichttp://pastie.org/private/5q4tgxezkuuxwgffdo0wq10:19
jodhexec meteor --port 340010:19
Ariclike that? i haven't used oure bash much10:19
Aricpure*10:19
jodhAric: yes10:19
Aricty jodh i'll try that10:19
jodhAric: the 'chdir' is not bash - it's upstart syntax.10:19
Aricok10:20
Aricnow i'm getting "start: Unknown job: meteor-subh"10:29
jodhAric: run "init-checkconf /etc/init/your-job.conf"10:29
Aricok10:29
AricERROR: cannot run as root10:30
jodhAric: as it says, run it as a non-root user.10:30
Aricok10:30
Ariccreated a user for it and now on start got:10:33
Aricstart: 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
AricERROR: cannot find dbus-launch10:34
jodhAric: looks like you are logged into a server remotely? try running it locally on a system with dbus installe.d10:36
Arici have to ssh to this server, it's my web server10:37
jodhAric: 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
Aricthis is a server, no gui10:38
Aricubuntu server10:38
Arichere is the job10:38
Arichttp://pastie.org/private/5nu7mljokrgcuwc6688a10:38
jodhmeteor-subh"10:43
jodhAric: that job is valid. are you sure it's called /etc/init/meteor-subh.conf?10:43
Aricroot@web:/etc/init# cat meteor-subh.conf 10:44
Aricwas how i got it  for the pastie10:44
Aricwhen i run it as root i get no errors but it doesn't work because I'm root10:44
Aricroot@web:/etc/init# start meteor-subh10:44
Aricmeteor-subh start/running10:44
Aricthen:10:45
Aricroot@web:/etc/init# sudo -u upstart start meteor-subh10:45
Aricstart: 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
jodhAric: only root can start system jobs, hence it won't work as user upstart.10:45
Aricroot@web:/etc/init# init-checkconf /etc/init/meteor-subh.conf 10:46
AricERROR: cannot run as root10:46
Aricso if i can't start it as upstart or root than?10:46
jodhAric: forget that tool for now - that's not trying to start the job.10:46
jodhAric: your job is running - you've shown us above.10:47
Arichmm but the meteor server never got started10:49
Aricif i go to the directory and type meteor --port 340010:49
Aricit works fine10:49
jodhsudo cat /var/log/upstart/meteor-subh.log10:49
Aric/usr/local/bin/meteor: line 34: HOME: unbound variable10:50
Arichmm10:50
Arici'll check with the meteor guys10:50
Aricty for your help10:50
jodhAric: 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-start10:50
Aricty jodh 10:51
jodhAric: if it's just HOME, then add "env HOME=/home/..." to the job.10:51
Aricwould home be my apps directory right?10:51
jodhAric: 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
jodhAric: I have no idea what meteor expects it to be set to.10:52
Aricok10:52
blakemy 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!