LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 08-02-2006, 11:20 AM   #1
mike81
LQ Newbie
 
Registered: Aug 2006
Posts: 9

Rep: Reputation: 0
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
 
Old 08-02-2006, 11:31 AM   #2
ethics
Senior Member
 
Registered: Apr 2005
Location: London
Distribution: Arch - Latest
Posts: 1,522

Rep: Reputation: 45
isn't exit going to quit the script regardless?
 
Old 08-02-2006, 11:46 AM   #3
mike81
LQ Newbie
 
Registered: Aug 2006
Posts: 9

Original Poster
Rep: Reputation: 0
The script stop after i issue the su - oraweb then if i manualy enter Exit.. the script continue after
 
Old 08-02-2006, 11:47 AM   #4
Xena
Member
 
Registered: Nov 2005
Posts: 84

Rep: Reputation: 15
I suspect you might want the screen command... allows some program to work after the konsole has closed?
 
Old 08-02-2006, 11:52 AM   #5
mike81
LQ Newbie
 
Registered: Aug 2006
Posts: 9

Original Poster
Rep: Reputation: 0
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
 
Old 08-02-2006, 11:56 AM   #6
mike81
LQ Newbie
 
Registered: Aug 2006
Posts: 9

Original Poster
Rep: Reputation: 0
so i need some sort of owsctl stop runas oraweb <-- so i dont need to su - oraweb
 
Old 08-02-2006, 01:07 PM   #7
spirit receiver
Member
 
Registered: May 2006
Location: Frankfurt, Germany
Distribution: SUSE 10.2
Posts: 424

Rep: Reputation: 33
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.
 
Old 08-02-2006, 01:58 PM   #8
mike81
LQ Newbie
 
Registered: Aug 2006
Posts: 9

Original Poster
Rep: Reputation: 0
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
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Whats the command that allow you to run a script as another user? ziggie216 Linux - Software 3 11-10-2005 04:05 AM
run command as user BFEINZIMER Linux - Newbie 9 08-24-2005 11:21 PM
run mount command as user paul_mat Linux - Newbie 1 12-14-2004 07:28 PM
How to run a command on new mail for a user? pembo13 Linux - Networking 0 09-26-2004 08:37 AM
run command as alternate user joeca Linux - General 1 08-06-2003 05:31 PM


All times are GMT -5. The time now is 07:29 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration