![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| root executes a script as another user | ravi.sri24 | Shell Programming and Scripting | 9 | 02-11-2009 10:43 AM |
| As root , running script as different user with su - problem | dbsupp | Shell Programming and Scripting | 4 | 12-18-2008 01:28 AM |
| login into root from user and execute command through script | pradeepreddy | Shell Programming and Scripting | 6 | 08-29-2008 03:49 AM |
| run a script on logout by a non-root user | harsha10 | Shell Programming and Scripting | 6 | 06-16-2008 04:14 PM |
| root executes a script as another user | tads98 | Shell Programming and Scripting | 1 | 05-17-2005 09:54 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Is there a way to change a process owned by root to be owned by another user. I am interested in finding out if there is a way to put a script in /etc/rc2.d that will start up automatically on reboot that will not be owned by root
This is for security reasons.. The Service that runs on my server recomends that I dont run it as root.. Im at the office right now and I have the script on my home computer, if needed I can post it. But Im merly intressted if its possible and what command exec´s stuff as an assigned user. root -> run startTS.sh as user seb |
|
||||
|
ofc... its always the simplest solution...
Then Ill add PHP Code:
For some reason I dident think logging on as a normal user at that stage worked. Kinda stupid now when I think about it. Heh thank you |
|
||||
|
Thank you methyl. As you realise this is my first on boot script. I have done a handfull of diffrent scripts that manualy exec when thay are needed..
Ok so I will make a script in /etc/rc2.d/ PHP Code:
|
|
||||
|
Hi. Yes, exactly. I would run it with "su -" Code:
su - seb -c "/home/seb/tss/startservice.sh" That way you get seb's environment too. If you have a method to stop the application when you shutdown, don't forget to create a Knnnnnnn script too. (the Snnnnn and Knnnnn scripts are often generic...) Code:
case "$1" in
start )
startsrc -g ssh
;;
stop )
stopsrc -g ssh
;;
* )
echo "Usage: $0 (start | stop)"
exit 1
esac
The number you use for your S and K scripts determines the order in which your script is executed, so make sure everything else your application needs (i.e. Oracle, or whatever) is started before you start your application. |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|