![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Rules & FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How do i change to super user then revert back to ordinary user ,using shell script? | wrapster | Shell Programming and Scripting | 3 | 06-04-2008 04:11 AM |
| script to change passwords for the same user on multiple servers | stolz | Shell Programming and Scripting | 6 | 12-18-2007 09:08 AM |
| Change Password In A Shell Script | pintu_asim | Shell Programming and Scripting | 6 | 06-29-2006 07:16 AM |
| change user in a shell | scottl | UNIX for Dummies Questions & Answers | 2 | 08-28-2003 01:15 PM |
| How would I telnet & change user password automatically in a script | darthur | UNIX for Dummies Questions & Answers | 4 | 01-14-2002 07:40 AM |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
hi,
my problem is that i am calling a script from my perl program. the script checks wether a particular process is running or not if the process is not running then it should start the process. the problem here is that the front end logs into backend with a user which does not have the permission to restart the process. i tried using SU command it prompts me for the password. expect is not installed so was not able to use it. i even tried setting the SUID bit of the script and running the script as su - user -c "/path/test.sh here it starts asking for the roots password the script is: #!/bin/sh var1=`ps -ef | grep -v grep | grep ravi | awk '{print $2}'` echo $var1 if [ -z $var1 ] then echo "The Process is Running" else xx=`whoami` echo $xx cwd=`cd /user/bin` pwd=`pwd` echo $pwd `su - user` `ravi` xx=`whoami` echo $xx prrestart=`/ravi/admin/KickWatchdog -restart` echo "You win" fi echo $vasr1 echo 'ravi' |
|||
| Google UNIX.COM |
| Forum Sponsor | ||
|
|