From b1ef1351553bdc43077d001a759b62b720d11ae2 Mon Sep 17 00:00:00 2001 From: Javier Sánchez Parra Date: Fri, 21 Aug 2020 13:20:44 +0200 Subject: #999 Fix ogClient session command Irina reports that booting an OS from ogLive is not working. This is happening because the bootOS shell script kills ogClient before invoking kexec to start the OS. However, ogClient runs this shell script that initiates the boot process, so it is also stopping the boot process. The ogClient needs to close the connection with ogServer before kexec, otherwise ogServer keeps reporting via REST API that the client is in ogLive state / busy state. Because after kexec everything is gone basically. This patch updates the script to: 1) spawn a process to kill the ogClient in 2 seconds, so the ogClient has time to reply to the ogServer and to close the connection gracefully. 2) spawn a process to invoke kexec in 3 seconds to boot the OS. [1] 2ead1639fd54bcf92d56cf7bf89b8d9cf4d6d24e --- client/engine/Boot.lib | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/client/engine/Boot.lib b/client/engine/Boot.lib index 376472ec..383777d8 100755 --- a/client/engine/Boot.lib +++ b/client/engine/Boot.lib @@ -121,8 +121,8 @@ case "$TYPE" in else # Arranque BIOS: configurar kernel Linux con los parámetros leídos de su GRUB. kexec -l "${MNTDIR}${KERNEL}" --append="$APPEND" --initrd="${MNTDIR}${INITRD}" - pkill ogclient - kexec -e & + nohup bash -c 'sleep 2 && pkill ogclient' >/dev/null 2>&1 & + nohup bash -c 'sleep 3 && kexec -e' >/dev/null 2>&1 & fi ;; Windows) @@ -154,8 +154,8 @@ case "$TYPE" in # Modo de arranque en caliente (con kexec). cp $OGLIB/grub4dos/* $MNTDIR # */ (Comentario Doxygen) kexec -l $MNTDIR/grub.exe --append=--config-file="root (hd$[$1-1],$[$2-1]); chainloader (hd$[$1-1],$[$2-1])/$LOADER; tpm --init" - pkill ogclient - kexec -e & + nohup bash -c 'sleep 2 && pkill ogclient' >/dev/null 2>&1 & + nohup bash -c 'sleep 3 && kexec -e' >/dev/null 2>&1 & else # Modo de arranque por reinicio (con reboot). dd if=/dev/zero of=${MNTDIR}/ogboot.me bs=1024 count=3 -- cgit v1.2.3-18-g5258