Page 2 sur 2

Re: souci de demarrage

Publié : 23 mai 2020, 15:28
par Goa_From_Gaia
Merci Chrominator pour les infos.

Dans le cas que tu me présente sur la surveillance de ton domoticz. Si tu juges nécessaire de faire des tests supplémentaires sur un appel url de domoticz ou sur l'augmentation du CPU au de la de 70%, cela t'es déjà arrivé que cela plante pour ces raisons?
Le test sur l'état du daemon ne te semble pas suffisant? parce que je partait sinon dans l'idée de cronifier un script sh

Re: souci de demarrage

Publié : 23 mai 2020, 15:49
par Chrominator
Tu peux développer ta propre solution, aucun souci.
J'ai un petit côté qui m'interdit de réinventer la roue, c'est mon défaut :lol:

Re: souci de demarrage

Publié : 23 mai 2020, 16:07
par Goa_From_Gaia
5272435225ecb85ff00827d9b9b14522.png
5272435225ecb85ff00827d9b9b14522.png (182.63 Kio) Consulté 11860 fois

Re: souci de demarrage

Publié : 17 janv. 2024, 14:48
par jpk
thier a écrit : 29 avr. 2020, 11:14 La modification de /etc/init.d/domoticz.sh pour attendre la mise à l'heure avant de lancer domoticz:
ouvrir /etc/init.d/domoticz.sh avec sudo nano /etc/init.d/domoticz.sh.
remplacer

Code : Tout sélectionner

# 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
}
Dans la version de Domoticz nouvellement installée sur un nouveau RPi 4B, je lis dans /etc/init.d/domoticz.sh nouveau :

Code : Tout sélectionner

# Function that starts the daemon/service
#
do_start()
{
	# Script that waits for time synchronisation before starting Domoticz to prevent a crash
	# on a cold boot when no real time clock is available.

	# Check if systemd-timesyncd is enabled and running, otherwise ignore script
	if systemctl --quiet is-enabled systemd-timesyncd && systemctl --quiet is-active systemd-timesyncd; then
	    # Check if time is already synced, if so start Domoticz immediately
	    if [ -f "/run/systemd/timesync/synchronized" ]; then
		printf "Time synchronized, starting Domoticz...\n"
	    else
		# Check if custom time server(s) are defined
		if grep -q "^#NTP=" /etc/systemd/timesyncd.conf; then
		    printf "INFO: No time server(s) defined in /etc/systemd/timesyncd.conf, using default fallback server(s)\n"
		fi
		# Wait a maximum of 30 seconds until sync file is generated indicating successful time sync
		printf "Waiting for time synchronization before starting Domoticz"
		count=30
		while [ ! -f "/run/systemd/timesync/synchronized" ]
		do
		    count=$((count-1))
		    if [ $((count)) -lt 1 ]
		    then
			# If failed, print error message, exit loop and start Domoticz anyway
			printf "\nWARNING: Time synchronization failed, check network and /etc/systemd/timesyncd.conf\n"
			printf "Starting Domoticz without successful time synchronization...\n"
			break
		    fi
		    printf "."
		    sleep 1
		done
		#If the file was found in time, sync was successful and Domoticz will start immediately
		if [ -f "/run/systemd/timesync/synchronized" ]
		then
		    printf "\nTime synchronization successful, starting Domoticz...\n"
		fi
	    fi
	fi

	# 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
}

Re: souci de demarrage

Publié : 17 janv. 2024, 18:27
par Keros
Ton message est une question ? une information ?

Re: souci de demarrage

Publié : 19 janv. 2024, 09:55
par jpk
C'est en effet une information qui, je pense, pourrait intéresser ceux qui subissent des arrêts/démarrages dus à des coupures de l'alimentation électrique et dont le problème a été présenté en début 2020.

Re: souci de demarrage

Publié : 18 mars 2025, 13:27
par Thorgal
Ben perso la solution officielle, intégrée par défaut ne marche pas chez moi.
Mais celle du post oui.