<div dir="ltr">Hey Folks,<div><br></div><div>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.</div>
<div><br></div><div>Here's a simple example:<br></div><div><br></div><div>--snip--</div><div>respawn<br></div><div><div>respawn limit 15 5</div><div><br></div><div>start on runlevel [2345]</div><div>stop on runlevel[06]</div>
<div>#expect fork</div><div><br></div><div>exec su -c '/bin/sleep 1000' ec2-user</div></div><div>--snip--</div><div><br></div><div>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. </div>
<div><br></div><div>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.</div>
<div><br></div><div>Any ideas?</div><div><br></div><div>Thanks!</div><div><br></div><div>--adam</div><div><br></div><div><br></div><div><br></div></div>