summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xadmin/Sources/Services/ogAdmRepoAux5
-rwxr-xr-xclient/shared/scripts/createImage10
-rwxr-xr-xclient/shared/scripts/deployImage29
-rwxr-xr-xclient/shared/scripts/initCache2
-rwxr-xr-xinstaller/opengnsys_installer.sh12
-rwxr-xr-xserver/bin/comparedhcpopengnsys (renamed from server/bin/compareDhcpOpengnsys)6
-rw-r--r--server/etc/smb-og.conf.tmpl2
7 files changed, 35 insertions, 31 deletions
diff --git a/admin/Sources/Services/ogAdmRepoAux b/admin/Sources/Services/ogAdmRepoAux
index 76c61271..4e922e1a 100755
--- a/admin/Sources/Services/ogAdmRepoAux
+++ b/admin/Sources/Services/ogAdmRepoAux
@@ -157,8 +157,9 @@ case "$PARM1" in
# Si no existe la imagen creamos el fichero.
else
echolog "Creamos la imagen $IMGFILE al tamaño necesario: $SIZEREQUIRED"
- echolog dd if=/dev/zero of=$IMGFILE bs=1024 count=$SIZEREQUIRED
- dd if=/dev/zero of=$IMGFILE bs=1024 count=$SIZEREQUIRED
+ touch "$IMGFILE"
+ echolog "truncate --size=\">$SIZEREQUIRED\"k $IMGFILE"
+ truncate --size=">$SIZEREQUIRED"k $IMGFILE 2>&1 > $REPOLOG
#Formateamos imagen
echo losetup $LOOPDEVICE "$IMGFILE"
losetup $LOOPDEVICE "$IMGFILE"
diff --git a/client/shared/scripts/createImage b/client/shared/scripts/createImage
index 85bd08b9..7c6ed5bb 100755
--- a/client/shared/scripts/createImage
+++ b/client/shared/scripts/createImage
@@ -102,11 +102,6 @@ read SIZEDATA SIZEREQUIRED ISENOUGHSPACE <<< $(ogGetSizeParameters $1 $2 "$3")
ogEcho log session "[16] $PROG: $MSG_SCRIPTS_CREATE_SIZE $SIZEREQUIRED"
[ "$ISENOUGHSPACE" == "TRUE" ] || exit $(ogRaiseError session $OG_ERR_CACHESIZE "$3"; echo $?)
-# Ejecuta script personalizado de preconfiguración del sistema operativo modelo.
-if which createImageCustomPre &>/dev/null; then
- createImageCustomPre "$1" "$2" "$3" "$4"
-fi
-
# Comprobar consistencia del sistema de archivos.
echo " " > $OGLOGCOMMAND
SIZEFS=$(ogGetFsSize $1 $2)
@@ -153,8 +148,3 @@ ogEcho log session "[100] $MSG_SCRIPTS_TIME_TOTAL $[TIME/60]m $[TIME%60]s"
ogEcho log session " FileSystem $PART with $NEWSIZEFS KB data created onto file-image as $4 and used $IMGSIZE KB across DFS $ogprotocol"
ogEcho log session " Image-file $4 metada: $IMGOS"
-# Ejecuta scripts personalizado de postconfiguracion del sistema operativo modelo.
-if which createImageCustomPost &>/dev/null; then
- createImageCustomPost "$1" "$2" "$3" "$4"
-fi
-
diff --git a/client/shared/scripts/deployImage b/client/shared/scripts/deployImage
index 89d776a6..3be16e92 100755
--- a/client/shared/scripts/deployImage
+++ b/client/shared/scripts/deployImage
@@ -160,23 +160,27 @@ esac
TIME3=$SECONDS
+# Obtener parámetros de restauración.
case "$NEXTOPERATION" in
CACHE)
- ogEcho log session "[55] $MSG_HELP_ogRestoreImage : restoreImage CACHE $IMGNAME $DISK $PART UNICAST"
- restoreImage CACHE "$IMGNAME" "$DISK" "$PART"
- RETVAL=$?
- ;;
+ PARAMS="CACHE $IMGNAME $DISK $PART" ;;
UNICAST)
- ogEcho log session "[55] $MSG_HELP_ogRestoreImage : restoreImage REPO $IMGNAME $DISK $PART UNICAST"
- restoreImage REPO "$IMGNAME" "$DISK" "$PART"
- RETVAL=$?
- ;;
+ PARAMS="REPO $IMGNAME $DISK $PART" ;;
MULTICAST)
- ogEcho log session "[55] $MSG_HELP_ogRestoreImage : restoreImage REPO $IMGNAME $DISK $PART $PROTO $PROTOOPT"
- restoreImage REPO "$IMGNAME" "$DISK" "$PART" $PROTO $PROTOOPT
- RETVAL=$?
- ;;
+ PARAMS="REPO $IMGNAME $DISK $PART $PROTO $PROTOOPT" ;;
esac
+
+# Si existe, ejecuta script personalizado "restoreImageCustom"; si no, llama al genérico "restoreImage".
+if which restoreImageCustom &>/dev/null; then
+ ogEcho log session "[55] $MSG_HELP_ogRestoreImage: restoreImageCustom $PARAMS"
+ restoreImageCustom $PARAMS
+else
+ ogEcho log session "[55] $MSG_HELP_ogRestoreImage: restoreImage $PARAMS"
+ restoreImage $PARAMS
+fi
+RETVAL=$?
+
+# Mostrar resultados.
RESUMERESTOREIMAGE=$(grep -m 1 "Total Time:" $OGLOGCOMMAND)
ogEcho log session " [ ] $RESUMERESTOREIMAGE "
# Si la transferencia ha dado error me salgo.
@@ -189,6 +193,7 @@ fi
TIME3=$[SECONDS-TIME3]
ogEcho log session " [ ] $MSG_SCRIPTS_TIME_PARTIAL : $[TIME3/60]m $[TIME3%60]s"
+# Si existe, ejecuta script personalizado de postconfiguración "configureOsCustom"; si no, llama al genérico "configureOs".
if which configureOsCustom &>/dev/null; then
ogEcho log session "[90] configureOsCustom"
configureOsCustom "$DISK" "$PART" "$REPO" "$IMGNAME"
diff --git a/client/shared/scripts/initCache b/client/shared/scripts/initCache
index 908ce85b..d5fba1e7 100755
--- a/client/shared/scripts/initCache
+++ b/client/shared/scripts/initCache
@@ -50,7 +50,7 @@ else
PART=${FINDCACHE#* }
# Si la CACHE actual esta definida en otro disco, se elimina
- if [ "$NDISK" != "$CACHEDISK" ]
+ if [ -n "$CACHEDISK" -a "$NDISK" != "$CACHEDISK" ]
then
echo "[10] Detectada cache en otro disco, eliminarla"
ogUnmountCache 2>/dev/null
diff --git a/installer/opengnsys_installer.sh b/installer/opengnsys_installer.sh
index 0ed3ca5f..9819b8df 100755
--- a/installer/opengnsys_installer.sh
+++ b/installer/opengnsys_installer.sh
@@ -189,7 +189,7 @@ case "$OSDISTRIB" in
fedora|centos)
DEPENDENCIES=( subversion httpd mod_ssl php php-ldap mysql-server mysql-devel mysql-devel.i686 php-mysql dhcp tftp-server tftp syslinux xinetd binutils gcc gcc-c++ glibc-devel glibc-devel.i686 glibc-static glibc-static.i686 libstdc++ libstdc++.i686 libstdc++-devel.i686 make wget doxygen graphviz ctorrent samba samba-client rsync unzip debootstrap schroot squashfs-tools python-crypto arp-scan )
INSTALLEXTRADEPS=( 'rpm -Uv ftp://ftp.altlinux.org/pub/distributions/ALTLinux/5.1/branch/files/i586/RPMS/netpipes-4.2-alt1.i586.rpm'
- 'pushd /tmp; wget http://download.bittornado.com/download/BitTornado-0.3.18.tar.gz; tar xvzf BitTornado-0.3.18.tar.gz; cd BitTornado-CVS; python setup.py install; ln -fs btlaunchmany.py /usr/bin/btlaunchmany; ln -fs bttrack.py /usr/bin/bttrack; popd' )
+ 'pushd /tmp; wget -t3 http://download.bittornado.com/download/BitTornado-0.3.18.tar.gz && tar xvzf BitTornado-0.3.18.tar.gz && cd BitTornado-CVS && python setup.py install && ln -fs btlaunchmany.py /usr/bin/btlaunchmany && ln -fs bttrack.py /usr/bin/bttrack; popd' )
if [ "$OSDISTRIB" == "centos" ]; then
UPDATEPKGLIST='test rpm -q --quiet epel-release || echo -e "[epel]\nname=EPEL temporal\nmirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-\$releasever&arch=\$basearch\nenabled=1\ngpgcheck=0" >/etc/yum.repos.d/epel.repo'
fi
@@ -867,7 +867,7 @@ function tftpConfigure()
perl -pi -e 's/disable.*/disable = no/' $INETDCFGDIR/$TFTPSERV
else
service=$TFTPSERV
- $ENABLESERVICE
+ $ENABLESERVICE; $STARTSERVICE
fi
fi
service=$INETDSERV
@@ -1393,6 +1393,11 @@ function openGnsysConfigure()
echoAndLog "${FUNCNAME}(): Copying init files."
cp -a $WORKDIR/opengnsys/admin/Sources/Services/opengnsys.init /etc/init.d/opengnsys
cp -a $WORKDIR/opengnsys/admin/Sources/Services/opengnsys.default /etc/default/opengnsys
+ # Deshabilitar servicios de BitTorrent si no están instalados.
+ if [ ! -e /usr/bin/bttrack ]; then
+ sed -ie 's/RUN_BTTRACKER="yes"/RUN_BTTRACKER="no"/; s/RUN_BTSEEDER="yes"/RUN_BTSEEDER="no"/' \
+ /etc/default/opengnsys
+ fi
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
@@ -1485,6 +1490,9 @@ function installationSummary()
echoAndLog "Samba configuration directory: $SAMBACFGDIR"
echoAndLog "Web Console URL: $OPENGNSYS_CONSOLEURL"
echoAndLog "Web Console access data: specified in installer script"
+ if grep -q "^RUN_BTTRACK.*no" /etc/default/opengnsys; then
+ echoAndLog "BitTorrent service is disabled."
+ fi
echo
echoAndLog "Post-Installation Instructions:"
echo "==============================="
diff --git a/server/bin/compareDhcpOpengnsys b/server/bin/comparedhcpopengnsys
index bc6447d1..53a9684c 100755
--- a/server/bin/compareDhcpOpengnsys
+++ b/server/bin/comparedhcpopengnsys
@@ -2,8 +2,8 @@
# Descripcion: scrit compara la configuración de los equipos en el dhcp y la base de datos de opengnsys
# utiliza dos archivos temporales, uno de cada servicio, con el formato nombre;mac;ip.
# El formato depende de que el fichero dhcpd.conf este en el orden "correcto"
-# Uso: compareDhcpOpengnsys (fichero DHCP por defecto: /etc/dhcp/dhcpd.conf)
-# DHCPFILE=/camino/fichero/dhcpd.conf compareDhcpOpengnsys
+# Uso: comparedhcpopengnsys (fichero DHCP por defecto: /etc/dhcp/dhcpd.conf)
+# DHCPFILE=/camino/fichero/dhcpd.conf comparedhcpopengnsys
# Autora: Irina Gómez, Univ. Sevilla.
# Fecha: 2012-02-08
@@ -52,7 +52,7 @@ mysql --defaults-extra-file=$TMP_MYCNF -D "$CATALOG" -N -e \
# Comparo los ficheros
echo "Comparamos las configuraciones: < dhcp y > mysql"
diff -bi $TMP_DHCP $TMP_MYSQL
-[ $? == 0 ] && echo "El ficheros del servicio dhcp y la base de datos de ogAdmBD tienen la misma configuracion"
+[ $? == 0 ] && echo "El fichero del servicio dhcp y la base de datos de ogAdmBD tienen la misma configuracion"
rm -f $TMP_DHCP $TMP_MYSQL $TMP_MYCNF
diff --git a/server/etc/smb-og.conf.tmpl b/server/etc/smb-og.conf.tmpl
index 76022639..3ce6baad 100644
--- a/server/etc/smb-og.conf.tmpl
+++ b/server/etc/smb-og.conf.tmpl
@@ -1,5 +1,5 @@
[tftpboot]
- comment = el directorio fisico ogclient debe estar como escritura
+ comment = OpenGnSys init files
browseable = no
writeable = no
path = OPENGNSYSDIR/tftpboot