Weblog entry #12 for Utumno

*Not* starting services at bootup
Posted by Utumno on Tue 15 Aug 2006 at 09:50
Tags: none.
I've got a couple of services ( most notably Samba, mldonkey-server ) which I do not want to start at system bootup. So I 'update-rc.d -f XXXX remove' those services from the initscripts.

The annoyance: every time I 'apt-get upgrade' the system and a given service gets upgraded, it adds itself back to the initscripts. Anyone knows how to prevent that?

 

Comments on this Entry

Posted by Utumno (60.248.xx.xx) on Tue 15 Aug 2006 at 10:50
[ Send Message | View Utumno's Scratchpad | View Weblogs ]
Ok, seems like changing all the 'S' links to 'K' ( rather than removing them altogether with update-rc.d remove ) will solve my problem. Thanks.

[ Parent | Reply to this comment ]

Posted by Utumno (60.248.xx.xx) on Tue 15 Aug 2006 at 10:52
[ Send Message | View Utumno's Scratchpad | View Weblogs ]
**pining for BSD-style initscripts***

[ Parent | Reply to this comment ]

Posted by trakic (87.72.xx.xx) on Tue 15 Aug 2006 at 20:22
[ Send Message | View Weblogs ]
Always works: just do `chmod -x /etc/init.d/service-name` - no need to change the default installation ;-)...

[ Parent | Reply to this comment ]

Posted by Utumno (60.248.xx.xx) on Wed 16 Aug 2006 at 04:53
[ Send Message | View Utumno's Scratchpad | View Weblogs ]
that does not work *always*... Does not work in my situation, for one.

The reason I do not want to have Samba started at bootup is that the laptop we are talking about is typically run in two places ( my office and my house ) and in my house I do not need nor want to run it. The network there is very hostile and filled up to the brim with script-kiddies - after a week of running samba there ( accidental, that was after an 'apt-get upgrade' and my failure to notice that this re-adds samba to initscripts ) my /var/log/samba/* directory was over 100 MB of breakin attempt logs.

So I had to write a script which first detects where I am and only if I am in the office it brings samba up with a '/etc/init.d/samba start'. So no, a 'chmod -x' wont do.

[ Parent | Reply to this comment ]

Posted by Steve (62.30.xx.xx) on Wed 16 Aug 2006 at 09:30
[ Send Message | View Steve's Scratchpad | View Weblogs ]

Surely in that situation you're fine:

  • The bootup script is non-executable.
  • You run your "where am I script" which either:
    • 1. Identifies it needs to start samba and runs "chmod +x ; start; chmod -x"
    • 2. Realises nothing needs to happen so does nothing.

The only extra complication I see is that once you've identified that you need to enable Samba you must start it, but remove the -x permission so that at reboot time it doesn't come back up unless your identification script detects that this is required.

Steve

[ Parent | Reply to this comment ]

Posted by Utumno (61.229.xx.xx) on Thu 17 Aug 2006 at 14:56
[ Send Message | View Utumno's Scratchpad | View Weblogs ]
Well, yeah, but... What about other services then, like mldonkey-server, which I only want to start manually? with this solution I would have to write a wrapper-script to start it the 'chmod +x;start;chmod -x' way. The same for all the other services which I do not want to start on bootup. This is of course perfectly doable, but I was hoping for some more generic solution.

I guess the real question is the following: why is that an upgrade re-adds a service to initscripts anyway? Seems like if a service is installed, and if the default behavior is to start it on bootup *but* during the upgrade it turns out this service is currently set *not* to be started on bootup , it can only mean one thing: the administrator of this machine must have update-rc.d remove'd it, and he must have done it on purpose. So why the forceful override of administrator's choice?

[ Parent | Reply to this comment ]

Posted by daemon (196.25.xx.xx) on Thu 17 Aug 2006 at 21:56
[ Send Message | View Weblogs ]
What about doing:

sh /etc/init.d/<service-name> start

?

That should work for those services that you want to start manually -- if you go with the non-executable scheme that is.

Cheers.

[ Parent | Reply to this comment ]

Posted by niol (143.196.xx.xx) on Wed 16 Aug 2006 at 12:36
[ Send Message | View Weblogs ]
What I did on my laptop and what works great is the following :
# update-rc.d samba stop 0 1 2 3 4 5 6 .

[ Parent | Reply to this comment ]

Posted by Utumno (61.229.xx.xx) on Thu 17 Aug 2006 at 15:06
[ Send Message | View Utumno's Scratchpad | View Weblogs ]
This is exactly what was suggested in this debian-user post pointed at by Steve: changing all the 'S' links to 'K' links. I did exactly that and so far it seems to work :)

[ Parent | Reply to this comment ]

Posted by philcore (70.161.xx.xx) on Fri 18 Aug 2006 at 12:47
[ Send Message | View Weblogs ]
I went round and round with this on debian-user a year or so ago. My final solution was to use John Hasler's tool sysvconfig to administer init scripts.

phil

[ Parent | Reply to this comment ]

Posted by Utumno (218.160.xx.xx) on Sun 24 Sep 2006 at 10:42
[ Send Message | View Utumno's Scratchpad | View Weblogs ]
Oh, in case of mldonkey, best is to simply edit /etc/default/mldonkey-server and set 'LAUNCH_AT_STARTUP' to false... No such file for Samba, though.

[ Parent | Reply to this comment ]

User Login

Username:

Password:

[ Advanced Login ]

Register Account

Quick Site Search