configure host serial console
[sysadmin-cookbook] / recepies / ganeti / migrate-lxc / H-host-console.sh
diff --git a/recepies/ganeti/migrate-lxc/H-host-console.sh b/recepies/ganeti/migrate-lxc/H-host-console.sh
new file mode 100755 (executable)
index 0000000..7845402
--- /dev/null
@@ -0,0 +1,24 @@
+#!/bin/sh -xe
+
+. ./0-host.sh
+. ./0-ganeti.sh
+
+ssh_host ps ax | grep getty | tee $host/getty
+ssh_host cat /proc/cmdline  | tee $host/cmdline
+
+cat $host/getty | grep ttyS0   > $host/serial_console
+cat $host/getty | grep console > $host/console
+
+tail $host/*console
+
+#pid=`awk '{ print $1 }' $host/console`
+#ssh_host kill $pid
+
+ssh_host cat /etc/inittab > $host/inittab
+grep -v ^# $host/inittab | grep console || (
+       echo "1:2345:respawn:/sbin/getty 38400 console" | tee -a $host/inittab
+       rsync $host/inittab root@$host:/etc/
+       ssh_host bak diff /etc/inittab
+       ssh_host init q
+       ssh_host tail -1 /var/log/daemon.log
+)