diff options
author | ramon <ramongomez@us.es> | 2011-10-21 12:27:33 +0000 |
---|---|---|
committer | ramon <ramongomez@us.es> | 2011-10-21 12:27:33 +0000 |
commit | 57cf15b048c257c1ba8b3ee217c2e631c936efd3 (patch) | |
tree | 14755834f2cd43c42de566c3f612ac35c18d0e5d | |
parent | fd0c323b9beb34c3a76f314cc70fcbc0135e2796 (diff) |
Versión 1.0.2: añadir al cron un proceso de comprobación y reinicio ante caída de los servicios principales (modifica #426).
git-svn-id: https://opengnsys.es/svn/branches/version1.0@2359 a21b9725-9963-47de-94b9-378ad31fedc9
-rwxr-xr-x | installer/opengnsys_installer.sh | 1 | ||||
-rwxr-xr-x | installer/opengnsys_update.sh | 1 | ||||
-rwxr-xr-x | repoman/bin/opengnsys.cron | 10 |
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 |