Merge "Implement serial-console for systemd."

This commit is contained in:
Jenkins 2014-01-16 00:03:11 +00:00 committed by Gerrit Code Review
commit e152e27937
2 changed files with 15 additions and 5 deletions

View File

@ -1,5 +1,10 @@
Start getty on ttyS0 or ttyS1 Start getty on ttyS0 and/or ttyS1
With ILO and other remote admin environments, having a serial console can be With ILO and other remote admin environments, having a serial console can be
useful for debugging / troubleshooting. If ttyS1 exists, getty will run on useful for debugging and troubleshooting.
that, otherwise on ttyS0.
For upstart:
If ttyS1 exists, getty will run on that, otherwise on ttyS0.
For systemd:
Try to start getty on both ttyS0 and ttyS1.

View File

@ -3,5 +3,10 @@
home=$(dirname $0) home=$(dirname $0)
set -uex set -uex
install -m 0644 -o root -g root $home/ttySx.conf /etc/init/ttySx.conf DIB_INIT_SYSTEM=$(dib-init-system)
if [ "$DIB_INIT_SYSTEM" == "upstart" ]; then
install -m 0644 -o root -g root $home/ttySx.conf /etc/init/ttySx.conf
elif [ "$DIB_INIT_SYSTEM" == "systemd" ]; then
ln -s /usr/lib/systemd/system/getty@.service /etc/systemd/system/getty.target.wants/getty@ttyS0.service
ln -s /usr/lib/systemd/system/getty@.service /etc/systemd/system/getty.target.wants/getty@ttyS1.service
fi