Find the answer to your Linux question:
Results 1 to 4 of 4
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Jul 2005
    Location
    look out your window
    Posts
    72

    Init script help


    I looked at a few things on here about init scripts but none of them really help me out.
    I understand the basic structure and I have the script created fine.
    The question I'm asking is is there a way to add an init script without using rc-update or chkconfig or a similar tool, as the script I'm writing is to be packaged with software designed to run on any distobution and it'd be a lot simpler to have one universal way of doing it rather than to be distro-specific.
    Thanks,
    ZDW

  2. #2
    In short, *nope*...but you can simplify it some...

    The init scripts are usually stored in /etc/init.d, but then the run levels may be /etc/init.d/rcX or /etc/rcX. Your installer would have to check this.

    You can copy your file into the /etc/init.d dir, chmod/chown, and then based on where the rc.d dir's are, create a symlink back to your /etc/init.d script - using capital S to start and capital K to kill when leaving that run level.

  3. #3
    Just Joined!
    Join Date
    Jul 2005
    Location
    look out your window
    Posts
    72
    sorry if I'm slow but what exactly do I need to do with the runlevels?

  4. $spacer_open
    $spacer_close
  5. #4
    You need to understand how services get started via the init scripts in the different run levels. This is what chkconfig and rc-update are changing/editing.

    Linux Boot - Init Scripts

    The scripts in /etc/init.d are linked to by files in the run level folders like /etc/init.d/rc3.d. If the link starts with a capital S, then that service is started when run level 3 is entered.

Posting Permissions

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