running shell script from rc.local

running shell script from rc.local

Post by Rick Goyet » Sat, 23 Feb 2002 00:46:44



How do I get rc.local to run  a shell script as a particular user, and not
as root?

--
R. J. Goyette
Argonne National Laboratory

 
 
 

running shell script from rc.local

Post by Sven Vermeul » Sat, 23 Feb 2002 00:56:48



>  How do I get rc.local to run  a shell script as a particular user, and not
>  as root?

Make the appropriate line read "/bin/su $user -c $command". So, if you want
to run /home/rick/bin/somescript as rock from rc.local, the line would
read:
        /bin/su rick -c /home/rick/bin/somescript  

Wkr,
        Sven Vermeulen

--
 Some stuff you might not know:
        ~$ is the user-prompt. You don't have to type this.
        ~# is the root-prompt. You don't have to type this, but you do
           need to be root in order to execute the command.

 
 
 

running shell script from rc.local

Post by Ashok Aiya » Sat, 23 Feb 2002 02:12:38


On Thu, 21 Feb 2002 09:46:44 -0600,

Quote:> How do I get rc.local to run  a shell script as a particular user, and not
> as root?

Use 'su' with the '-c' command-line option.  For eg.

/bin/su username -c /path/to/shell-script

Ashok
--
Ashok Aiyar
RLU #51601

 
 
 

running shell script from rc.local

Post by Clar » Sat, 23 Feb 2002 03:04:00



> How do I get rc.local to run  a shell script as a particular user, and not
> as root?

> --
> R. J. Goyette
> Argonne National Laboratory


Put an su command in the script.

Clark Zahn

 
 
 

1. which user does /etc/rc.d/rc.local / rc.sysinit run as?

Im running Enigma and want to set up a systemwide fetchmail daemon ... I
have got the /root/.fetchmailrc file set up fine and need to know where
to put the 'fetchmail' command.

Should I put fetchmail somewhere in either /etc/rc.d/rc.local or
rc.sysinit?  Whereabouts should I put it in?  Are there security risks
here I should know about?

--
Cheers,
Glen

2. Apache vs. IIS

3. running apps from /etc/rc.d/rc.local

4. NI6510

5. /usr/local/etc/rc.d - scripts not running

6. Linux Hardware Database

7. run local shell script on remote machine

8. Unstable remote login

9. 2.2.19 Debian no rc.d or rc.local ????!!!!!!

10. *BIG* Problem with /etc/rc.d/rc.local

11. starting apps from /etc/rc.d/rc.local

12. *BIG* Problem with /etc/rc.d/rc.local

13. searching /etc/rc.d/rc.local file in SuSE6.0