[CLUE-Tech] set user id of script

Lynn Danielson lynnd at techangle.com
Thu Jun 6 12:05:34 MDT 2002


Dave Price wrote:
> 
> Is there a 'nice' way to execute a line in a script (or a script at
> startup under the priveleges of another user ... 
> 
> I need to run some oracle scripts as different oracle uids which have
> appropriate priveleges ...

You can add inittab entries for the appropriate runlevel(s) and have
init execute the script via su, e.g.,

o1:35:wait:/sbin/su - oracle_user1 -c /absolute_path_to/script1 >/dev/null 2>1

An entry like this would execute script1 for runlevels 3 and 5 at
startup.  The nice thing about using init to kick off processes,
is that if you want the script running all the time, you can use
the respawn directive in the third field.  Then if the script ever
dies, init will automatically restart it.

Hope this helps,

Lynn




More information about the clue-tech mailing list