LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices

Reply
 
Search this Thread
Old 04-11-2013, 12:06 AM   #1
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Servers: Debian Squeeze and Wheezy. Desktop: Slackware64 14.0. Netbook: Slackware 13.37
Posts: 8,551
Blog Entries: 28

Rep: Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176
Service startup at boot: how to disable robustly?


How to stop a Debian service starting at boot in a way which will not be undone if the package containing the service is upgraded?

Research shows several ways are commonly used to stop a service starting at boot:
  • update-rc.d -f <service name> remove
    This has the effect of removing all the /etc/rc*.d/[KS]*<service name> symlinks
  • Removing the execute permission on /etc/init.d/<service name>
  • Changing the S in /etc/rc*.d/S*<service name> symlink names to K
  • Modifying /etc/default/<service name> to configure the service not to start.
    Not all (few?) services support such a configuration option.
  • Perhaps only on upstart systems where it may be the only way ... Modifying /etc/init/<service name>.conf file to configure the service not to start.
This issue of persistence during package upgrade is not mentioned in the LQ WIKI page on update-rc.d and I could not find anything about it in the Debian FAQ
where a search found only three references to update-rc.d.

Last edited by catkin; 04-11-2013 at 12:28 AM. Reason: Made clear that question is re Debian
 
Old 04-11-2013, 02:47 AM   #2
cynwulf
Senior Member
 
Registered: Apr 2005
Distribution: OpenBSD, FreeBSD
Posts: 1,337

Rep: Reputation: Disabled
I tend to do

Code:
# update-rc.d daemon_foo disable
But have a look at

Code:
$ man sysv-rc-conf
I'm pretty sure that all of those methods you've listed will be overwritten by package upgrades.
 
Old 04-13-2013, 03:50 AM   #3
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Servers: Debian Squeeze and Wheezy. Desktop: Slackware64 14.0. Netbook: Slackware 13.37
Posts: 8,551
Blog Entries: 28

Original Poster
Rep: Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176
Thanks caravel

AIUI the effect of update-rc.d <service name> disable is to change the S in /etc/rc*.d/S*<service name> symlink names to K.

Thanks for the heads up on sysv-rc-conf. AIUI it's a character-based menu tool for manipulating the /etc/rc*.d/[KS]* symlinks.

Nice to learn of different approaches but not solved yet ...
 
Old 04-13-2013, 04:11 AM   #4
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Servers: Debian Squeeze and Wheezy. Desktop: Slackware64 14.0. Netbook: Slackware 13.37
Posts: 8,551
Blog Entries: 28

Original Poster
Rep: Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176
Ah, found it! From Securing Debian Manual section "3.6.1 Disabling daemon services"
Quote:
... the files under /etc/init.d are configuration files and should not get overwritten due to package upgrades if you have made local changes to them
Based on that, any disabling technique that leaves at least one /etc/rc*.d/[KS]* symlink which is different from the symlinks in the upgrade package should be fine. These techniques should do:
  • update-rc.d -f <service name> disable
  • sysv-rc-conf <service name> followed by interactively changing the default symlinks
  • for s in /etc/rc*.d/S*<service name>; do mv $s ${s/.d\/S/.d\/K}; done

Last edited by catkin; 04-13-2013 at 04:24 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 a service glennbtn Linux - Server 3 07-18-2012 05:13 PM
how to disable Text-to-speechmanager on startup, and disable fsck after 20 boots Kristian2 Slackware 2 02-25-2009 10:55 AM
Disable Service port Paris Heng Solaris / OpenSolaris 3 02-08-2009 10:18 PM
How to disable snmp service on T3. UltraSoul Solaris / OpenSolaris 4 03-19-2007 02:48 AM
How to disable service linuxturtle Linux - Security 1 09-23-2003 10:30 PM


All times are GMT -5. The time now is 06:00 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration