Stop Microsoft
		Operating Systems => Linux and UNIX => Topic started by: Master of Reality on 23 July 2002, 05:26
		
			
			- 
				when i run things at startup (in rc.local) does it run as root?
How do i get it to run as a certain user?
[ July 22, 2002: Message edited by: Master of Reality / Bob ]
[ July 22, 2002: Message edited by: Master of Reality / Bob ]
			 
			
			- 
				Yes it does run as root.  You can use the "su" command to run something as another user among other methods:
su - someuser -c "/bin/command args"
And if the command is intended to be run continuously do not forget to redirect the output and background it with the "&" so your startup script does not hang.
			 
			
			- 
				how do i redirect its output? If i want to run seti as user mor i just put:
su - mor -c /command/setiathome & 
it only gives the little output when you first start it ssys "setiathome has started, this is the last message you will recieve", do i still need to redirect that to /dev/null ?
			 
			
			- 
				I would do it like this:
su - mor -c "/command/setiathome > /tmp/setiathome.log 2>&1 &"
			 
			
			- 
				can i do this to make it run continously and wait 30 minutes between each time it shuts down and when it restarts (in case the seti servers go down i dont want to keep requesting). 
while true
      do
    su - mor -c "all that stuff"
   sleep 1800
      done
[ July 23, 2002: Message edited by: Master of Reality / Bob ]
[ July 23, 2002: Message edited by: Master of Reality / Bob ]
			 
			
			- 
				Why not just run it the way the instructions suggest to run it?
http://setiathome.ssl.berkeley.edu/unix.html (http://setiathome.ssl.berkeley.edu/unix.html)
or from cron as the README states:
http://setiathome.ssl.berkeley.edu/README.unix.txt (http://setiathome.ssl.berkeley.edu/README.unix.txt)
[ July 23, 2002: Message edited by: VoidMain ]