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 ?
1 Answer
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
-
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 ?– WaslapFeb 22, 2019 at 13:26