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