0

When a service, most notably httpd is configured to run in level 3 and 5 (on CentOS 6.5) and the current run-level is 3 and I move to 5 by init 5, then init restarts httpd which is silly IMHO. Is there a way to prevent this behavior ?

Waslap
  • 173
  • 5

1 Answers1

0

This behaviour can be achieved by turning off the 'httpd' service at run-level 5.

chkconfig --level 5 httpd off

This will disable the service to start at run-level 5.

Thanks

Newbie
  • 53
  • 1
  • 4
  • I don't want the service disabled, i simply want to prevent it from being restarted if it was already running. In other words, it is set to run in level 3 and 5, why restart it when switching from 3 to 5 ? – Waslap Feb 22 '19 at 13:26