LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
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 03-24-2006, 11:01 PM   #1
Akhran
Member
 
Registered: Aug 2005
Distribution: Debian 'lenny'
Posts: 208

Rep: Reputation: 30
How do you customize scripts' sequence number for different runlevels?


1) I have a start/stop script in /etc/init.d/myscript and I would like the script to start at sequence number 60 at runlevel 2 and 99 for the rest of the runlevels. That is,

/etc/rc1.d/S99myscript
/etc/rc2.d/S60myscript
/etc/rc3.d/S99myscript
/etc/rc4.d/S99myscript
/etc/rc5.d/S99myscript
/etc/rc6.d/S99myscript

Can this be accomplished through update-rc.d command?

2) I have a start/stop script in /etc/init.d/myscript and the script starts at sequence number 99 on all runlevels. How do I edit with 'update-rc.d' to change the sequence number at runlevel 2 from 99 to 50?

3) How do I remove a script from running at runlevel 2 without affecting the start/stop sequence of the script for the rest of the runlevels?


Thanks !
 
Old 03-25-2006, 01:15 AM   #2
dracae
Member
 
Registered: Feb 2006
Location: Oklahoma
Distribution: Debian Sid and Etch
Posts: 423

Rep: Reputation: 30
To set to 50
update-rc.d myscript start 50 2 3 4 5 . stop 50 0 1 6 .
Disabling myscript for runlevel 3
update-rc.d myscript stop 50 3 .
 
Old 03-25-2006, 03:23 AM   #3
Akhran
Member
 
Registered: Aug 2005
Distribution: Debian 'lenny'
Posts: 208

Original Poster
Rep: Reputation: 30
Quote:
Originally Posted by dracae
To set to 50
update-rc.d myscript start 50 2 3 4 5 . stop 50 0 1 6 .
1) Can the script start at sequence number 50 at runlevel 2 (only) and 99 for the rest of the runlevels. That is,

/etc/rc1.d/S99myscript
/etc/rc2.d/S50myscript
/etc/rc3.d/S99myscript
/etc/rc4.d/S99myscript
/etc/rc5.d/S99myscript
/etc/rc6.d/S99myscript

2) Can the sequence number of existing links in /etc/rcx.d be changed with 'update-rc.d'? Eg. to change sequence number of /etc/rc2.d/S99myscript to /etc/rc2.d/S80myscript.

Quote:
Originally Posted by dracae
Disabling myscript for runlevel 3
update-rc.d myscript stop 50 3 .
3) Error : System startup links for /etc/init.d/myscript already exist.


Thanks !
 
  


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
LXer: An introduction to runlevels and init scripts LXer Syndicated Linux News 0 01-11-2006 05:31 PM
udp + sequence number!!!!!! alaios Linux - Networking 1 07-27-2005 07:40 PM
Customize my init scripts Spack971 Slackware 16 07-04-2005 05:37 PM
Understanding K*, S* scripts and runlevels mikemrh9 Linux - Software 4 04-05-2005 09:00 AM
customize slackware install scripts iluvatar Slackware 8 12-16-2004 03:18 AM

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

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