Find the answer to your Linux question:
Results 1 to 6 of 6
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?...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Nov 2007
    Posts
    61

    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
    Just Joined!
    Join Date
    Nov 2007
    Posts
    61
    Where is rc.local? If I create it, where do I put it?

  4. #4
    Linux Newbie
    Join Date
    Mar 2009
    Posts
    228
    It's located in /etc.

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

    What distro are you using?
    What do we want?
    Time machines!

    When do we want 'em?
    Doesn't really matter does it!?


    Conkybots: Interactive plugins for your Conkys!

  6. #6
    Just Joined!
    Join Date
    Nov 2007
    Posts
    61
    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
  •