summaryrefslogtreecommitdiffstats
path: root/admin/Services/opengnsys.init
diff options
context:
space:
mode:
Diffstat (limited to 'admin/Services/opengnsys.init')
-rwxr-xr-xadmin/Services/opengnsys.init165
1 files changed, 0 insertions, 165 deletions
diff --git a/admin/Services/opengnsys.init b/admin/Services/opengnsys.init
deleted file mode 100755
index 6af54ab2..00000000
--- a/admin/Services/opengnsys.init
+++ /dev/null
@@ -1,165 +0,0 @@
-#! /bin/sh
-
-##################################################################################################################
-####### Script de arranque de los servicios OpenGnSys:
-####### Servidor ogAdmServer,
-####### Servidor de repositorio ogAdmRepo,
-####### Servidor ogAdmAgent, para tareas programadas
-#######
-####### Tracker Bittorrent y seeder de imagenes por Bittorrent
-####### autor: jcxifre <jcxifre@unizar.es>
-####### basado en http://www.epilogue.org/~xef4/start-stop-example
-##################################################################################################################
-
-
-### BEGIN INIT INFO
-# Provides: opengnsys
-# Required-Start:
-# Required-Stop:
-# Default-Start: 2 3 4 5
-# Default-Stop: 1
-# Short-Description: Servicios del sistema OpenGnSys
-# Description: Servicios del sistema OpenGnSys:
-### END INIT INFO
-
-#
-# Definiciones globales
-#
-BASEDIR=/opt/opengnsys
-
-#
-# Servidor de OpenGnSys
-#
-SERVERNAME=ogAdmServer
-SERVERDAEMON=$BASEDIR/sbin/$SERVERNAME
-SERVERCFG=$BASEDIR/etc/$SERVERNAME.cfg
-SERVERLOG=$BASEDIR/log/$SERVERNAME.log
-SERVERDAEMON_OPTIONS="-f $SERVERCFG -l $SERVERLOG"
-
-#
-# Servidor de Repositorio
-#
-REPONAME=ogAdmRepo
-REPODAEMON=$BASEDIR/sbin/$REPONAME
-REPOCFG=$BASEDIR/etc/$REPONAME.cfg
-REPOLOG=$BASEDIR/log/$REPONAME.log
-REPODAEMON_OPTIONS="-f $REPOCFG -l $REPOLOG"
-
-#
-# Servidor ogAdmAgent
-#
-AGENTNAME=ogAdmAgent
-AGENTDAEMON=$BASEDIR/sbin/$AGENTNAME
-AGENTCFG=$BASEDIR/etc/$AGENTNAME.cfg
-AGENTLOG=$BASEDIR/log/$AGENTNAME.log
-AGENTDAEMON_OPTIONS="-f $AGENTCFG -l $AGENTLOG"
-
-#
-# Opciones Bittorrent
-#
-
-BTTRACK=/usr/bin/bttrack.bittorrent
-BTSEEDER=/usr/bin/btlaunchmany.bittornado
-BTTRACKPORT=6969
-BTTRACKDFILE=/tmp/dstate
-BTTRACKLOG=/opt/opengnsys/log/bttrack.log
-BTINTERVAL=30
-BTTORRENTSDIR=/opt/opengnsys/images
-BTALLOW_GET=1
-BTTRACK_OPTIONS=" --port $BTTRACKPORT --dfile $BTTRACKDFILE --reannounce_interval $BTINTERVAL --logfile $BTTRACKLOG --allowed_dir $BTTORRENTSDIR --allow_get $BTALLOW_GET --parse_allowed_interval 1"
-BTTRACKPID="/var/run/bttrack.pid"
-BTSEEDERPID="/var/run/btseeder.pid"
-
-
-set -e
-export PATH="${PATH:+$PATH:}/usr/sbin:/sbin:/usr/bin"
-
-# Read config file if it is present.
-if [ -r /etc/default/opengnsys ]
-then
- . /etc/default/opengnsys
-fi
-
-arranca_demonios() {
- if [ $RUN_OGADMSERVER = "yes" ]
- then
- echo -n "Iniciando demonio: "$SERVERNAME
- start-stop-daemon --start --quiet --background --exec $SERVERDAEMON -- $SERVERDAEMON_OPTIONS
- echo "."
- fi
- if [ $RUN_OGADMSERVER = "yes" ] && [ $RUN_OGADMREPO = "yes" ]
- then
- sleep 5 # Damos tiempo a que ogAdmServer este funcionando
- fi
- if [ $RUN_OGADMREPO = "yes" ]
- then
- echo -n "Iniciando demonio: "$REPONAME
- start-stop-daemon --start --quiet --background --exec $REPODAEMON -- $REPODAEMON_OPTIONS
- echo "."
- fi
- if [ $RUN_OGADMAGENT = "yes" ]
- then
- echo -n "Iniciando demonio: "$AGENTNAME
- start-stop-daemon --start --quiet --background --exec $AGENTDAEMON -- $AGENTDAEMON_OPTIONS
- echo "."
- fi
-
- if [ $RUN_BTTRACKER = "yes" ]
- then
- echo -n "Iniciando demonio: "$BTTRACK
- start-stop-daemon --make-pidfile --pidfile $BTTRACKPID --start --quiet --background --exec $BTTRACK -- $BTTRACK_OPTIONS
- echo "."
- fi
- if [ $RUN_BTSEEDER = "yes" ]
- then
- echo -n "Iniciando demonio: "$BTSEEDER
- start-stop-daemon --make-pidfile --pidfile $BTSEEDERPID --start --quiet --background --exec $BTSEEDER -- $BTTORRENTSDIR
- echo "."
- fi
-
-}
-para_demonios() {
- if [ -e $BTSEEDERPID ]
- then
- echo -n "Parando demonio: "$BTSEEDER
- start-stop-daemon --stop --quiet --oknodo --retry 30 --pidfile $BTSEEDERPID
- echo "."
- rm $BTSEEDERPID > /dev/null
- fi
- if [ -e $BTTRACKPID ]
- then
- echo -n "Parando demonio: "$BTTRACK
- start-stop-daemon --stop --quiet --oknodo --pidfile $BTTRACKPID
- echo "."
- rm $BTTRACKPID > /dev/null
- fi
- echo -n "Parando demonio: "$AGENTNAME
- start-stop-daemon --stop --quiet --oknodo --name $AGENTNAME
- echo "."
- echo -n "Parando demonio: "$REPONAME
- start-stop-daemon --stop --quiet --oknodo --name $REPONAME
- echo "."
- echo -n "Parando demonio: "$SERVERNAME
- start-stop-daemon --stop --quiet --oknodo --name $SERVERNAME
- echo "."
-}
-
-case "$1" in
- start)
- arranca_demonios
- ;;
- stop)
- para_demonios
- ;;
- restart)
- para_demonios
- arranca_demonios
- ;;
-
- *)
- echo "Uso: opengnsys "$1" {start|stop|restart}"
- exit 1
- ;;
-esac
-
-exit 0