SDB:systemd

Ga naar: navigatie, zoeken

systemd in openSUSE Factory installeren

Waarschuwing: Het volgende kan er voor zorgen dat uw machine niet meer kan opstarten, alleen voor ervaren Linux systeembeheerders. :)
Dit artikel is nog maar gedeeltelijk vertaald. Als u mee wilt helpen met vertalen lees dan Wiki vertalen naar het Nederlands.

Please uninstall all earlier versions of systemd and systemd-sysvinit with

rpm -e --nodeps systemd systemd-sysvinit

before installing or updating new packages. Some needed logic inside the rpm runs only at the first installation of systemd.

A possible more recent version of systemd might be available from the Base:System repository: systemd. It usually takes a couple of days to move from there to Factory systemd.

Make sure you run a 2.6.36+ kernel with CONFIG_CGROUPS=y. Some kernel flavours, like -desktop, did not enable it. This should be fixed already, or be on the way to Factory.

# Use the Factory repo:
zypper ar http://download.opensuse.org/factory/repo/oss/ Factory
# Install systemd
zypper install systemd

At this point systemd is installed in parallel with systemvinit. To actually use systemd as your init reboot your machine and append the following to your kernel command line arguments at the grub menu:

init=/bin/systemd

On the running system check the output of:

 kay@yio:~> systemctl 
 UNIT                                          LOAD   ACTIVE       SUB          JOB             DESCRIPTION
 dev-hugepages.automount                       loaded active       running                      Huge Pages File System Automount Point
 dev-mqueue.automount                          loaded active       running                      POSIX Message Queue File System Automount Point
 proc-sys-fs-binfmt_misc.automount             loaded active       waiting                      Arbitrary Executable File Formats File System Automount Point
 sys-kernel-debug.automount                    loaded active       running                      Debug File System Automount Point
 sys-kernel-security.automount                 loaded active       running                      Security File System Automount Point
 sys-devices-pc...0000:00:19.0-net-eth0.device loaded active       plugged                      82567LM Gigabit Network Connection
 sys-devices-pc...000:03:00.0-net-wlan0.device loaded active       plugged                      Ultimate N WiFi Link 5300
 sys-devices-pc...0:0-6:0:0:0-block-sdb.device loaded active       plugged                      Flash_HS-CF
 sys-devices-pc...0:0-6:0:0:1-block-sdc.device loaded active       plugged                      Flash_HS-COMBO
 sys-devices-pc...:0:0:0-block-sda-sda1.device loaded active       plugged                      SAMSUNG_MMCQE28G8MUP-0VA
 sys-devices-pc...:0:0:0-block-sda-sda2.device loaded active       plugged                      SAMSUNG_MMCQE28G8MUP-0VA
 sys-devices-pc...:0:0:0-block-sda-sda3.device loaded active       plugged                      SAMSUNG_MMCQE28G8MUP-0VA
 sys-devices-pc...:0:0:0-block-sda-sda4.device loaded active       plugged                      SAMSUNG_MMCQE28G8MUP-0VA
 sys-devices-pc...0:0-0:0:0:0-block-sda.device loaded active       plugged                      SAMSUNG_MMCQE28G8MUP-0VA
 sys-devices-pl...-serial8250-tty-ttyS0.device loaded active       plugged                      /sys/devices/platform/serial8250/tty/ttyS0
 sys-devices-pl...-serial8250-tty-ttyS1.device loaded active       plugged                      /sys/devices/platform/serial8250/tty/ttyS1
 sys-devices-pl...-serial8250-tty-ttyS2.device loaded active       plugged                      /sys/devices/platform/serial8250/tty/ttyS2
 sys-devices-pl...-serial8250-tty-ttyS3.device loaded active       plugged                      /sys/devices/platform/serial8250/tty/ttyS3
 sys-devices-virtual-net-tun0.device           loaded active       plugged                      /sys/devices/virtual/net/tun0
 sys-devices-virtual-tty-tty0.device           loaded active       plugged                      /sys/devices/virtual/tty/tty0
 sys-devices-virtual-tty-tty1.device           loaded active       plugged                      /sys/devices/virtual/tty/tty1
 sys-devices-virtual-tty-tty10.device          loaded active       plugged                      /sys/devices/virtual/tty/tty10
 sys-devices-virtual-tty-tty11.device          loaded active       plugged                      /sys/devices/virtual/tty/tty11
 sys-devices-virtual-tty-tty12.device          loaded active       plugged                      /sys/devices/virtual/tty/tty12
 sys-devices-virtual-tty-tty2.device           loaded active       plugged                      /sys/devices/virtual/tty/tty2
 sys-devices-virtual-tty-tty3.device           loaded active       plugged                      /sys/devices/virtual/tty/tty3
 sys-devices-virtual-tty-tty4.device           loaded active       plugged                      /sys/devices/virtual/tty/tty4
 sys-devices-virtual-tty-tty5.device           loaded active       plugged                      /sys/devices/virtual/tty/tty5
 sys-devices-virtual-tty-tty6.device           loaded active       plugged                      /sys/devices/virtual/tty/tty6
 sys-devices-virtual-tty-tty7.device           loaded active       plugged                      /sys/devices/virtual/tty/tty7
 sys-devices-virtual-tty-tty8.device           loaded active       plugged                      /sys/devices/virtual/tty/tty8
 sys-devices-virtual-tty-tty9.device           loaded active       plugged                      /sys/devices/virtual/tty/tty9
 -.mount                                       loaded active       mounted                      /
 home-kay-.gvfs.mount                          loaded active       mounted                      /home/kay/.gvfs
 home-kay-work.mount                           loaded active       mounted                      /home/kay/work
 sys-kernel-security.mount                     loaded active       mounted                      Security File System
 tmp.mount                                     loaded active       mounted                      Temporary Directory
 var-lock.mount                                loaded active       mounted                      Lock Directory
 var-run.mount                                 loaded active       mounted                      Runtime Directory
 bluez-coldplug.service                        loaded active       exited                       LSB: 
 cups.service                                  loaded active       running                      LSB: CUPS printer daemon
 dbus.service                                  loaded active       running                      D-Bus System Message Bus
 getty@tty1.service                            loaded active       running                      Getty on tty1
 getty@tty2.service                            loaded active       running                      Getty on tty2
 getty@tty3.service                            loaded active       running                      Getty on tty3
 getty@tty4.service                            loaded active       running                      Getty on tty4
 getty@tty5.service                            loaded active       running                      Getty on tty5
 getty@tty6.service                            loaded active       running                      Getty on tty6
 localfs.service                               loaded active       exited                       LSB: check and mount local filesystems except /
 network.service                               loaded active       running                      LSB: Configure the localfs depending network interfaces
 rootfsck.service                              loaded active       exited                       LSB: check and mount root filesystem
 sysctl.service                                loaded active       exited                       Apply Kernel Variables
 syslog.service                                loaded active       running                      LSB: Start the system logging daemons
 udev-settle.service                           loaded active       exited                       udev Wait for Complete Device Initialization
 udev.service                                  loaded active       running                      udev Kernel Device Manager
 var-lock.service                              loaded active       exited                       Lock Directory
 var-run.service                               loaded active       exited                       Runtime Directory
 xdm.service                                   loaded active       running                      LSB: X Display Manager
 dbus.socket                                   loaded active       running                      D-Bus System Message Bus Socket
 systemd-initctl.socket                        loaded active       listening                    systemd /dev/initctl Compatibility Socket
 systemd-logger.socket                         loaded active       listening                    systemd Logging Socket
 systemd-shutdownd.socket                      loaded active       listening                    systemd Delayed Shutdown Socket
 basic.target                                  loaded active       active                       Basic System
 getty.target                                  loaded active       active                       Login Prompts
 graphical.target                              loaded active       active                       Graphical Interface
 local-fs.target                               loaded active       active                       Local File Systems
 multi-user.target                             loaded active       active                       Multi-User
 network.target                                loaded active       active                       Network
 remote-fs.target                              loaded active       active                       Remote File Systems
 sockets.target                                loaded active       active                       Sockets
 swap.target                                   loaded active       active                       Swap
 sysinit.target                                loaded active       active                       System Initialization
 
 LOAD   = Reflects whether the unit definition was properly loaded.
 ACTIVE = The high-level unit activation state, i.e. generalization of SUB.
 SUB    = The low-level unit activation state, values depend on unit type.
 JOB    = Pending job for the unit.
 
 178 units listed. Pass --all to see inactive units, too.

for a starting point to understand what's going on. All tools have proper man pages and should provide much of the needed information.

Server admins that manage many user logins might want to check pam_systemd, install the pam module, check the output of systemd-cgls and see how systemd takes track over groups of processes belonging to a service or a logged-in user. The kernel cgroups make it possible to have control over the resources a specific service, a user or a login is able to take:

 kay@yio:~> systemd-cgls 
 ├   2 [kthreadd]
 ├   3 [ksoftirqd/0]
 ├   4 [migration/0]
 ├   5 [migration/1]
 ...
 ├ 718 [usb-storage]
 ├ user
 │ └ kay
 │   └ 1
 │     ├   802 /usr/lib/gdm/gdm-session-worker
 │     ├   878 /usr/bin/gnome-session
 │     ├ 19199 /bin/bash
 │     ├ 19209 systemd-cgls
 │     ├ 30209 /bin/bash
 │     └ 30234 xchat
 └ systemd-1
   ├ 1 /sbin/init
   ├ sys-kernel-security.mount
   ├ syslog.service
   │ └ 767 /sbin/rsyslogd -c 5 -f /etc/rsyslog.conf
   ├ cups.service
   │ └ 706 /usr/sbin/cupsd -C /etc/cups/cupsd.conf
   ├ avahi-daemon.service
   │ └ 682 avahi-daemon: running [yio.local]
   ├ xdm.service
   │ ├ 708 /usr/sbin/gdm
   │ ├ 723 /usr/lib/gdm/gdm-simple-slave --display-id /org/gnome/DisplayManager/Display1
   │ └ 742 /usr/bin/Xorg :0 -br -verbose -auth /var/run/gdm/auth-for-gdm-s7iqVZ/database -nolisten tcp vt7
   ├ dbus.service
   │ ├  583 /bin/dbus-daemon --system --address=systemd: --nofork --systemd-activation
   │ ├  724 /usr/sbin/modem-manager
   │ ├  761 /usr/sbin/wpa_supplicant -c /etc/wpa_supplicant/wpa_supplicant.conf -u -f /var/log/wpa_supplicant.log
   │ ├  804 /usr/sbin/console-kit-daemon --no-daemon
   │ ├  977 /usr/lib/upower/upowerd
   │ ├ 1010 /usr/lib/udisks/udisks-daemon
   │ ├ 1015 udisks-daemon: polling /dev/sdd /dev/sdc
   │ ├ 1089 /usr/lib/rtkit/rtkit-daemon
   │ └ 1093 /usr/lib/polkit-1/polkitd
   ├ cron.service
   │ └ 631 /usr/sbin/crond
   ├ network-remotefs.service
   │ ├ 716 /usr/sbin/NetworkManager
   │ └ 786 /sbin/dhclient -d -sf /usr/lib/NetworkManager/nm-dhcp-client.action -pf /var/run/dhclient-eth0.pid -lf /var/lib/dhcp/dhclient-cd731c1...
   ├ var-lock.mount
   ├ var-run.mount
   └ udev.service
     ├    55 /sbin/udevd
     ├ 19102 /sbin/udevd
     └ 19103 /sbin/udevd


User/admin configuration of systemd takes place in /etc:

 kay@yio:~> tree /etc/systemd/
 /etc/systemd/
 ├── session
 ├── system
 │   ├── default.target -> /lib/systemd/system/runlevel5.target
 │   ├── getty.target.wants
 │   │   ├── getty@tty1.service -> /lib/systemd/system/getty@.service
 │   │   ├── getty@tty2.service -> /lib/systemd/system/getty@.service
 │   │   ├── getty@tty3.service -> /lib/systemd/system/getty@.service
 │   │   ├── getty@tty4.service -> /lib/systemd/system/getty@.service
 │   │   ├── getty@tty5.service -> /lib/systemd/system/getty@.service
 │   │   └── getty@tty6.service -> /lib/systemd/system/getty@.service
 │   ├── local-fs.target.wants
 │   │   └── tmp.service -> /lib/systemd/system/tmp.service
 │   ├── multi-user.target.wants
 │   │   └── remote-fs.target -> /lib/systemd/system/remote-fs.target
 └── system.conf

Static configuration and native systemd service files installed by packages take place in /lib/systemd:

 kay@yio:~> tree /lib/systemd/
 /lib/systemd/
 ├── system
 │   ├── avahi-daemon.service
 │   ├── avahi-daemon.socket
 │   ├── avahi-dnsconfd.service
 │   ├── basic.target
 │   ├── basic.target.wants
 │   │   └── console-kit-log-system-start.service -> ../console-kit-log-system-start.service
 │   ├── bluetooth.target
 │   ├── clock.service -> hwclock-load.service
 │   ├── console-kit-daemon.service
 │   ├── console-kit-log-system-restart.service
 │   ├── console-kit-log-system-start.service
 │   ├── console-kit-log-system-stop.service
 │   ├── ctrl-alt-del.target -> reboot.target
 │   ├── dbus.service
 │   ├── dbus.socket
 │   ├── dbus.target
 │   ├── dbus.target.wants
 │   │   └── dbus.socket -> ../dbus.socket
 │   ├── default.target -> graphical.target
 │   ├── dev-hugepages.automount
 │   ├── dev-hugepages.mount
 │   ├── dev-mqueue.automount
 │   ├── dev-mqueue.mount
 │   ├── emergency.service
 │   ├── emergency.target
 │   ├── fsck.target
 │   ├── getty@.service
 │   ├── getty.target
 │   ├── graphical.target
 │   ├── halt.service
 │   ├── halt.target
 │   ├── halt.target.wants
 │   │   └── console-kit-log-system-stop.service -> ../console-kit-log-system-stop.service
 │   ├── http-daemon.target
 │   ├── hwclock-load.service
 │   ├── hwclock-save.service
 │   ├── local-fs.target
 │   ├── local-fs.target.wants
 │   │   ├── var-lock.service -> ../var-lock.service
 │   │   └── var-run.service -> ../var-run.service
 │   ├── mail-transfer-agent.target
 │   ├── multi-user.target
 │   ├── multi-user.target.wants
 │   │   ├── dbus.service -> ../dbus.service
 │   │   └── getty.target -> ../getty.target
 │   ├── network.target
 │   ├── nss-lookup.target
 │   ├── poweroff.service
 │   ├── poweroff.target
 │   ├── poweroff.target.wants
 │   │   └── console-kit-log-system-stop.service -> ../console-kit-log-system-stop.service
 │   ├── printer.target
 │   ├── proc-sys-fs-binfmt_misc.automount
 │   ├── proc-sys-fs-binfmt_misc.mount
 │   ├── random.service -> systemd-random-seed-load.service
 │   ├── reboot.service
 │   ├── reboot.target
 │   ├── reboot.target.wants
 │   │   └── console-kit-log-system-restart.service -> ../console-kit-log-system-restart.service
 │   ├── remote-fs.target
 │   ├── remount-rootfs.service
 │   ├── rescue.target
 │   ├── rpcbind.target
 │   ├── rtc-set.target
 │   ├── runlevel0.target -> poweroff.target
 │   ├── runlevel1.target -> rescue.target
 │   ├── runlevel1.target.wants
 │   │   └── systemd-update-utmp-runlevel.service -> ../systemd-update-utmp-runlevel.service
 │   ├── runlevel2.target -> multi-user.target
 │   ├── runlevel2.target.wants
 │   │   └── systemd-update-utmp-runlevel.service -> ../systemd-update-utmp-runlevel.service
 │   ├── runlevel3.target -> multi-user.target
 │   ├── runlevel3.target.wants
 │   │   └── systemd-update-utmp-runlevel.service -> ../systemd-update-utmp-runlevel.service
 │   ├── runlevel4.target -> multi-user.target
 │   ├── runlevel4.target.wants
 │   │   └── systemd-update-utmp-runlevel.service -> ../systemd-update-utmp-runlevel.service
 │   ├── runlevel5.target -> graphical.target
 │   ├── runlevel5.target.wants
 │   │   └── systemd-update-utmp-runlevel.service -> ../systemd-update-utmp-runlevel.service
 │   ├── runlevel6.target -> reboot.target
 │   ├── serial-getty@.service
 │   ├── shutdown.target
 │   ├── shutdown.target.wants
 │   │   ├── hwclock-save.service -> ../hwclock-save.service
 │   │   ├── systemd-random-seed-save.service -> ../systemd-random-seed-save.service
 │   │   └── systemd-update-utmp-shutdown.service -> ../systemd-update-utmp-shutdown.service
 │   ├── sigpwr.target
 │   ├── smartcard.target
 │   ├── sockets.target
 │   ├── sockets.target.wants
 │   │   ├── dbus.socket -> ../dbus.socket
 │   │   ├── systemd-initctl.socket -> ../systemd-initctl.socket
 │   │   ├── systemd-logger.socket -> ../systemd-logger.socket
 │   │   └── systemd-shutdownd.socket -> ../systemd-shutdownd.socket
 │   ├── swap.target
 │   ├── sysctl.service
 │   ├── sysinit.target
 │   ├── sysinit.target.wants
 │   │   ├── dev-hugepages.automount -> ../dev-hugepages.automount
 │   │   ├── dev-mqueue.automount -> ../dev-mqueue.automount
 │   │   ├── proc-sys-fs-binfmt_misc.automount -> ../proc-sys-fs-binfmt_misc.automount
 │   │   ├── sysctl.service -> ../sysctl.service
 │   │   ├── sys-kernel-debug.automount -> ../sys-kernel-debug.automount
 │   │   ├── sys-kernel-security.automount -> ../sys-kernel-security.automount
 │   │   ├── systemd-modules-load.service -> ../systemd-modules-load.service
 │   │   ├── systemd-random-seed-load.service -> ../systemd-random-seed-load.service
 │   │   ├── systemd-vconsole-setup.service -> ../systemd-vconsole-setup.service
 │   │   ├── tmpwatch.service -> ../tmpwatch.service
 │   │   ├── tmpwatch.timer -> ../tmpwatch.timer
 │   │   ├── udev-retry.service -> ../udev-retry.service
 │   │   ├── udev.service -> ../udev.service
 │   │   └── udev-settle.service -> ../udev-settle.service
 │   ├── sys-kernel-debug.automount
 │   ├── sys-kernel-debug.mount
 │   ├── sys-kernel-security.automount
 │   ├── sys-kernel-security.mount
 │   ├── syslog.target
 │   ├── systemd-auto-serial-getty.service
 │   ├── systemd-initctl.service
 │   ├── systemd-initctl.socket
 │   ├── systemd-kmsg-syslogd.service
 │   ├── systemd-kmsg-syslogd.socket
 │   ├── systemd-logger.service
 │   ├── systemd-logger.socket
 │   ├── systemd-modules-load.service
 │   ├── systemd-random-seed-load.service
 │   ├── systemd-random-seed-save.service
 │   ├── systemd-remount-api-vfs.service
 │   ├── systemd-shutdownd.service
 │   ├── systemd-shutdownd.socket
 │   ├── systemd-update-utmp-runlevel.service
 │   ├── systemd-update-utmp-shutdown.service
 │   ├── systemd-vconsole-setup.service
 │   ├── tmp.mount
 │   ├── tmp.service
 │   ├── tmpwatch.service
 │   ├── tmpwatch.timer
 │   ├── udev_retry.service -> udev-retry.service
 │   ├── udev-retry.service
 │   ├── udev.service
 │   ├── udev-settle.service
 │   ├── umount.target
 │   ├── var-lock.mount
 │   ├── var-lock.service
 │   ├── var-run.mount
 │   └── var-run.service
 ├── systemd-auto-serial-getty
 ├── systemd-cgroups-agent
 ├── systemd-initctl
 ├── systemd-kmsg-syslogd
 ├── systemd-logger
 ├── systemd-modules-load
 ├── systemd-random-seed
 ├── systemd-remount-api-vfs
 ├── systemd-reply-password
 ├── systemd-shutdownd
 ├── systemd-update-utmp
 └── systemd-vconsole-setup

Systemd mounts afew filesystems natively, and some others are provided as automounts, which are activated on demand when accessed:

 kay@yio:~> cat /proc/self/mountinfo 
 13 1 259:524288 / / rw,noatime - ext4 /dev/root rw,user_xattr,acl,barrier=1,data=ordered
 14 13 0:5 / /dev rw,relatime - devtmpfs devtmpfs rw,size=1965248k,nr_inodes=491312,mode=755
 15 13 0:3 / /proc rw,relatime - proc proc rw
 16 13 0:13 / /sys rw,relatime - sysfs sysfs rw
 17 14 0:14 / /dev/shm rw,relatime - tmpfs tmpfs rw
 18 14 0:10 / /dev/pts rw,relatime - devpts devpts rw,mode=600
 19 13 0:15 / /cgroup rw,nosuid,nodev,noexec,relatime - tmpfs tmpfs rw,mode=755
 20 19 0:16 / /cgroup/systemd rw,nosuid,nodev,noexec,relatime - cgroup cgroup rw,release_agent=/lib/systemd/systemd-cgroups-agent,name=systemd
 21 14 0:17 / /dev/mqueue rw,relatime - autofs systemd-1   rw,fd=15,pgrp=1,timeout=300,minproto=5,maxproto=5,direct
 22 16 0:18 / /sys/kernel/security rw,relatime - autofs systemd-1 rw,fd=16,pgrp=1,timeout=300,minproto=5,maxproto=5,direct
 23 15 0:19 / /proc/sys/fs/binfmt_misc rw,relatime - autofs systemd-1 rw,fd=17,pgrp=1,timeout=300,minproto=5,maxproto=5,direct
 24 16 0:20 / /sys/kernel/debug rw,relatime - autofs systemd-1 rw,fd=18,pgrp=1,timeout=300,minproto=5,maxproto=5,direct
 25 14 0:21 / /dev/hugepages rw,relatime - autofs systemd-1 rw,fd=19,pgrp=1,timeout=300,minproto=5,maxproto=5,direct
 26 25 0:22 / /dev/hugepages rw,relatime - hugetlbfs hugetlbfs rw
 27 21 0:12 / /dev/mqueue rw,relatime - mqueue mqueue rw
 28 13 259:786432 / /home/kay/work rw,noatime - ext3 /dev/sda3 rw,errors=continue,user_xattr,acl,barrier=0,data=writeback
 29 13 0:23 / /var/run rw,relatime - tmpfs tmpfs rw,mode=755
 30 13 0:24 / /var/lock rw,relatime - tmpfs tmpfs rw,mode=775,gid=54
 31 16 0:25 / /sys/fs/fuse/connections rw,relatime - fusectl fusectl rw
 32 13 0:26 / /home/kay/.gvfs rw,nosuid,nodev,relatime - fuse.gvfs-fuse-daemon gvfs-fuse-daemon rw,user_id=2702,group_id=100

A typical bootup adds something like this to the kernel log (dmesg):

 [    2.289347] Freeing unused kernel memory: 2228k freed
 [    2.396738] init[1]: systemd 10 running in system mode. (+PAM +LIBWRAP +AUDIT +SELINUX; suse)
 [    2.490912] init[1]: Set hostname to <yio>.
 [    2.902303] udev[53]: starting version 162
 ...
 [            ] init[1]: Startup finished in 2s 492ms 633us (kernel) + 7s 303ms 506us (userspace) = 9s 796ms 139us.

To permanently switch-over, without any bootloader options, the RPM package systemd-sysvinit can be installed, which conflicts with the currently used sysvinit.

In case things go wrong during the current development cycle, it might be nice to have a copy of sysvinit's /sbin/init as /sbin/init.sysv laying around, to be able to repair a systemd-only system, which might be slightly more convenient than init=/bin/bash.

That's it! If things break try some of the Documentation.

The developers can be found at #systemd at irc.freenode.net.

Common Problems

Services not starting as expected

Even though chkconfig cron shows that cron should be enabled, it seems not to be started after boot. systemctl start cron.service starts it just fine. See Bug #660493.

systemctl enable cron.service helps here.

Loop mounts not working without manually loading the "loop" module

See Bug #661715. With SysV init, the loop module was unconditionally loaded by /etc/init.d/boot.localfs which is not used anymore. If you want to autoload it anyway, do

echo loop > /etc/modules-load.d/loop.conf

Getting debug from systemd

To get debug from systemd, you can either :

  • remove quiet from kernel command line
  • increase systemd verbosity by adding systemd.log_target=kmsg systemd.log_level=debug to kernel command line. You can also add systemd.sysv_console=1 (0: disabled, 1: enabled) to display legacy SysV initscripts output on console.
  • modify /etc/systemd/system.conf (check man systemd.conf) to increase verbosity like this :
LogLevel=debug
LogTarget=syslog-or-kmsg
SysVConsole=yes

serial console isn't working

By default, systemd starts a minimal set of getty to let the system accessible.

When specifying on kernel command line which serial console should be used, only the last one in the list (which define the "active" console), will get a getty started :

  • console=tty0 console=ttyS0 will start a console on both tty0 (ie physical console) and serial console
  • console=ttyS0 console=tty0 will only start a console on tty0

To force starting console on serial port, use :

ln -s /lib/systemd/systemd/serial-getty@.service /etc/systemd/system/getty.target.wants/serial-getty@ttyS0.service