[SLE] Example of rc.local for Suse

From: Adrian (adrian_at_autopublish.com)
Date: 07/20/05

  • Next message: Ken Schneider: "Re: [SLE] PDF brochure"
    To: suse-linux-e@suse.com
    Date: Wed, 20 Jul 2005 15:50:42 +0200
    
    

    Hi. I was missing a rc.local (as in redhat/fedora) in order to launch
    some programs/daemons AFTER the whole system has booted. I found
    "/etc/init.d/boot.local", but there we can read:

      # /etc/rc.d/boot.local
      #
      # Here you should add things, that should happen directly
      # after booting before we're going to the first run level.

    This is, things are launched BEFORE going into the first runlevel. In
    fedora's rc.local, things are launched AFTER the system has booted:

      # /etc/rc.d/rc.local
      #
      # This script will be executed *after* all the other init scripts.
      # You can put your own initialization stuff in here if you don't
      # want to do the full Sys V style init stuff.

    Well, I've made a script that simulates Fedora's rc.local. I show it
    since it can be useful for many people. It would be nice if Suse guys
    include something similar into next releases of Suse.

    Steps to simulate rc.local in Suse:

    1) Create a "/etc/rc.d/rclocal" script, with this content:

    ----------------------------
    #! /bin/sh

    ## This script simulates redhat's rc.local (Add commands at the end)

    ### BEGIN INIT INFO
    # Provides: rclocal
    # Required-Start: $local_fs $remote_fs $network
    # X-UnitedLinux-Should-Start: $ALL
    # Required-Stop:
    # X-UnitedLinux-Should-Stop:
    # Default-Start: 3 5
    # Default-Stop: 0 1 2 6
    # Short-Description: Simulates rc.local
    # Description: Simulates redhat's rc.local: contains
    # commands to execute after system has booted (all services are already
    # available)
    ### END INIT INFO

    ## Execute ony when service is started
    case "$1" in
      start)
        ## commands will be executed
      ;;
      *)
        exit 0
      ;;
    esac

    # vvvvv Add your commands bellow this line vvvvv
    ----------------------------

    2) Add executable permision: chmod +x rclocal

    3) Create symlink to make it easy to find: ln -s rclocal rc.local

    4) Activate the service by using yast2:
         yast2 > System > Runlevel editor > rclocal > Enable

    You can add/remove commands to /etc/rc.d/rc.local anytime you wish.

    -- 
    Check the headers for your unsubscription address
    For additional commands send e-mail to suse-linux-e-help@suse.com
    Also check the archives at http://lists.suse.com
    Please read the FAQs: suse-linux-e-faq@suse.com
    

  • Next message: Ken Schneider: "Re: [SLE] PDF brochure"

    Relevant Pages

    • Re: Program to generate buttons for sequence of commands
      ... I am using Win Xp and the commands are for unix system. ... What is it that I need to do to execute commands (such ... Hi, I don't use windows, but there are a variety of ways to ... where you go into the launch sub ...
      (comp.lang.perl.misc)
    • Steps to simulate rc.local in Suse
      ... ## This script simulates redhat's rc.local ... # commands to execute after system has booted (all services are ...
      (alt.os.linux.suse)
    • [UNIX] Vulnerabilities Found in Scponly
      ... SSHd environment files. ... the user can upload a file with a custom ... This provides the user with a means of running arbitrary commands ... the user could execute arbitrary commands by uploading ...
      (Securiteam)
    • Re: [Full-disclosure] FWD Cisco IOS Remote Command Execution Vulnerability
      ... > Vulnerability Alert Cisco IOS Remote Command Execution ... > 9.4 Last Change Cisco has responded to this issue; ... > prone to an issue that may permit gay people to execute arbitrary ... > commands from a password prompt. ...
      (Full-Disclosure)
    • Dont mind if I grouse on some basic topics?? (very long)
      ... I know as experienced programmers you really don't want to hear people gripe ... and moan about basic, indeed critical topics, but I just have to vent on ... commands within a set sequence. ... doesn't appear to uniformly execute them. ...
      (comp.windows.x)