summaryrefslogtreecommitdiffstats
path: root/admin/Sources/Services
diff options
context:
space:
mode:
authoririna <irinagomez@us.es>2013-03-27 16:33:02 +0000
committeririna <irinagomez@us.es>2013-03-27 16:33:02 +0000
commit831830f0a07fe03ef3d76bca69466a7f18233c24 (patch)
treeb2cbe96e58d3e03705c78739931a417375d01ebb /admin/Sources/Services
parentd2b8d242b5d2bac74026f80606e5091afd5f7d39 (diff)
#493 Configurar el arranque PXE desde el cliente
git-svn-id: https://opengnsys.es/svn/branches/version1.0@3719 a21b9725-9963-47de-94b9-378ad31fedc9
Diffstat (limited to 'admin/Sources/Services')
-rwxr-xr-xadmin/Sources/Services/ogAdmServerAux41
-rwxr-xr-xadmin/Sources/Services/opengnsys.init9
2 files changed, 50 insertions, 0 deletions
diff --git a/admin/Sources/Services/ogAdmServerAux b/admin/Sources/Services/ogAdmServerAux
new file mode 100755
index 00000000..fdc98bf2
--- /dev/null
+++ b/admin/Sources/Services/ogAdmServerAux
@@ -0,0 +1,41 @@
+#!/bin/bash
+# Script para solicitar acciones al servidor de administraciĆ³n desde los clientes.
+# Acciones permitidas: configurar modo de arranque.
+PARM=`cat`
+
+
+
+BASEDIR=/opt/opengnsys
+PATH=$PATH:$BASEDIR/bin
+SERVERNAME=ogAdmServer
+SERVERLOG=$BASEDIR/log/$SERVERNAME.log
+
+
+# AƱade registro de incidencias.
+function echolog () {
+ date +"%Y%m%d-%H%M%S $*" >> $SERVERLOG
+}
+
+
+PARM1=$(echo $PARM | cut -f1 -d" ")
+PARM2=$(echo $PARM | cut -f2 -d" ")
+PARM3=$(echo $PARM | cut -f3 -d" ")
+PARM4=$(echo $PARM | cut -f4 -d" ")
+
+
+case "$PARM1" in
+ SET_CLIENTMODE)
+ #1 SET_CLIENTMODE
+ #2 template
+ #3 pc_name o group_pc
+ TEMPLATE="$PARM2"
+ PC="$PARM3"
+ echolog "Ejecutar $(which setclientmode) $FILE $MCASTOPT"
+ setclientmode $TEMPLATE $PC &>> $SERVERLOG
+ exit $?
+ ;;
+ default)
+ echolog "Solicitud con parametros \"$PARM\" no realizada, no registrada o con errores"
+ ;;
+esac
+
diff --git a/admin/Sources/Services/opengnsys.init b/admin/Sources/Services/opengnsys.init
index 2c46fc70..19507b37 100755
--- a/admin/Sources/Services/opengnsys.init
+++ b/admin/Sources/Services/opengnsys.init
@@ -40,6 +40,11 @@ REPOAUXNAME=ogAdmRepoAux
REPOAUXDAEMON=$BASEDIR/sbin/$REPOAUXNAME
REPOAUXPORT=$(awk -F= '/PUERTO/ {print $2+1}' $SERVERCFG 2>/dev/null)
############## ADV
+############# IRINA # para setBootMode desde el cliente
+SERVERAUXNAME=ogAdmServerAux
+SERVERAUXDAEMON=$BASEDIR/sbin/$SERVERAUXNAME
+SERVERAUXPORT=2011
+############# IRINA
#
# Servidor de tareas programadas
@@ -139,6 +144,10 @@ arranca_demonios() {
$ACTIONMSG "Iniciando demonio: $SERVERNAME"
$DAEMONSTART $SERVERDAEMON $EXTRAOPTS $SERVERDAEMON_OPTIONS $ENDOPTS
[ $? = 0 ] && $SUCCESSMSG || $FAILMSG
+ # Para SetBootmode desde el cliente
+ $ACTIONMSG "Iniciando demonio: $SERVERAUXNAME" #
+ faucet $SERVERAUXPORT --daemon --in bash -c "$SERVERAUXDAEMON" # NUEVO
+ [ $? = 0 ] && $SUCCESSMSG || $FAILMSG
fi
if [ $RUN_OGADMSERVER = "yes" ] && [ $RUN_OGADMREPO = "yes" ]; then
sleep 5 # Damos tiempo a que ogAdmServer este funcionando