OpenHPC:fixes
Jump to navigation
Jump to search
Preshell/Postshell fix
- Identify the bootstrap that the relevant node is using, from the node's MAC address (for example fa:16:3e:cc:30:e3):
[root@ohpc-head ~]# ls /var/lib/tftpboot/warewulf/pxelinux.cfg/
01-fa-16-3e-34-14-bd 01-fa-16-3e-8f-2c-f2 01-fa-16-3e-fc-44-6d
01-fa-16-3e-3c-75-21 01-fa-16-3e-cc-30-e3
[root@ohpc-head ~]# cat /var/lib/tftpboot/warewulf/pxelinux.cfg/01-fa-16-3e-cc-30-e3
# Configuration for Warewulf node: caas01
# Warewulf data store ID: 18
DEFAULT bootstrap
LABEL bootlocal
LOCALBOOT 0
LABEL bootstrap
SAY Now booting caas01 with Warewulf bootstrap (3.10.0-327.22.2.el7.x86_64)
KERNEL bootstrap/11/kernel
APPEND ro initrd=bootstrap/11/initfs.gz wwhostname=caas01 quiet wwmaster=10.16.0.150 wwipaddr=10.16.0.151 wwnetmask=255.255.255.0 wwnetdev=eth0 wwgateway=10.16.0.150In the KERNEL and APPEND values we can see that it's using bootstrap 11
- We now need to unzip and uncompress the initfs image of this bootstrap to a temp directory:
[root@ohpc-head ~]# mkdir /tmp/initfs-dir
[root@ohpc-head ~]# ls /var/lib/tftpboot/warewulf/bootstrap/11/
cookie initfs.gz kernel
[root@ohpc-head ~]# cp /var/lib/tftpboot/warewulf/bootstrap/11/initfs.gz /tmp/initfs-dir/
[root@ohpc-head ~]# cd /tmp/initfs-dir/
[root@ohpc-head initfs-dir]# gunzip initfs.gz
[root@ohpc-head initfs-dir]# ls
initfs
[root@ohpc-head initfs-dir]# mkdir uncompressed
[root@ohpc-head initfs-dir]# cd uncompressed/
[root@ohpc-head uncompressed]# cat ../initfs | cpio -i
113303 blocks
[root@ohpc-head uncompressed]# ls
bin dev etc init lib lib64 proc sbin tmp usr var warewulf- Change the relevant lines in /init:
@@ -239,7 +239,7 @@
if [ $WWDEBUG -ge 3 ]; then
echo
echo "Spawning a debug shell. Exit to continue provisioning."
- setsid cttyhack sh + setsid /bin/cttyhack /bin/sh
echo "Continuing provisioning process."
echo
fi
@@ -316,7 +316,7 @@
echo "due to the 'preshell' Warewulf node configuration... So be it!"
echo
wwlogger "PRESHELL defined, waiting for local shell to exit"
- setsid cttyhack sh + setsid /bin/cttyhack /bin/sh
fi wwlogger "Starting the provision handler"
@@ -330,7 +330,7 @@
echo "due to the 'postshell' Warewulf node configuration... So be it!"
echo
wwlogger "POSTSHELL defined, waiting for local shell to exit"
- setsid cttyhack sh + setsid /bin/cttyhack /bin/sh
fi