Closed gamb closed 8 years ago
Oops meant to reference #131 , also I was on honcho 0.5.0
. Accidentally replaced group_name
.
Hey, thanks for this. I'm happy with moving the environment variable declarations into the upstart config, but the setuid
directive was introduced in Upstart v1.4, meaning that this change will generate upstart configs that don't work on older distributions (in particular, Ubuntu Lucid).
I'm pretty sure you could fix the restart problem by just putting exec
in front of {{ process.cmd }}
. Do you fancy trying that?
Also, I note you've removed the shellquote
filter for the environment variables, and changed {{ group_name }}
to {{ app }}-{{ name }}
. I don't think we want or need either of those changes.
Yep happy to give that a go later on, and tidy the commit up (shellquote
etc). I think the fallback might be:
exec start-stop-daemon --start -c {user} --exec {command}
I have a preference for su
over start-stop-daemon
because the latter is (IIRC) Ubuntu-specific.
The chdir
change is fine, I think.
See your point with start-stop-daemon
, although doesn't upstart
itself imply an ~Ubuntu-specific target?
That's a fair point, actually. Whatever is easiest, then. To be honest I think su(1)
is still a better bet. You're not going to find a unix that doesn't have it, and we're not using any features of start-stop-daemon
that su
doesn't have.
Does this still need an update?
This approach stops child processing hanging with exported upstart process by leveraging
setuid
(http://upstart.ubuntu.com/cookbook/#setuid).service {app} restart
now works correctly for me.