LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   Linux services - disable startup but preserve the kill (https://www.linuxquestions.org/questions/linux-server-73/linux-services-disable-startup-but-preserve-the-kill-4175481994/)

guna_pmk 10-24-2013 07:58 AM

Linux services - disable startup but preserve the kill
 
Hi,

I am aware of the chckconfig on/off which disables the automatic service startups during the system boot (in the specified run levels).

When I run the

Code:

chckconfig myservice off
it removes both the S and K links from the rcN.d directories. However I want only to disable the automatic startups but preserve the kill orders (i.e the K symlinks). Is, instead of using the chkconfig off, removing the link from the relevant runlevel (/etc/rcN.d) the only way to perform this? Or is there any standard way of doing this?

The background is, I have some manual services in the server which may be started by some applications during the server's lifetime. And if the server is shutdown, the services should go through the proper stop procedure. If I do chkconfig off, what happens is, when the server is shutdown, the processes are SIGTERM'd which is an undesired behaviour.

Please let me know if I am not clear in this regard.

Thanks

TB0ne 10-24-2013 08:59 AM

Quote:

Originally Posted by guna_pmk (Post 5051451)
Hi,
I am aware of the chckconfig on/off which disables the automatic service startups during the system boot (in the specified run levels). When I run the
Code:

chckconfig myservice off
it removes both the S and K links from the rcN.d directories. However I want only to disable the automatic startups but preserve the kill orders (i.e the K symlinks). Is, instead of using the chkconfig off, removing the link from the relevant runlevel (/etc/rcN.d) the only way to perform this? Or is there any standard way of doing this?

The background is, I have some manual services in the server which may be started by some applications during the server's lifetime. And if the server is shutdown, the services should go through the proper stop procedure. If I do chkconfig off, what happens is, when the server is shutdown, the processes are SIGTERM'd which is an undesired behaviour.

Well, it does seem obvious that if the chkconfig function removes both the kill and start links, that removing the start-link manually would accomplish what you're after. An "rm <filename>" is all you need, isn't it?

voleg 10-24-2013 10:03 AM

Your initscript file include line like this:

# chkconfig: 2345 55 25

Replace "2345" to "4" only. Run:

# chkconfig --del servicename
# chkconfig --add servicename

Check results and write, if this is what you want to.

guna_pmk 10-24-2013 11:29 AM

Thanks for your reply guys.

Editing the service script is not an option for me (sorry I must have mentioned that in my original post).

I am going to settle with removing the 'S' link from the runlevel.

Cheers

guna_pmk 10-24-2013 11:32 AM

One thing to add. I saw the above mentioned behaviour in open suse 11.

In CentOS 6.4, I noticed that if you call the chkconfig off, it adds a 'K' link to all the runlevels (which is exactly what I am after).

Please let me know if this is not clear please let me know.

Cheers


All times are GMT -5. The time now is 05:59 PM.