[lug] simple bash Q.

D. Stimits stimits at idcomm.com
Sat Mar 9 16:49:53 MST 2002


Peter Hutnick wrote:
> 
> On Saturday 09 March 2002 04:01 pm, D. Stimits wrote:
> > Peter Hutnick wrote:
> > > On Saturday 09 March 2002 03:29 pm, D. Stimits wrote:
> > One other question if anyone here is familiar with init scripts (in my
> > case RH 7.x, but any info is desired). If an init script wishes to
> > transfer a new startup process from root to some other user with less
> > privileges, would the usual way be via su -c? Or would there be some
> > other convention for doing this within an init script? The script in
> > question will be in /etc/rc.d/init.d/, or the comparable location for
> > any linux distro.
> 
> RH comes with a function library in /etc/rc.d/init.d/functions.
> 
> One of these functions is "daemon."
> 
> If you, for instance want foo to run as foo_user you'd do "daemon --user
> foo_user foo"

Perfect!

Perhaps this is a tough one to answer, but I am curious if the daemon
bash function is useable on most distros? Could I use the same function
(or some obvious corollary) on SuSE, Mandrake, or Debian? Is anyone here
familiar with the init script functions for those distros? I'm trying to
refine a script, and possibly make a version for other distributions,
though I only have RH to test on. The obvious difference is that install
locations and paths would change, I'm more interested in init script
function differences.

D. Stimits, stimits at idcomm.com

> 
> -Peter
> _______________________________________________
> Web Page:  http://lug.boulder.co.us
> Mailing List: http://lists.lug.boulder.co.us/mailman/listinfo/lug



More information about the LUG mailing list