Hallo Liste,

wie es scheint stelle ich mir gerade mal selber wieder ein Bein. - Ich
sehe nur nicht warum.

Was ich will: Analog zu /etc/rc.local will ich ein shut-down-script
/etc/rc.local.stop anstubsen, wenn meine Box runter fährt. Dazu habe ich
versucht meine /etc/init.d/rc-local so zu modifizieren:

    #! /bin/sh
    ### BEGIN INIT INFO
    # Provides:          rc.local
    # Required-Start:    $all
    # Required-Stop:
    # Default-Start:     2 3 4 5
    # Default-Stop:      0 6
    # Short-Description: Run /etc/rc.local OR /etc/rc.local.stop if it exist
    ### END INIT INFO


    PATH=/sbin:/usr/sbin:/bin:/usr/bin

    . /lib/init/vars.sh
    . /lib/lsb/init-functions

    do_start() {
            if [ -x /etc/rc.local ]; then
                    [ "$VERBOSE" != no ] && log_begin_msg "Running local boot 
scripts (/etc/rc.local)"
                    /etc/rc.local
                    ES=$?
                    [ "$VERBOSE" != no ] && log_end_msg $ES
                    return $ES
            fi
    }

    do_stop() {
            if [ -x /etc/rc.local.stop ]; then
                    [ "$VERBOSE" != no ] && log_begin_msg "Running local 
shutdown scripts (/etc/rc.local.stop)"
                    /etc/rc.local.stop
                    ES=$?
                    [ "$VERBOSE" != no ] && log_end_msg $ES
                    return $ES
            fi
    }

    case "$1" in
        start)
            do_start
            ;;
        stop)
            do_stop
            ;;
        restart|reload|force-reload)
            echo "Error: argument '$1' not supported" >&2
            exit 3
            ;;
        status)
            # No-op
            exit 0
            ;;
        *)
            echo "Usage: $0 start|stop" >&2
            exit 3
            ;;
    esac

Allerdings scheint der Aufruf "/etc/init.d/rc.local stop" nicht das zu
tun, was er soll:

    # init.d/rc.local stop
    [ ok ] Stopping rc.local (via systemctl): rc.local.service.

... das sieht zwar gut aus, aber es passiert nichts weiter. Ich muss da
oben im Script irgendwas vergurkt haben, sehe es bloß grad nicht.

Hinweise die zur Ergreifung des Täters beitragen werden mit großer
Dankbarkeit gewürdigt ... ;-).

Gruß

Stefan.

-- 
Stefan U. Hegner
         <[email protected]>
              * * *
D-32584 Löhne --- good ole Germany
internet: http://www.hegner-web.de
              * * *
GPG-Key | 048D 7F64 0BEB 73B1 2725
F-Print | C05E 4F77 9674 EF11 55FE

Attachment: signature.asc
Description: OpenPGP digital signature

-- 
Linux mailing list [email protected]
subscribe/unsubscribe: http://lug-owl.de/mailman/listinfo/linux
Hinweise zur Nutzung: http://www.lug-owl.de/Mailingliste/hints.epo

Antwort per Email an