summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xinstaller/opengnsys_installer.sh1
-rwxr-xr-xinstaller/opengnsys_update.sh1
-rwxr-xr-xrepoman/bin/opengnsys.cron10
3 files changed, 9 insertions, 3 deletions
diff --git a/installer/opengnsys_installer.sh b/installer/opengnsys_installer.sh
index cd724e2d..7763ea43 100755
--- a/installer/opengnsys_installer.sh
+++ b/installer/opengnsys_installer.sh
@@ -1070,6 +1070,7 @@ function openGnsysConfigure()
cp -p $WORKDIR/opengnsys/admin/Sources/Services/ogAdmRepoAux /opt/opengnsys/sbin/
update-rc.d opengnsys defaults
echoAndLog "${FUNCNAME}(): Creating cron files."
+ echo "* * * * * root [ -x $INSTALL_TARGET/bin/opengnsys.cron ] && $INSTALL_TARGET/bin/opengnsys.cron" > /etc/cron.d/opengnsys
echo "* * * * * root [ -x $INSTALL_TARGET/bin/torrent-creator ] && $INSTALL_TARGET/bin/torrent-creator" > /etc/cron.d/torrentcreator
echo "5 * * * * root [ -x $INSTALL_TARGET/bin/torrent-tracker ] && $INSTALL_TARGET/bin/torrent-tracker" > /etc/cron.d/torrenttracker
diff --git a/installer/opengnsys_update.sh b/installer/opengnsys_update.sh
index d81ba381..685d42eb 100755
--- a/installer/opengnsys_update.sh
+++ b/installer/opengnsys_update.sh
@@ -464,6 +464,7 @@ function updateServerFiles()
done
fi
echoAndLog "${FUNCNAME}(): updating cron files"
+ echo "* * * * * root [ -x $INSTALL_TARGET/bin/opengnsys.cron ] && $INSTALL_TARGET/bin/opengnsys.cron" > /etc/cron.d/opengnsys
echo "* * * * * root [ -x $INSTALL_TARGET/bin/torrent-creator ] && $INSTALL_TARGET/bin/torrent-creator" > /etc/cron.d/torrentcreator
echoAndLog "${FUNCNAME}(): server files updated successfully."
}
diff --git a/repoman/bin/opengnsys.cron b/repoman/bin/opengnsys.cron
index b8b50a1d..55022ef1 100755
--- a/repoman/bin/opengnsys.cron
+++ b/repoman/bin/opengnsys.cron
@@ -2,14 +2,18 @@
# Variables.
OPENGNSYS=${OPENGNSYS:-"/opt/opengnsys"}
LOGDIR="$OPENGNSYS/log"
+DEFAULTFILE=/etc/default/opengnsys
+# Comprobar servicios que deben estar activos.
+[ -f $DEFAULTFILE ] && source $DEFAULTFILE
-if ! $(pgrep ogAdmServer >> /dev/null); then
+# Si un servicio debe estar activo y no se está ejecutando, reiniciar OpenGnSys.
+if [ "$RUN_OGADMSERVER" == "yes" -a $(pgrep -c ogAdmServer) == 0 ]; then
date +"%d/%m/%Y %T ERROR: El servicio ogAdmServer estaba caido, se reinicia" >> $LOGDIR/ogAdmServer.log
/etc/init.d/opengnsys restart
fi
-if ! $(pgrep ogAdmRepo >> /dev/null); then
- date +"%d/%m/%Y %T ERROR: El servicio opAdmRepo estaba caido, se reinicia" >> $LOGDIR/ogAdmRepo.log
+if [ "$RUN_OGADMREPO" == "yes" -a $(pgrep -c ogAdmRepo) == 0 ]; then
+ date +"%d/%m/%Y %T ERROR: El servicio ogAdmRepo estaba caido, se reinicia" >> $LOGDIR/ogAdmRepo.log
/etc/init.d/opengnsys restart
fi