[systemd-devel] Help getting serial console working again after upgrade to systemd?

Dmt Ops opsdmt at gmail.com
Wed Jul 10 11:26:57 PDT 2013


Hey all,

I'm starting upgrades to old production servers to newer 64-bit Linux that
runs systemd >= v195.

Serial consoles are always my 1st step.  Before upgrade it worked great.

After upgrade, with the new systemd-based config, I'm not having much luck
so far.

I configured the grub conf:

serial --unit=0 --speed=57600 --word=8 --parity=no --stop=1
terminal --timeout=3 serial console
title PRODUCTION
 root (hd0,0)
 kernel /vmlinuz root=/dev/sd1a noresume showopts x11failsafe vga=0x31a
console=tty0 console=com1,vga
 initrd /initrd

I installed the getty service on S0:

cat /etc/systemd/system/getty.target.wants/serial-getty at ttyS0.service
    [Unit]
    Description=Serial Getty on %I
    Documentation=systemd-getty-generator
    BindsTo=dev-%i.device
    After=dev-%i.device systemd-user-sessions.service
    Before=getty.target
    IgnoreOnIsolate=yes

    [Service]
    ExecStart=-/sbin/agetty -s %I 57600 vt102
    Type=idle
    Restart=always
    RestartSec=0
    UtmpIdentifier=%I
    TTYPath=/dev/%I
    TTYReset=yes
    TTYVHangup=yes
    KillMode=process
    IgnoreSIGPIPE=no
    KillSignal=SIGHUP

    [Install]
    WantedBy=getty.target


After a system boot the service is up:

systemctl status serial-getty at ttyS0.service
serial-getty at ttyS0.service - Serial Getty on ttyS0
          Loaded: loaded (/etc/systemd/system/serial-getty at .service;
enabled)
          Active: active (running) since Wed, 2013-07-10 10:55:13 PDT;
16min ago
            Docs: man:agetty(8)
                  man:systemd-getty-generator(8)
        Main PID: 1043 (agetty)
          CGroup: name=systemd:/system/serial-getty at .service/ttyS0
                  └ 1043 /sbin/agetty -s ttyS0 57600 vt102

Jul 10 10:55:13 rosencrantz.lan systemd[1]: Starting Serial Getty on
ttyS0...
Jul 10 10:55:13 rosencrantz.lan systemd[1]: Started Serial Getty on ttyS0.

ps ax | grep S0
 1043 ttyS0    Ss+    0:00 /sbin/agetty -s ttyS0 57600 vt102

dmesg looks like the serial port is active:

dmesg | egrep -i "S0|serial|console|tty" | egrep -vi "usb"
    [    0.000000] Command line: root=/dev/sd1a noresume showopts
x11failsafe vga=0x31a console=tty0 console=com1,vga
    [    0.000000] Kernel command line: root=/dev/sd1a noresume showopts
x11failsafe vga=0x31a console=tty0 console=com1,vga
    [    0.000000] console [tty0] enabled
    [    0.218685] ACPI: (supports S0 S1 S3 S4 S5)
    [    1.228895] Console: switching to colour frame buffer device 160x64
    [    1.318499] Serial: 8250/16550 driver, 32 ports, IRQ sharing disabled
    [    1.339563] 00:07: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A
    [   21.032996] systemd[1]: Expecting device dev-ttyS0.device...
    [   21.739832] systemd[1]: Starting Dispatch Password Requests to
Console Directory Watch.
    [   21.775883] systemd[1]: Started Dispatch Password Requests to
Console Directory Watch.
    [   24.305690] systemd[1]: Starting Setup Virtual Console...
    [   25.384797] systemd[1]: Started Setup Virtual Console.
    [   26.942274] systemd[1]: Found device /dev/ttyS0.
    [   32.493821] Console: switching to colour dummy device 80x25
    [   32.691960] Console: switching to colour frame buffer device 240x67
    [   41.849014] systemd[1]: Starting Console System Startup Logging...
    [   42.550658] systemd[1]: Started Console System Startup Logging.

With that setup I get nothing out the serial port.  I probably have the
grub cmd line wrong for using with systemd.  I could use some help getting
this untangled.

Dave
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/systemd-devel/attachments/20130710/6423f443/attachment.html>


More information about the systemd-devel mailing list