SUMMARY: start-up scripts for non-root programs

From: Andrew Lamb (andrew@mis.mua.go.th)
Date: Mon Apr 22 1996 - 10:08:49 CDT


 
Solution: Use the su command at the beginning of the script e.g.

        su - username -c 'command args'
        su - sybase -c startserver
        su - the_user -c 'the_command'
        su <userid> -c command
        su <username> -c <script>
        su - username -c "program_name args"

        #!/sbin/sh
        su - <user> -C <program> &
        #eof

Notes:

        The quotes around the command is required if there are any
        arguments as su expects only one argument for the command,
        (which could also be a script name).

        Root isn't prompted for the user's password when su runs.

         -c : command

        For more info, do "man su".

        Before actually putting the script into rc3.d, make sure
        you test it separately.

Contributors:

Glenn Satchell Glenn.Satchell@Uniq.com.au
Ric Anderson ric@rtd.com
Sahir Siddiqui sahirns@menger.eecs.stevens-tech.edu
J. Patrick Narkinsky patrick@cnu.edu
Salvador Ramirez sram@inf.UDEC.CL
Rob Allan rob.e.allan@hydro.on.ca
Gary Merinstein gmerin@panix.com

Thanks Sun Managers! Your help is greatly appreciated.



This archive was generated by hypermail 2.1.2 : Fri Sep 28 2001 - 23:10:58 CDT