configure host serial console
authorDobrica Pavlinusic <dpavlin@rot13.org>
Sun, 12 Jan 2014 16:07:07 +0000 (16:07 +0000)
committerDobrica Pavlinusic <dpavlin@rot13.org>
Sun, 12 Jan 2014 16:07:07 +0000 (16:07 +0000)
git-svn-id: svn://svn.rot13.org/sysadmin-cookbook@309 191e9f34-6774-4a6d-acfc-7664dacd4a2a

recepies/ganeti/migrate-lxc/H-host-console.sh [new file with mode: 0755]

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
+)