LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Debian (https://www.linuxquestions.org/questions/debian-26/)
-   -   how to restore the startup scripts after removal (https://www.linuxquestions.org/questions/debian-26/how-to-restore-the-startup-scripts-after-removal-442917/)

kushalkoolwal 05-08-2006 06:16 PM

how to restore the startup scripts after removal
 
I recently removed the atd service from starting up automatically by giving the following command:
Code:

update-rc.d -f atd remove
Now I want to restore it back just the way the init scripts for atd were setup before giving the above command? How can I do that?

mrcheeks 05-08-2006 06:24 PM

Code:

update-rc.d atd defaults

kushalkoolwal 05-08-2006 06:47 PM

Quote:

Originally Posted by mrcheeks
Code:

update-rc.d atd defaults

yeah I was aware of this command but the Number after S/K are different for e.g. when I removed atd the output was:
Code:

root@debian:~# update-rc.d -f atd remove
 Removing any system startup links for /etc/init.d/atd ...
  /etc/rc0.d/K89atd
  /etc/rc1.d/K89atd
  /etc/rc2.d/S89atd
  /etc/rc3.d/S89atd
  /etc/rc4.d/S89atd
  /etc/rc5.d/S89atd
  /etc/rc6.d/K89atd
root@debian:~#

and now when I tried to restore it the output was:
Code:

root@debian:~# update-rc.d atd defaults
 Adding system startup for /etc/init.d/atd ...
  /etc/rc0.d/K20atd -> ../init.d/atd
  /etc/rc1.d/K20atd -> ../init.d/atd
  /etc/rc6.d/K20atd -> ../init.d/atd
  /etc/rc2.d/S20atd -> ../init.d/atd
  /etc/rc3.d/S20atd -> ../init.d/atd
  /etc/rc4.d/S20atd -> ../init.d/atd
  /etc/rc5.d/S20atd -> ../init.d/atd
root@debian:~#

The nuber 89 got changed to 20 i.e. means the order in which this service will start will now be different than what it was previosuly. So therefore I was looking for a way which we can restore the service exactly the way it was.

kushalkoolwal 05-09-2006 01:16 AM

anyone can explain this mystery????:confused: :scratch:

nx5000 05-09-2006 02:53 AM

Quote:

Originally Posted by kushalkoolwal
anyone can explain this mystery????:confused: :scratch:

No mystery :) update-rc.d blindly executed what you wanted.

man update-rc.d , look for defaults

This order is a bit tricky to choose, so you should keep the old order in a file or somewhere.

To set it back to 89:
Code:

update-rc.d atd defaults 89

kushalkoolwal 05-09-2006 12:51 PM

Quote:

Originally Posted by nx5000
No mystery :) update-rc.d blindly executed what you wanted.

man update-rc.d , look for defaults

This order is a bit tricky to choose, so you should keep the old order in a file or somewhere.

To set it back to 89:
Code:

update-rc.d atd defaults 89

Ahh. I wish update-rc.d could keep a track of this somehow rather the user keeping track of those numbers.....

Nways, thanks for the reply dude.

kushalkoolwal 05-10-2006 01:06 PM

Sorry for being such a pest. But I really don't feel very intuitive if I have to note down the order number (K20,K59,S89,etc) before I remove the scripts by update-rc.d. Looking at the high quality of the Debian Distribution, I am sure the developers of Debian must have thought of some idea/techniques by which we can restore the scripts in their original order??


Thanks


All times are GMT -5. The time now is 06:52 AM.