diff options
author | Jose M. Guisado <jguisado@soleta.eu> | 2021-04-13 12:17:44 +0200 |
---|---|---|
committer | OpenGnSys Support Team <soporte-og@soleta.eu> | 2021-04-13 12:32:45 +0200 |
commit | 992ebb99a7abaf3a3234d85beded319c10073e46 (patch) | |
tree | 6d97a2c1398727ce521905900a2d138f0fdd95ca | |
parent | 875c34e3d1e858b4cb197ee4eaae6ecfc9b4199b (diff) |
#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.
-rwxr-xr-x | client/shared/bin/poweroffconf | 3 |
1 files changed, 2 insertions, 1 deletions
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 |