LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   run a command as another user!! (https://www.linuxquestions.org/questions/linux-newbie-8/run-a-command-as-another-user-470101/)

mike81 08-02-2006 10:20 AM

run a command as another user!!
 
Is there anyway to run a command as another user so my script can keep going ?

instead of

su - oraweb
owsctl stop
exit

ethics 08-02-2006 10:31 AM

isn't exit going to quit the script regardless?

mike81 08-02-2006 10:46 AM

The script stop after i issue the su - oraweb then if i manualy enter Exit.. the script continue after

Xena 08-02-2006 10:47 AM

I suspect you might want the screen command... allows some program to work after the konsole has closed?

mike81 08-02-2006 10:52 AM

All i want is to run that sort of script but the script stop after the su - oraweb goes in... won't do anything unless i do exit manualy

#!/bin/sh
su - oraweb
owsctl stop
owsctl stop -nodemgr
exit

kill -9 `pgrep oraweb`

su - oraweb
owsctl start -nodemgr &
owsctl start

mike81 08-02-2006 10:56 AM

so i need some sort of owsctl stop runas oraweb <-- so i dont need to su - oraweb

spirit receiver 08-02-2006 12:07 PM

How about "sudo -u oraweb owsctl stop"? You can use /etc/sudoers to specify users that may invoke that command without being prompted for a password.

mike81 08-02-2006 12:58 PM

Ill try but i dont need to enter password at all ... i just need to change use to do that command and come back to root to kill all oraweb process

thanks


All times are GMT -5. The time now is 04:10 AM.