Suse init script: start daemon as different user. possible?
Redhat supplies /etc/init.d/functions. In that file, many shell script functions are provided, one of which is "daemon" which has an option of "--user" which allows a daemon to be started by a user other than root. daemon --user foo /path/to/program.
Is there an equivilent provided by Suse? I see /lib/lsb/init-functions which includes "start_daemon". start_daemon is a symlink to startproc, but the man page(s) shows that start_daemon only takes an argument of -p, whereas startproc takes, among others, a -u <uid> option, which is close to what I'm after, though not exactly.
At the end of the day, I'm trying to write an init script that will work on both RH and Suse. One of the features of the init script is the ability to run a daemon as a given username. Is start_daemon the best way to go for Suse? Is it acceptable use -u with it? Is there another way I can go about this so that I can provide a username rather than UID?
Suggestions? Thanks.
|