=== JanC_test_ is now known as JanC_test | ||
rawtaz | hi! | 10:49 |
---|---|---|
rawtaz | question: 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 |
rawtaz | not 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 |
rawtaz | so it tracks the right pid | 11:50 |
JanC_test | rawtaz, maybe use start-stop-daemon (you can't hand over the pid to upstart right now) | 13:40 |
SpamapS | rawtaz: 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 |
SpamapS | rawtaz: 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 |
rawtaz | JanC_test: start-stop-daemon is an ubuntu thing i believe :) | 13:44 |
rawtaz | SpamapS: oh, didnt know about foreground mode, gonna check it out | 13:44 |
rawtaz | SpamapS: 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 is | 13:44 |
rawtaz | SpamapS: 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 |
rawtaz | so 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 important | 13:46 |
rawtaz | thanks a lot for your help guys :) | 13:46 |
SpamapS | rawtaz: np, and agreed, that is silly and they should fix it | 13:57 |
SpamapS | rawtaz: or, if you feel like you might know enough C, you could of course fix it yourself :) | 13:57 |
rawtaz | i could, if i did :D | 13:58 |
Generated by irclog2html.py 2.7 by Marius Gedminas - find it at mg.pov.lt!