views:

151

answers:

1

How to run specific program with root privileges (Ubuntu OS) when no sudo user log into system? Program need root privileges to function correctly. Normal user shouldn't be able to shutdown this process.

A: 

You could create an init.d script to run your program in the /etc/init.d/ directory, run

update-rc.d FOO defaults

where FOO is the name of your program/script, and defaults adds it to the normal system runlevels. Be sure to check out /etc/init.d/skeleton to check out the format expected for files living there. I'm guessing that this will be helpful to you since you added the startup/login tag.

You could also look into adding a system-wide cron job, which you can find plenty of information about on the Ubuntu Community How-To page. Pay specific attention to the "Special Strings" section.

https://help.ubuntu.com/community/CronHowto

Ryan
Whoops, I answered before thinking about if this question was in the right place or not :)
Ryan