I've got a daemon that I want to launch on startup using the standard service
framework (e.g. a file in /etc/init.d/rc.d
, launched using /sbin/service
). I've written scripts for the service framework before, so I don't need basic knowledge there.
However, I've never tried to run a process that shouldn't be launched as root. The process itself doesn't support chrooting on startup, and I don't want to run it as root. Short of using su
or sudo
in the launch script, is there any preferred or recommended way to say "run this script on startup as user X"?