Page 4 sur 9
Re: Domoticz ne démarre plus !
Publié : 25 févr. 2017, 19:18
par ChristianM
patrice a écrit :oui mais comme tu tapes domoticz stop ca ne marche pas
tu n'as le droit de faire start/stoop que dans /etc/init.d ou domoticz est lancé comme un service
Code : Tout sélectionner
pi@raspberrypi:~ $ cd domoticz
pi@raspberrypi:~/domoticz $ ./domoticz.sh
Usage: /etc/init.d/domoticz {start|stop|status|restart}
pi@raspberrypi:~/domoticz $
donc dans le dossier /domoticz, j'ai tapé " ./domoticz.sh "
et il me répond :
" Usage: /etc/init.d/domoticz {start|stop|status|restart} "

Re: Domoticz ne démarre plus !
Publié : 25 févr. 2017, 19:31
par patrice
ah pardon c'est moi qui perd le fil
la commande c'est
sudo ./domoticz
tout court
désolé je ne suis perdu en cours de route
Re: Domoticz ne démarre plus !
Publié : 25 févr. 2017, 19:54
par ChristianM
patrice a écrit :ah pardon c'est moi qui perd le fil
la commande c'est
sudo ./domoticz
tout court
désolé je ne suis perdu en cours de route
Ok, ça remarche ... en partie.
Ce qui est en wifi (mon volet atelier piloté par Wemos et ma présence par mon smartphone) fonctionne.
Ce qui est en 433 MHz (Chacon) volet chambre + prises, ne fonctionne pas.
Cela provient sans doute de mon RFLink.
Voila une capture d'écran (en partie) de ce que ça m'a donné suite à la saisie de sudo ./domoticz

- RPI20170225-6.JPG (122.86 Kio) Consulté 9936 fois
Merci pour tout
Re: Domoticz ne démarre plus !
Publié : 25 févr. 2017, 20:00
par domcars0
Salut,
Juste pour info, pourrais tu taper la commande
% sudo systemctl status -l domoticz
(après avoir tenté de démarrer domoticz 'normalement', c.à.d :
% sudo systemctl start domoticz
)
Et nous renvoyer la réponse STP.
Explication:
systemctl ( signifie "system control"), permet de vérifier l'état (status) , démarrer (start) ou arréter(stop) un service (domoticz dans notre cas) ,
l'option -l (pour 'long') nous permet d'obtenir plus d'info sur l'état.
Pour un domoticz qui tourne on obtient un truc du genre
domcars0@domopi:~ $ sudo systemctl status -l domoticz
● domoticz.service - LSB: Home Automation System
Loaded: loaded (/etc/init.d/domoticz.sh)
Active: active (running) since jeu. 2017-02-16 07:17:44 CET; 1 weeks 2 days ago
CGroup: /system.slice/domoticz.service
└─601 /usr/local/domoticz/domoticz -daemon -www 8192 -sslwww 4238
Warning: Journal has been rotated since unit was started. Log output is incomplete or unavailable.
Re: Domoticz ne démarre plus !
Publié : 25 févr. 2017, 20:12
par ChristianM
domcars0 a écrit :Salut,
Juste pour info, pourrais tu taper la commande
% sudo systemctl status -l domoticz
Et nous renvoyer la réponse STP.
Explication:
systemctl ( signifie "system control"), permet de vérifier l'état (status) , démarrer (start) ou arréter(stop) un service (domoticz dans notre cas) ,
l'option -l (pour 'long') nous permet d'obtenir plus d'info sur l'état.
Pour un domoticz qui tourne on obtient un truc du genre
domcars0@domopi:~ $ sudo systemctl status -l domoticz
● domoticz.service - LSB: Home Automation System
Loaded: loaded (/etc/init.d/domoticz.sh)
Active: active (running) since jeu. 2017-02-16 07:17:44 CET; 1 weeks 2 days ago
CGroup: /system.slice/domoticz.service
└─601 /usr/local/domoticz/domoticz -daemon -www 8192 -sslwww 4238
Warning: Journal has been rotated since unit was started. Log output is incomplete or unavailable.
Bonsoir

- RPI20170225-8.JPG (68.15 Kio) Consulté 9932 fois
Re: Domoticz ne démarre plus !
Publié : 25 févr. 2017, 20:15
par ChristianM
En fait, après avoir redémarré le RPI, je n'ai plus accès via l'explorateur comme je faisais auparavant :

- RPI20170225-7.JPG (23.45 Kio) Consulté 9931 fois
Re: Domoticz ne démarre plus !
Publié : 25 févr. 2017, 21:20
par domcars0
Mouais pas beaucoup d'infos
Tu peux nous faire un copier/coller du fichier /etc/init.d/domoticz.sh s'il te plait.
Merci
Ah et aussi la réponse à la commande :
% ls -l /etc/init.d/domoticz.sh
(
ls = list ,
-l = long response)
Re: Domoticz ne démarre plus !
Publié : 25 févr. 2017, 21:34
par ChristianM
domcars0 a écrit :Mouais pas beaucoup d'infos
Tu peux nous faire un copier/coller du fichier /etc/init.d/domoticz.sh s'il te plait.
Merci
Ah et aussi la réponse à la commande :
% ls -l /etc/init.d/domoticz.sh
(
ls = list ,
-l = long response)
Code : Tout sélectionner
#! /bin/sh
### BEGIN INIT INFO
# Required-Stop: $network $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Home Automation System
# Description: This daemon will start the Domoticz Home Automation System
### END INIT INFO
# Do NOT "set -e"
PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin
/usr/local/bin/gpio export 17 out
/usr/local/bin/gpio export 18 out
/usr/local/bin/gpio export 27 out
/usr/local/bin/gpio export 22 out
/usr/local/bin/gpio export 23 out
/usr/local/bin/gpio export 24 out
/usr/local/bin/gpio export 25 out
/usr/local/bin/gpio export 12 out
DESC="Domoticz Home Automation System"
NAME=domoticz
USERNAME=pi
PIDFILE=/var/run/$NAME.pid
SCRIPTNAME=/etc/init.d/$NAME
DAEMON=/home/pi/domoticz/$NAME
DAEMON_ARGS="-daemon"
#DAEMON_ARGS="$DAEMON_ARGS -daemonname $NAME -pidfile $PIDFILE"
DAEMON_ARGS="$DAEMON_ARGS -www 8080"
DAEMON_ARGS="$DAEMON_ARGS -sslwww 443"
#DAEMON_ARGS="$DAEMON_ARGS -log /tmp/domoticz.txt"
#DAEMON_ARGS="$DAEMON_ARGS -syslog"
# Exit if the package is not installed
[ -x "$DAEMON" ] || exit 0
# Load the VERBOSE setting and other rcS variables
. /lib/init/vars.sh
# Define LSB log_* functions.
# Depend on lsb-base (>= 3.2-14) to ensure that this file is present
# and status_of_proc is working.
. /lib/lsb/init-functions
pidof_domoticz() {
# if there is actually a domoticz process whose pid is in PIDFILE,
# print it and return 0.
if [ -e "$PIDFILE" ]; then
if pidof domoticz | tr ' ' '\n' | grep -w $(cat $PIDFILE); then
return 0
fi
fi
return 1
}
#
# Function that starts the daemon/service
#
do_start()
{
# Return
# 0 if daemon has been started
# 1 if daemon was already running
# 2 if daemon could not be started
start-stop-daemon --chuid $USERNAME --start --quiet --pidfile $PIDFILE --exec $DAEMON --test > /dev/null \
|| return 1
start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON -- \
$DAEMON_ARGS \
|| return 2
}
#
# Function that stops the daemon/service
#
do_stop()
{
# Return
# 0 if daemon has been stopped
# 1 if daemon was already stopped
# 2 if daemon could not be stopped
# other if a failure occurred
start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --pidfile $PIDFILE --name $NAME
RETVAL="$?"
[ "$RETVAL" = 2 ] && return 2
# Wait for children to finish too if this is a daemon that forks
# and if the daemon is only ever run from this initscript.
# If the above conditions are not satisfied then add some other code
# that waits for the process to drop all resources that could be
# needed by services started subsequently. A last resort is to
# sleep for some time.
start-stop-daemon --stop --quiet --oknodo --retry=0/30/KILL/5 --exec $DAEMON
[ "$?" = 2 ] && return 2
# Many daemons don't delete their pidfiles when they exit.
rm -f $PIDFILE
return "$RETVAL"
}
case "$1" in
start)
[ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME"
do_start
case "$?" in
0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
esac
;;
stop)
[ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME"
do_stop
case "$?" in
0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
esac
;;
status)
status_of_proc "$DAEMON" "$NAME" && exit 0 || exit $?
;;
reload)
log_daemon_msg "Reloading $DESC" "$NAME"
PID=$(pidof_domoticz) || true
if [ "${PID}" ]; then
kill -HUP $PID
fi
;;
restart)
log_daemon_msg "Restarting $DESC" "$NAME"
do_stop
case "$?" in
0|1)
do_start
case "$?" in
0) log_end_msg 0 ;;
1) log_end_msg 1 ;; # Old process is still running
*) log_end_msg 1 ;; # Failed to start
esac
;;
*)
# Failed to stop
log_end_msg 1
;;
esac
;;
*)
echo "Usage: $SCRIPTNAME {start|stop|status|restart}" >&2
exit 3
;;
esac
:
et
Code : Tout sélectionner
pi@raspberrypi:/etc/init.d $ ls -l /etc/init.d/domoticz.sh
-rwxr-xr-x 1 root root 4533 févr. 24 19:41 /etc/init.d/domoticz.sh
Re: Domoticz ne démarre plus !
Publié : 25 févr. 2017, 22:11
par domcars0
Tu peux donner la réponse à
% ls -l /usr/local/bin
et à
% ls -l /lib/init/vars.sh
ainsi qu'à
% ls -l /lib/lsb/init-functions
Merci.
Re: Domoticz ne démarre plus !
Publié : 25 févr. 2017, 22:22
par domcars0
Ah merde je crois que j'ai trouvé c'est tout con ..
Au début du fichier tu as viré les instructions de Required -Start
Remplace :
#! /bin/sh
### BEGIN INIT INFO
# Required-Stop: $network $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Home Automation System
par
#! /bin/sh
### BEGIN INIT INFO
# Provides: domoticz
# Required-Start: $network $remote_fs $syslog
# Required-Stop: $network $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Home Automation System
(En gras ce que tu dois ajouter)
Du coup le système ne sait pas ce qui doit être déjà démarré pour démarrer ce service (domoticz) et je pense donc qu'il ne le démarre pas.
(tu peux donner quand même la réponse à
% ls -l /usr/local/bin
, car je suis étonné que le programme gpio soit dans /usr/local/bin et pas dans /usr/bin ?)