Sean H. wrote:
When I want something to start at boot, I put it into /etc/rc*. The
service will start as root, though.
How do I make it start as a particular user? I’m worried about the
machine going down and me not being around to pick my app back up when
I’m far from being a Unix guru, but your subject line specifically
lighttpd, which is something I can offer some assistance on.
Basically, you always want root to launch lighttpd, for a production
but what you do is you tell lighttpd to change its user and group when
launches. You do that with these lines in your lighttpd.conf:
server.username = “foo”
server.groupname = “bar”
Since lighttpd is run as root, it can pretty much change its user and
will. The advantage is that since the lighttpd process becomes owned by
“foo”, any child processes launched by lighttpd are also owned by user
when you have lighttpd launch the FastCGI listeners, they will be owned
I think this would also help my SwitchTower issue of having 8 fastcgi
processes running for the app. 4 started by lighttpd, and 4
started/restarted when I deploy. Since the deployment user can’t kill
the root-run fastcgi processes, they stay running.
Yes. It makes the auto-deployment of your changed app code much
make sure you tell lighttpd to become the user that SwitchTower logs in
you should be all set. That’s basically what I’m doing for all my Rails
although I don’t have ST wired into my deployment process, just yet…