LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices


Reply
  Search this Thread
Old 04-18-2010, 03:58 AM   #1
tkmsr
Member
 
Registered: Oct 2006
Distribution: Ubuntu,Open Suse,Debian,Mac OS X
Posts: 798

Rep: Reputation: 39
where to keep a scrip so that it always start with system boot


I want to know where should I keep a script which I developed so that it always start with system boots also if some one can let me know about strace some common use scenarios.I have searched net also.
 
Old 04-18-2010, 04:04 AM   #2
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Arch
Posts: 8,529

Rep: Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899
Try
Code:
/etc/rc.local
 
Old 04-18-2010, 04:07 AM   #3
puntjuh
Member
 
Registered: Apr 2006
Location: holland
Distribution: Gentoo / debian / suse / mint
Posts: 558

Rep: Reputation: 42
A script used at boot should be in the following folder:

Code:
/etc/init.d
chmod +x the script to make it an executable file.

Run:

Code:
update-rc.d "filename" defaults 5
where filename without the "" is the name of your script. Behind defaults is the runlevel u want to add it too, 5 is for when you want to start it with X. i suggest reading:

Code:
man update-rc.d
for further and more advanced functions!

Good luck!

Last edited by puntjuh; 04-18-2010 at 04:20 AM. Reason: added something
 
Old 04-18-2010, 04:10 AM   #4
kainosnous
Member
 
Registered: Mar 2010
Location: Tennessee, USA
Distribution: Arch, Fedora
Posts: 59

Rep: Reputation: 18
Debian uses a System V style init process. That means that your script is accessed by making a link to it. For instance, if you are using runlevel 5 (the standard if you are using a GUI), then you would use something like"ln -sv /path/to/your/script /etc/rc5.d/S98yourscriptname". Alternately, a quick google search led me to the command update-rc.d Here is a link to a page I found in that search: http://www.debian-administration.org...me_with_Debian

Most distros also have a /etc/rc.local that is executed at startup on any runlevel. You could add a your program to that file.
 
Old 04-30-2010, 02:11 AM   #5
tkmsr
Member
 
Registered: Oct 2006
Distribution: Ubuntu,Open Suse,Debian,Mac OS X
Posts: 798

Original Poster
Rep: Reputation: 39
Thanks all.
 
  


Reply



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
System halts at boot when trying to start udevd saurabh nigam Slackware 6 11-02-2009 05:04 AM
how to make my application start during system boot rajesh84210 Linux - Software 5 07-27-2009 06:33 AM
how to add a process start during the system boot rajesh84210 Linux - General 2 07-27-2009 02:47 AM
Intermittent system failure at boot, don't know where to start looking rollo Linux - General 3 11-23-2008 12:10 AM
MySQL won't start on system boot... defa0009 Linux - Server 9 12-21-2006 08:27 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian

All times are GMT -5. The time now is 12:49 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