]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
5 years agosystemctl: do not show preset state for "static"/"alias"/"generated"/"transient"... 15692/head
Zbigniew Jędrzejewski-Szmek [Mon, 4 May 2020 18:01:52 +0000 (20:01 +0200)] 
systemctl: do not show preset state for "static"/"alias"/"generated"/"transient" units

This modifies list-unit-files and status.

The output of list-unit-files would contain various lines with "static
disabled", which is just misleading, because systemctl preset will not touch
those files, so the preset configuration is not relevant. Similarly, for
"generated" and "transient" units, preset state is irrelevant. For "alias"
lines, the preset for the alias target would be used. In all cases let's just
skip preset status in those cases.

Diff for a a Fedora rawhide container:

--- $ systemctl --root=/tmp/root2 list-unit-files
+++ $ build/systemctl --root=/tmp/root2 list-unit-files
@@ -1,125 +1,125 @@
 UNIT FILE                                  STATE    VENDOR PRESET
-proc-sys-fs-binfmt_misc.automount          static   disabled
-dev-hugepages.mount                        static   disabled
-dev-mqueue.mount                           static   disabled
-proc-fs-nfsd.mount                         static   disabled
+proc-sys-fs-binfmt_misc.automount          static
+dev-hugepages.mount                        static
+dev-mqueue.mount                           static
+proc-fs-nfsd.mount                         static
 proc-sys-fs-binfmt_misc.mount              disabled disabled
-sys-fs-fuse-connections.mount              static   disabled
-sys-kernel-config.mount                    static   disabled
-sys-kernel-debug.mount                     static   disabled
-sys-kernel-tracing.mount                   static   disabled
-tmp.mount                                  static   disabled
-var-lib-nfs-rpc_pipefs.mount               static   disabled
+sys-fs-fuse-connections.mount              static
+sys-kernel-config.mount                    static
+sys-kernel-debug.mount                     static
+sys-kernel-tracing.mount                   static
+tmp.mount                                  static
+var-lib-nfs-rpc_pipefs.mount               static
 ostree-finalize-staged.path                disabled enabled
-systemd-ask-password-console.path          static   disabled
-systemd-ask-password-plymouth.path         static   disabled
-systemd-ask-password-wall.path             static   disabled
+systemd-ask-password-console.path          static
+systemd-ask-password-plymouth.path         static
+systemd-ask-password-wall.path             static
 abrt-journal-core.service                  enabled  enabled
 abrt-oops.service                          enabled  enabled
 abrt-pstoreoops.service                    disabled disabled
 abrt-vmcore.service                        enabled  enabled
 abrt-xorg.service                          enabled  enabled
 abrtd.service                              enabled  enabled
-anaconda-direct.service                    static   disabled
-anaconda-nm-config.service                 static   disabled
-anaconda-noshell.service                   static   disabled
-anaconda-pre.service                       static   disabled
-anaconda-shell@.service                    static   disabled
-anaconda-sshd.service                      static   disabled
-anaconda-tmux@.service                     static   disabled
-anaconda.service                           static   disabled
+anaconda-direct.service                    static
+anaconda-nm-config.service                 static
+anaconda-noshell.service                   static
+anaconda-pre.service                       static
+anaconda-shell@.service                    static
+anaconda-sshd.service                      static
+anaconda-tmux@.service                     static
+anaconda.service                           static
 arp-ethers.service                         disabled disabled
 atd.service                                enabled  enabled
 auditd.service                             enabled  enabled
-auth-rpcgss-module.service                 static   disabled
+auth-rpcgss-module.service                 static
 autofs.service                             disabled disabled
-autovt@.service                            enabled  disabled
-blivet.service                             static   disabled
+autovt@.service                            alias
+blivet.service                             static
 blk-availability.service                   disabled disabled
 bluetooth.service                          enabled  enabled
-btattach-bcm@.service                      static   disabled
+btattach-bcm@.service                      static
 certmonger.service                         disabled disabled
-chrony-dnssrv@.service                     static   disabled
+chrony-dnssrv@.service                     static
 chrony-wait.service                        disabled disabled
 chronyd.service                            enabled  enabled
-clean-mount-point@.service                 static   disabled
-cockpit-motd.service                       static   disabled
-cockpit-wsinstance-http-redirect.service   static   disabled
-cockpit-wsinstance-http.service            static   disabled
-cockpit-wsinstance-https-factory@.service  static   disabled
-cockpit-wsinstance-https@.service          static   disabled
-cockpit.service                            static   disabled
+clean-mount-point@.service                 static
+cockpit-motd.service                       static
+cockpit-wsinstance-http-redirect.service   static
+cockpit-wsinstance-http.service            static
+cockpit-wsinstance-https-factory@.service  static
+cockpit-wsinstance-https@.service          static
+cockpit.service                            static
 console-getty.service                      disabled disabled
-container-getty@.service                   static   disabled
+container-getty@.service                   static
 dbus-broker.service                        enabled  enabled
 dbus-daemon.service                        disabled disabled
-dbus-org.bluez.service                     enabled  disabled
-dbus-org.fedoraproject.FirewallD1.service  enabled  disabled
-dbus-org.freedesktop.home1.service         static   disabled
-dbus-org.freedesktop.hostname1.service     static   disabled
-dbus-org.freedesktop.locale1.service       static   disabled
-dbus-org.freedesktop.login1.service        static   disabled
-dbus-org.freedesktop.ModemManager1.service enabled  disabled
-dbus-org.freedesktop.nm-dispatcher.service enabled  disabled
-dbus-org.freedesktop.portable1.service     static   disabled
-dbus-org.freedesktop.timedate1.service     static   disabled
-dbus.service                               enabled  disabled
+dbus-org.bluez.service                     alias
+dbus-org.fedoraproject.FirewallD1.service  alias
+dbus-org.freedesktop.home1.service         alias
+dbus-org.freedesktop.hostname1.service     alias
+dbus-org.freedesktop.locale1.service       alias
+dbus-org.freedesktop.login1.service        alias
+dbus-org.freedesktop.ModemManager1.service alias
+dbus-org.freedesktop.nm-dispatcher.service alias
+dbus-org.freedesktop.portable1.service     alias
+dbus-org.freedesktop.timedate1.service     alias
+dbus.service                               alias
 dbxtool.service                            enabled  enabled
 debug-shell.service                        disabled disabled
-dm-event.service                           static   enabled
+dm-event.service                           static
 dmraid-activation.service                  enabled  enabled
-dnf-makecache.service                      static   disabled
+dnf-makecache.service                      static
 dnsmasq.service                            disabled disabled
-dracut-cmdline.service                     static   disabled
-dracut-initqueue.service                   static   disabled
-dracut-mount.service                       static   disabled
-dracut-pre-mount.service                   static   disabled
-dracut-pre-pivot.service                   static   disabled
-dracut-pre-trigger.service                 static   disabled
-dracut-pre-udev.service                    static   disabled
-dracut-shutdown.service                    static   disabled
+dracut-cmdline.service                     static
+dracut-initqueue.service                   static
+dracut-mount.service                       static
+dracut-pre-mount.service                   static
+dracut-pre-pivot.service                   static
+dracut-pre-trigger.service                 static
+dracut-pre-udev.service                    static
+dracut-shutdown.service                    static
 ead.service                                disabled disabled
-emergency.service                          static   disabled
+emergency.service                          static
 fancontrol.service                         disabled disabled
 firewalld.service                          enabled  enabled
-fprintd.service                            static   disabled
-fstrim.service                             static   disabled
+fprintd.service                            static
+fstrim.service                             static
 getty@.service                             enabled  enabled
-grub-boot-indeterminate.service            static   disabled
+grub-boot-indeterminate.service            static
 gssproxy.service                           disabled disabled
 import-state.service                       enabled  enabled
 initial-setup-reconfiguration.service      disabled disabled
 initial-setup.service                      enabled  disabled
-initrd-cleanup.service                     static   disabled
-initrd-parse-etc.service                   static   disabled
-initrd-switch-root.service                 static   disabled
-initrd-udevadm-cleanup-db.service          static   disabled
-instperf.service                           static   disabled
+initrd-cleanup.service                     static
+initrd-parse-etc.service                   static
+initrd-switch-root.service                 static
+initrd-udevadm-cleanup-db.service          static
+instperf.service                           static
 io.podman.service                          disabled disabled
 irqbalance.service                         enabled  enabled
-iscsi-shutdown.service                     static   disabled
+iscsi-shutdown.service                     static
 iscsi.service                              enabled  disabled
 iscsid.service                             disabled disabled
 iscsiuio.service                           disabled disabled
 iwd.service                                disabled disabled
 kdump.service                              disabled disabled
-kmod-static-nodes.service                  static   disabled
-ldconfig.service                           static   disabled
+kmod-static-nodes.service                  static
+ldconfig.service                           static
 lm_sensors.service                         enabled  enabled
 loadmodules.service                        disabled disabled
-logrotate.service                          static   disabled
-lvm2-lvmpolld.service                      static   enabled
+logrotate.service                          static
+lvm2-lvmpolld.service                      static
 lvm2-monitor.service                       enabled  enabled
-lvm2-pvscan@.service                       static   disabled
-man-db-cache-update.service                static   disabled
+lvm2-pvscan@.service                       static
+man-db-cache-update.service                static
 man-db-restart-cache-update.service        disabled disabled
-mdadm-grow-continue@.service               static   disabled
-mdadm-last-resort@.service                 static   disabled
-mdmon@.service                             static   disabled
+mdadm-grow-continue@.service               static
+mdadm-last-resort@.service                 static
+mdmon@.service                             static
 mdmonitor.service                          enabled  enabled
-mlocate-updatedb.service                   static   disabled
+mlocate-updatedb.service                   static
 ModemManager.service                       enabled  enabled
-modprobe@.service                          static   disabled
+modprobe@.service                          static
 multipathd.service                         enabled  enabled
 ndctl-monitor.service                      disabled disabled
 NetworkManager-dispatcher.service          enabled  enabled
@@ -127,53 +127,53 @@
 NetworkManager.service                     enabled  enabled
 nfs-blkmap.service                         disabled disabled
 nfs-convert.service                        enabled  disabled
-nfs-idmapd.service                         static   disabled
-nfs-mountd.service                         static   disabled
+nfs-idmapd.service                         static
+nfs-mountd.service                         static
 nfs-server.service                         disabled disabled
-nfs-utils.service                          static   disabled
-nfsdcld.service                            static   disabled
+nfs-utils.service                          static
+nfsdcld.service                            static
 nftables.service                           disabled disabled
 nis-domainname.service                     disabled disabled
 oddjobd.service                            disabled disabled
 openhpid.service                           disabled disabled
-ostree-finalize-staged.service             static   disabled
-ostree-prepare-root.service                static   disabled
+ostree-finalize-staged.service             static
+ostree-prepare-root.service                static
 ostree-remount.service                     enabled  enabled
-packagekit-offline-update.service          static   disabled
-packagekit.service                         static   disabled
+packagekit-offline-update.service          static
+packagekit.service                         static
 pcscd.service                              indirect disabled
-plymouth-halt.service                      static   disabled
-plymouth-kexec.service                     static   disabled
-plymouth-poweroff.service                  static   disabled
-plymouth-quit-wait.service                 static   disabled
-plymouth-quit.service                      static   disabled
-plymouth-read-write.service                static   disabled
-plymouth-reboot.service                    static   disabled
-plymouth-start.service                     static   disabled
-plymouth-switch-root.service               static   disabled
+plymouth-halt.service                      static
+plymouth-kexec.service                     static
+plymouth-poweroff.service                  static
+plymouth-quit-wait.service                 static
+plymouth-quit.service                      static
+plymouth-read-write.service                static
+plymouth-reboot.service                    static
+plymouth-start.service                     static
+plymouth-switch-root.service               static
 podman.service                             disabled disabled
-polkit.service                             static   enabled
+polkit.service                             static
 psacct.service                             disabled disabled
 qemu-guest-agent.service                   enabled  enabled
-quotaon.service                            static   disabled
+quotaon.service                            static
 raid-check.service                         disabled disabled
-rc-local.service                           static   disabled
+rc-local.service                           static
 rdisc.service                              disabled disabled
-realmd.service                             static   disabled
-rescue.service                             static   disabled
+realmd.service                             static
+rescue.service                             static
 rngd.service                               enabled  enabled
-rpc-gssd.service                           static   disabled
-rpc-statd-notify.service                   static   disabled
-rpc-statd.service                          static   disabled
+rpc-gssd.service                           static
+rpc-statd-notify.service                   static
+rpc-statd.service                          static
 rpcbind.service                            disabled disabled
 rsyslog.service                            enabled  enabled
 selinux-autorelabel-mark.service           enabled  enabled
-selinux-autorelabel.service                static   disabled
+selinux-autorelabel.service                static
 serial-getty@.service                      disabled disabled
 smartd.service                             enabled  enabled
 sshd-keygen@.service                       disabled disabled
 sshd.service                               enabled  enabled
-sshd@.service                              static   disabled
+sshd@.service                              static
 sssd-autofs.service                        indirect disabled
 sssd-kcm.service                           indirect disabled
 sssd-nss.service                           indirect disabled
@@ -182,84 +182,84 @@
 sssd-ssh.service                           indirect disabled
 sssd-sudo.service                          indirect disabled
 sssd.service                               enabled  enabled
-system-update-cleanup.service              static   disabled
-systemd-ask-password-console.service       static   disabled
-systemd-ask-password-plymouth.service      static   disabled
-systemd-ask-password-wall.service          static   disabled
-systemd-backlight@.service                 static   disabled
-systemd-binfmt.service                     static   disabled
-systemd-bless-boot.service                 static   disabled
+system-update-cleanup.service              static
+systemd-ask-password-console.service       static
+systemd-ask-password-plymouth.service      static
+systemd-ask-password-wall.service          static
+systemd-backlight@.service                 static
+systemd-binfmt.service                     static
+systemd-bless-boot.service                 static
 systemd-boot-check-no-failures.service     disabled disabled
-systemd-boot-system-token.service          static   disabled
-systemd-coredump@.service                  static   disabled
-systemd-exit.service                       static   disabled
-systemd-firstboot.service                  static   disabled
-systemd-fsck-root.service                  static   disabled
-systemd-fsck@.service                      static   disabled
-systemd-halt.service                       static   disabled
-systemd-hibernate-resume@.service          static   disabled
-systemd-hibernate.service                  static   disabled
-systemd-homed.service                      static   disabled
-systemd-hostnamed.service                  static   disabled
-systemd-hwdb-update.service                static   disabled
-systemd-hybrid-sleep.service               static   disabled
-systemd-initctl.service                    static   disabled
-systemd-journal-catalog-update.service     static   disabled
-systemd-journal-flush.service              static   disabled
-systemd-journald.service                   static   disabled
-systemd-journald@.service                  static   disabled
-systemd-kexec.service                      static   disabled
-systemd-localed.service                    static   disabled
-systemd-logind.service                     static   disabled
-systemd-machine-id-commit.service          static   disabled
-systemd-modules-load.service               static   disabled
+systemd-boot-system-token.service          static
+systemd-coredump@.service                  static
+systemd-exit.service                       static
+systemd-firstboot.service                  static
+systemd-fsck-root.service                  static
+systemd-fsck@.service                      static
+systemd-halt.service                       static
+systemd-hibernate-resume@.service          static
+systemd-hibernate.service                  static
+systemd-homed.service                      static
+systemd-hostnamed.service                  static
+systemd-hwdb-update.service                static
+systemd-hybrid-sleep.service               static
+systemd-initctl.service                    static
+systemd-journal-catalog-update.service     static
+systemd-journal-flush.service              static
+systemd-journald.service                   static
+systemd-journald@.service                  static
+systemd-kexec.service                      static
+systemd-localed.service                    static
+systemd-logind.service                     static
+systemd-machine-id-commit.service          static
+systemd-modules-load.service               static
 systemd-network-generator.service          disabled disabled
 systemd-networkd-wait-online.service       disabled disabled
 systemd-networkd.service                   disabled disabled
-systemd-portabled.service                  static   disabled
-systemd-poweroff.service                   static   disabled
+systemd-portabled.service                  static
+systemd-poweroff.service                   static
 systemd-pstore.service                     disabled enabled
-systemd-quotacheck.service                 static   disabled
-systemd-random-seed.service                static   disabled
-systemd-reboot.service                     static   disabled
-systemd-remount-fs.service                 static   disabled
-systemd-repart.service                     static   disabled
+systemd-quotacheck.service                 static
+systemd-random-seed.service                static
+systemd-reboot.service                     static
+systemd-remount-fs.service                 static
+systemd-repart.service                     static
 systemd-resolved.service                   disabled disabled
-systemd-rfkill.service                     static   disabled
-systemd-suspend-then-hibernate.service     static   disabled
-systemd-suspend.service                    static   disabled
-systemd-sysctl.service                     static   disabled
-systemd-sysusers.service                   static   disabled
+systemd-rfkill.service                     static
+systemd-suspend-then-hibernate.service     static
+systemd-suspend.service                    static
+systemd-sysctl.service                     static
+systemd-sysusers.service                   static
 systemd-time-wait-sync.service             disabled disabled
-systemd-timedated.service                  static   disabled
+systemd-timedated.service                  static
 systemd-timesyncd.service                  disabled disabled
-systemd-tmpfiles-clean.service             static   disabled
-systemd-tmpfiles-setup-dev.service         static   disabled
-systemd-tmpfiles-setup.service             static   disabled
-systemd-udev-settle.service                static   disabled
-systemd-udev-trigger.service               static   disabled
-systemd-udevd.service                      static   disabled
-systemd-update-done.service                static   disabled
-systemd-update-utmp-runlevel.service       static   disabled
-systemd-update-utmp.service                static   disabled
-systemd-user-sessions.service              static   disabled
-systemd-userdbd.service                    static   disabled
-systemd-vconsole-setup.service             static   disabled
-systemd-volatile-root.service              static   disabled
-teamd@.service                             static   disabled
+systemd-tmpfiles-clean.service             static
+systemd-tmpfiles-setup-dev.service         static
+systemd-tmpfiles-setup.service             static
+systemd-udev-settle.service                static
+systemd-udev-trigger.service               static
+systemd-udevd.service                      static
+systemd-update-done.service                static
+systemd-update-utmp-runlevel.service       static
+systemd-update-utmp.service                static
+systemd-user-sessions.service              static
+systemd-userdbd.service                    static
+systemd-vconsole-setup.service             static
+systemd-volatile-root.service              static
+teamd@.service                             static
 udisks2.service                            enabled  enabled
-user-runtime-dir@.service                  static   disabled
-user@.service                              static   disabled
+user-runtime-dir@.service                  static
+user@.service                              static
 winbind.service                            disabled disabled
 zram-swap.service                          enabled  disabled
-zram.service                               static   disabled
-system-cockpithttps.slice                  static   disabled
-system-systemd\x2dcryptsetup.slice         static   disabled
-user.slice                                 static   disabled
-cockpit-wsinstance-http-redirect.socket    static   disabled
-cockpit-wsinstance-http.socket             static   disabled
-cockpit-wsinstance-https-factory.socket    static   disabled
-cockpit-wsinstance-https@.socket           static   disabled
+zram.service                               static
+system-cockpithttps.slice                  static
+system-systemd\x2dcryptsetup.slice         static
+user.slice                                 static
+cockpit-wsinstance-http-redirect.socket    static
+cockpit-wsinstance-http.socket             static
+cockpit-wsinstance-https-factory.socket    static
+cockpit-wsinstance-https@.socket           static
 cockpit.socket                             enabled  enabled
 dbus.socket                                enabled  enabled
 dm-event.socket                            enabled  enabled
@@ -280,95 +280,95 @@
 sssd-pam.socket                            disabled disabled
 sssd-ssh.socket                            disabled disabled
 sssd-sudo.socket                           disabled disabled
-syslog.socket                              static   disabled
-systemd-coredump.socket                    static   disabled
-systemd-initctl.socket                     static   disabled
-systemd-journald-audit.socket              static   disabled
-systemd-journald-dev-log.socket            static   disabled
-systemd-journald-varlink@.socket           static   disabled
-systemd-journald.socket                    static   disabled
-systemd-journald@.socket                   static   disabled
+syslog.socket                              static
+systemd-coredump.socket                    static
+systemd-initctl.socket                     static
+systemd-journald-audit.socket              static
+systemd-journald-dev-log.socket            static
+systemd-journald-varlink@.socket           static
+systemd-journald.socket                    static
+systemd-journald@.socket                   static
 systemd-networkd.socket                    disabled disabled
-systemd-rfkill.socket                      static   disabled
-systemd-udevd-control.socket               static   disabled
-systemd-udevd-kernel.socket                static   disabled
-systemd-userdbd.socket                     static   disabled
-anaconda.target                            static   disabled
-basic.target                               static   disabled
-blockdev@.target                           static   disabled
-bluetooth.target                           static   enabled
-boot-complete.target                       static   disabled
-cryptsetup-pre.target                      static   disabled
-cryptsetup.target                          static   disabled
-ctrl-alt-del.target                        enabled  disabled
-default.target                             indirect disabled
-emergency.target                           static   disabled
+systemd-rfkill.socket                      static
+systemd-udevd-control.socket               static
+systemd-udevd-kernel.socket                static
+systemd-userdbd.socket                     static
+anaconda.target                            static
+basic.target                               static
+blockdev@.target                           static
+bluetooth.target                           static
+boot-complete.target                       static
+cryptsetup-pre.target                      static
+cryptsetup.target                          static
+ctrl-alt-del.target                        alias
+default.target                             alias
+emergency.target                           static
 exit.target                                disabled disabled
-final.target                               static   disabled
-getty-pre.target                           static   disabled
-getty.target                               static   disabled
-graphical.target                           static   disabled
+final.target                               static
+getty-pre.target                           static
+getty.target                               static
+graphical.target                           static
 halt.target                                disabled disabled
-hibernate.target                           static   disabled
-hybrid-sleep.target                        static   disabled
-initrd-fs.target                           static   disabled
-initrd-root-device.target                  static   disabled
-initrd-root-fs.target                      static   disabled
-initrd-switch-root.target                  static   disabled
-initrd.target                              static   disabled
+hibernate.target                           static
+hybrid-sleep.target                        static
+initrd-fs.target                           static
+initrd-root-device.target                  static
+initrd-root-fs.target                      static
+initrd-switch-root.target                  static
+initrd.target                              static
 kexec.target                               disabled disabled
-local-fs-pre.target                        static   disabled
-local-fs.target                            static   disabled
+local-fs-pre.target                        static
+local-fs.target                            static
 multi-user.target                          indirect disabled
-network-online.target                      static   disabled
-network-pre.target                         static   disabled
-network.target                             static   disabled
+network-online.target                      static
+network-pre.target                         static
+network.target                             static
 nfs-client.target                          enabled  disabled
-nss-lookup.target                          static   disabled
-nss-user-lookup.target                     static   disabled
-paths.target                               static   disabled
+nss-lookup.target                          static
+nss-user-lookup.target                     static
+paths.target                               static
 poweroff.target                            disabled disabled
-printer.target                             static   disabled
+printer.target                             static
 reboot.target                              enabled  enabled
 remote-cryptsetup.target                   disabled enabled
-remote-fs-pre.target                       static   disabled
+remote-fs-pre.target                       static
 remote-fs.target                           enabled  enabled
-rescue.target                              static   disabled
-rpc_pipefs.target                          static   disabled
-rpcbind.target                             static   disabled
-runlevel0.target                           disabled disabled
-runlevel1.target                           static   disabled
-runlevel2.target                           indirect disabled
-runlevel3.target                           indirect disabled
-runlevel4.target                           indirect disabled
-runlevel5.target                           static   disabled
-runlevel6.target                           enabled  disabled
-selinux-autorelabel.target                 static   disabled
-shutdown.target                            static   disabled
-sigpwr.target                              static   disabled
-sleep.target                               static   disabled
-slices.target                              static   disabled
-smartcard.target                           static   disabled
-sockets.target                             static   disabled
-sound.target                               static   disabled
-sshd-keygen.target                         static   disabled
-suspend-then-hibernate.target              static   disabled
-suspend.target                             static   disabled
-swap.target                                static   disabled
-sysinit.target                             static   disabled
-system-update-pre.target                   static   disabled
-system-update.target                       static   disabled
-time-set.target                            static   disabled
-time-sync.target                           static   disabled
-timers.target                              static   disabled
-umount.target                              static   disabled
+rescue.target                              static
+rpc_pipefs.target                          static
+rpcbind.target                             static
+runlevel0.target                           alias
+runlevel1.target                           alias
+runlevel2.target                           alias
+runlevel3.target                           alias
+runlevel4.target                           alias
+runlevel5.target                           alias
+runlevel6.target                           alias
+selinux-autorelabel.target                 static
+shutdown.target                            static
+sigpwr.target                              static
+sleep.target                               static
+slices.target                              static
+smartcard.target                           static
+sockets.target                             static
+sound.target                               static
+sshd-keygen.target                         static
+suspend-then-hibernate.target              static
+suspend.target                             static
+swap.target                                static
+sysinit.target                             static
+system-update-pre.target                   static
+system-update.target                       static
+time-set.target                            static
+time-sync.target                           static
+timers.target                              static
+umount.target                              static
 chrony-dnssrv@.timer                       disabled disabled
 dnf-makecache.timer                        enabled  enabled
 fstrim.timer                               enabled  enabled
 logrotate.timer                            enabled  enabled
-mdadm-last-resort@.timer                   static   disabled
+mdadm-last-resort@.timer                   static
 mlocate-updatedb.timer                     enabled  enabled
 raid-check.timer                           disabled disabled
-systemd-tmpfiles-clean.timer               static   disabled
+systemd-tmpfiles-clean.timer               static

 371 unit files listed.

In particular, this allows a meaningful comparison to be made:

$ ~/src/systemd/build/systemctl --root=/tmp/root2 list-unit-files|rg 'enabled.*disabled|disabled.*enabled'
ostree-finalize-staged.path                disabled enabled
initial-setup.service                      enabled  disabled
iscsi.service                              enabled  disabled
nfs-convert.service                        enabled  disabled
systemd-pstore.service                     disabled enabled
zram-swap.service                          enabled  disabled
iscsid.socket                              enabled  disabled
iscsiuio.socket                            enabled  disabled
multipathd.socket                          enabled  disabled
nfs-client.target                          enabled  disabled
remote-cryptsetup.target                   disabled enabled

(It turns out that most of the services on this list that are enabled without a
corresponding preset are against rpm packaging and do direct 'systemctl enable'
calls in %post, instead of going through presets as they are supposed to.)

systemctl: also skip preset status in status verb

5 years agosystemctl: add new enablement state "alias"
Zbigniew Jędrzejewski-Szmek [Mon, 4 May 2020 17:53:33 +0000 (19:53 +0200)] 
systemctl: add new enablement state "alias"

For units which are aliases of other units, reporting preset status as
"enabled" is rather misleading. For example, dbus.service is an alias of
dbus-broker.service. In list-unit-files we'd show both as "enabled".  In
particular, systemctl preset ignores aliases, so showing any preset status at
all is always going to be misleading. Let's introduce a new state "alias" and
use that for all aliases.

I was trying to avoid adding a new state, to keep compatibility with previous
behaviour, but for alias unit files it simply doesn't seem very useful to show
any of the existing states. It seems that the clearly showing that those are
aliases for other units will be easiest to understand for users.

5 years agoshared/install: rename variable for clarity
Zbigniew Jędrzejewski-Szmek [Mon, 4 May 2020 17:48:59 +0000 (19:48 +0200)] 
shared/install: rename variable for clarity

5 years agoshared/install: print name of offending file in error
Zbigniew Jędrzejewski-Szmek [Mon, 4 May 2020 17:45:19 +0000 (19:45 +0200)] 
shared/install: print name of offending file in error

"Unit type slice cannot be templated."

"/etc/systemd/system.control/user@.slice: unit type slice cannot be templated."

5 years agoshared/install: indent tables
Zbigniew Jędrzejewski-Szmek [Mon, 4 May 2020 12:25:58 +0000 (14:25 +0200)] 
shared/install: indent tables

5 years agoshared/install: optionally cache the preset list
Zbigniew Jędrzejewski-Szmek [Thu, 30 Apr 2020 20:37:34 +0000 (22:37 +0200)] 
shared/install: optionally cache the preset list

When doing list-unit-files with --root, we would re-read the preset
list for every unit. This uses a cache to only do it once. The time
for list-unit-files goes down by about ~30%.

unit_file_query_preset() is also called from src/core/. This patch does not
touch that path, since the saving there are smaller, since preset status is
only read on demand over dbus, and caching would be more complicated.

5 years agosystemctl: fix --root support in querying presets
Zbigniew Jędrzejewski-Szmek [Thu, 30 Apr 2020 16:45:08 +0000 (18:45 +0200)] 
systemctl: fix --root support in querying presets

We would always look on the host, ignoring --root.

5 years agosystemctl: refuse online-only ops with --root
Zbigniew Jędrzejewski-Szmek [Thu, 30 Apr 2020 12:26:36 +0000 (14:26 +0200)] 
systemctl: refuse online-only ops with --root

It is super confusing when a command does not support --root, and is called
with it specified, and returns some bogus results. Let's just catch this
early and refuse.

5 years agoshared/verbs: split out helper to find verbs
Zbigniew Jędrzejewski-Szmek [Thu, 30 Apr 2020 12:20:31 +0000 (14:20 +0200)] 
shared/verbs: split out helper to find verbs

It will be used later, but I think it makes the code clearer anyway.

Also change the message about ignoring to include the name for default
verbs.

5 years agoshared/verbs: add a modicum of documentation
Zbigniew Jędrzejewski-Szmek [Thu, 30 Apr 2020 11:59:33 +0000 (13:59 +0200)] 
shared/verbs: add a modicum of documentation

5 years agosystemctl: mark log-level,log-target,service-watchdogs as online-only
Zbigniew Jędrzejewski-Szmek [Thu, 30 Apr 2020 11:31:24 +0000 (13:31 +0200)] 
systemctl: mark log-level,log-target,service-watchdogs as online-only

They were added in 6ab863190dee5ab631795ef547fcc7314ddccd40 and
38fcb7f766c84736425e86854b8a4468c126dafa. I don't see a good reason to
exclude them from the online-only check.

5 years agosystemctl: fix hint when 'systemctl help' is given
Zbigniew Jędrzejewski-Szmek [Thu, 30 Apr 2020 10:38:36 +0000 (12:38 +0200)] 
systemctl: fix hint when 'systemctl help' is given

Not all verbs require unit names, but that is beside the point. We need a verb
here, and help is not a valid verb.

5 years agoshared/unit-file: fix resolution of absoulute symlinks with --root
Zbigniew Jędrzejewski-Szmek [Thu, 30 Apr 2020 10:02:44 +0000 (12:02 +0200)] 
shared/unit-file: fix resolution of absoulute symlinks with --root

$ systemctl --no-pager --root /tmp/root2/ cat ctrl-alt-del.target
Failed to resolve symlink /tmp/root2/etc/systemd/system/ctrl-alt-del.target pointing to /usr/lib/systemd/system/reboot.target, ignoring: Channel number out of range
...

5 years agoman: mention that ProtectSystem= also takes care of /efi
Zbigniew Jędrzejewski-Szmek [Wed, 29 Apr 2020 16:22:46 +0000 (18:22 +0200)] 
man: mention that ProtectSystem= also takes care of /efi

5 years agoefi: cache test results of boolean EFI state functions
Lennart Poettering [Tue, 28 Apr 2020 21:33:46 +0000 (23:33 +0200)] 
efi: cache test results of boolean EFI state functions

EFI variable access is nowadays subject to rate limiting by the kernel.
Thus, let's cache the results of checking them, in order to minimize how
often we access them.

Fixes: #14828
5 years agoMerge pull request #15630 from nabijaczleweli/symmetric-buffers
Lennart Poettering [Thu, 30 Apr 2020 06:06:26 +0000 (08:06 +0200)] 
Merge pull request #15630 from nabijaczleweli/symmetric-buffers

link: Allow configuring RX mini and jumbo ring sizes, too

5 years agolink: Allow configuring RX mini and jumbo ring sizes, too 15630/head
nabijaczleweli [Wed, 29 Apr 2020 00:00:25 +0000 (02:00 +0200)] 
link: Allow configuring RX mini and jumbo ring sizes, too

This now covers all ethtool_ringparam configurables (as of v5.6;
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/include/uapi/linux/ethtool.h?h=v5.6#n488)

5 years agolink: Add units and fix typo in (Rx|Tx)BufferSize= manpage. Clean up the implementati...
nabijaczleweli [Wed, 29 Apr 2020 16:38:56 +0000 (18:38 +0200)] 
link: Add units and fix typo in (Rx|Tx)BufferSize= manpage. Clean up the implementation slightly

5 years agodocs: reorder the section about security reporting to emphasize the sekrit list
Zbigniew Jędrzejewski-Szmek [Wed, 29 Apr 2020 06:09:53 +0000 (08:09 +0200)] 
docs: reorder the section about security reporting to emphasize the sekrit list

5 years agoMerge pull request #15626 from poettering/more-specifiers
Frantisek Sumsal [Wed, 29 Apr 2020 08:07:12 +0000 (10:07 +0200)] 
Merge pull request #15626 from poettering/more-specifiers

tmpfiles,sysusers,pid1: add a bunch of more specifiers

5 years agoMerge pull request #15628 from poettering/tmpfiles-fuzz-fix
Lennart Poettering [Wed, 29 Apr 2020 07:41:46 +0000 (09:41 +0200)] 
Merge pull request #15628 from poettering/tmpfiles-fuzz-fix

systemd-tmpfiles fuzz issue fix

5 years agotmpfiles: remove unnecessary assert 15628/head
Lennart Poettering [Tue, 28 Apr 2020 22:13:52 +0000 (00:13 +0200)] 
tmpfiles: remove unnecessary assert

if we parse an xattr line that has no valid assignment, we might end up
with an empty ->xattr list. Don't hit assert on that, just go on.

Fixes: #15610
5 years agotmpfiles: use log_syntax() for all parse errors
Lennart Poettering [Tue, 28 Apr 2020 22:07:06 +0000 (00:07 +0200)] 
tmpfiles: use log_syntax() for all parse errors

5 years agoupdate TODO 15626/head
Lennart Poettering [Tue, 28 Apr 2020 21:16:35 +0000 (23:16 +0200)] 
update TODO

5 years agoman: document new specifiers
Lennart Poettering [Tue, 28 Apr 2020 20:50:50 +0000 (22:50 +0200)] 
man: document new specifiers

5 years agotree-wide: support a bunch of additional specifiers
Lennart Poettering [Tue, 28 Apr 2020 18:03:56 +0000 (20:03 +0200)] 
tree-wide: support a bunch of additional specifiers

5 years agoupdate TODO
Lennart Poettering [Tue, 28 Apr 2020 18:02:39 +0000 (20:02 +0200)] 
update TODO

5 years agomain: bump RLIMIT_MEMLOCK by physical RAM size
Lennart Poettering [Wed, 22 Apr 2020 20:49:02 +0000 (22:49 +0200)] 
main: bump RLIMIT_MEMLOCK by physical RAM size

Let's allow more memory to be locked on beefy machines than on small
ones. The previous limit of 64M is the lower bound still. This
effectively means on a 4GB machine we can lock 512M, which should be
more than enough, but still not lock up the machine entirely under
pressure.

Fixes: #15053
5 years agonspawn: be more careful with creating/chowning directories to overmount
Lennart Poettering [Wed, 22 Apr 2020 14:35:32 +0000 (16:35 +0200)] 
nspawn: be more careful with creating/chowning directories to overmount

We should never re-chown selinuxfs.

Fixes: #15475
5 years agoupdate TODO
Lennart Poettering [Tue, 28 Apr 2020 17:38:38 +0000 (19:38 +0200)] 
update TODO

5 years agosd-bus: Add sd_bus_query_sender_creds/privilege docs
Daan De Meyer [Tue, 28 Apr 2020 17:29:46 +0000 (19:29 +0200)] 
sd-bus: Add sd_bus_query_sender_creds/privilege docs

5 years agoMerge pull request #15618 from keszybz/help-output
Zbigniew Jędrzejewski-Szmek [Tue, 28 Apr 2020 17:31:16 +0000 (19:31 +0200)] 
Merge pull request #15618 from keszybz/help-output

Small adjustments to --help output

5 years agosd-bus: Add sd_bus_get_creds_mask docs
Daan De Meyer [Thu, 23 Apr 2020 19:31:45 +0000 (21:31 +0200)] 
sd-bus: Add sd_bus_get_creds_mask docs

5 years agoRevert "detect-virt: also detect "microsoft" as WSL"
Luca Boccassi [Mon, 27 Apr 2020 11:04:35 +0000 (12:04 +0100)] 
Revert "detect-virt: also detect "microsoft" as WSL"

WSL2 will soon (TM) include the "WSL2" string in /proc/sys/kernel/osrelease
so the workaround will no longer be necessary.
We have several different cloud images which do include the "microsoft"
string already, which would break this detection. They are for internal
usage at the moment, but the userspace side can come from all over the
place so it would be quite hard to track and downstream-patch to avoid
breakages.

This reverts commit a2f838d59075a49b012f9b7056664f7ffeed44d2.

5 years agohomectl: say "home area" in more places 15618/head
Zbigniew Jędrzejewski-Szmek [Tue, 28 Apr 2020 07:09:26 +0000 (09:09 +0200)] 
homectl: say "home area" in more places

Follow-up for b5947b5b100f694c93857a82018fb0656d08be34.

5 years agomeson: test userdbctl and homectl --help
Zbigniew Jędrzejewski-Szmek [Tue, 28 Apr 2020 07:08:37 +0000 (09:08 +0200)] 
meson: test userdbctl and homectl --help

5 years agouserdbctl: make --help fit in 80 columns
Zbigniew Jędrzejewski-Szmek [Tue, 28 Apr 2020 07:13:47 +0000 (09:13 +0200)] 
userdbctl: make --help fit in 80 columns

5 years agomeson: modernize indentation
Zbigniew Jędrzejewski-Szmek [Tue, 28 Apr 2020 07:08:04 +0000 (09:08 +0200)] 
meson: modernize indentation

By using a newline after executable( and run_target(, we get less
indentation and the indentation level does not change when the returned
object is saved to a variable.

5 years agoefivars: retry open and read operations
Zbigniew Jędrzejewski-Szmek [Fri, 24 Apr 2020 08:53:46 +0000 (10:53 +0200)] 
efivars: retry open and read operations

On my laptop (Lenovo X1carbo 4th) I very occasionally see test-boot-timestamps
fail with this tb:

262/494 test-boot-timestamps                    FAIL    0.7348453998565674 s (killed by signal 6 SIGABRT)

08:12:48 SYSTEMD_LANGUAGE_FALLBACK_MAP='/home/zbyszek/src/systemd/src/locale/language-fallback-map' SYSTEMD_KBD_MODEL_MAP='/home/zbyszek/src/systemd/src/locale/kbd-model-map' PATH='/home/zbyszek/src/systemd/build:/home/zbyszek/.local/bin:/usr/lib64/qt-3.3/bin:/usr/share/Modules/bin:/usr/condabin:/usr/lib64/ccache:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/home/zbyszek/bin:/var/lib/snapd/snap/bin' /home/zbyszek/src/systemd/build/test-boot-timestamps
--- stderr ---
Failed to read $container of PID 1, ignoring: Permission denied
Found container virtualization none.
Failed to get SystemdOptions EFI variable, ignoring: Interrupted system call
Failed to read ACPI FPDT: Permission denied
Failed to read LoaderTimeInitUSec: Interrupted system call
Failed to read EFI loader data: Interrupted system call
Assertion 'q >= 0' failed at src/test/test-boot-timestamps.c:84, function main(). Aborting.

Normally it takes ~0.02s, but here there's a slowdown to 0.73 and things fail with EINTR.
This happens only occasionally, and I haven't been able to capture a strace.

It would be to ignore that case in test-boot-timestamps or always translate
EINTR to -ENODATA. Nevertheless, I think it's better to retry, since this gives
as more resilient behaviour and avoids a transient failure.

See
https://github.com/torvalds/linux/blob/master/fs/efivarfs/file.c#L75
and
https://github.com/torvalds/linux/commit/bef3efbeb897b56867e271cdbc5f8adaacaeb9cd.

5 years agoshell-completion/zsh: update systemd-analyze completions
Ronan Pigott [Mon, 27 Apr 2020 06:16:55 +0000 (23:16 -0700)] 
shell-completion/zsh: update systemd-analyze completions

5 years agozsh: fix disable/enable completion
Haochen Tong [Sun, 26 Apr 2020 22:30:49 +0000 (00:30 +0200)] 
zsh: fix disable/enable completion

The "preset" column introduced in
b01c1f305c044a381ad110709a62507d74bf6d86 breaks zsh completion for
systemctl disable/enable. Fix by ignoring everything after the last
space in a line.

5 years agotests: various small fixes for strict systems
Topi Miettinen [Thu, 23 Apr 2020 10:12:23 +0000 (13:12 +0300)] 
tests: various small fixes for strict systems

Don't assume that 4MB can be allocated from stack since there could be smaller
DefaultLimitSTACK= in force, so let's use malloc(). NUL terminate the huge
strings by hand, also ensure termination in test_lz4_decompress_partial() and
optimize the memset() for the string.

Some items in /proc and /etc may not be accessible to poor unprivileged users
due to e.g. SELinux, BOFH or both, so check for EACCES and EPERM.

/var/tmp may be a symlink to /tmp and then path_compare() will always fail, so
let's stick to /tmp like elsewhere.

/tmp may be mounted with noexec option and then trying to execute scripts from
there would fail.

Detect and warn if seccomp is already in use, which could make seccomp test
fail if the syscalls are already blocked.

Unset $TMPDIR so it will not break specifier tests where %T is assumed to be
/tmp and %V /var/tmp.

5 years agosd-bus: Cite sd_bus_creds_unref in sd_bus_get_name_creds docs
Daan De Meyer [Fri, 24 Apr 2020 16:45:15 +0000 (18:45 +0200)] 
sd-bus: Cite sd_bus_creds_unref in sd_bus_get_name_creds docs

5 years agotest-cgroup: skip if /sys/fs/cgroup unknown fs
Dan Streetman [Sat, 21 Mar 2020 14:59:42 +0000 (10:59 -0400)] 
test-cgroup: skip if /sys/fs/cgroup unknown fs

It's not always mounted, e.g. during the build-time tests, it's running inside
a chroot (that's how Debian/Ubuntu build packages, in chroots) so this test
always fails because /sys/fs/cgroup isn't mounted.

5 years agocgroup-util: check for SYSFS_MAGIC when detecting cgroup format
Dan Streetman [Sat, 21 Mar 2020 15:19:44 +0000 (11:19 -0400)] 
cgroup-util: check for SYSFS_MAGIC when detecting cgroup format

When nothing at all is mounted at /sys/fs/cgroup, the fs.f_type is
SYSFS_MAGIC (0x62656572) which results in the confusing debug log:

"Unknown filesystem type 62656572 mounted on /sys/fs/cgroup."

Instead, if the f_type is SYSFS_MAGIC, a more accurate message is:

"No filesystem is currently mounted on /sys/fs/cgroup."

5 years agoImprove help for clang-format
Norbert Lange [Fri, 24 Apr 2020 23:40:37 +0000 (01:40 +0200)] 
Improve help for clang-format

The comments lack the most important usecase: fixing up your commits.

5 years agoci: introduce CIFuzz
Frantisek Sumsal [Fri, 24 Apr 2020 10:00:44 +0000 (12:00 +0200)] 
ci: introduce CIFuzz

Per-PR fuzzing provided by OSS-Fuzz using GH workflows.

See: https://google.github.io/oss-fuzz/getting-started/continuous-integration/

5 years agodhcp6: make string argument to sd_dhcp6_client_set_request_mud_url() const
Thomas Haller [Fri, 24 Apr 2020 07:15:59 +0000 (09:15 +0200)] 
dhcp6: make string argument to sd_dhcp6_client_set_request_mud_url() const

5 years agoMerge pull request #15579 from DaanDeMeyer/sd-bus-get-name/owner-creds-docs
Zbigniew Jędrzejewski-Szmek [Fri, 24 Apr 2020 06:29:41 +0000 (08:29 +0200)] 
Merge pull request #15579 from DaanDeMeyer/sd-bus-get-name/owner-creds-docs

5 years agoMerge pull request #15564 from poettering/tmpfiles-no-proc
Zbigniew Jędrzejewski-Szmek [Fri, 24 Apr 2020 06:16:22 +0000 (08:16 +0200)] 
Merge pull request #15564 from poettering/tmpfiles-no-proc

util-lib: check for /proc being mounted in some really basic fs operations

5 years agosd-bus: Add sd_bus_get_name/owner_creds docs 15579/head
Daan De Meyer [Thu, 23 Apr 2020 19:21:58 +0000 (21:21 +0200)] 
sd-bus: Add sd_bus_get_name/owner_creds docs

5 years agoMerge pull request #15570 from poettering/cmsg-find
Zbigniew Jędrzejewski-Szmek [Fri, 24 Apr 2020 05:45:07 +0000 (07:45 +0200)] 
Merge pull request #15570 from poettering/cmsg-find

CMSG_FIND_DATA() and cmsg_find() work

5 years agotree-wide: use structured initialization at various places
Lennart Poettering [Fri, 17 Apr 2020 13:30:48 +0000 (15:30 +0200)] 
tree-wide: use structured initialization at various places

5 years agodhcp-server: port to recvmsg_safe()
Lennart Poettering [Thu, 23 Apr 2020 18:00:07 +0000 (20:00 +0200)] 
dhcp-server: port to recvmsg_safe()

Split out of #15457, let's see if this is the culprit of the CI failure.

5 years agoicmp6-util: port to recvmsg_safe()
Lennart Poettering [Thu, 23 Apr 2020 17:53:27 +0000 (19:53 +0200)] 
icmp6-util: port to recvmsg_safe()

Split out of #15457, let's see if this is the culprit of the CI failure.

5 years agodhcp-client: port to recvmsg_safe()
Lennart Poettering [Thu, 23 Apr 2020 17:57:53 +0000 (19:57 +0200)] 
dhcp-client: port to recvmsg_safe()

Split out of #15457, let's see if this is the culprit of the CI failure.

(also setting green label here, since @keszybz already greenlit it in that other PR)

5 years agofuzzit: make the submit phase a bit more robust
Frantisek Sumsal [Thu, 23 Apr 2020 19:24:22 +0000 (21:24 +0200)] 
fuzzit: make the submit phase a bit more robust

The submit phase of the Fuzzit Travis job has been spuriously failing
for some time with various (and usually pretty hidden) errors, like:

```
./fuzzit create job --type regression ...
2020/04/23 17:02:12 please set env variable FUZZIT_API_KEY or pass --api-key. API Key for you account: ...
```

```
./fuzzit create job --type regression ...
2020/04/23 11:36:53 Creating job...
2020/04/23 11:36:54 Uploading fuzzer...
2020/04/23 11:36:54 Job created successfully
2020/04/23 11:36:54 Get https://...&action=create: read tcp x.x.x.x:39674->x.x.x.x:443: read: connection reset by peer
```

```
./fuzzit create job --type regression ...
2020/04/22 18:09:15 Creating job...
2020/04/22 18:09:16 Uploading fuzzer...
2020/04/22 18:09:37 Job created successfully
2020/04/22 18:09:37 500 Internal Server Error
```

etc.

Let's retry each submit job up to three times to (hopefully) mitigate this.

5 years agonss-systemd: don't synthesize root/nobody when iterating
Lennart Poettering [Thu, 23 Apr 2020 07:55:06 +0000 (09:55 +0200)] 
nss-systemd: don't synthesize root/nobody when iterating

Fixes: #15160
5 years agosd-bus: Add sd_bus_message_get_creds docs
Daan De Meyer [Thu, 23 Apr 2020 19:40:52 +0000 (21:40 +0200)] 
sd-bus: Add sd_bus_message_get_creds docs

5 years agosd-bus: Add sd_bus_get_name_machine_id docs
Daan De Meyer [Thu, 23 Apr 2020 19:07:36 +0000 (21:07 +0200)] 
sd-bus: Add sd_bus_get_name_machine_id docs

5 years agosd-bus: Add sd_bus_send_to docs
Daan De Meyer [Thu, 23 Apr 2020 18:40:30 +0000 (20:40 +0200)] 
sd-bus: Add sd_bus_send_to docs

5 years agoMerge pull request #15566 from poettering/destroy-binfmt
Lennart Poettering [Thu, 23 Apr 2020 19:15:22 +0000 (21:15 +0200)] 
Merge pull request #15566 from poettering/destroy-binfmt

unregister binary formats during shutdown

5 years agohome: fix strv NUL termination
Lennart Poettering [Thu, 23 Apr 2020 11:46:10 +0000 (13:46 +0200)] 
home: fix strv NUL termination

Fixes: #15559
5 years agoMerge pull request #15569 from DaanDeMeyer/sd-bus-message-peek-type-docs
Zbigniew Jędrzejewski-Szmek [Thu, 23 Apr 2020 18:11:14 +0000 (20:11 +0200)] 
Merge pull request #15569 from DaanDeMeyer/sd-bus-message-peek-type-docs

5 years agonetworkd: don't do lldp rx nor tx on bond devices
Lennart Poettering [Thu, 23 Apr 2020 13:18:18 +0000 (15:18 +0200)] 
networkd: don't do lldp rx nor tx on bond devices

Fixes: #15146
5 years agoMerge pull request #15550 from DaanDeMeyer/sd-bus-open/close/enter/exit-container...
Zbigniew Jędrzejewski-Szmek [Thu, 23 Apr 2020 17:58:43 +0000 (19:58 +0200)] 
Merge pull request #15550 from DaanDeMeyer/sd-bus-open/close/enter/exit-container-docs

sd-bus: Add sd_bus_open/close/enter/exit_container docs

5 years agoman: add a description of handling of single-label names
Zbigniew Jędrzejewski-Szmek [Wed, 15 Apr 2020 18:10:39 +0000 (20:10 +0200)] 
man: add a description of handling of single-label names

It turns out that our man page didn't describe the handling of single-label
names almost at all. This probably adds to the confusion regarding the subject.
So let's first describe what our current implementation is doing.

Quoting https://www.iab.org/documents/correspondence-reports-documents/2013-2/iab-statement-dotless-domains-considered-harmful/:
> Applications and platforms that apply a suffix search list to a single-label
> name are in conformance with IETF standards track RFCs. Furthermore,
> applications and platforms that do not query DNS for a TLD are in conformance
> with IETF standards track recommendations

Current behaviour is in line with that recommendation.

For #13763.

5 years agoMerge pull request #15563 from keszybz/wait-callback-tweak
Lennart Poettering [Thu, 23 Apr 2020 17:50:36 +0000 (19:50 +0200)] 
Merge pull request #15563 from keszybz/wait-callback-tweak

Add NULL callback check in one more place

5 years agoMerge pull request #15561 from poettering/udev-memdup-fix
Lennart Poettering [Thu, 23 Apr 2020 17:50:12 +0000 (19:50 +0200)] 
Merge pull request #15561 from poettering/udev-memdup-fix

udev: nulstr NUL termination fix

5 years agosocket-util: introduce type-safe, dereferencing wrapper CMSG_FIND_DATA around cmsg_find() 15570/head
Lennart Poettering [Fri, 17 Apr 2020 09:52:48 +0000 (11:52 +0200)] 
socket-util: introduce type-safe, dereferencing wrapper CMSG_FIND_DATA around cmsg_find()

let's take this once step further, and add type-safety to cmsg_find(),
and imply the CMSG_DATA() macro for finding the cmsg payload.

5 years agotree-wide: use cmsg_find() helper at various places where appropriate
Lennart Poettering [Fri, 17 Apr 2020 09:52:05 +0000 (11:52 +0200)] 
tree-wide: use cmsg_find() helper at various places where appropriate

5 years agosd-bus: Add sd_bus_message_peek_type docs 15569/head
Daan De Meyer [Thu, 23 Apr 2020 17:37:21 +0000 (19:37 +0200)] 
sd-bus: Add sd_bus_message_peek_type docs

5 years agosd-bus: Add sd_bus_message_open/close/enter/exit_container docs 15550/head
Daan De Meyer [Wed, 22 Apr 2020 20:02:39 +0000 (22:02 +0200)] 
sd-bus: Add sd_bus_message_open/close/enter/exit_container docs

5 years agosd-bus: Fix typo in sd_bus_message_append_array docs
Daan De Meyer [Wed, 22 Apr 2020 20:02:17 +0000 (22:02 +0200)] 
sd-bus: Fix typo in sd_bus_message_append_array docs

5 years agoMerge pull request #15504 from poettering/cmsg-find-pure
Lennart Poettering [Thu, 23 Apr 2020 15:28:19 +0000 (17:28 +0200)] 
Merge pull request #15504 from poettering/cmsg-find-pure

just the recvmsg_safe() stuff from #15457

5 years agoman: document binfmt's new --unregister switch 15566/head
Lennart Poettering [Thu, 23 Apr 2020 14:51:37 +0000 (16:51 +0200)] 
man: document binfmt's new --unregister switch

5 years agobinfmt: also unregister binfmt entries from unit
Lennart Poettering [Thu, 23 Apr 2020 14:36:45 +0000 (16:36 +0200)] 
binfmt: also unregister binfmt entries from unit

We unregister binfmt_misc twice during shutdown with this change:

1. A previous commit added support for doing that in the final shutdown
   phase, i.e. when we do the aggressive umount loop. This is the robust
   thing to do, in case the earlier ("clean") shutdown phase didn't work
   for some reason.

2. This commit adds support for doing that when systemd-binfmt.service
   is stopped. This is a good idea so that people can order mounts
   before the service if they want to register binaries from such
   mounts, as in that case we'll undo the registration on shutdown
   again, before unmounting those mounts.

And all that, just because of that weird "F" flag the kernel introduced
that can pin files...

Fixes: #14981
5 years agobinfmt: modernize code a bit
Lennart Poettering [Thu, 23 Apr 2020 14:27:46 +0000 (16:27 +0200)] 
binfmt: modernize code a bit

Let's just copy out the bit of the string we need, and let's make sure
we refuse rules called "status" and "register", since those are special
files in binfmt_misc's file system.

5 years agoshutdown: unregister all binfmt_misc entries before entering shutdown loop
Lennart Poettering [Thu, 23 Apr 2020 14:25:53 +0000 (16:25 +0200)] 
shutdown: unregister all binfmt_misc entries before entering shutdown loop

Apparently if the new "F" flag is used they might pin files, which
blocks us from unmounting things. Let's hence clear this up explicitly.
Before entering our umount loop.

Fixes: #14981
5 years agoshared: add common helper for unregistering all binfmt entries
Lennart Poettering [Thu, 23 Apr 2020 14:36:06 +0000 (16:36 +0200)] 
shared: add common helper for unregistering all binfmt entries

5 years agoMerge pull request #15472 from keszybz/dbus-api-docs
Lennart Poettering [Thu, 23 Apr 2020 15:01:11 +0000 (17:01 +0200)] 
Merge pull request #15472 from keszybz/dbus-api-docs

A few more dbus api documentation updates

5 years agoupdate TODO
Lennart Poettering [Thu, 23 Apr 2020 14:01:46 +0000 (16:01 +0200)] 
update TODO

5 years agoshared: add NULL callback check in one more place 15563/head
Zbigniew Jędrzejewski-Szmek [Thu, 23 Apr 2020 12:53:54 +0000 (14:53 +0200)] 
shared: add NULL callback check in one more place

Follow-up for 9f65637308.

5 years agotmpfiles: if we get ENOENT when opening /proc/self/fd/, check if /proc is mounted 15564/head
Lennart Poettering [Thu, 23 Apr 2020 12:52:10 +0000 (14:52 +0200)] 
tmpfiles: if we get ENOENT when opening /proc/self/fd/, check if /proc is mounted

let's return ENOSYS in that case, to make things a bit less confusng.

Previously we'd just propagate ENOENT, which people might mistake as
applying to the object being modified rather than /proc/ just not being
there.

Let's return ENOSYS instead, i.e. an error clearly indicating that some
kernel API is not available. This hopefully should put people on a
better track.

Note that we only do the procfs check in the error path, which hopefully
means it's the less likely path.

We probably can add similar bits to more suitable codepaths dealing with
/proc/self/fd, but for now, let's pick to the ones noticed in #14745.

Fixes: #14745
5 years agostat-util: add simpler helper for checking if /proc/ is mounted
Lennart Poettering [Thu, 23 Apr 2020 12:51:08 +0000 (14:51 +0200)] 
stat-util: add simpler helper for checking if /proc/ is mounted

5 years agostat-util: no need to open a file to check fs type
Lennart Poettering [Thu, 23 Apr 2020 12:50:53 +0000 (14:50 +0200)] 
stat-util: no need to open a file to check fs type

5 years agosysusers,tmpfiles: always mention error when failing to replace specifiers
Lennart Poettering [Thu, 23 Apr 2020 12:50:07 +0000 (14:50 +0200)] 
sysusers,tmpfiles: always mention error when failing to replace specifiers

5 years agosysusers: add accidentally forgotten 'return'
Lennart Poettering [Thu, 23 Apr 2020 12:49:14 +0000 (14:49 +0200)] 
sysusers: add accidentally forgotten 'return'

5 years agocore: fix unused variable warning when !HAVE_SECCOMP
Zbigniew Jędrzejewski-Szmek [Wed, 22 Apr 2020 21:27:51 +0000 (23:27 +0200)] 
core: fix unused variable warning when !HAVE_SECCOMP

5 years agoudev: use STR_IN_SET() wher eit makes sense 15561/head
Lennart Poettering [Thu, 23 Apr 2020 11:36:36 +0000 (13:36 +0200)] 
udev: use STR_IN_SET() wher eit makes sense

5 years agoudev: prepare memory for extra NUL termination for NULSTR
Lennart Poettering [Thu, 23 Apr 2020 11:36:00 +0000 (13:36 +0200)] 
udev: prepare memory for extra NUL termination for NULSTR

Fixes: #15162
5 years agoMerge pull request #15543 from poettering/fix-ubsan-sd-bus
Lennart Poettering [Thu, 23 Apr 2020 11:39:58 +0000 (13:39 +0200)] 
Merge pull request #15543 from poettering/fix-ubsan-sd-bus

sd-bus: work around ubsan warning

5 years agoshared: Don't try calling NULL callback in bus_wait_for_units_clear
Balint Reczey [Wed, 22 Apr 2020 07:51:53 +0000 (09:51 +0200)] 
shared: Don't try calling NULL callback in bus_wait_for_units_clear

BugLink: https://bugs.launchpad.net/bugs/1870930
5 years agoMerge pull request #15544 from poettering/fix-journalctl-namespace
Lennart Poettering [Thu, 23 Apr 2020 10:19:25 +0000 (12:19 +0200)] 
Merge pull request #15544 from poettering/fix-journalctl-namespace

sd-journal: fix namespace check

5 years agoMerge pull request #15538 from poettering/nspawn-no-netns
Lennart Poettering [Thu, 23 Apr 2020 09:11:11 +0000 (11:11 +0200)] 
Merge pull request #15538 from poettering/nspawn-no-netns

nspawn: politely refuse --image= when run inside non-host netns

5 years agoMerge pull request #15527 from Werkov/mkosi-opensuse
Zbigniew Jędrzejewski-Szmek [Thu, 23 Apr 2020 09:00:02 +0000 (11:00 +0200)] 
Merge pull request #15527 from Werkov/mkosi-opensuse

Add mkosi config for openSUSE Tumbleweed

5 years agomkosi: Add openSUSE params file 15527/head
Michal Koutný [Wed, 22 Apr 2020 00:11:18 +0000 (02:11 +0200)] 
mkosi: Add openSUSE params file

The setup is meant to run against openSUSE Tumbleweed and install
minimum packages necessary for successful build and passing tests.

To speed up incremental build an external build directory is used.

5 years agorun: don't wait for start job to complete when running interactively anyway
Lennart Poettering [Wed, 22 Apr 2020 18:08:34 +0000 (20:08 +0200)] 
run: don't wait for start job to complete when running interactively anyway

Otherwise we'd not read the services input while waiting for the job to
wait, and there's no point in waiting for the job anyway if we wait for
the unit to stop ultimately.

Fixes: #15395
5 years agotree-wide: use recvmsg_safe() at various places 15504/head
Lennart Poettering [Thu, 23 Apr 2020 07:40:03 +0000 (09:40 +0200)] 
tree-wide: use recvmsg_safe() at various places

Let's be extra careful whenever we return from recvmsg() and see
MSG_CTRUNC set. This generally means we ran into a programming error, as
we didn't size the control buffer large enough. It's an error condition
we should at least log about, or propagate up. Hence do that.

This is particularly important when receiving fds, since for those the
control data can be of any size. In particular on stream sockets that's
nasty, because if we miss an fd because of control data truncation we
cannot recover, we might not even realize that we are one off.

(Also, when failing early, if there's any chance the socket might be
AF_UNIX let's close all received fds, all the time. We got this right
most of the time, but there were a few cases missing. God, UNIX is hard
to use)

5 years agosocket-util: add recvmsg_safe() wrapper that handles MSG_CTRUNC
Lennart Poettering [Fri, 17 Apr 2020 20:26:14 +0000 (22:26 +0200)] 
socket-util: add recvmsg_safe() wrapper that handles MSG_CTRUNC