From 992ebb99a7abaf3a3234d85beded319c10073e46 Mon Sep 17 00:00:00 2001 From: "Jose M. Guisado" Date: Tue, 13 Apr 2021 12:17:44 +0200 Subject: #1041 Fix poweroffconf script poweroffconf is checking if the system is idle by doing a pgrep of processes starting with "/opt/opengnsys/" and ignoring the ones containing $OGETC or "poweroffconf". ogclient process always falls under this process lookup thus making the system seem as always active. Ignore the ogclient process when checking if the system is not idle. --- client/shared/bin/poweroffconf | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'client') diff --git a/client/shared/bin/poweroffconf b/client/shared/bin/poweroffconf index de6726b4..c8cdf39c 100755 --- a/client/shared/bin/poweroffconf +++ b/client/shared/bin/poweroffconf @@ -21,6 +21,7 @@ OPENGNSYS=${OPENGNSYS:-/opt/opengnsys} # Instalación de OpenGnsys OGETC=${OGETC:-$OPENGNSYS/etc} # Configuración de OpenGnsys POWEROFFCONF=/etc/poweroff.conf # Configuración del script +OGCLIENT=ogclient # Error si no existe el fichero de configuración de ahorro de energía. if [ ! -f $POWEROFFCONF ]; then @@ -62,7 +63,7 @@ case $# in esac # Comprobar si hay algún script en ejecución (verificando compatibilidad de "pgrep"). [ -n "$(pgrep -fa 2>&1 | grep "invalid")" ] && PGREP="pgrep -fl" || PGREP="pgrep -fa" -if [ -n "$($PGREP $OPENGNSYS | egrep -v "$OGETC|$0")" ]; then +if [ -n "$($PGREP $OPENGNSYS | egrep -v "$OGETC|$0|$OGCLIENT")" ]; then # Eliminar tiempo de inicio de espera, si se está ejecutando operación. perl -pi -e 's/POWEROFFTIME=.*$/POWEROFFTIME=/' $POWEROFFCONF else -- cgit v1.2.3-18-g5258