bash-script question: How to start a user A's process from other users?
A Tomcat server is installed under user A. Now I am going to write a script which will start this Tomcat server. And this script can be executed from other users (from there account). And if other user run this script, the process ID should be of user A, so that user A can start or stop this process any time.
This means, at the beginning of the script I have set the process ID as user A. How to do this? Regards |
The switch user: su command.
Cheers, Evo2. |
My script startAll.sh looks as follow:
Quote:
Quote:
Any mistake in the script? |
I guess the last line in your script should be something like:
Code:
$SUBIT $TOMCAT_HOME/apache-tomcat-5.5.23/bin/startup.sh |
bingo!
|
Excellent. Glad I could help.
Could you mark the thread as [solved]? Cheers, Evo2. |
Hi,
Before I mark this as solved, I have a further question: When I run this script under root, it doesn't ask me for password. But when I run this under user A, it ask me for the password. This script is located under "/opt/jboss/tomcat" where is user A's region. The user A can run all execute files without entering any password. But it's now not the case. Is it possible to run the script under user A without asking for password? Besides, I change the script as follow: Quote:
|
Quote:
Evo2. PS. There are ways around this eg suid bits and sudo, but both have security implications. |
All times are GMT -5. The time now is 12:59 PM. |