initctl stop hangs when script uses su
Adam Weiss
adam at signal11.com
Mon Aug 18 21:46:07 UTC 2014
Hey Folks,
I've been experimenting with EC2 and recent "Amazon Linux" images that use
Upstart. I'd like to configure a service to start with dropped privileges,
but there's no start-stop-daemon on there and I've been having trouble
getting the su examples from the cookbook to work.
Here's a simple example:
--snip--
respawn
respawn limit 15 5
start on runlevel [2345]
stop on runlevel[06]
#expect fork
exec su -c '/bin/sleep 1000' ec2-user
--snip--
This will start fine, and Upstart will follow the pid of su, and an
"initctl stop" will kill the process fine.. but then leave the terminal
containing initctl hung.
If I kill the initctl, Upstart then goes into a broken state where it hangs
on all start/stop requests until I send upstart itself a SIGTERM. If I
uncomment "expect fork", I get the exact same behavior and breakage except
that it tracks the pid of the sleep process rather than the su process.
Any ideas?
Thanks!
--adam
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/upstart-devel/attachments/20140818/31d761de/attachment.html>
More information about the upstart-devel
mailing list