setting up xen console on a debian system
cat > serial-getty-hvc0.service <<EOF
[Unit]
Description=diy serial getty for xen
Documentation=man:agetty(8)
After=systemd-user-sessions.service plymouth-quit-wait.service
After=rc-local.service getty-pre.target
Before=getty.target
ConditionPathExists=/dev/hvc0
[Service]
ExecStart=-/sbin/agetty -L 38400 hvc0 vt102
Type=idle
Restart=always
UtmpIdentifier=cons
StandardInput=tty
StandardOutput=tty
TTYPath=/dev/hvc0
TTYReset=yes
TTYVHangup=yes
IgnoreSIGPIPE=no
SendSIGHUP=yes
[Install]
WantedBy=getty.target
EOF
systemctl daemon-reload
systemctl enable serial-getty-hvc0
ls -lF /etc/systemd/system/getty.target.wants/