PDA

View Full Version : run script on boot from specified user?


Daerious
03-04-2008, 04:31 PM
I'm needing to run a script during boot, but it must be ran as a specific user, not root. Can anyone tell me the proper way of doing this?

Rick
03-04-2008, 07:47 PM
Hi, use this:

su - USER -c "COMMAND TO RUN"

replace USER and COMMAND

Daerious
03-04-2008, 07:56 PM
thanks Rick, that worked perfectly, i assume adding that line to rc.local is an acceptable practice? (Debian 4)

Rick
03-04-2008, 08:04 PM
yes, that is fine. my rc.locals are full of start up stuff.