LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Debian (https://www.linuxquestions.org/questions/debian-26/)
-   -   How do you customize scripts' sequence number for different runlevels? (https://www.linuxquestions.org/questions/debian-26/how-do-you-customize-scripts-sequence-number-for-different-runlevels-428239/)

Akhran 03-24-2006 11:01 PM

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 !

dracae 03-25-2006 01:15 AM

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 .

Akhran 03-25-2006 03:23 AM

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 !


All times are GMT -5. The time now is 01:32 AM.