LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 10-24-2013, 07:58 AM   #1
guna_pmk
Member
 
Registered: Sep 2008
Posts: 220

Rep: Reputation: 5
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
 
Old 10-24-2013, 08:59 AM   #2
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,634

Rep: Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965
Quote:
Originally Posted by guna_pmk View Post
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?
 
Old 10-24-2013, 10:03 AM   #3
voleg
Member
 
Registered: Oct 2013
Distribution: RedHat CentOS Fedora SuSE
Posts: 354

Rep: Reputation: 51
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.
 
Old 10-24-2013, 11:29 AM   #4
guna_pmk
Member
 
Registered: Sep 2008
Posts: 220

Original Poster
Rep: Reputation: 5
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
 
Old 10-24-2013, 11:32 AM   #5
guna_pmk
Member
 
Registered: Sep 2008
Posts: 220

Original Poster
Rep: Reputation: 5
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
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
disable services like bluetooth on startup Elnegro8 Linux - Software 4 07-17-2008 05:11 AM
LXer: GPLv3 is to preserve Free Software, not kill it LXer Syndicated Linux News 0 09-25-2006 01:24 AM
What is the RIGHT way to disable startup services? asimov Ubuntu 3 06-01-2006 10:43 AM
disable AppleTalk services from startup cccc Debian 2 10-23-2005 03:46 PM
what are the services i can disable, also disable ads, banners in konqueror? greythorne SUSE / openSUSE 3 03-16-2005 08:30 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

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

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration