update-rc.d deaktivieren/entfernen nicht entfernen etc/init.d/rc* Referenzen
Habe ich einen daemon über das Debian-init.d Skelett, die erfolgreich als Dienst läuft. Hab ich auch verwendet:
sudo update-rc.d /etc/init.d/pirservice.sh defaults
bekommen, der daemon läuft auf der boot und schließen schön, wenn die Ausstellung eines shutdown-Befehl.
Allerdings habe ich da versucht zu entfernen, die nach dem Booten starten-Dienst mithilfe des folgenden:
sudo update-rc.d /etc/init.d/pirservice.sh remove
Auf die Prüfung für den Abschluss mit:
ls -l /etc/rc?.d/*pirservice.sh
Den Skripten ist noch vernetzt in alle 6 rc?.d Ordner und sicher genug, noch beim Systemstart geladen wird
wenn ich versuche, verwenden Sie die folgende:
sudo update-rc.d /etc/init.d/pirservice.sh disable
Bekomme ich die folgende Fehlermeldung:
update-rc.d: using dependency based boot sequencing
update-rc.d: error: cannot find a LSB script for /etc/init.d/pirservice.sh
Meine Skripts ist wie folgt:
#!/bin/sh
# /etc/init.d/pirservice.sh
### BEGIN INIT INFO
# Provides: myservice
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Put a short description of the service here
# Description: Put a long description of the service here
### END INIT INFO
# Change the next 3 lines to suit where you install your script and what you want to call it
DIR=/usr/local/bin/myservice
DAEMON=$DIR/pir.py
DAEMON_NAME=pir
# This next line determines what user the script runs as.
# Root generally not recommended but necessary if you are using the Raspberry Pi GPIO from Python.
DAEMON_USER=root
# The process ID of the script when it runs is stored here:
PIDFILE=/var/run/$DAEMON_NAME.pid
. /lib/lsb/init-functions
do_start () {
log_daemon_msg "Starting system $DAEMON_NAME daemon"
start-stop-daemon --start --background --pidfile $PIDFILE --make-pidfile --user $DAEMON_USER --startas $DAEMON
log_end_msg $?
}
do_stop () {
log_daemon_msg "Stopping system $DAEMON_NAME daemon"
start-stop-daemon --stop --pidfile $PIDFILE --retry 10
log_end_msg $?
}
case "$1" in
start|stop)
do_${1}
;;
log_end_msg $?
}
do_stop () {
log_daemon_msg "Stopping system $DAEMON_NAME daemon"
start-stop-daemon --stop --pidfile $PIDFILE --retry 10
log_end_msg $?
}
case "$1" in
start|stop)
do_${1}
;;
restart|reload|force-reload)
do_stop
do_start
;;
status)
status_of_proc "$DAEMON_NAME" "$DAEMON" && exit 0 || exit $?
;;
*)
echo "Usage: /etc/init.d/$DEAMON_NAME {start|stop|restart|status}"
exit 1
;;
esac
exit 0
Kann mir jemand eine Anleitung?
InformationsquelleAutor user3132567 | 2013-12-26
Du musst angemeldet sein, um einen Kommentar abzugeben.
OK. Ich konnte nicht sehen, keine offensichtlichen Fehler mit dem init-Skript. so dass ich gezwungen die Entfernung wie folgt:
Wenn jemand herausfinden kann, warum ich das LSB Fehler wäre ich dankbar.
InformationsquelleAutor user3132567
Die man-page sagt
Benutzen Sie deshalb
statt.
Für guten Stil, den Sie aktualisieren sollten, Informationen innerhalb der
INIT INFO
block.Zusätzlich könnten entfernen Sie die
.sh
Erweiterung für ein schöner name.InformationsquelleAutor ViToni