Jessie: lokales "Shutdown" script einbauen
Stefan U. Hegner
stefan at hegner-online.de
Wed Jan 27 19:27:26 CET 2016
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
<stefan at hegner-online.de>
* * *
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
-------------- nächster Teil --------------
Ein Dateianhang mit Binärdaten wurde abgetrennt...
Dateiname : signature.asc
Dateityp : application/pgp-signature
Dateigröße : 213 bytes
Beschreibung: OpenPGP digital signature
URL : <http://lug-owl.de/pipermail/linux/attachments/20160127/9468884e/attachment.sig>
More information about the Linux
mailing list