[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: disabling inetd



* Kevin Mark (kmark+debian-user@pipeline.com) [031212 22:52]:
> On Fri, Dec 12, 2003 at 06:44:52PM -0800, Vineet Kumar wrote:
> > * Initech (initech@r00tserverz.net) [031212 13:42]:
> > > 
> > > update-rc.d -f inetd remove
> > > 
> > > (note: this is the way you modify init scripts in debian)
> > 
> > note: this is _not_ the way you modify init scripts in debian.
> <snip>
> > still think it an important myth to shoot down each time I see it,
> > because the only way I can figure that anyone thinks that 'update-rc.d
> > -f inetd remove' is a reasonable thing to do is because they saw someone
> > else suggest it here without being corrected.  I guess it sounds kind of
> > like update-menus or update-modules, so people think it's "The Debian
> > Way" of managing sysvinit rc.d boot directories.
> <snip>
> Hi Vineet, I recall someone saying that update-rc.d was for interal use.
> So what is a better way other than removing the service. People
> 'discovered' the update-rc.d supposedly because they couldin't find a
> 'debian' way to do it as I can tell from the number of people making 
> various and sundry queries on this list. Is there a README or FAQ that
> points this out. TIA. ;-).

update-rc.d is a fine tool when used correctly.  the '-f $package
remove' invocation is hardly ever the correct usage when you simply want
to disable a process from running, though.  The main reason for this is
packages' installation scripts call update-rc.d when installing,
including when upgrading.  update-rc.d does nothing if any links already
exist, but installs links if none are found.  What this means is that if
you use 'update-rc.d -f $package remove', and then the package is
upgraded (say via a security update) the package's default links will be
reinstalled.  Probably not what you wanted.

If you want to disable a service but keep it installed on your system
(say you like to run it sometimes, but not in your "default" boot), I
recommend you take the time to customize your run levels.  For example,
(say for a laptop) you could set one for your settings at work, one for
at home, one for "on the road", etc.  These could differ in all of the
services they run.

If you don't want that level of customization and only ever use one
runlevel (2 is the default) you should just remove the startup link from
/etc/rc2.d.  You can use update-rc.d to do this (I'd have to look at the
manpage to remember the syntax) or you can just "sudo rm
/etc/rc2.d/S??$package".  I've always found that much, much simpler than
learning the syntax of yet-another rarely-used tool, but that's just me.

Or if you want to temporarily disable a service entirely, you could just
insert an 'exit 0' near the top of its initscript in /etc/init.d.  That
has the disadvantage of not being able to manually issue "sudo
/etc/init.d/$package start" post-boot, but it's fine for temporary use.

good times,
Vineet
-- 
http://www.doorstop.net/
-- 
If Haydn had patented "a symphony, characterised by that sound is produced
[ in extended sonata form ]", Mozart would have been in trouble.
http://swpat.ffii.org

Attachment: signature.asc
Description: Digital signature


Reply to: