/srv/irclogs.ubuntu.com/2013/05/11/#upstart.txt

=== JanC_test_ is now known as JanC_test
rawtazhi!10:49
rawtazquestion: i am writing a conf for a third paty script which in turn starts a daemon. but it doesnt return a PID so i need to make a post-start script that grabs the pid. i can do that, but how should i hand the resolved PID of the final process to upstart so that it can keep track of things? should i e.g. put it in a file (pidfile maybe), and/or should i set a variable in the upstart conf, or something else?10:51
rawtaznot having very much success with this. i need to tell whatever upstart is which pid the executed process has. how can i do that?11:49
rawtazso it tracks the right pid11:50
JanC_testrawtaz, maybe use start-stop-daemon  (you can't hand over the pid to upstart right now)13:40
SpamapSrawtaz: There are only two options. Either you make the process not "daemonize" (usually "foreground mode" in the options), or you carefully count the number of times it forks before being a daemon, and use 'expect fork' or 'expect daemon'.13:41
SpamapSrawtaz: a third option is to run the program in post-start, and in post-stop, you use the pidfile to kill it. THis means upstart does not keep track of the pid and can't do things like respawn.13:41
rawtazJanC_test: start-stop-daemon is an ubuntu thing i believe :)13:44
rawtazSpamapS: oh, didnt know about foreground mode, gonna check it out13:44
rawtazSpamapS: yeah, but for some impossible-to-understand reason there's only two levels of forking supported. to me thats a big wtf but i guess it's the way it is13:44
rawtazSpamapS: doing your third suggestion is what i ended up with, found a post on SO as well. having some trouble with it not binding correctly but that shouldnt be due to upstart :)13:45
rawtazso i think it's okay. i guess this means upstart doesnt track the pid and have no control over the process, but thats fine i think, its not that important13:46
rawtazthanks a lot for your help guys :)13:46
SpamapSrawtaz: np, and agreed, that is silly and they should fix it13:57
SpamapSrawtaz: or, if you feel like you might know enough C, you could of course fix it yourself :)13:57
rawtazi could, if i did :D13:58

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