Find the answer to your Linux question:
Results 1 to 6 of 6
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    Start up/shutdown


    I would like to run a command or script on every shutdown or startup, or maybe both, could someone point me in the right direction please?

  2. #2
    Linux Newbie
    Join Date
    Feb 2009
    Location
    Third ring of Pergatory
    Posts
    199
    rc.local is the customary place to put start-up scripts.
    Shutdown scripts work better if you call the shudown via /sbin/shutdown inside another script rather than trying to rewrite shutdown itself. I.E don't try to edit shutdown, write a script that contains the commands you want run and place /bin/shutdown at the end of it. (the very end) then call shutdown through the script.

  3. #3
    Where is rc.local? If I create it, where do I put it?

  4. $spacer_open
    $spacer_close
  5. #4
    It's located in /etc.

  6. #5
    Penguin of trust elija's Avatar
    Join Date
    Jul 2004
    Location
    Either at home or at work or down the pub
    Posts
    3,814
    How you do this depends on the distro - and the runlevel you want it to run at.

    What distro are you using?
    Should you be sitting wondering,
    Which Batman is the best,
    There's only one true answer my friend,
    It's Adam Bloody West!


    The Fifth Continent

  7. #6
    Sorry folks, I usually post in SUSE forums got out of the habit:
    I use openSUSE 11.1 (kde 3.5)

Posting Permissions

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