7

I need to have only stop scripts in rcN.d (runlevels 0,1,6) for apache2. So that I always start it by myself, but when reboot occurs server will shut down apache2 properly. And when I change runlevel 2-3 server doesnt' touch apache daemon (leaving it in the state it is).

Basically, I just need a legal way to remove apache2 startup symlinks from rc2.d -> rc5.d. With tools like update-rc.d.

I can just remove those symlinks by hands, but I'm not sure if this is a proper way for this.

Evgenyt
  • 803

4 Answers4

11

This should do the trick :

update-rc.d apache2 disable

Basically update-rc.d will modify existing runlevel links for the script /etc/init.d/apache2 by renaming start links to stop links.

If you wanted to disable only runlevel 2 and 5, you could do :

update-rc.d apache2 disable 2 5

nico

ijqndq824
  • 368
6
sysv-rc-conf 

is the new way to do this job.

enter image description here

JJD
  • 77
2

You can remove symblinks by hands, there is no problem to do that this way if you know what you are doing.

aligot
  • 328
2
update-rc.d -f apache2 remove
user6738237482
  • 1,580
  • 12
  • 7