Assuming you mean automatically launch the daemon at boot time, you can put a script in your /etc/rc2.d directory called Snn<scriptname> which would contain the following:
su - <user> -c "<daemon_start_script>"
nn would depend on how soon you wanted the daemon to start after entering the startup procedure (1 for immediately, 99 for the last event etc). It might also be an idea to include the line:
. /<users_home_dir>/.profile
early on in your script so that any environment variables are set correctly. I've just realised I've answered this from a Solaris point-of-view - hopefully the same will apply to Linux variants. Others may be able to confirm this. Cheers.
Probably best is to do a 'ps -aux' and find some non-root processes (e.g. httpd) and then look at the code of the related init script in /etc/rc.d/init.d (probably - varies by distro)
I think you just want to be able to run a server process
as a non-root user?" Assuming you have a daemon that can bind the necessary unix or inet socks as a non-priviliged user
you can run it from xinetd or inetd. Instead of the "root"
user field in the .conf file, you can specify the user you wish the process to run as.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.