RE: /etc/init.d/ - add/remove services

From: Ben Yau (byau_at_cardcommerce.com)
Date: 01/30/04

  • Next message: s. keeling: "Re: Isolationism is history."
    To: <debian-user@lists.debian.org>
    Date: Fri, 30 Jan 2004 13:36:27 -0800
    
    

    > -----Original Message-----
    > From: s. keeling [mailto:keeling@spots.ab.ca]
    > Sent: Friday, January 30, 2004 12:39 PM
    > To: debian-user@lists.debian.org
    > Subject: Re: /etc/init.d/ - add/remove services
    >
    >
    > Incoming from Adam Aube:
    > > On Friday 30 January 2004 03:15 pm, mrl7d4@sbcglobal.net wrote:
    > > > What is the preferred way to add or remove a /etc/init.d/ service from
    > > > certain runlevels?
    > >
    > > For adding, use the update-rc.d script. To remove, just manually delete
    > > the symlink. You can use update-rc.d to remove, but you would need to
    > > first remove all the symlinks, then add the set that you want.
    >
    > Alternatively, leave the links alone and just manipulate the scripts
    > in /etc/init.d themselves. If you don't want something to run, insert
    > "exit" near the top of the script (after the shebang line).
    >
    >

    I don't know if there is a preferred way. There are many ways and choose
    the one you like. The convention I use is to rename the file/link with a
    "no" in front.
    e.g.

    mv /etc/rc3.d/K96pcmcia /etc/rc3.d/noK96pcmcia
    mv /etc/rc3.d/S50snmpd /etc/rc3.d/noS50snmpd

    That way if I ever want to put it back, I know where the original file was .

    The advantage it would have over the "exit" method above is that by doing an
    "ls" on the /etc/rc*d directories you can see what services are
    started/killed clearly and also what services used to be started/killed by
    the "no" in the filename whereas with the "exit" you'd have to look in the
    file itself to find that the service was being killed. Also, you have finer
    control over the runlevels. Putting an "exit" in the script will kill the
    service for all runlevels. Whereas renaming a link will kill for an
    individual runlevel. THe disadvantage is if you do want to disable the
    service altogether, you wlil have to possibly rename up to 6 scripts where
    as in the "exit" method you just have to edit one script.

    Just another alternative.

    -- 
    To UNSUBSCRIBE, email to debian-user-request@lists.debian.org 
    with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
    

  • Next message: s. keeling: "Re: Isolationism is history."

    Relevant Pages

    • Re: speed of script execution
      ... the execution of the following scripts. ... Of course "don't use the curly braces" but this is part of a larger ...
      (comp.protocols.kermit.misc)
    • The best scripts ever (trick or treat)
      ... POST YOUR COOLEST SCRIPTS! ... prints an optional argument to stderr and exits. ... # but may not exit with a code other than 0. ...
      (freebsd-questions)
    • Re: How to shrink image files?
      ... I use the netpbm tools and some helper scripts, ... sub usage { ... my $exit = shift; ...
      (comp.os.linux.misc)
    • Re: what is the difference?
      ... > Could somebody tell me what the difference between these 2 scripts are? ... > exit 1 ... define $status to the the value of the last command executed. ...
      (comp.unix.shell)