How to make ubuntu service run as specific user?
I created an init.d script and make it start at boot, but sooner I found the service is running as root after reboot.
I google and google, people suggest run as a seperate user, so what's the steps?
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It only takes a minute to sign up.Sign up to join this community
Upstart v1.4+ states ...
Changes to the user before running the job's process.
- Change $user to an actual username
- Note that all processes (pre-start, post-stop, et cetera) will be run as the user specified.
- Note that if you specify an invalid username in the setuid stanza, Upstart will log an error if it is in Debug Mode.