ValidUser
Posts: 3
Joined: Wed Jan 30, 2013 7:13 pm

Autorun a program with root

Wed Jan 30, 2013 7:21 pm

I recently started messing with the Pi with Rasbian Wheezy installed.

I configured freeSWITCH on it in /usr/local/freeswitch and i still need "sudo ./freeswitch" to run it. Is there a way to run this program at start up??? I saw a lot of links on how to do it but none from scratch and none said whether it would run as sudo

Thanks!

User avatar
Dweeber
Posts: 606
Joined: Fri Aug 17, 2012 3:35 am
Location: Mesa, AZ
Contact: Website

Re: Autorun a program with root

Wed Jan 30, 2013 8:39 pm

Many ways... one simple way is to add to the /etc/rc.local file like:

Add you command before the exit 0 that is at the bottom of the script....

Code: Select all

# Added freeswitch
/usr/local/freeswitch &

# Original exit 0 at bottom of script
exit 0
This will be run as root when the system boots up. Make sure that the command you are running any anything it might run has a full path to the scripts it needs.
Dweeber A.K.A. Kevin...
My RPI Info Pages including Current Setup - http://rpi.tnet.com

ValidUser
Posts: 3
Joined: Wed Jan 30, 2013 7:13 pm

Re: Autorun a program with root

Wed Jan 30, 2013 8:48 pm

again, I am not that good at this yet. What your saying is to go to
/etc/rc.local file

Then add in this text exactly?

I changed it to /usr/local/freeswitch/bin and added the "sudo ./freeswitch" before the exit 0

Is this right???

Code: Select all

# Added freeswitch
/usr/local/freeswitch/bin &
sudo ./freeswitch

exit 0
Thanks!!

ValidUser
Posts: 3
Joined: Wed Jan 30, 2013 7:13 pm

Re: Autorun a program with root

Wed Jan 30, 2013 8:50 pm

Dweeber wrote:Many ways... one simple way is to add to the /etc/rc.local file like:

Add you command before the exit 0 that is at the bottom of the script....

Code: Select all

# Added freeswitch
/usr/local/freeswitch &

# Original exit 0 at bottom of script
exit 0
This will be run as root when the system boots up. Make sure that the command you are running any anything it might run has a full path to the scripts it needs.

I probably should have quoted you first!

Thanks again!!

Return to “Beginners”