Thanks to all of you. My mailbox is overflowing with responses.
Thanks to Ann Cantelow, Joseph Thveldt, alan, Allan Simeone, Mandell
Degerness, Bob Jones, Roger Leornard, Ivan Heffner, Gary George, Ivan
Veach and Alan Davis.
by a landslide the solution was to su - user -c command
you need to enclose in quotes ; seperate multiple commands.
I am sure I will get more replies. These are the people who have
responded at the time I am sending this email.
Why wouldn't such a useful feature be in the manpages??
<Original question>
I am a vms person pretending to be a unix admin. In vms you can do a
submit/user=username to run a command as someone else.
I have not been able to find this in my unix manuals. Please help me
see where I went wrong.
I was given two commands to run during startup, one from root and one
from user xxxx. I created a file in /sbin/rc3.d called S92httpstart
this file contained basically two lines
/usr/dir/otherdir/scriptname # basically run first script as root
/sbin/rc3.d/stest & # execute the file containing other command in bg
the second one i put in another file called /sbin/rc3.d/stest and it
does the following
su - xxxx # switch to the other user
command -switch # start the webserver processes
exit # exit
I figured root would create a background process, switch users, run the
command and the process would go away. When I checked the webserver
processes were not there. I can do the same thing interactively and it
works. There is probably some command to do this, can someone pass it
on to me.
Received on Fri Sep 03 1999 - 18:32:54 NZST