/srv/irclogs.ubuntu.com/2012/05/21/#upstart.txt

=== bradleyayers_ is now known as bradleyayers
muzzolhi11:49
muzzolis there any variable that holds the action that triggers it? (start, stop, restart)11:50
muzzoli want to do something like this: http://pastebin.com/XFJJsceu11:51
muzzolis that possible?11:51
lpappjodh: hey, I do not understand what upstart does, but when I run the command manually, the "daemon" works as expected unlike with an upstart job :(16:49
jodhlpapp: where does $ACTION come from?16:50
jodhlpapp: have you looked at http://upstart.ubuntu.com/cookbook/ ?16:51
jodhlpapp: your job looks good aside from that variable which isn't being set, so the script will presumably fail. See also http://upstart.ubuntu.com/cookbook/#obtaining-a-log-of-a-script-section16:52
djszapijodh: do you have a clue what can cause that ?16:56
djszapihttp://paste.kde.org/483674/ -> this is my upstart job16:57
doki_penwhat's the best way to kick off a proc as an unprivileged user?17:12
djszapiinit-checkconf /etc/init/foobar.conf17:23
djszapiERROR: failed to ask Upstart to check conf file17:23
djszapiwhat is this, SpamapS ideas ?17:23
djszapislangasek: same issue again17:25
djszapithe exec line works, if I run manually.17:26
djszapibut if I use start foobar, it does not.17:26
slangasekoh, really?17:26
slangasekso even running 'start foobar' fails?17:26
djszapinope17:27
djszapifunky thing is that, the ps aux17:27
djszapioutput shows the process execed :D17:27
djszapibut the daemon does not work as expected.17:27
slangasekdjszapi: is the code for the daemon open?17:27
slangasekalso, can you try modifying the job to run /usr/bin/foobar under strace, and capture the syscall output?17:28
djszapislangasek: first step would be to get the daemon output logged into somewhere.17:28
djszapino, the daemon is a commercial stuff17:29
djszapicannot disclose, sorry.17:29
slangasekok17:29
djszapibut that helps, if I know how to log the output.17:29
slangasekdaemon output logged> what version of Ubuntu are you running again?17:29
slangasekthe upstart from 12.04 has logging support17:29
djszapiLinux linaro-ubuntu-desktop 3.1.1-26-linaro-lt-omap #26~lt~ci~20120325001352+1332635991~4f6ec49b-Ubuntu SMP PREEMPT  armv7l armv7l armv7l GNU/Linux17:30
djszapi1.3-0ubuntu12~linaro217:31
slangasekif you're using 12.04, or if you can upgrade upstart to that version, you'll get a /var/log/upstart/foobar.log containing all the output17:31
slangasekotherwise, you can use shell redirection directly in the upstart job17:31
slangasekexec /usr/bin/foobar receive /dev/ttyUSB0 38400 > /var/log/my-log 2>&117:31
slangasek^^ should work17:31
slangasekif it *doesn't* work, you just need to wrap the exec with a script / end script17:32
djszapilet us see if that redirection works.17:33
djszapislangasek: foudn the issue. The log helped a lot, thanks.17:59
djszapiit is now working :)17:59
slangasekok17:59
gchristensenhi, my upstart script seems to fail to start when the system is starting, even though I've given it a very relaxed respawn limit, and even put a 3 second sleep in the script. here it is: https://gist.github.com/96512f0ef329d5b022e421:56
slangasekgchristensen: a) your start and stop conditions are identical, which is certainly an error; b) 'mysql' is not a standard upstart event, so unless you've written something that outputs it, you'll never satisfy the start condition22:00
gchristensenI see22:00
slangasekyou probably want 'start on started mysql'22:00
slangasekand 'stop on stopping mysql'22:00
JoeJulianIf an upstart script has to wait for the network to be started, what's the string it needs to WAIT_FOR?22:01
gchristensenslangasek: that might do it. thank you for your help, I'll read the manual closer22:02
slangasekyour 'sleep 3' should be unnecessary, btw; the mysql upstart job should, like all upstart jobs, have already been written such that the mysql server is up and ready to receive queries before emitting 'started'22:02
gchristensenslangasek: that was a last-ditch attempt22:02
slangasekJoeJulian: unless there's a specific reason that your service needs to start earlier, best practice here is 'start on runlevel [2345]'22:03
JoeJulianSo the network should be started already at that point?22:04
slangasekJoeJulian: definitely22:04
JoeJulianThe problem seems to be with semiosis' upstart scripts for glusterfs. One user has encountered an issue with resolving hostnames while glusterd is starting. I presumed this was due to the network not being started.22:05
slangasekJoeJulian: the exception is if your network is controlled by network-manager, in which case there's no guaranteed synchronization event for the network being up22:05
JoeJulianDoes debian use network-manager? (not a debian user myself)22:05
slangasekJoeJulian: Debian supports network-manager... it would not be used by default on a server, be it Debian or Ubuntu22:06
slangasekand Debian also doesn't use upstart22:07
slangasek(currently)22:07
JoeJulianOk. Thank you. I'm not very good at supporting non-rpm based distros. :D22:08
slangasek:)22:09
slangasekso are the upstart jobs that you're concerned about different than the ones in the glusterfs-server package shipped in Ubuntu?22:09
slangasek(which does indeed show 'start on runlevel [...]'22:10
slangasek)22:10
JoeJulianI /think/ that those are, indeed, the ones that semiosis wrote.22:10
JoeJulianAnd I got two users mixed up. It is ubuntu.22:11
slangasekright - that's much more plausible :)22:12
slangasekso yeah, if it was a server install, the existing job should already be correct22:12
slangasekif someone's doing this on a desktop install, there could be problems, depending on the configuration of network-manager22:12
JoeJulianThis guy is a former windows admin. I think you're on to something with the networkmanager idea. 22:12
gchristensenslangasek: what "start on" output should I be listening to for something that expects networking and a writable filesystem? ie: a generally usable machine22:13
slangasekgchristensen: that's precisely the 'start on runlevel [2345]' I mentioned to JoeJulian 22:13
JoeJulianLooks like you need a bot with an automatic notice. :D22:13
JoeJulianhehe22:13
slangasekif you look in /etc/init/rc-sysinit.conf, you'll see this defined in terms of 'filesystem and static-network-up'22:14
gchristensenI see22:14
gchristensenthank you22:15
JoeJulian"Desktop 32bit. Stock image"! Thanks slangasek. Good catch.22:24
slangasekok22:24
slangasektoo bad that there's no upstart event to key on in that case22:25
slangasekbut yeah, if the user can switch to static network config via /etc/network/interfaces, it'll work around this problem22:25
JoeJulianIt's supposed to be a server anyway. I'll just make him reinstall.22:26
slangasek:)22:27

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