LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 01-10-2014, 11:10 AM   #1
skilo47
Member
 
Registered: Sep 2012
Posts: 47

Rep: Reputation: Disabled
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.
 
Old 01-10-2014, 11:12 AM   #2
schneidz
LQ Guru
 
Registered: May 2005
Location: boston, usa
Distribution: fedora-35
Posts: 5,313

Rep: Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918
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.
 
Old 01-10-2014, 11:20 AM   #3
skilo47
Member
 
Registered: Sep 2012
Posts: 47

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by schneidz View Post
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?
 
  


Reply

Tags
boot, debian, program, startup



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Unable to run xtream download manager under debian wheezy x64 tousif Linux - Newbie 6 10-15-2013 04:50 AM
Debian Wheezy: How to get a Google Voice program/daemon up and running? Cyberman Linux - Software 5 09-23-2013 05:03 PM
[SOLVED] Cannot log in, or use, as root in new clean Debian Wheezy installs. k3lt01 Debian 11 06-20-2013 07:24 AM
I cannot get cdemu 1.4.0 to run in Debian Wheezy 64-bit. joseluis64 Linux - Software 0 02-11-2013 06:44 AM
how can i run a java program with root privilages from a non-root account? joyjjs Linux - Software 1 08-04-2009 12:14 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 05:29 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration