Find the answer to your Linux question:
Results 1 to 6 of 6
Hi everyone. I'm using Debian Sarge. When I switch runlevels, daemons for which I have put an underscore before their startup script do not stop, but carry on running. Does ...
  1. #1
    Just Joined!
    Join Date
    Dec 2005
    Location
    UK
    Posts
    3

    init, runlevels, kill scripts

    Hi everyone. I'm using Debian Sarge. When I switch runlevels, daemons for which I have put an underscore before their startup script do not stop, but carry on running. Does this mean that I need to put a kill script in every runlevel including those scripts which I don't want to run in each level?

    I.e. Say I want to run Apache in runlevel 3 but not 2, do I have to manually put a kill script in the runlevel 2 folder so that when I switch from 3 to 2, the Apache server is stopped?

    Thanks,
    Greg.

  2. #2
    Banned
    Join Date
    Jul 2004
    Posts
    947
    if i remember correct no network interface is present at run level 2, only at 3 and 5
    so it shouldnt be a problem

  3. #3
    Just Joined!
    Join Date
    Dec 2005
    Location
    UK
    Posts
    3
    Quote Originally Posted by the_guy_dressed_in_black
    if i remember correct no network interface is present at run level 2, only at 3 and 5
    so it shouldnt be a problem
    I've been using a network interface in runlevel 2, that's odd... maybe just the way I configured it (by accident!).

    I think I may have understood the matter a little better now. If I want to customise a runlevel so that certain daemons are not run, do I just replace the S at the start of the link's filename with a K?

    Thanks,
    Greg.

  4. #4
    Linux Guru
    Join Date
    May 2004
    Location
    forums.gentoo.org
    Posts
    1,814
    You only need to have the daemon killed if it's already running, like if you start in one runlevel that starts a daemon and then you change to another runlevel. If you put an underbar in front of a Start script and then boot to that runlevel, the daemon with the underbar shouldn't start.
    /IMHO
    //got nothin'
    ///this use to look better

  5. #5
    Linux User
    Join Date
    Apr 2005
    Location
    Ohio
    Posts
    326
    There will already be a startup script for apache there, you simply need to rename the link from S(xx)apache to K(xx)apache

    ls /etc/rc2.d | grep apache
    S91apache
    S91apache-perl
    S91apache-ssl

    mv /etc/rc2.d/S91apache /etc/rc2.d/K91apache

    Now when entering run level 2 apache will not start.
    if apache is already running it will be stopped.
    far...out

  6. #6
    Just Joined!
    Join Date
    Dec 2005
    Location
    UK
    Posts
    3
    Great, thanks for all your help.

    Greg.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •