Results 1 to 4 of 4

Thread: /etc/init.d/rc5.d script

  1. #1
    Join Date
    Jun 2008
    Posts
    16

    Default /etc/init.d/rc5.d script

    Hi,

    if I make my own script flush in /etc/init.d
    (with a soft-link in /etc/init.d/rc5.d:
    # ln -s ../flush S98flush )

    If I run it from the command prompt, it's OK
    when booting nothing is done from that script (i.e. no /tmp/flush_entered file created)

    What wrong?

    ----
    #!/bin/sh

    case "$1" in
    start)
    echo flush >/tmp/flush_entered
    if [ -f /etc/udev/rules.d/70-persistent-net.rules ]; then
    cp /etc/udev/rules.d/70-persistent-net.rules /tmp/70-persistent-net.rules
    else
    echo "/etc/udev/rules.d/70-persistent-net.rules not found" >/tmp/70-persistent-net.rules.message

    fi
    cat </dev/null >/etc/udev/rules.d/70-persistent-net.rules
    ;;
    *)
    echo "Usage: $0 {start|stop}"
    exit 1
    ;;
    esac

    exit 0
    -----------

  2. #2
    Join Date
    Jun 2008
    Location
    Podunk
    Posts
    26,499
    Blog Entries
    15

    Default Re: /etc/init.d/rc5.d script

    Quote Originally Posted by pdon
    Hi,

    if I make my own script flush in /etc/init.d
    (with a soft-link in /etc/init.d/rc5.d:
    # ln -s ../flush S98flush )

    If I run it from the command prompt, it's OK
    when booting nothing is done from that script (i.e. no
    /tmp/flush_entered file created)

    What wrong?

    ----
    #!/bin/sh

    case "$1" in
    start)
    echo flush >/tmp/flush_entered
    if [ -f /etc/udev/rules.d/70-persistent-net.rules ]; then
    cp /etc/udev/rules.d/70-persistent-net.rules
    /tmp/70-persistent-net.rules
    else
    echo "/etc/udev/rules.d/70-persistent-net.rules not found"
    >/tmp/70-persistent-net.rules.message


    fi
    cat </dev/null >/etc/udev/rules.d/70-persistent-net.rules
    ;;
    *)
    echo "Usage: $0 {start|stop}"
    exit 1
    ;;
    esac

    exit 0
    -----------
    Hi
    Use the template called /etc/init.d/skeleton to create your
    script (wrapper), then use the chkconfig <name_of_script> on command.

    --
    Cheers Malcolm (Linux Counter #276890)
    openSUSE 11.0 x86 Kernel 2.6.25.16-0.1-default
    up 1 day 19:41, 1 user, load average: 0.05, 0.19, 0.23
    GPU GeForce 6600 TE/6200 TE - Driver Version: 173.14.12


  3. #3
    Join Date
    Jun 2008
    Posts
    16

    Default Re: /etc/init.d/rc5.d script

    What is this chkconfig ???

    In Solaris I do not need to do that (there is no chkconfig command) and can create my own scripts (as in the example) and have them executed as such at boot...

  4. #4
    ab@novell.com NNTP User

    Default Re: /etc/init.d/rc5.d script

    -----BEGIN PGP SIGNED MESSAGE-----
    Hash: SHA1

    Everything else looks okay, so I assume you're not booting to runlevel
    5. Follow the comments from the other poster.... they are good. You
    apparently know you are using opensuse as you posted in the opensuse
    forums.... Linux Is Not UniX. Things are very similar, but not exactly
    the same. chkconfig helps control services in a simpler way than I've
    found in Solaris (granted, I am not a Solaris expert by any stretch of
    the imagination). Similarly /etc/init.d/skeleton is made to create
    these scripts that work well with the way Linux does things. With that
    said your way should be fine, but just realize that it's not the "Linux"
    way, or at least not the SUSE way in this case.

    So anyway, are you sure you're at runlevel 5? Use the 'runlevel'
    command to find out. If you aren't then be sure to put your softlink
    int he appropriate directory for the runlevel you are using.

    Good luck.





    pdon wrote:
    > Hi,
    >
    > if I make my own script flush in /etc/init.d
    > (with a soft-link in /etc/init.d/rc5.d:
    > # ln -s ../flush S98flush )
    >
    > If I run it from the command prompt, it's OK
    > when booting nothing is done from that script (i.e. no
    > /tmp/flush_entered file created)
    >
    > What wrong?
    >
    > ----
    > #!/bin/sh
    >
    > case "$1" in
    > start)
    > echo flush >/tmp/flush_entered
    > if [ -f /etc/udev/rules.d/70-persistent-net.rules ]; then
    > cp /etc/udev/rules.d/70-persistent-net.rules
    > /tmp/70-persistent-net.rules
    > else
    > echo "/etc/udev/rules.d/70-persistent-net.rules not found"
    >> /tmp/70-persistent-net.rules.message

    >
    > fi
    > cat </dev/null >/etc/udev/rules.d/70-persistent-net.rules
    > ;;
    > *)
    > echo "Usage: $0 {start|stop}"
    > exit 1
    > ;;
    > esac
    >
    > exit 0
    > -----------
    >
    >

    -----BEGIN PGP SIGNATURE-----
    Version: GnuPG v1.4.2 (GNU/Linux)
    Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

    iD8DBQFI2JTv3s42bA80+9kRAglNAJ47eioEICQ9IsFJcsAOLSNPq/gQiwCfR9v3
    rnvBVX3wx/WJSro7AF2N3cQ=
    =h8zZ
    -----END PGP SIGNATURE-----

Posting Permissions

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