running a scr in rc3.d not as root, can i?


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users running a scr in rc3.d not as root, can i?
# 1  
Old 11-01-2002
running a scr in rc3.d not as root, can i?

I want to run one of my startup script S21mystartup.scr in rc3.d directory so it boots with the system, however, can i do this as other than root? Don't want it to run as root. how can i get this to go as another user?
# 2  
Old 11-02-2002
You may be able to call the actual executables within the script using "su". You can specify which user to run each executable.
# 3  
Old 11-04-2002
I am somewhat curious as to what advantage you would gain from this configuration. Are you wanting to be able to restart the script after the box is up in case of trouble?

From what I can tell on my HPUX system, my /sbin/rc3.d directory has read and exe for all of the startup scripts there.

Now that I look closer, I believe that you would actually exe the script from/sbin/init.d/myscript, and not from startup script directory /sbin/rc3.d/myscript. You can use the myscript stop; myscript start functionality from /sbin/init.d. Most likely, you should already be able to exe the scripts from there if the permissions are at least 755.

However, I don't see any advantages/disadvantages of having it owned by a non-root user. I think it is entirely possible that you can do this, but I don't see any gain by this configuration.

Maybe you can elaborate on your situation.

Smilie

Last edited by Kelam_Magnus; 11-04-2002 at 05:47 PM..
# 4  
Old 11-05-2002
We have a configuration tool, and I've been told i can't bring up the license manager or that database in the initial startup scripts as root since it won't allow others to modify files checked in and out, i haven't foudn this to be true yet, but one of our other sites says this happens. So was wondering if i could set it to start up as another user. so could i set up my startup script like this:
start:

su otheruser
myscript



:
end
# 5  
Old 11-05-2002
What you need to do to write a script to be run to bring up the tool. Then the startup script will do:
su whoever -c /path/to/true.startup.script
# 6  
Old 11-12-2002
Worked!

changing the script to say su -c .... worked! Thanks, so simple, and I didn't even think about it, thanks for the help!
# 7  
Old 11-12-2002
As far as the question of advantages/disadvantages of having a process started up as non-root, many times the different SQL processes start as either root or as their own user (Sybase or Oracle). The Sybase folks (half of them) know that they don't need root to run and set up their scripts with a su to the sybase user. Oracle folks almost always do this. Our other Sybase folks like to run Sybase from root - then they need root to work on their servers. This was started because someone many years ago didn't care about security - just wanted to get things working. Although it's been proven and implemented on some servers to remove the root/Sybase connection, getting it pushed across all servers is a hassle.

There is no disadvantage to my knowledge but the advantage is not having another process that could be hacked and leave someone with root on a server.
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Running a command as another non-root user

Hi, I am trying to run a command within my KSH script as another user due to permission issues, now both users are non root. I have tried the following command and was unsuccessful: echo "<password>" | sudo -S -u <username> -k command Can I use sudo to run a command as a non-root user? (5 Replies)
Discussion started by: MIA651
5 Replies

2. Shell Programming and Scripting

Running a script as root but with different users inside

Hi All, my script.sh has the below lines, and i need to run the script as root or wam. please tell me if this will work #!/bin/bash sudo -t wam /usr/local/wam/stopwam -r ------- this needs run as wam user /usr/local/web/stopweb -a --- this needs to run as... (18 Replies)
Discussion started by: nanz143
18 Replies

3. Shell Programming and Scripting

Issue running script as root

1) Environment:Red Hat Linux, bash shell Script to be run owned by user :myUser Home environment of myUser: pathto/home 2) ESP agent with root access will run JobXXX.sh su - myUser -c "/pathto/home/bin/script.sh" where script.sh has some echo statements and an exit statement in the end... (4 Replies)
Discussion started by: cj09
4 Replies

4. Cybersecurity

Running script through SSH as root

Hi all, I have a situation where I have a shell script that I need to run remotely on multiple *nix machines via SSH. Unfortunately, some of the commands in it require root access. I know that best practices for ssh entail configuring it so that the root account cannot log in, you need to... (4 Replies)
Discussion started by: irinotecan
4 Replies

5. Shell Programming and Scripting

As root , running script as different user with su - problem

Dear All I am running into a situation where I am running a script as another user lets say oracle using su command as below, and the script fails because the .profile of oracle is not executed so the environment variables are not set. cat /etc/passwd | grep oracle... (4 Replies)
Discussion started by: dbsupp
4 Replies

6. UNIX for Advanced & Expert Users

running X-11 programs as root

Hello, I would like to run gedit as root while logged into my regular user account. When I try to launch gedit from the command line as super user, I get this message: Gtk-WARNING **: cannot open display: Any suggestions or word arounds? It would make my life a lot simpler to edit files... (8 Replies)
Discussion started by: Allasso
8 Replies

7. Shell Programming and Scripting

Switching workspaces thru shell scr.(Solaris)

Using Solaris CDE environment and want to write a shell script (pref. Korn) which can: Upon invokation opens a dtterm new window (no problems, here, i.e. on how to open one) The new dtterm should be moved by the script to another workspace (consider no one changed the default Solaris naming... (3 Replies)
Discussion started by: baivab
3 Replies

8. UNIX for Advanced & Expert Users

Running out of Space (Root)

Hi, I m working on about 16 Unix Servers, Sometime a file is generated in the root names STA, which causes the root to run out of space within few seconds ,,, and the server crashes..... hlp me out to find why the file is generated , what does it contain 'n' what is the cause ! (0 Replies)
Discussion started by: scorpiyanz
0 Replies

9. Shell Programming and Scripting

Running a command or script as root

I'm writing an application (Progress language) that needs to: 1) load the contents of a cron table into the Progress application; 2) display this information in a human manner and allow a select group of people to update it (these people are logged in as themselves, not as root); 3) save... (3 Replies)
Discussion started by: rm-r
3 Replies
Login or Register to Ask a Question