[11:56] why "stop" would hang? [11:56] start works, tracking PID is corret, when i do stop the process finishes succesfully, but the command itself hangs [13:14] xaka: what does "initctl status " show? maybe you 'post-stop' is still running? [13:16] i don't have post-stop. after some time i stopped it by Ctrl+C. status is "stop/killed, pid ...". then i tried to start it again and even start hanged [13:18] xaka: can you show me the conf file? [13:21] jodh: http://pastebin.com/nMV1s7YD [13:23] xaka: firstly, you need to be careful with those pre-start commands since if any fail, the job will not run. See http://upstart.ubuntu.com/cookbook/#develop-scripts-using-bin-sh [13:24] jodh: i understand, but that pre-start is the only solution for my case that i was talking about yesterday here [13:24] xaka: are you sure that Upstart is tracking the pid correctly? Does "nms" definately fork only once? [13:25] it starts with no issues, after that "status" shows correct PID [13:25] it even stops the process, but "stop" command doesn't finish [13:26] jodh: i have the simple script that you can use to reproduce the situation, let me paste it [13:28] jodh: http://pastebin.com/jityDGxg ( don't ask why it's been written in this way :) ) [13:32] jodh: btw, are you going to add support for dependencies like SMF has? i was talking/complaing about it yesterday. i want to say that B depends on A so when B is started and A isn't running yet, A has to be started first. [13:33] that is the only reason i have that pre-start hook - i don't want (and i haven't) to modify ntp/mongodb conf files, but i still want to be sure that the services are running [13:43] xaka: the problem is that your perl script is attempting to "manage" the service by killing the child. However, you've told Upstart that the child PID *is* the service so Upstart is tracking the forked child process. Either remove the "expect fork" or stop the perl script from killing the child - Upstart will do that for you as it kills the process group. [13:52] jodh: the wrapper doesn't kill the child (those INT/TERM handles only for developers). the simple is chain is: fork->exec->waitpid [13:53] btw, does the upstart kill the process group of forked child or the parent? [13:53] xaka: please see my comments above. [21:25] How can you tell upstart to get the pid from a pid file on the stop command