Results 1 to 3 of 3

Thread: script wont run at startup

  1. #1
    Junior Member
    Join Date
    Feb 2006
    Posts
    25

    Default script wont run at startup

    Hi all,

    I have script that I wrote that I want to run at startup. I read other postings and they say to place it in /etc/rc.d/ as well as to make it executable by chmod +x script_name.

    I can run the script no problem from a command line, but when i reboot, it never runs. Anyone have any ideas? Thanks.

    tparnet

  2. #2
    Member
    Join Date
    Jan 2006
    Posts
    66

    Default

    /etc/rc.d/ is the directory that stores the rc scripts. You can check /etc/inittab to find out which scripts are called at different runlevels (google it if you don't know it). Once you've decided exactly when you want your script to be run you can add it with something like this:

    Code:
    #Check for scripts existence, then run it
    if [ -x /path/to/script.sh ]; then
      . /path/to/script.sh
    fi
    This article might help you too.
    ---
    Useful HowTo Threads <-- Why do people think I'm joking when I link this?

  3. #3
    Junior Member
    Join Date
    Feb 2006
    Posts
    25

    Default

    Awesome! Works great. Thanks Hobbes!

Posting Permissions

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