LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   How to run a program as root on startup in debian wheezy? (https://www.linuxquestions.org/questions/linux-software-2/how-to-run-a-program-as-root-on-startup-in-debian-wheezy-4175490835/)

skilo47 01-10-2014 11:10 AM

How to run a program as root on startup in debian wheezy?
 
I have a small program written in C for checking disk information and i would like it to run on startup everytime the machine boots.

My program requires sudo to run so im guessing i need to make it start with root privileges.

schneidz 01-10-2014 11:12 AM

for the system to do it automatically, i would put it in /etc/rc.local.
for the user to do it once logged in you can put it in ~/.bash_profile.
some newer distros support a @reboot directive in the users crontab.

skilo47 01-10-2014 11:20 AM

Quote:

Originally Posted by schneidz (Post 5095576)
for the system to do it automatically, i would put it in /etc/rc.local.
for the user to do it once logged in you can put it in ~/.bash_profile.
some newer distros support a @reboot directive in the users crontab.

So i don't need to make a startup script or anything? Just put the program in /etc/rc.local and it should run as root?


All times are GMT -5. The time now is 08:40 PM.