[KLUG Members] Running a program as a specified user at boot.

Adam Tauno Williams members@kalamazoolinux.org
Wed, 17 Oct 2001 14:18:26 -0400 (EDT)


>At boot I want to run a script as uid 501 so that the program starts
>with thier variables and permissions etc...
>How do I do this?  I figure I need to put something in /etc/rc.local,
>but what?

su -l {username} -c {command}

since the startup scripts run as root, this shouldn't give you any trouble

You can also change the owner of the binary to {user} and setuid {u+s} and the
program will "always" run as that user, no matter who starts it.

On a kerbized network you can grant permissions to execute the binary as a given
user to any other user via the ksu facility

>The script will be in the user's (and only the users's) path and is
>located at /home/$USER/bin/$SCRIPT, for example...

su or ksu with "-l" should develope the given user's default environment.

Systems and Network Administrator
Morrison Industries
1825 Monroe Ave NW
Grand Rapids, MI. 49505