Find the answer to your Linux question:
Results 1 to 4 of 4
I need to run a script after SUSE ENTP 10 loaded fully every time I restart the server. How can i do it. Thanks for the help in advance...
  1. #1
    Just Joined!
    Join Date
    Mar 2009
    Posts
    6

    run a script after OS loaded fully

    I need to run a script after SUSE ENTP 10 loaded fully every time I restart the server. How can i do it.
    Thanks for the help in advance

  2. #2
    Linux Engineer hazel's Avatar
    Join Date
    May 2004
    Location
    Harrow, UK
    Posts
    955
    I'm not familiar with SUSE but most distros have a script called rc.local into which you can put anything that you want to run at boot. It executes after all the standard scripts.
    "I'm just a little old lady; don't try to dazzle me with jargon!"

  3. #3
    Linux Newbie
    Join Date
    Feb 2007
    Posts
    248
    I think "rc.local" is not the SUSE way for running/executing a run-level script

    place your script under /etc/init.d directory
    e.g
    /etc/init.d/yourscript

    make your script executeable
    # chmod +x /etc/init.d/yourscript

    then open your script(/etc/init.d/yourscript) in any editor and put the following on top of your script
    Code:
    # !/bin/bash
    # /etc/init.d/yourscript
    #
    ### BEGIN INIT INFO
    # Provides:       yourscript
    # Required-Start: $ALL
    # Should-Start: 
    # Required-Stop:
    # Should-Stop:
    # Default-Start:   3 5
    # Default-Stop:   0 1 2 6
    # Description:    any short description 
    ### END INIT INFO
    
    . /etc/rc.status
    rc_reset
    put the above lines on top in your script

    after inserting the above lines in your script, execute the following command
    # insserv yourscript

    enjoy
    Regards

  4. #4
    Content Team
    Join Date
    Dec 2008
    Location
    Evansville, IN
    Posts
    15
    In Suse you have have a script that runs after startup.

    Create the file /etc/init.d/after.local
    You can call your script from this file. You will also see two other files

    halt.local
    boot.local

    These can also be used to start scripts at various times.

Posting Permissions

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