This also happens when you use "expect fork" or "expect daemon" combined with "script", Upstart ends up following the first spawned child whose exit status is reaped by the shell. For example:
script
ARGS=$(cat /etc/default/myservice)
exec /sbin/myservice $ARGS
end script
Upstart ends up with the pid of "cat", and never receives SIGCHLD for it. So stays in running indefinitely, and when you try and stop it, hangs in "stop/killed"
This also happens when you use "expect fork" or "expect daemon" combined with "script", Upstart ends up following the first spawned child whose exit status is reaped by the shell. For example:
script myservice)
ARGS=$(cat /etc/default/
exec /sbin/myservice $ARGS
end script
Upstart ends up with the pid of "cat", and never receives SIGCHLD for it. So stays in running indefinitely, and when you try and stop it, hangs in "stop/killed"