summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore302
-rw-r--r--.mailmap1
l---------.mkosi/Makefile1
-rw-r--r--.mkosi/mkosi.arch6
-rw-r--r--.mkosi/mkosi.debian1
-rw-r--r--.mkosi/mkosi.fedora1
-rw-r--r--DISTRO_PORTING61
-rw-r--r--HACKING12
-rw-r--r--Makefile5
-rw-r--r--Makefile-man.am2910
-rw-r--r--Makefile.am6915
-rw-r--r--README46
-rw-r--r--TODO7
-rwxr-xr-xautogen.sh94
-rw-r--r--catalog/.gitignore1
l---------catalog/Makefile1
-rwxr-xr-xconfigure21
-rw-r--r--configure.ac1863
-rw-r--r--docs/.gitignore1
l---------docs/Makefile1
-rw-r--r--docs/sysvinit/.gitignore1
l---------docs/sysvinit/Makefile1
-rw-r--r--docs/var-log/.gitignore1
l---------docs/var-log/Makefile1
-rw-r--r--hwdb/60-evdev.hwdb11
-rw-r--r--hwdb/60-keyboard.hwdb2
-rw-r--r--hwdb/60-sensor.hwdb95
l---------hwdb/Makefile1
-rw-r--r--hwdb/meson.build1
-rw-r--r--m4/.gitignore6
-rw-r--r--m4/arch.m413
-rw-r--r--m4/attributes.m4292
-rw-r--r--m4/ax_compiler_vendor.m487
-rw-r--r--m4/ax_normalize_path.m4115
-rw-r--r--man/.gitignore5
l---------man/Makefile1
-rw-r--r--man/crypttab.xml5
-rw-r--r--man/journald.conf.xml8
-rw-r--r--man/meson.build2
-rw-r--r--man/sd_bus_negotiate_fds.xml9
-rw-r--r--man/systemd-resolved.service.xml2
-rw-r--r--man/systemd.exec.xml92
-rw-r--r--man/systemd.network.xml3
-rw-r--r--meson.build69
-rw-r--r--meson_options.txt6
-rwxr-xr-xmkosi.build17
l---------network/Makefile1
-rw-r--r--po/.gitignore6
-rw-r--r--rules/.gitignore2
l---------rules/Makefile1
-rw-r--r--rules/meson.build1
l---------shell-completion/Makefile1
-rw-r--r--shell-completion/bash/.gitignore1
l---------shell-completion/bash/Makefile1
-rw-r--r--shell-completion/bash/systemctl.in14
-rw-r--r--shell-completion/zsh/.gitignore1
l---------shell-completion/zsh/Makefile1
-rw-r--r--shell-completion/zsh/_sd_unit_files2
-rw-r--r--src/.gitignore8
-rw-r--r--src/Makefile28
l---------src/ac-power/Makefile1
l---------src/activate/Makefile1
-rw-r--r--src/activate/activate.c5
-rw-r--r--src/analyze/.gitignore1
l---------src/analyze/Makefile1
l---------src/ask-password/Makefile1
l---------src/backlight/Makefile1
-rw-r--r--src/basic/.gitignore16
l---------src/basic/Makefile1
-rw-r--r--src/basic/calendarspec.c36
-rw-r--r--src/basic/cgroup-util.c6
-rw-r--r--src/basic/def.h4
-rw-r--r--src/basic/exit-status.c12
-rw-r--r--src/basic/exit-status.h4
-rw-r--r--src/basic/fd-util.c3
-rw-r--r--src/basic/fileio.c21
-rw-r--r--src/basic/fs-util.c2
-rw-r--r--src/basic/log.c14
-rw-r--r--src/basic/log.h5
-rw-r--r--src/basic/process-util.c66
-rw-r--r--src/basic/process-util.h2
-rw-r--r--src/basic/replace-var.c2
-rw-r--r--src/basic/replace-var.h2
-rw-r--r--src/basic/special.h1
-rw-r--r--src/basic/string-util.c21
-rw-r--r--src/basic/string-util.h2
-rw-r--r--src/basic/terminal-util.c2
-rw-r--r--src/basic/unit-name.c15
-rw-r--r--src/basic/unit-name.h17
-rw-r--r--src/basic/util.c2
-rw-r--r--src/basic/virt.c3
l---------src/binfmt/Makefile1
l---------src/boot/Makefile1
-rw-r--r--src/boot/efi/.gitignore2
-rw-r--r--src/boot/efi/boot.c5
-rw-r--r--src/boot/efi/measure.c2
-rw-r--r--src/boot/efi/meson.build2
-rw-r--r--src/boot/efi/stub.c5
l---------src/cgls/Makefile1
l---------src/cgroups-agent/Makefile1
l---------src/cgtop/Makefile1
-rw-r--r--src/core/.gitignore3
l---------src/core/Makefile1
-rw-r--r--src/core/automount.c2
-rw-r--r--src/core/bus-policy.c180
-rw-r--r--src/core/bus-policy.h64
-rw-r--r--src/core/busname.c1081
-rw-r--r--src/core/busname.h69
-rw-r--r--src/core/cgroup.c4
-rw-r--r--src/core/dbus-busname.c37
-rw-r--r--src/core/dbus-busname.h23
-rw-r--r--src/core/dbus-cgroup.c10
-rw-r--r--src/core/dbus-execute.c76
-rw-r--r--src/core/dbus-service.c2
-rw-r--r--src/core/dbus.c2
-rw-r--r--src/core/execute.c154
-rw-r--r--src/core/execute.h35
-rw-r--r--src/core/load-fragment-gperf.gperf.m424
-rw-r--r--src/core/load-fragment.c117
-rw-r--r--src/core/load-fragment.h6
-rw-r--r--src/core/main.c33
-rw-r--r--src/core/manager.c79
-rw-r--r--src/core/manager.h5
-rw-r--r--src/core/meson.build6
-rw-r--r--src/core/mount-setup.c4
-rw-r--r--src/core/mount.c10
-rw-r--r--src/core/service.c37
-rw-r--r--src/core/shutdown.c2
-rw-r--r--src/core/smack-setup.c2
-rw-r--r--src/core/socket.c11
-rw-r--r--src/core/swap.c13
-rw-r--r--src/core/transaction.c83
-rw-r--r--src/core/unit-printf.c6
-rw-r--r--src/core/unit.c24
-rw-r--r--src/core/unit.h2
l---------src/coredump/Makefile1
-rw-r--r--src/coredump/coredump.c2
-rw-r--r--src/coredump/stacktrace.c2
l---------src/cryptsetup/Makefile1
-rw-r--r--src/cryptsetup/cryptsetup-generator.c79
l---------src/dbus1-generator/Makefile1
l---------src/debug-generator/Makefile1
l---------src/delta/Makefile1
l---------src/detect-virt/Makefile1
l---------src/dissect/Makefile1
l---------src/environment-d-generator/Makefile1
l---------src/escape/Makefile1
-rw-r--r--src/escape/escape.c2
l---------src/firstboot/Makefile1
l---------src/fsck/Makefile1
l---------src/fstab-generator/Makefile1
-rw-r--r--src/fstab-generator/fstab-generator.c51
l---------src/getty-generator/Makefile1
l---------src/gpt-auto-generator/Makefile1
-rw-r--r--src/gpt-auto-generator/gpt-auto-generator.c76
l---------src/hibernate-resume/Makefile1
-rw-r--r--src/hostname/.gitignore1
l---------src/hostname/Makefile1
l---------src/hwdb/Makefile1
-rw-r--r--src/import/.gitignore1
l---------src/import/Makefile1
l---------src/initctl/Makefile1
-rw-r--r--src/initctl/initctl.c4
-rw-r--r--src/journal-remote/.gitignore2
l---------src/journal-remote/Makefile1
-rw-r--r--src/journal-remote/journal-remote.c4
-rw-r--r--src/journal-remote/journal-upload.c2
-rw-r--r--src/journal/.gitignore3
l---------src/journal/Makefile1
-rw-r--r--src/journal/journal-file.c19
-rw-r--r--src/journal/journal-qrcode.c4
-rw-r--r--src/journal/journal-verify.c2
-rw-r--r--src/journal/journald-gperf.gperf1
-rw-r--r--src/journal/journald-kmsg.c13
-rw-r--r--src/journal/journald-server.c5
-rw-r--r--src/journal/journald-server.h1
-rw-r--r--src/journal/journald-syslog.c2
-rw-r--r--src/journal/journald.c4
-rw-r--r--src/journal/mmap-cache.c50
-rw-r--r--src/journal/mmap-cache.h3
-rw-r--r--src/journal/sd-journal.c4
-rw-r--r--src/journal/test-compress-benchmark.c2
-rw-r--r--src/journal/test-mmap-cache.c10
l---------src/kernel-install/Makefile1
l---------src/libsystemd-network/Makefile1
-rw-r--r--src/libsystemd-network/sd-dhcp-lease.c12
-rw-r--r--src/libsystemd/.gitignore1
l---------src/libsystemd/Makefile1
-rw-r--r--src/libsystemd/meson.build1
l---------src/libsystemd/sd-bus/Makefile1
-rw-r--r--src/libsystemd/sd-bus/bus-container.c135
-rw-r--r--src/libsystemd/sd-bus/bus-container.h1
-rw-r--r--src/libsystemd/sd-bus/bus-control.c995
-rw-r--r--src/libsystemd/sd-bus/bus-control.h2
-rw-r--r--src/libsystemd/sd-bus/bus-convenience.c16
-rw-r--r--src/libsystemd/sd-bus/bus-creds.c2
-rw-r--r--src/libsystemd/sd-bus/bus-internal.h73
-rw-r--r--src/libsystemd/sd-bus/bus-introspect.c38
-rw-r--r--src/libsystemd/sd-bus/bus-kernel.c1673
-rw-r--r--src/libsystemd/sd-bus/bus-kernel.h53
-rw-r--r--src/libsystemd/sd-bus/bus-match.c14
-rw-r--r--src/libsystemd/sd-bus/bus-message.c90
-rw-r--r--src/libsystemd/sd-bus/bus-message.h4
-rw-r--r--src/libsystemd/sd-bus/bus-objects.c4
-rw-r--r--src/libsystemd/sd-bus/bus-socket.c1
-rw-r--r--src/libsystemd/sd-bus/kdbus.h980
-rw-r--r--src/libsystemd/sd-bus/sd-bus.c332
-rw-r--r--src/libsystemd/sd-bus/test-bus-benchmark.c38
-rw-r--r--src/libsystemd/sd-bus/test-bus-kernel-bloom.c141
-rw-r--r--src/libsystemd/sd-bus/test-bus-kernel.c190
-rw-r--r--src/libsystemd/sd-bus/test-bus-zero-copy.c210
l---------src/libsystemd/sd-daemon/Makefile1
-rw-r--r--src/libsystemd/sd-daemon/sd-daemon.c6
l---------src/libsystemd/sd-device/Makefile1
l---------src/libsystemd/sd-event/Makefile1
-rw-r--r--src/libsystemd/sd-event/sd-event.c4
-rw-r--r--src/libsystemd/sd-event/test-event.c10
l---------src/libsystemd/sd-hwdb/Makefile1
l---------src/libsystemd/sd-id128/Makefile1
l---------src/libsystemd/sd-login/Makefile1
l---------src/libsystemd/sd-netlink/Makefile1
-rw-r--r--src/libsystemd/sd-netlink/sd-netlink.c4
l---------src/libsystemd/sd-network/Makefile1
l---------src/libsystemd/sd-path/Makefile1
-rw-r--r--src/libsystemd/sd-path/sd-path.c5
l---------src/libsystemd/sd-resolve/Makefile1
-rw-r--r--src/libsystemd/sd-resolve/sd-resolve.c4
l---------src/libsystemd/sd-utf8/Makefile1
-rw-r--r--src/libudev/.gitignore1
l---------src/libudev/Makefile1
-rw-r--r--src/locale/.gitignore1
l---------src/locale/Makefile1
-rw-r--r--src/locale/keymap-util.c14
-rw-r--r--src/login/.gitignore6
l---------src/login/Makefile1
-rw-r--r--src/login/logind-seat.c4
-rw-r--r--src/login/logind-user.c38
-rw-r--r--src/login/logind.c4
-rw-r--r--src/login/pam_systemd.c5
l---------src/machine-id-setup/Makefile1
-rw-r--r--src/machine/.gitignore1
l---------src/machine/Makefile1
-rw-r--r--src/machine/machine.c6
-rw-r--r--src/machine/machined.c5
l---------src/modules-load/Makefile1
l---------src/mount/Makefile1
-rw-r--r--src/network/.gitignore2
l---------src/network/Makefile1
-rw-r--r--src/network/netdev/.gitignore1
l---------src/network/netdev/Makefile1
-rw-r--r--src/network/networkd-link.c56
-rw-r--r--src/network/networkd-manager.c4
l---------src/network/wait-online/Makefile1
l---------src/notify/Makefile1
-rw-r--r--src/nspawn/.gitignore1
l---------src/nspawn/Makefile1
-rw-r--r--src/nspawn/nspawn-mount.c3
-rw-r--r--src/nspawn/nspawn.c2
l---------src/nss-myhostname/Makefile1
l---------src/nss-mymachines/Makefile1
l---------src/nss-resolve/Makefile1
l---------src/nss-systemd/Makefile1
l---------src/path/Makefile1
l---------src/quotacheck/Makefile1
l---------src/random-seed/Makefile1
l---------src/rc-local-generator/Makefile1
l---------src/remount-fs/Makefile1
l---------src/reply-password/Makefile1
-rw-r--r--src/resolve/.gitignore6
l---------src/resolve/Makefile1
-rw-r--r--src/resolve/resolved-link.c28
-rw-r--r--src/resolve/resolved-resolv-conf.c32
l---------src/rfkill/Makefile1
l---------src/run/Makefile1
-rw-r--r--src/run/run.c2
l---------src/shared/Makefile1
-rw-r--r--src/shared/ask-password-api.c3
-rw-r--r--src/shared/bus-unit-util.c13
-rw-r--r--src/shared/bus-util.c44
-rw-r--r--src/shared/condition.c5
-rw-r--r--src/shared/dropin.c9
-rw-r--r--src/shared/generator.c20
-rw-r--r--src/shared/generator.h2
-rw-r--r--src/shared/pager.c2
-rw-r--r--src/shared/seccomp-util.c15
l---------src/sleep/Makefile1
l---------src/socket-proxy/Makefile1
-rw-r--r--src/sulogin-shell/.gitignore1
l---------src/sysctl/Makefile1
l---------src/system-update-generator/Makefile1
l---------src/systemctl/Makefile1
-rw-r--r--src/systemctl/systemctl.c5
l---------src/systemd/Makefile1
l---------src/sysusers/Makefile1
l---------src/sysv-generator/Makefile1
-rw-r--r--src/sysv-generator/sysv-generator.c31
-rw-r--r--src/test/.gitignore1
l---------src/test/Makefile1
-rw-r--r--src/test/meson.build15
-rw-r--r--src/test/test-cgroup.c6
-rw-r--r--src/test/test-condition.c2
-rw-r--r--src/test/test-log.c6
-rw-r--r--src/test/test-process-util.c133
-rw-r--r--src/test/test-seccomp.c12
-rw-r--r--src/test/test-signal-util.c10
-rw-r--r--src/test/test-tables.c4
-rw-r--r--src/test/test-tmpfiles.c4
-rw-r--r--src/test/test-unit-name.c15
-rw-r--r--src/timedate/.gitignore1
l---------src/timedate/Makefile1
-rw-r--r--src/timesync/.gitignore2
l---------src/timesync/Makefile1
-rw-r--r--src/timesync/timesyncd-manager.c4
-rw-r--r--src/timesync/timesyncd.c3
l---------src/tmpfiles/Makefile1
l---------src/tty-ask-password-agent/Makefile1
-rw-r--r--src/udev/.gitignore4
l---------src/udev/Makefile1
l---------src/udev/ata_id/Makefile1
l---------src/udev/cdrom_id/Makefile1
l---------src/udev/collect/Makefile1
l---------src/udev/mtd_probe/Makefile1
-rw-r--r--src/udev/net/.gitignore1
l---------src/udev/net/Makefile1
-rw-r--r--src/udev/scsi_id/.gitignore1
l---------src/udev/scsi_id/Makefile1
-rw-r--r--src/udev/udevd.c6
l---------src/udev/v4l_id/Makefile1
l---------src/update-done/Makefile1
l---------src/update-utmp/Makefile1
-rw-r--r--src/update-utmp/update-utmp.c5
l---------src/user-sessions/Makefile1
-rw-r--r--src/vconsole/.gitignore1
l---------src/vconsole/Makefile1
l---------src/veritysetup/Makefile1
l---------src/volatile-root/Makefile1
-rw-r--r--sysctl.d/.gitignore1
l---------sysctl.d/Makefile1
l---------system-preset/Makefile1
-rw-r--r--sysusers.d/.gitignore3
l---------sysusers.d/Makefile1
-rw-r--r--test/Makefile20
-rw-r--r--test/Makefile.guess14
-rw-r--r--test/TEST-01-BASIC/Makefile14
-rw-r--r--test/TEST-13-NSPAWN-SMOKE/Makefile12
l---------[-rw-r--r--]test/TEST-14-MACHINE-ID/Makefile11
-rw-r--r--test/bus-policy/check-own-rules.conf14
-rw-r--r--test/bus-policy/hello.conf14
-rw-r--r--test/bus-policy/many-rules.conf61
-rw-r--r--test/bus-policy/methods.conf17
-rw-r--r--test/bus-policy/ownerships.conf24
-rw-r--r--test/bus-policy/signals.conf15
-rw-r--r--test/bus-policy/test.conf20
-rw-r--r--test/meson.build13
-rwxr-xr-xtest/networkd-test.py2
-rwxr-xr-xtest/sysv-generator-test.py3
-rw-r--r--test/test-functions6
-rw-r--r--tmpfiles.d/.gitignore4
l---------tmpfiles.d/Makefile1
-rwxr-xr-xtools/add-git-hook.sh11
-rwxr-xr-xtools/make-directive-index.py2
-rwxr-xr-xtools/make-man-index.py2
-rwxr-xr-xtools/make-man-rules.py73
-rw-r--r--units/.gitignore80
l---------units/Makefile1
-rw-r--r--units/org.freedesktop.hostname1.busname15
-rw-r--r--units/org.freedesktop.import1.busname14
-rw-r--r--units/org.freedesktop.locale1.busname15
-rw-r--r--units/org.freedesktop.login1.busname16
-rw-r--r--units/org.freedesktop.machine1.busname15
-rw-r--r--units/org.freedesktop.network1.busname20
-rw-r--r--units/org.freedesktop.resolve1.busname21
-rw-r--r--units/org.freedesktop.systemd1.busname15
-rw-r--r--units/org.freedesktop.timedate1.busname15
-rw-r--r--units/systemd-journald.service.in2
-rw-r--r--units/systemd-logind.service.in3
-rw-r--r--units/systemd-networkd.service.m4.in5
-rw-r--r--units/systemd-resolved.service.m4.in5
-rw-r--r--units/user/.gitignore1
l---------units/user/Makefile1
380 files changed, 1657 insertions, 20694 deletions
diff --git a/.gitignore b/.gitignore
index 8c4331e54f..4f0c6a7892 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,326 +1,32 @@
*.a
*.cache
*.gch
-*.la
-*.lo
*.log
*.o
*.plist
+*.py[co]
*.stamp
*.swp
*.trs
*~
.config.args
.deps/
-.dirstamp
-.libs/
/*.gcda
/*.gcno
/*.tar.bz2
/*.tar.gz
/*.tar.xz
-/30-systemd-environment-d-generator
/GPATH
/GRTAGS
/GSYMS
/GTAGS
-/Makefile
/TAGS
-/ata_id
-/bootctl
/build*
-/busctl
-/cdrom_id
-/collect
-/coredumpctl
/coverage/
-/defined
-/exported
-/exported-*
-/hostnamectl
/image.raw
+/image.raw.cache-pre-dev
+/image.raw.cache-pre-inst
/install-tree
-/journalctl
-/libtool
-/linuxx64.efi.stub
-/localectl
-/loginctl
-/machinectl
-/mtd_probe
-/networkctl
-/scsi_id
-/systemctl
-/systemd
-/systemd-ac-power
-/systemd-analyze
-/systemd-ask-password
-/systemd-backlight
-/systemd-binfmt
-/systemd-bootx64.efi
-/systemd-cat
-/systemd-cgls
-/systemd-cgroups-agent
-/systemd-cgtop
-/systemd-coredump
-/systemd-cryptsetup
-/systemd-cryptsetup-generator
-/systemd-dbus1-generator
-/systemd-debug-generator
-/systemd-delta
-/systemd-detect-virt
-/systemd-dissect
-/systemd-escape
-/systemd-export
-/systemd-firstboot
-/systemd-fsck
-/systemd-fstab-generator
-/systemd-getty-generator
-/systemd-gpt-auto-generator
-/systemd-hibernate-resume
-/systemd-hibernate-resume-generator
-/systemd-hostnamed
-/systemd-hwdb
-/systemd-import
-/systemd-importd
-/systemd-inhibit
-/systemd-initctl
-/systemd-journal-gatewayd
-/systemd-journal-remote
-/systemd-journal-upload
-/systemd-journald
-/systemd-localed
-/systemd-logind
-/systemd-machine-id-setup
-/systemd-machined
-/systemd-modules-load
-/systemd-mount
-/systemd-networkd
-/systemd-networkd-wait-online
-/systemd-notify
-/systemd-nspawn
-/systemd-path
-/systemd-pull
-/systemd-quotacheck
-/systemd-random-seed
-/systemd-rc-local-generator
-/systemd-remount-fs
-/systemd-reply-password
-/systemd-resolve
-/systemd-resolved
-/systemd-rfkill
-/systemd-run
-/systemd-shutdown
-/systemd-sleep
-/systemd-socket-activate
-/systemd-socket-proxyd
-/systemd-stdio-bridge
-/systemd-sysctl
-/systemd-system-update-generator
-/systemd-sysusers
-/systemd-sysv-generator
-/systemd-timedated
-/systemd-timesyncd
-/systemd-tmpfiles
-/systemd-tty-ask-password-agent
-/systemd-udevd
-/systemd-update-done
-/systemd-update-utmp
-/systemd-user-sessions
-/systemd-vconsole-setup
-/systemd-veritysetup
-/systemd-veritysetup-generator
-/systemd-volatile-root
+/mkosi.builddir/
/tags
-/test-acd
-/test-acl-util
-/test-af-list
-/test-alloc-util
-/test-architecture
-/test-arphrd-list
-/test-ask-password-api
-/test-async
-/test-audit-type
-/test-barrier
-/test-bitmap
-/test-boot-timestamps
-/test-btrfs
-/test-bus-benchmark
-/test-bus-chat
-/test-bus-cleanup
-/test-bus-creds
-/test-bus-error
-/test-bus-gvariant
-/test-bus-introspect
-/test-bus-kernel
-/test-bus-kernel-bloom
-/test-bus-marshal
-/test-bus-match
-/test-bus-objects
-/test-bus-policy
-/test-bus-server
-/test-bus-signature
-/test-bus-track
-/test-bus-vtable
-/test-bus-vtable-cc
-/test-bus-zero-copy
-/test-calendarspec
-/test-cap-list
-/test-capability
-/test-catalog
-/test-cgroup
-/test-cgroup-mask
-/test-cgroup-util
-/test-clock
-/test-compress
-/test-compress-benchmark
-/test-condition
-/test-conf-files
-/test-conf-parser
-/test-copy
-/test-coredump-vacuum
-/test-cpu-set-util
-/test-daemon
-/test-date
-/test-device-nodes
-/test-dnssec-complex
-/test-dhcp-client
-/test-dhcp-option
-/test-dhcp-server
-/test-dhcp6-client
-/test-dissect-image
-/test-dns-domain
-/test-dns-packet
-/test-dnssec
-/test-efi-disk.img
-/test-ellipsize
-/test-engine
-/test-env-util
-/test-escape
-/test-event
-/test-exec-util
-/test-execute
-/test-extract-word
-/test-fd-util
-/test-fdset
-/test-fileio
-/test-firewall-util
-/test-fs-util
-/test-fstab-util
-/test-glob-util
-/test-hash
-/test-hashmap
-/test-hexdecoct
-/test-hostname
-/test-hostname-util
-/test-id128
-/test-inhibit
-/test-install
-/test-install-root
-/test-io-util
-/test-ipcrm
-/test-ipv4ll
-/test-ipv4ll-manual
-/test-job-type
-/test-journal
-/test-journal-enum
-/test-journal-flush
-/test-journal-importer
-/test-journal-init
-/test-journal-interleaving
-/test-journal-match
-/test-journal-send
-/test-journal-stream
-/test-journal-syslog
-/test-journal-verify
-/test-keymap-util
-/test-libsystemd-sym*
-/test-libudev
-/test-libudev-sym*
-/test-list
-/test-lldp
-/test-local-addresses
-/test-locale-util
-/test-log
-/test-login
-/test-login-shared
-/test-login-tables
-/test-loopback
-/test-machine-tables
-/test-mmap-cache
-/test-mount-util
-/test-namespace
-/test-ndisc-rs
-/test-netlink
-/test-netlink-manual
-/test-networkd-conf
-/test-network
-/test-network-tables
-/test-ns
-/test-nss
-/test-parse-util
-/test-patch-uid
-/test-path
-/test-path-lookup
-/test-path-util
-/test-prioq
-/test-proc-cmdline
-/test-process-util
-/test-pty
-/test-qcow2
-/test-random-util
-/test-ratelimit
-/test-replace-var
-/test-resolve
-/test-resolve-tables
-/test-resolved-packet
-/test-ring
-/test-rlimit-util
-/test-sched-prio
-/test-sd-dhcp-lease
-/test-seccomp
-/test-selinux
-/test-set
-/test-sizeof
-/test-sigbus
-/test-signal-util
-/test-siphash24
-/test-sleep
-/test-socket-util
-/test-stat-util
-/test-strbuf
-/test-string-util
-/test-strip-tab-ansi
-/test-strv
-/test-strxcpyx
-/test-tables
-/test-terminal-util
-/test-time
-/test-timesync
-/test-tmpfiles
-/test-udev
-/test-uid-range
-/test-unaligned
-/test-unit-file
-/test-unit-name
-/test-user-util
-/test-utf8
-/test-util
-/test-verbs
-/test-watchdog
-/test-web-util
-/test-xattr-util
-/test-xml
-/timedatectl
-/udevadm
-/undefined
-/v4l_id
-Makefile.in
__pycache__/
-*.py[co]
-aclocal.m4
-config.h
-config.h.in
-config.log
-config.status
-configure
-stamp-*
diff --git a/.mailmap b/.mailmap
index e2a390bbea..73b0700f59 100644
--- a/.mailmap
+++ b/.mailmap
@@ -123,3 +123,4 @@ Federico Di Pierro <nierro92@gmail.com>
Josef Andersson <josef.andersson@fripost.org>
Josef Andersson <l10nl18nsweja@gmail.com>
Hendrik Westerberg <hendrik@gestorf.com>
+Stefan Pietsch <mail.ipv4v6@gmail.com>
diff --git a/.mkosi/Makefile b/.mkosi/Makefile
deleted file mode 120000
index bd1047548b..0000000000
--- a/.mkosi/Makefile
+++ /dev/null
@@ -1 +0,0 @@
-../src/Makefile \ No newline at end of file
diff --git a/.mkosi/mkosi.arch b/.mkosi/mkosi.arch
index 613ef4746f..c2487c9ef2 100644
--- a/.mkosi/mkosi.arch
+++ b/.mkosi/mkosi.arch
@@ -48,7 +48,7 @@ BuildPackages=
kmod
libcap
libgcrypt
- libidn2
+ libidn
libmicrohttpd
libseccomp
libtool
@@ -56,6 +56,7 @@ BuildPackages=
libxkbcommon
libxslt
lz4
+ m4
meson
pam
pkgconfig
@@ -63,6 +64,7 @@ BuildPackages=
python-lxml
qrencode
xz
+# TODO use libidn2 once it's available in official repositories
Packages=
- libidn2
+ libidn
diff --git a/.mkosi/mkosi.debian b/.mkosi/mkosi.debian
index c41fc1d419..1a3b517d0f 100644
--- a/.mkosi/mkosi.debian
+++ b/.mkosi/mkosi.debian
@@ -65,6 +65,7 @@ BuildPackages=
libsmartcols-dev
libtool
libxkbcommon-dev
+ m4
meson
pkg-config
python3
diff --git a/.mkosi/mkosi.fedora b/.mkosi/mkosi.fedora
index c38ee7e6d3..4cfdcb0b36 100644
--- a/.mkosi/mkosi.fedora
+++ b/.mkosi/mkosi.fedora
@@ -62,6 +62,7 @@ BuildPackages=
libxslt
lz4
lz4-devel
+ m4
meson
pam-devel
pkgconfig
diff --git a/DISTRO_PORTING b/DISTRO_PORTING
index 68107e46c9..d1a187aa41 100644
--- a/DISTRO_PORTING
+++ b/DISTRO_PORTING
@@ -6,29 +6,29 @@ HOWTO:
1) Find the right configure parameters for:
- --with-rootprefix=
- --with-sysvinit-path=
- --with-sysvrcnd-path=
- --with-rc-local-script-path-start=
- --with-rc-local-script-path-stop=
- --with-kbd-loadkeys=
- --with-kbd-setfont=
- --with-tty-gid=
- --with-ntp-servers=
- --with-support-url=
+ -D rootprefix=
+ -D sysvinit-path=
+ -D sysvrcnd-path=
+ -D rc-local=
+ -D halt-local=
+ -D loadkeys-path=
+ -D setfont-path=
+ -D tty-gid=
+ -D ntp-servers=
+ -D dns-servers=
+ -D support-url=
2) Try it out. Play around (as an ordinary user) with
'/usr/lib/systemd/systemd --test --system' for a test run
of systemd without booting. This will read the unit files and
print the initial transaction it would execute during boot-up.
- This will also inform you about ordering loops and suchlike
+ This will also inform you about ordering loops and suchlike.
NTP POOL:
-
- By default, timesyncd uses the Google Public NTP servers
- time[1-4].google.com. They serve time that uses a leap second
- smear, and can be up to .5s off from servers that use stepped
- leap seconds.
+ By default, systemd-timesyncd uses the Google Public NTP servers
+ time[1-4].google.com, if no other NTP configuration is available. They
+ serve time that uses a leap second smear, and can be up to .5s off from
+ servers that use stepped leap seconds.
https://developers.google.com/time/smear
@@ -39,6 +39,17 @@ NTP POOL:
http://www.pool.ntp.org/en/vendors.html
+ Use -D ntp-servers= to direct systemd-timesyncd to different fallback
+ NTP servers.
+
+DNS SERVERS:
+ By default, systemd-resolved uses the Google Public DNS servers
+ 8.8.8.8, 8.8.4.4, 2001:4860:4860::8888, 2001:4860:4860::8844 as
+ fallback, if no other DNS configuration is available.
+
+ Use -D dns-servers= to direct systemd-resolved to different fallback
+ DNS servers.
+
PAM:
The default PAM config shipped by systemd is really bare bones.
It does not include many modules your distro might want to enable
@@ -46,17 +57,15 @@ PAM:
/etc/security/limits.conf will not be read unless you load pam_limits.
Make sure you add modules your distro expects from user services.
- Pass --with-pamconfdir=no to ./configure to avoid installing this file
- and instead install your own.
+ Pass -D pamconfdir=no to meson to avoid installing this file and
+ instead install your own.
CONTRIBUTING UPSTREAM:
-
- We generally do no longer accept distribution-specific
- patches to systemd upstream. If you have to make changes to
- systemd's source code to make it work on your distribution,
- unless your code is generic enough to be generally useful, we
- are unlikely to merge it. Please always consider adopting the
- upstream defaults. If that is not possible, please maintain
- the relevant patches downstream.
+ We generally do no longer accept distribution-specific patches to
+ systemd upstream. If you have to make changes to systemd's source code
+ to make it work on your distribution, unless your code is generic
+ enough to be generally useful, we are unlikely to merge it. Please
+ always consider adopting the upstream defaults. If that is not
+ possible, please maintain the relevant patches downstream.
Thank you for understanding.
diff --git a/HACKING b/HACKING
index 193cff13f7..d9d2043821 100644
--- a/HACKING
+++ b/HACKING
@@ -56,15 +56,17 @@ for systemd (this example is for Fedora):
$ git clone https://github.com/systemd/systemd.git
$ cd systemd
$ vim src/core/main.c # or wherever you'd like to make your changes
- $ ./autogen.sh c # configure the source tree
- $ make -j `nproc` # build it locally, see if everything compiles fine
- $ make -j `nproc` check # run some simple regression tests
+ $ meson build # configure the build
+ $ ninja -C build # build it locally, see if everything compiles fine
+ $ ninja -C build test # run some simple regression tests
$ sudo mkosi # build a test image
$ sudo systemd-nspawn -bi image.raw # boot up the test image
$ git add -p # interactively put together your patch
$ git commit # commit it
- $ ...
+ $ git push REMOTE HEAD:refs/heads/BRANCH
+ # where REMOTE is your "fork" on github
+ # and BRANCH is a branch name.
-And after that, please submit your branch as PR to systemd via github.
+And after that, head over to your repo on github and click "Compare & pull request"
Happy hacking!
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000000..09222128cd
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,5 @@
+all:
+ ninja -C build
+
+install:
+ DESTDIR=$(DESTDIR) ninja -C build
diff --git a/Makefile-man.am b/Makefile-man.am
deleted file mode 100644
index d51236ed56..0000000000
--- a/Makefile-man.am
+++ /dev/null
@@ -1,2910 +0,0 @@
-# Do not edit. Generated by make-man-rules.py.
-# To regenerate:
-# 1. Create, update, or remove source .xml files in man/
-# 2. Run 'make update-man-list'
-# 3. Run 'make man' to generate manpages
-#
-# To make a man page conditional on a configure switch add
-# attribute conditional="ENABLE_WHAT" or conditional="WITH_WHAT"
-# to <refentry> element.
-MANPAGES += \
- man/bootup.7 \
- man/busctl.1 \
- man/daemon.7 \
- man/file-hierarchy.7 \
- man/halt.8 \
- man/hostname.5 \
- man/journalctl.1 \
- man/journald.conf.5 \
- man/kernel-command-line.7 \
- man/kernel-install.8 \
- man/libudev.3 \
- man/locale.conf.5 \
- man/localtime.5 \
- man/machine-id.5 \
- man/machine-info.5 \
- man/os-release.5 \
- man/sd-bus-errors.3 \
- man/sd-bus.3 \
- man/sd-daemon.3 \
- man/sd-event.3 \
- man/sd-id128.3 \
- man/sd-journal.3 \
- man/sd_booted.3 \
- man/sd_bus_add_match.3 \
- man/sd_bus_creds_get_pid.3 \
- man/sd_bus_creds_new_from_pid.3 \
- man/sd_bus_default.3 \
- man/sd_bus_error.3 \
- man/sd_bus_error_add_map.3 \
- man/sd_bus_get_fd.3 \
- man/sd_bus_message_append.3 \
- man/sd_bus_message_append_array.3 \
- man/sd_bus_message_append_basic.3 \
- man/sd_bus_message_append_string_memfd.3 \
- man/sd_bus_message_append_strv.3 \
- man/sd_bus_message_get_cookie.3 \
- man/sd_bus_message_get_monotonic_usec.3 \
- man/sd_bus_message_read_basic.3 \
- man/sd_bus_negotiate_fds.3 \
- man/sd_bus_new.3 \
- man/sd_bus_path_encode.3 \
- man/sd_bus_process.3 \
- man/sd_bus_request_name.3 \
- man/sd_bus_track_add_name.3 \
- man/sd_bus_track_new.3 \
- man/sd_event_add_child.3 \
- man/sd_event_add_defer.3 \
- man/sd_event_add_io.3 \
- man/sd_event_add_signal.3 \
- man/sd_event_add_time.3 \
- man/sd_event_exit.3 \
- man/sd_event_get_fd.3 \
- man/sd_event_new.3 \
- man/sd_event_now.3 \
- man/sd_event_run.3 \
- man/sd_event_set_watchdog.3 \
- man/sd_event_source_get_event.3 \
- man/sd_event_source_get_pending.3 \
- man/sd_event_source_set_description.3 \
- man/sd_event_source_set_enabled.3 \
- man/sd_event_source_set_prepare.3 \
- man/sd_event_source_set_priority.3 \
- man/sd_event_source_set_userdata.3 \
- man/sd_event_source_unref.3 \
- man/sd_event_wait.3 \
- man/sd_id128_get_machine.3 \
- man/sd_id128_randomize.3 \
- man/sd_id128_to_string.3 \
- man/sd_is_fifo.3 \
- man/sd_journal_add_match.3 \
- man/sd_journal_enumerate_fields.3 \
- man/sd_journal_get_catalog.3 \
- man/sd_journal_get_cursor.3 \
- man/sd_journal_get_cutoff_realtime_usec.3 \
- man/sd_journal_get_data.3 \
- man/sd_journal_get_fd.3 \
- man/sd_journal_get_realtime_usec.3 \
- man/sd_journal_get_usage.3 \
- man/sd_journal_has_runtime_files.3 \
- man/sd_journal_next.3 \
- man/sd_journal_open.3 \
- man/sd_journal_print.3 \
- man/sd_journal_query_unique.3 \
- man/sd_journal_seek_head.3 \
- man/sd_journal_stream_fd.3 \
- man/sd_listen_fds.3 \
- man/sd_machine_get_class.3 \
- man/sd_notify.3 \
- man/sd_watchdog_enabled.3 \
- man/shutdown.8 \
- man/sysctl.d.5 \
- man/systemctl.1 \
- man/systemd-analyze.1 \
- man/systemd-ask-password-console.service.8 \
- man/systemd-ask-password.1 \
- man/systemd-cat.1 \
- man/systemd-cgls.1 \
- man/systemd-cgtop.1 \
- man/systemd-debug-generator.8 \
- man/systemd-delta.1 \
- man/systemd-detect-virt.1 \
- man/systemd-escape.1 \
- man/systemd-fsck@.service.8 \
- man/systemd-fstab-generator.8 \
- man/systemd-getty-generator.8 \
- man/systemd-gpt-auto-generator.8 \
- man/systemd-halt.service.8 \
- man/systemd-inhibit.1 \
- man/systemd-initctl.service.8 \
- man/systemd-journald.service.8 \
- man/systemd-machine-id-commit.service.8 \
- man/systemd-machine-id-setup.1 \
- man/systemd-mount.1 \
- man/systemd-notify.1 \
- man/systemd-nspawn.1 \
- man/systemd-path.1 \
- man/systemd-remount-fs.service.8 \
- man/systemd-run.1 \
- man/systemd-sleep.conf.5 \
- man/systemd-socket-activate.1 \
- man/systemd-socket-proxyd.8 \
- man/systemd-suspend.service.8 \
- man/systemd-sysctl.service.8 \
- man/systemd-system-update-generator.8 \
- man/systemd-system.conf.5 \
- man/systemd-sysusers.8 \
- man/systemd-tmpfiles.8 \
- man/systemd-tty-ask-password-agent.1 \
- man/systemd-udevd.service.8 \
- man/systemd-update-done.service.8 \
- man/systemd-volatile-root.service.8 \
- man/systemd.1 \
- man/systemd.automount.5 \
- man/systemd.device.5 \
- man/systemd.exec.5 \
- man/systemd.generator.7 \
- man/systemd.journal-fields.7 \
- man/systemd.kill.5 \
- man/systemd.link.5 \
- man/systemd.mount.5 \
- man/systemd.nspawn.5 \
- man/systemd.offline-updates.7 \
- man/systemd.path.5 \
- man/systemd.preset.5 \
- man/systemd.resource-control.5 \
- man/systemd.scope.5 \
- man/systemd.service.5 \
- man/systemd.slice.5 \
- man/systemd.socket.5 \
- man/systemd.special.7 \
- man/systemd.swap.5 \
- man/systemd.target.5 \
- man/systemd.time.7 \
- man/systemd.timer.5 \
- man/systemd.unit.5 \
- man/telinit.8 \
- man/tmpfiles.d.5 \
- man/udev.7 \
- man/udev.conf.5 \
- man/udev_device_get_syspath.3 \
- man/udev_device_has_tag.3 \
- man/udev_device_new_from_syspath.3 \
- man/udev_enumerate_add_match_subsystem.3 \
- man/udev_enumerate_new.3 \
- man/udev_enumerate_scan_devices.3 \
- man/udev_list_entry.3 \
- man/udev_monitor_filter_update.3 \
- man/udev_monitor_new_from_netlink.3 \
- man/udev_monitor_receive_device.3 \
- man/udev_new.3 \
- man/udevadm.8
-MANPAGES_ALIAS += \
- man/SD_ALERT.3 \
- man/SD_BUS_ERROR_ACCESS_DENIED.3 \
- man/SD_BUS_ERROR_ADDRESS_IN_USE.3 \
- man/SD_BUS_ERROR_AUTH_FAILED.3 \
- man/SD_BUS_ERROR_BAD_ADDRESS.3 \
- man/SD_BUS_ERROR_DISCONNECTED.3 \
- man/SD_BUS_ERROR_END.3 \
- man/SD_BUS_ERROR_FAILED.3 \
- man/SD_BUS_ERROR_FILE_EXISTS.3 \
- man/SD_BUS_ERROR_FILE_NOT_FOUND.3 \
- man/SD_BUS_ERROR_INCONSISTENT_MESSAGE.3 \
- man/SD_BUS_ERROR_INTERACTIVE_AUTHORIZATION_REQUIRED.3 \
- man/SD_BUS_ERROR_INVALID_ARGS.3 \
- man/SD_BUS_ERROR_INVALID_SIGNATURE.3 \
- man/SD_BUS_ERROR_IO_ERROR.3 \
- man/SD_BUS_ERROR_LIMITS_EXCEEDED.3 \
- man/SD_BUS_ERROR_MAKE_CONST.3 \
- man/SD_BUS_ERROR_MAP.3 \
- man/SD_BUS_ERROR_MATCH_RULE_INVALID.3 \
- man/SD_BUS_ERROR_MATCH_RULE_NOT_FOUND.3 \
- man/SD_BUS_ERROR_NAME_HAS_NO_OWNER.3 \
- man/SD_BUS_ERROR_NOT_SUPPORTED.3 \
- man/SD_BUS_ERROR_NO_MEMORY.3 \
- man/SD_BUS_ERROR_NO_NETWORK.3 \
- man/SD_BUS_ERROR_NO_REPLY.3 \
- man/SD_BUS_ERROR_NO_SERVER.3 \
- man/SD_BUS_ERROR_NULL.3 \
- man/SD_BUS_ERROR_PROPERTY_READ_ONLY.3 \
- man/SD_BUS_ERROR_SERVICE_UNKNOWN.3 \
- man/SD_BUS_ERROR_TIMEOUT.3 \
- man/SD_BUS_ERROR_UNIX_PROCESS_ID_UNKNOWN.3 \
- man/SD_BUS_ERROR_UNKNOWN_INTERFACE.3 \
- man/SD_BUS_ERROR_UNKNOWN_METHOD.3 \
- man/SD_BUS_ERROR_UNKNOWN_OBJECT.3 \
- man/SD_BUS_ERROR_UNKNOWN_PROPERTY.3 \
- man/SD_CRIT.3 \
- man/SD_DEBUG.3 \
- man/SD_EMERG.3 \
- man/SD_ERR.3 \
- man/SD_EVENT_ARMED.3 \
- man/SD_EVENT_EXITING.3 \
- man/SD_EVENT_FINISHED.3 \
- man/SD_EVENT_INITIAL.3 \
- man/SD_EVENT_OFF.3 \
- man/SD_EVENT_ON.3 \
- man/SD_EVENT_ONESHOT.3 \
- man/SD_EVENT_PENDING.3 \
- man/SD_EVENT_PREPARING.3 \
- man/SD_EVENT_PRIORITY_IDLE.3 \
- man/SD_EVENT_PRIORITY_IMPORTANT.3 \
- man/SD_EVENT_PRIORITY_NORMAL.3 \
- man/SD_EVENT_RUNNING.3 \
- man/SD_ID128_CONST_STR.3 \
- man/SD_ID128_FORMAT_STR.3 \
- man/SD_ID128_FORMAT_VAL.3 \
- man/SD_ID128_MAKE.3 \
- man/SD_ID128_MAKE_STR.3 \
- man/SD_ID128_NULL.3 \
- man/SD_INFO.3 \
- man/SD_JOURNAL_APPEND.3 \
- man/SD_JOURNAL_CURRENT_USER.3 \
- man/SD_JOURNAL_FOREACH.3 \
- man/SD_JOURNAL_FOREACH_BACKWARDS.3 \
- man/SD_JOURNAL_FOREACH_DATA.3 \
- man/SD_JOURNAL_FOREACH_FIELD.3 \
- man/SD_JOURNAL_FOREACH_UNIQUE.3 \
- man/SD_JOURNAL_INVALIDATE.3 \
- man/SD_JOURNAL_LOCAL_ONLY.3 \
- man/SD_JOURNAL_NOP.3 \
- man/SD_JOURNAL_OS_ROOT.3 \
- man/SD_JOURNAL_RUNTIME_ONLY.3 \
- man/SD_JOURNAL_SUPPRESS_LOCATION.3 \
- man/SD_JOURNAL_SYSTEM.3 \
- man/SD_LISTEN_FDS_START.3 \
- man/SD_NOTICE.3 \
- man/SD_WARNING.3 \
- man/init.1 \
- man/journald.conf.d.5 \
- man/poweroff.8 \
- man/reboot.8 \
- man/sd_bus_creds_get_audit_login_uid.3 \
- man/sd_bus_creds_get_audit_session_id.3 \
- man/sd_bus_creds_get_augmented_mask.3 \
- man/sd_bus_creds_get_cgroup.3 \
- man/sd_bus_creds_get_cmdline.3 \
- man/sd_bus_creds_get_comm.3 \
- man/sd_bus_creds_get_description.3 \
- man/sd_bus_creds_get_egid.3 \
- man/sd_bus_creds_get_euid.3 \
- man/sd_bus_creds_get_exe.3 \
- man/sd_bus_creds_get_fsgid.3 \
- man/sd_bus_creds_get_fsuid.3 \
- man/sd_bus_creds_get_gid.3 \
- man/sd_bus_creds_get_mask.3 \
- man/sd_bus_creds_get_owner_uid.3 \
- man/sd_bus_creds_get_ppid.3 \
- man/sd_bus_creds_get_selinux_context.3 \
- man/sd_bus_creds_get_session.3 \
- man/sd_bus_creds_get_sgid.3 \
- man/sd_bus_creds_get_slice.3 \
- man/sd_bus_creds_get_suid.3 \
- man/sd_bus_creds_get_supplementary_gids.3 \
- man/sd_bus_creds_get_tid.3 \
- man/sd_bus_creds_get_tid_comm.3 \
- man/sd_bus_creds_get_tty.3 \
- man/sd_bus_creds_get_uid.3 \
- man/sd_bus_creds_get_unique_name.3 \
- man/sd_bus_creds_get_unit.3 \
- man/sd_bus_creds_get_user_slice.3 \
- man/sd_bus_creds_get_user_unit.3 \
- man/sd_bus_creds_get_well_known_names.3 \
- man/sd_bus_creds_has_bounding_cap.3 \
- man/sd_bus_creds_has_effective_cap.3 \
- man/sd_bus_creds_has_inheritable_cap.3 \
- man/sd_bus_creds_has_permitted_cap.3 \
- man/sd_bus_creds_ref.3 \
- man/sd_bus_creds_unref.3 \
- man/sd_bus_creds_unrefp.3 \
- man/sd_bus_default_system.3 \
- man/sd_bus_default_user.3 \
- man/sd_bus_error_copy.3 \
- man/sd_bus_error_free.3 \
- man/sd_bus_error_get_errno.3 \
- man/sd_bus_error_has_name.3 \
- man/sd_bus_error_is_set.3 \
- man/sd_bus_error_map.3 \
- man/sd_bus_error_set.3 \
- man/sd_bus_error_set_const.3 \
- man/sd_bus_error_set_errno.3 \
- man/sd_bus_error_set_errnof.3 \
- man/sd_bus_error_set_errnofv.3 \
- man/sd_bus_error_setf.3 \
- man/sd_bus_message_append_array_iovec.3 \
- man/sd_bus_message_append_array_memfd.3 \
- man/sd_bus_message_append_array_space.3 \
- man/sd_bus_message_append_string_iovec.3 \
- man/sd_bus_message_append_string_space.3 \
- man/sd_bus_message_appendv.3 \
- man/sd_bus_message_get_realtime_usec.3 \
- man/sd_bus_message_get_reply_cookie.3 \
- man/sd_bus_message_get_seqnum.3 \
- man/sd_bus_negotiate_creds.3 \
- man/sd_bus_negotiate_timestamp.3 \
- man/sd_bus_open.3 \
- man/sd_bus_open_system.3 \
- man/sd_bus_open_system_machine.3 \
- man/sd_bus_open_system_remote.3 \
- man/sd_bus_open_user.3 \
- man/sd_bus_path_decode.3 \
- man/sd_bus_path_decode_many.3 \
- man/sd_bus_path_encode_many.3 \
- man/sd_bus_ref.3 \
- man/sd_bus_release_name.3 \
- man/sd_bus_track_add_sender.3 \
- man/sd_bus_track_contains.3 \
- man/sd_bus_track_count.3 \
- man/sd_bus_track_count_name.3 \
- man/sd_bus_track_count_sender.3 \
- man/sd_bus_track_first.3 \
- man/sd_bus_track_get_bus.3 \
- man/sd_bus_track_get_recursive.3 \
- man/sd_bus_track_get_userdata.3 \
- man/sd_bus_track_next.3 \
- man/sd_bus_track_ref.3 \
- man/sd_bus_track_remove_name.3 \
- man/sd_bus_track_remove_sender.3 \
- man/sd_bus_track_set_recursive.3 \
- man/sd_bus_track_set_userdata.3 \
- man/sd_bus_track_unref.3 \
- man/sd_bus_track_unrefp.3 \
- man/sd_bus_unref.3 \
- man/sd_bus_unrefp.3 \
- man/sd_event.3 \
- man/sd_event_add_exit.3 \
- man/sd_event_add_post.3 \
- man/sd_event_child_handler_t.3 \
- man/sd_event_default.3 \
- man/sd_event_dispatch.3 \
- man/sd_event_get_exit_code.3 \
- man/sd_event_get_iteration.3 \
- man/sd_event_get_state.3 \
- man/sd_event_get_tid.3 \
- man/sd_event_get_watchdog.3 \
- man/sd_event_handler_t.3 \
- man/sd_event_io_handler_t.3 \
- man/sd_event_loop.3 \
- man/sd_event_prepare.3 \
- man/sd_event_ref.3 \
- man/sd_event_signal_handler_t.3 \
- man/sd_event_source.3 \
- man/sd_event_source_get_child_pid.3 \
- man/sd_event_source_get_description.3 \
- man/sd_event_source_get_enabled.3 \
- man/sd_event_source_get_io_events.3 \
- man/sd_event_source_get_io_fd.3 \
- man/sd_event_source_get_io_revents.3 \
- man/sd_event_source_get_priority.3 \
- man/sd_event_source_get_signal.3 \
- man/sd_event_source_get_time.3 \
- man/sd_event_source_get_time_accuracy.3 \
- man/sd_event_source_get_time_clock.3 \
- man/sd_event_source_get_userdata.3 \
- man/sd_event_source_ref.3 \
- man/sd_event_source_set_io_events.3 \
- man/sd_event_source_set_io_fd.3 \
- man/sd_event_source_set_time.3 \
- man/sd_event_source_set_time_accuracy.3 \
- man/sd_event_source_unrefp.3 \
- man/sd_event_time_handler_t.3 \
- man/sd_event_unref.3 \
- man/sd_event_unrefp.3 \
- man/sd_id128_equal.3 \
- man/sd_id128_from_string.3 \
- man/sd_id128_get_boot.3 \
- man/sd_id128_get_invocation.3 \
- man/sd_id128_get_machine_app_specific.3 \
- man/sd_id128_is_null.3 \
- man/sd_id128_t.3 \
- man/sd_is_mq.3 \
- man/sd_is_socket.3 \
- man/sd_is_socket_inet.3 \
- man/sd_is_socket_sockaddr.3 \
- man/sd_is_socket_unix.3 \
- man/sd_is_special.3 \
- man/sd_journal.3 \
- man/sd_journal_add_conjunction.3 \
- man/sd_journal_add_disjunction.3 \
- man/sd_journal_close.3 \
- man/sd_journal_enumerate_data.3 \
- man/sd_journal_enumerate_unique.3 \
- man/sd_journal_flush_matches.3 \
- man/sd_journal_get_catalog_for_message_id.3 \
- man/sd_journal_get_cutoff_monotonic_usec.3 \
- man/sd_journal_get_data_threshold.3 \
- man/sd_journal_get_events.3 \
- man/sd_journal_get_monotonic_usec.3 \
- man/sd_journal_get_timeout.3 \
- man/sd_journal_has_persistent_files.3 \
- man/sd_journal_next_skip.3 \
- man/sd_journal_open_directory.3 \
- man/sd_journal_open_directory_fd.3 \
- man/sd_journal_open_files.3 \
- man/sd_journal_open_files_fd.3 \
- man/sd_journal_perror.3 \
- man/sd_journal_previous.3 \
- man/sd_journal_previous_skip.3 \
- man/sd_journal_printv.3 \
- man/sd_journal_process.3 \
- man/sd_journal_reliable_fd.3 \
- man/sd_journal_restart_data.3 \
- man/sd_journal_restart_fields.3 \
- man/sd_journal_restart_unique.3 \
- man/sd_journal_seek_cursor.3 \
- man/sd_journal_seek_monotonic_usec.3 \
- man/sd_journal_seek_realtime_usec.3 \
- man/sd_journal_seek_tail.3 \
- man/sd_journal_send.3 \
- man/sd_journal_sendv.3 \
- man/sd_journal_set_data_threshold.3 \
- man/sd_journal_test_cursor.3 \
- man/sd_journal_wait.3 \
- man/sd_listen_fds_with_names.3 \
- man/sd_machine_get_ifindices.3 \
- man/sd_notifyf.3 \
- man/sd_pid_notify.3 \
- man/sd_pid_notify_with_fds.3 \
- man/sd_pid_notifyf.3 \
- man/sleep.conf.d.5 \
- man/system.conf.d.5 \
- man/systemd-ask-password-console.path.8 \
- man/systemd-ask-password-wall.path.8 \
- man/systemd-ask-password-wall.service.8 \
- man/systemd-fsck-root.service.8 \
- man/systemd-fsck.8 \
- man/systemd-hibernate.service.8 \
- man/systemd-hybrid-sleep.service.8 \
- man/systemd-initctl.8 \
- man/systemd-initctl.socket.8 \
- man/systemd-journald-audit.socket.8 \
- man/systemd-journald-dev-log.socket.8 \
- man/systemd-journald.8 \
- man/systemd-journald.socket.8 \
- man/systemd-kexec.service.8 \
- man/systemd-poweroff.service.8 \
- man/systemd-reboot.service.8 \
- man/systemd-remount-fs.8 \
- man/systemd-shutdown.8 \
- man/systemd-sleep.8 \
- man/systemd-sysctl.8 \
- man/systemd-sysusers.service.8 \
- man/systemd-tmpfiles-clean.service.8 \
- man/systemd-tmpfiles-clean.timer.8 \
- man/systemd-tmpfiles-setup-dev.service.8 \
- man/systemd-tmpfiles-setup.service.8 \
- man/systemd-udevd-control.socket.8 \
- man/systemd-udevd-kernel.socket.8 \
- man/systemd-udevd.8 \
- man/systemd-umount.1 \
- man/systemd-update-done.8 \
- man/systemd-user.conf.5 \
- man/systemd-volatile-root.8 \
- man/udev_device_get_action.3 \
- man/udev_device_get_devlinks_list_entry.3 \
- man/udev_device_get_devnode.3 \
- man/udev_device_get_devnum.3 \
- man/udev_device_get_devpath.3 \
- man/udev_device_get_devtype.3 \
- man/udev_device_get_driver.3 \
- man/udev_device_get_is_initialized.3 \
- man/udev_device_get_parent.3 \
- man/udev_device_get_parent_with_subsystem_devtype.3 \
- man/udev_device_get_properties_list_entry.3 \
- man/udev_device_get_property_value.3 \
- man/udev_device_get_subsystem.3 \
- man/udev_device_get_sysattr_list_entry.3 \
- man/udev_device_get_sysattr_value.3 \
- man/udev_device_get_sysname.3 \
- man/udev_device_get_sysnum.3 \
- man/udev_device_get_tags_list_entry.3 \
- man/udev_device_get_udev.3 \
- man/udev_device_new_from_device_id.3 \
- man/udev_device_new_from_devnum.3 \
- man/udev_device_new_from_environment.3 \
- man/udev_device_new_from_subsystem_sysname.3 \
- man/udev_device_ref.3 \
- man/udev_device_set_sysattr_value.3 \
- man/udev_device_unref.3 \
- man/udev_enumerate_add_match_is_initialized.3 \
- man/udev_enumerate_add_match_parent.3 \
- man/udev_enumerate_add_match_property.3 \
- man/udev_enumerate_add_match_sysattr.3 \
- man/udev_enumerate_add_match_sysname.3 \
- man/udev_enumerate_add_match_tag.3 \
- man/udev_enumerate_add_nomatch_subsystem.3 \
- man/udev_enumerate_add_nomatch_sysattr.3 \
- man/udev_enumerate_add_syspath.3 \
- man/udev_enumerate_get_list_entry.3 \
- man/udev_enumerate_get_udev.3 \
- man/udev_enumerate_ref.3 \
- man/udev_enumerate_scan_subsystems.3 \
- man/udev_enumerate_unref.3 \
- man/udev_list_entry_get_by_name.3 \
- man/udev_list_entry_get_name.3 \
- man/udev_list_entry_get_next.3 \
- man/udev_list_entry_get_value.3 \
- man/udev_monitor_enable_receiving.3 \
- man/udev_monitor_filter_add_match_subsystem_devtype.3 \
- man/udev_monitor_filter_add_match_tag.3 \
- man/udev_monitor_filter_remove.3 \
- man/udev_monitor_get_fd.3 \
- man/udev_monitor_get_udev.3 \
- man/udev_monitor_ref.3 \
- man/udev_monitor_set_receive_buffer_size.3 \
- man/udev_monitor_unref.3 \
- man/udev_ref.3 \
- man/udev_unref.3 \
- man/user.conf.d.5
-man/SD_ALERT.3: man/sd-daemon.3
-man/SD_BUS_ERROR_ACCESS_DENIED.3: man/sd-bus-errors.3
-man/SD_BUS_ERROR_ADDRESS_IN_USE.3: man/sd-bus-errors.3
-man/SD_BUS_ERROR_AUTH_FAILED.3: man/sd-bus-errors.3
-man/SD_BUS_ERROR_BAD_ADDRESS.3: man/sd-bus-errors.3
-man/SD_BUS_ERROR_DISCONNECTED.3: man/sd-bus-errors.3
-man/SD_BUS_ERROR_END.3: man/sd_bus_error_add_map.3
-man/SD_BUS_ERROR_FAILED.3: man/sd-bus-errors.3
-man/SD_BUS_ERROR_FILE_EXISTS.3: man/sd-bus-errors.3
-man/SD_BUS_ERROR_FILE_NOT_FOUND.3: man/sd-bus-errors.3
-man/SD_BUS_ERROR_INCONSISTENT_MESSAGE.3: man/sd-bus-errors.3
-man/SD_BUS_ERROR_INTERACTIVE_AUTHORIZATION_REQUIRED.3: man/sd-bus-errors.3
-man/SD_BUS_ERROR_INVALID_ARGS.3: man/sd-bus-errors.3
-man/SD_BUS_ERROR_INVALID_SIGNATURE.3: man/sd-bus-errors.3
-man/SD_BUS_ERROR_IO_ERROR.3: man/sd-bus-errors.3
-man/SD_BUS_ERROR_LIMITS_EXCEEDED.3: man/sd-bus-errors.3
-man/SD_BUS_ERROR_MAKE_CONST.3: man/sd_bus_error.3
-man/SD_BUS_ERROR_MAP.3: man/sd_bus_error_add_map.3
-man/SD_BUS_ERROR_MATCH_RULE_INVALID.3: man/sd-bus-errors.3
-man/SD_BUS_ERROR_MATCH_RULE_NOT_FOUND.3: man/sd-bus-errors.3
-man/SD_BUS_ERROR_NAME_HAS_NO_OWNER.3: man/sd-bus-errors.3
-man/SD_BUS_ERROR_NOT_SUPPORTED.3: man/sd-bus-errors.3
-man/SD_BUS_ERROR_NO_MEMORY.3: man/sd-bus-errors.3
-man/SD_BUS_ERROR_NO_NETWORK.3: man/sd-bus-errors.3
-man/SD_BUS_ERROR_NO_REPLY.3: man/sd-bus-errors.3
-man/SD_BUS_ERROR_NO_SERVER.3: man/sd-bus-errors.3
-man/SD_BUS_ERROR_NULL.3: man/sd_bus_error.3
-man/SD_BUS_ERROR_PROPERTY_READ_ONLY.3: man/sd-bus-errors.3
-man/SD_BUS_ERROR_SERVICE_UNKNOWN.3: man/sd-bus-errors.3
-man/SD_BUS_ERROR_TIMEOUT.3: man/sd-bus-errors.3
-man/SD_BUS_ERROR_UNIX_PROCESS_ID_UNKNOWN.3: man/sd-bus-errors.3
-man/SD_BUS_ERROR_UNKNOWN_INTERFACE.3: man/sd-bus-errors.3
-man/SD_BUS_ERROR_UNKNOWN_METHOD.3: man/sd-bus-errors.3
-man/SD_BUS_ERROR_UNKNOWN_OBJECT.3: man/sd-bus-errors.3
-man/SD_BUS_ERROR_UNKNOWN_PROPERTY.3: man/sd-bus-errors.3
-man/SD_CRIT.3: man/sd-daemon.3
-man/SD_DEBUG.3: man/sd-daemon.3
-man/SD_EMERG.3: man/sd-daemon.3
-man/SD_ERR.3: man/sd-daemon.3
-man/SD_EVENT_ARMED.3: man/sd_event_wait.3
-man/SD_EVENT_EXITING.3: man/sd_event_wait.3
-man/SD_EVENT_FINISHED.3: man/sd_event_wait.3
-man/SD_EVENT_INITIAL.3: man/sd_event_wait.3
-man/SD_EVENT_OFF.3: man/sd_event_source_set_enabled.3
-man/SD_EVENT_ON.3: man/sd_event_source_set_enabled.3
-man/SD_EVENT_ONESHOT.3: man/sd_event_source_set_enabled.3
-man/SD_EVENT_PENDING.3: man/sd_event_wait.3
-man/SD_EVENT_PREPARING.3: man/sd_event_wait.3
-man/SD_EVENT_PRIORITY_IDLE.3: man/sd_event_source_set_priority.3
-man/SD_EVENT_PRIORITY_IMPORTANT.3: man/sd_event_source_set_priority.3
-man/SD_EVENT_PRIORITY_NORMAL.3: man/sd_event_source_set_priority.3
-man/SD_EVENT_RUNNING.3: man/sd_event_wait.3
-man/SD_ID128_CONST_STR.3: man/sd-id128.3
-man/SD_ID128_FORMAT_STR.3: man/sd-id128.3
-man/SD_ID128_FORMAT_VAL.3: man/sd-id128.3
-man/SD_ID128_MAKE.3: man/sd-id128.3
-man/SD_ID128_MAKE_STR.3: man/sd-id128.3
-man/SD_ID128_NULL.3: man/sd-id128.3
-man/SD_INFO.3: man/sd-daemon.3
-man/SD_JOURNAL_APPEND.3: man/sd_journal_get_fd.3
-man/SD_JOURNAL_CURRENT_USER.3: man/sd_journal_open.3
-man/SD_JOURNAL_FOREACH.3: man/sd_journal_next.3
-man/SD_JOURNAL_FOREACH_BACKWARDS.3: man/sd_journal_next.3
-man/SD_JOURNAL_FOREACH_DATA.3: man/sd_journal_get_data.3
-man/SD_JOURNAL_FOREACH_FIELD.3: man/sd_journal_enumerate_fields.3
-man/SD_JOURNAL_FOREACH_UNIQUE.3: man/sd_journal_query_unique.3
-man/SD_JOURNAL_INVALIDATE.3: man/sd_journal_get_fd.3
-man/SD_JOURNAL_LOCAL_ONLY.3: man/sd_journal_open.3
-man/SD_JOURNAL_NOP.3: man/sd_journal_get_fd.3
-man/SD_JOURNAL_OS_ROOT.3: man/sd_journal_open.3
-man/SD_JOURNAL_RUNTIME_ONLY.3: man/sd_journal_open.3
-man/SD_JOURNAL_SUPPRESS_LOCATION.3: man/sd_journal_print.3
-man/SD_JOURNAL_SYSTEM.3: man/sd_journal_open.3
-man/SD_LISTEN_FDS_START.3: man/sd_listen_fds.3
-man/SD_NOTICE.3: man/sd-daemon.3
-man/SD_WARNING.3: man/sd-daemon.3
-man/init.1: man/systemd.1
-man/journald.conf.d.5: man/journald.conf.5
-man/poweroff.8: man/halt.8
-man/reboot.8: man/halt.8
-man/sd_bus_creds_get_audit_login_uid.3: man/sd_bus_creds_get_pid.3
-man/sd_bus_creds_get_audit_session_id.3: man/sd_bus_creds_get_pid.3
-man/sd_bus_creds_get_augmented_mask.3: man/sd_bus_creds_new_from_pid.3
-man/sd_bus_creds_get_cgroup.3: man/sd_bus_creds_get_pid.3
-man/sd_bus_creds_get_cmdline.3: man/sd_bus_creds_get_pid.3
-man/sd_bus_creds_get_comm.3: man/sd_bus_creds_get_pid.3
-man/sd_bus_creds_get_description.3: man/sd_bus_creds_get_pid.3
-man/sd_bus_creds_get_egid.3: man/sd_bus_creds_get_pid.3
-man/sd_bus_creds_get_euid.3: man/sd_bus_creds_get_pid.3
-man/sd_bus_creds_get_exe.3: man/sd_bus_creds_get_pid.3
-man/sd_bus_creds_get_fsgid.3: man/sd_bus_creds_get_pid.3
-man/sd_bus_creds_get_fsuid.3: man/sd_bus_creds_get_pid.3
-man/sd_bus_creds_get_gid.3: man/sd_bus_creds_get_pid.3
-man/sd_bus_creds_get_mask.3: man/sd_bus_creds_new_from_pid.3
-man/sd_bus_creds_get_owner_uid.3: man/sd_bus_creds_get_pid.3
-man/sd_bus_creds_get_ppid.3: man/sd_bus_creds_get_pid.3
-man/sd_bus_creds_get_selinux_context.3: man/sd_bus_creds_get_pid.3
-man/sd_bus_creds_get_session.3: man/sd_bus_creds_get_pid.3
-man/sd_bus_creds_get_sgid.3: man/sd_bus_creds_get_pid.3
-man/sd_bus_creds_get_slice.3: man/sd_bus_creds_get_pid.3
-man/sd_bus_creds_get_suid.3: man/sd_bus_creds_get_pid.3
-man/sd_bus_creds_get_supplementary_gids.3: man/sd_bus_creds_get_pid.3
-man/sd_bus_creds_get_tid.3: man/sd_bus_creds_get_pid.3
-man/sd_bus_creds_get_tid_comm.3: man/sd_bus_creds_get_pid.3
-man/sd_bus_creds_get_tty.3: man/sd_bus_creds_get_pid.3
-man/sd_bus_creds_get_uid.3: man/sd_bus_creds_get_pid.3
-man/sd_bus_creds_get_unique_name.3: man/sd_bus_creds_get_pid.3
-man/sd_bus_creds_get_unit.3: man/sd_bus_creds_get_pid.3
-man/sd_bus_creds_get_user_slice.3: man/sd_bus_creds_get_pid.3
-man/sd_bus_creds_get_user_unit.3: man/sd_bus_creds_get_pid.3
-man/sd_bus_creds_get_well_known_names.3: man/sd_bus_creds_get_pid.3
-man/sd_bus_creds_has_bounding_cap.3: man/sd_bus_creds_get_pid.3
-man/sd_bus_creds_has_effective_cap.3: man/sd_bus_creds_get_pid.3
-man/sd_bus_creds_has_inheritable_cap.3: man/sd_bus_creds_get_pid.3
-man/sd_bus_creds_has_permitted_cap.3: man/sd_bus_creds_get_pid.3
-man/sd_bus_creds_ref.3: man/sd_bus_creds_new_from_pid.3
-man/sd_bus_creds_unref.3: man/sd_bus_creds_new_from_pid.3
-man/sd_bus_creds_unrefp.3: man/sd_bus_creds_new_from_pid.3
-man/sd_bus_default_system.3: man/sd_bus_default.3
-man/sd_bus_default_user.3: man/sd_bus_default.3
-man/sd_bus_error_copy.3: man/sd_bus_error.3
-man/sd_bus_error_free.3: man/sd_bus_error.3
-man/sd_bus_error_get_errno.3: man/sd_bus_error.3
-man/sd_bus_error_has_name.3: man/sd_bus_error.3
-man/sd_bus_error_is_set.3: man/sd_bus_error.3
-man/sd_bus_error_map.3: man/sd_bus_error_add_map.3
-man/sd_bus_error_set.3: man/sd_bus_error.3
-man/sd_bus_error_set_const.3: man/sd_bus_error.3
-man/sd_bus_error_set_errno.3: man/sd_bus_error.3
-man/sd_bus_error_set_errnof.3: man/sd_bus_error.3
-man/sd_bus_error_set_errnofv.3: man/sd_bus_error.3
-man/sd_bus_error_setf.3: man/sd_bus_error.3
-man/sd_bus_message_append_array_iovec.3: man/sd_bus_message_append_array.3
-man/sd_bus_message_append_array_memfd.3: man/sd_bus_message_append_array.3
-man/sd_bus_message_append_array_space.3: man/sd_bus_message_append_array.3
-man/sd_bus_message_append_string_iovec.3: man/sd_bus_message_append_string_memfd.3
-man/sd_bus_message_append_string_space.3: man/sd_bus_message_append_string_memfd.3
-man/sd_bus_message_appendv.3: man/sd_bus_message_append.3
-man/sd_bus_message_get_realtime_usec.3: man/sd_bus_message_get_monotonic_usec.3
-man/sd_bus_message_get_reply_cookie.3: man/sd_bus_message_get_cookie.3
-man/sd_bus_message_get_seqnum.3: man/sd_bus_message_get_monotonic_usec.3
-man/sd_bus_negotiate_creds.3: man/sd_bus_negotiate_fds.3
-man/sd_bus_negotiate_timestamp.3: man/sd_bus_negotiate_fds.3
-man/sd_bus_open.3: man/sd_bus_default.3
-man/sd_bus_open_system.3: man/sd_bus_default.3
-man/sd_bus_open_system_machine.3: man/sd_bus_default.3
-man/sd_bus_open_system_remote.3: man/sd_bus_default.3
-man/sd_bus_open_user.3: man/sd_bus_default.3
-man/sd_bus_path_decode.3: man/sd_bus_path_encode.3
-man/sd_bus_path_decode_many.3: man/sd_bus_path_encode.3
-man/sd_bus_path_encode_many.3: man/sd_bus_path_encode.3
-man/sd_bus_ref.3: man/sd_bus_new.3
-man/sd_bus_release_name.3: man/sd_bus_request_name.3
-man/sd_bus_track_add_sender.3: man/sd_bus_track_add_name.3
-man/sd_bus_track_contains.3: man/sd_bus_track_add_name.3
-man/sd_bus_track_count.3: man/sd_bus_track_add_name.3
-man/sd_bus_track_count_name.3: man/sd_bus_track_add_name.3
-man/sd_bus_track_count_sender.3: man/sd_bus_track_add_name.3
-man/sd_bus_track_first.3: man/sd_bus_track_add_name.3
-man/sd_bus_track_get_bus.3: man/sd_bus_track_new.3
-man/sd_bus_track_get_recursive.3: man/sd_bus_track_new.3
-man/sd_bus_track_get_userdata.3: man/sd_bus_track_new.3
-man/sd_bus_track_next.3: man/sd_bus_track_add_name.3
-man/sd_bus_track_ref.3: man/sd_bus_track_new.3
-man/sd_bus_track_remove_name.3: man/sd_bus_track_add_name.3
-man/sd_bus_track_remove_sender.3: man/sd_bus_track_add_name.3
-man/sd_bus_track_set_recursive.3: man/sd_bus_track_new.3
-man/sd_bus_track_set_userdata.3: man/sd_bus_track_new.3
-man/sd_bus_track_unref.3: man/sd_bus_track_new.3
-man/sd_bus_track_unrefp.3: man/sd_bus_track_new.3
-man/sd_bus_unref.3: man/sd_bus_new.3
-man/sd_bus_unrefp.3: man/sd_bus_new.3
-man/sd_event.3: man/sd_event_new.3
-man/sd_event_add_exit.3: man/sd_event_add_defer.3
-man/sd_event_add_post.3: man/sd_event_add_defer.3
-man/sd_event_child_handler_t.3: man/sd_event_add_child.3
-man/sd_event_default.3: man/sd_event_new.3
-man/sd_event_dispatch.3: man/sd_event_wait.3
-man/sd_event_get_exit_code.3: man/sd_event_exit.3
-man/sd_event_get_iteration.3: man/sd_event_wait.3
-man/sd_event_get_state.3: man/sd_event_wait.3
-man/sd_event_get_tid.3: man/sd_event_new.3
-man/sd_event_get_watchdog.3: man/sd_event_set_watchdog.3
-man/sd_event_handler_t.3: man/sd_event_add_defer.3
-man/sd_event_io_handler_t.3: man/sd_event_add_io.3
-man/sd_event_loop.3: man/sd_event_run.3
-man/sd_event_prepare.3: man/sd_event_wait.3
-man/sd_event_ref.3: man/sd_event_new.3
-man/sd_event_signal_handler_t.3: man/sd_event_add_signal.3
-man/sd_event_source.3: man/sd_event_add_io.3
-man/sd_event_source_get_child_pid.3: man/sd_event_add_child.3
-man/sd_event_source_get_description.3: man/sd_event_source_set_description.3
-man/sd_event_source_get_enabled.3: man/sd_event_source_set_enabled.3
-man/sd_event_source_get_io_events.3: man/sd_event_add_io.3
-man/sd_event_source_get_io_fd.3: man/sd_event_add_io.3
-man/sd_event_source_get_io_revents.3: man/sd_event_add_io.3
-man/sd_event_source_get_priority.3: man/sd_event_source_set_priority.3
-man/sd_event_source_get_signal.3: man/sd_event_add_signal.3
-man/sd_event_source_get_time.3: man/sd_event_add_time.3
-man/sd_event_source_get_time_accuracy.3: man/sd_event_add_time.3
-man/sd_event_source_get_time_clock.3: man/sd_event_add_time.3
-man/sd_event_source_get_userdata.3: man/sd_event_source_set_userdata.3
-man/sd_event_source_ref.3: man/sd_event_source_unref.3
-man/sd_event_source_set_io_events.3: man/sd_event_add_io.3
-man/sd_event_source_set_io_fd.3: man/sd_event_add_io.3
-man/sd_event_source_set_time.3: man/sd_event_add_time.3
-man/sd_event_source_set_time_accuracy.3: man/sd_event_add_time.3
-man/sd_event_source_unrefp.3: man/sd_event_source_unref.3
-man/sd_event_time_handler_t.3: man/sd_event_add_time.3
-man/sd_event_unref.3: man/sd_event_new.3
-man/sd_event_unrefp.3: man/sd_event_new.3
-man/sd_id128_equal.3: man/sd-id128.3
-man/sd_id128_from_string.3: man/sd_id128_to_string.3
-man/sd_id128_get_boot.3: man/sd_id128_get_machine.3
-man/sd_id128_get_invocation.3: man/sd_id128_get_machine.3
-man/sd_id128_get_machine_app_specific.3: man/sd_id128_get_machine.3
-man/sd_id128_is_null.3: man/sd-id128.3
-man/sd_id128_t.3: man/sd-id128.3
-man/sd_is_mq.3: man/sd_is_fifo.3
-man/sd_is_socket.3: man/sd_is_fifo.3
-man/sd_is_socket_inet.3: man/sd_is_fifo.3
-man/sd_is_socket_sockaddr.3: man/sd_is_fifo.3
-man/sd_is_socket_unix.3: man/sd_is_fifo.3
-man/sd_is_special.3: man/sd_is_fifo.3
-man/sd_journal.3: man/sd_journal_open.3
-man/sd_journal_add_conjunction.3: man/sd_journal_add_match.3
-man/sd_journal_add_disjunction.3: man/sd_journal_add_match.3
-man/sd_journal_close.3: man/sd_journal_open.3
-man/sd_journal_enumerate_data.3: man/sd_journal_get_data.3
-man/sd_journal_enumerate_unique.3: man/sd_journal_query_unique.3
-man/sd_journal_flush_matches.3: man/sd_journal_add_match.3
-man/sd_journal_get_catalog_for_message_id.3: man/sd_journal_get_catalog.3
-man/sd_journal_get_cutoff_monotonic_usec.3: man/sd_journal_get_cutoff_realtime_usec.3
-man/sd_journal_get_data_threshold.3: man/sd_journal_get_data.3
-man/sd_journal_get_events.3: man/sd_journal_get_fd.3
-man/sd_journal_get_monotonic_usec.3: man/sd_journal_get_realtime_usec.3
-man/sd_journal_get_timeout.3: man/sd_journal_get_fd.3
-man/sd_journal_has_persistent_files.3: man/sd_journal_has_runtime_files.3
-man/sd_journal_next_skip.3: man/sd_journal_next.3
-man/sd_journal_open_directory.3: man/sd_journal_open.3
-man/sd_journal_open_directory_fd.3: man/sd_journal_open.3
-man/sd_journal_open_files.3: man/sd_journal_open.3
-man/sd_journal_open_files_fd.3: man/sd_journal_open.3
-man/sd_journal_perror.3: man/sd_journal_print.3
-man/sd_journal_previous.3: man/sd_journal_next.3
-man/sd_journal_previous_skip.3: man/sd_journal_next.3
-man/sd_journal_printv.3: man/sd_journal_print.3
-man/sd_journal_process.3: man/sd_journal_get_fd.3
-man/sd_journal_reliable_fd.3: man/sd_journal_get_fd.3
-man/sd_journal_restart_data.3: man/sd_journal_get_data.3
-man/sd_journal_restart_fields.3: man/sd_journal_enumerate_fields.3
-man/sd_journal_restart_unique.3: man/sd_journal_query_unique.3
-man/sd_journal_seek_cursor.3: man/sd_journal_seek_head.3
-man/sd_journal_seek_monotonic_usec.3: man/sd_journal_seek_head.3
-man/sd_journal_seek_realtime_usec.3: man/sd_journal_seek_head.3
-man/sd_journal_seek_tail.3: man/sd_journal_seek_head.3
-man/sd_journal_send.3: man/sd_journal_print.3
-man/sd_journal_sendv.3: man/sd_journal_print.3
-man/sd_journal_set_data_threshold.3: man/sd_journal_get_data.3
-man/sd_journal_test_cursor.3: man/sd_journal_get_cursor.3
-man/sd_journal_wait.3: man/sd_journal_get_fd.3
-man/sd_listen_fds_with_names.3: man/sd_listen_fds.3
-man/sd_machine_get_ifindices.3: man/sd_machine_get_class.3
-man/sd_notifyf.3: man/sd_notify.3
-man/sd_pid_notify.3: man/sd_notify.3
-man/sd_pid_notify_with_fds.3: man/sd_notify.3
-man/sd_pid_notifyf.3: man/sd_notify.3
-man/sleep.conf.d.5: man/systemd-sleep.conf.5
-man/system.conf.d.5: man/systemd-system.conf.5
-man/systemd-ask-password-console.path.8: man/systemd-ask-password-console.service.8
-man/systemd-ask-password-wall.path.8: man/systemd-ask-password-console.service.8
-man/systemd-ask-password-wall.service.8: man/systemd-ask-password-console.service.8
-man/systemd-fsck-root.service.8: man/systemd-fsck@.service.8
-man/systemd-fsck.8: man/systemd-fsck@.service.8
-man/systemd-hibernate.service.8: man/systemd-suspend.service.8
-man/systemd-hybrid-sleep.service.8: man/systemd-suspend.service.8
-man/systemd-initctl.8: man/systemd-initctl.service.8
-man/systemd-initctl.socket.8: man/systemd-initctl.service.8
-man/systemd-journald-audit.socket.8: man/systemd-journald.service.8
-man/systemd-journald-dev-log.socket.8: man/systemd-journald.service.8
-man/systemd-journald.8: man/systemd-journald.service.8
-man/systemd-journald.socket.8: man/systemd-journald.service.8
-man/systemd-kexec.service.8: man/systemd-halt.service.8
-man/systemd-poweroff.service.8: man/systemd-halt.service.8
-man/systemd-reboot.service.8: man/systemd-halt.service.8
-man/systemd-remount-fs.8: man/systemd-remount-fs.service.8
-man/systemd-shutdown.8: man/systemd-halt.service.8
-man/systemd-sleep.8: man/systemd-suspend.service.8
-man/systemd-sysctl.8: man/systemd-sysctl.service.8
-man/systemd-sysusers.service.8: man/systemd-sysusers.8
-man/systemd-tmpfiles-clean.service.8: man/systemd-tmpfiles.8
-man/systemd-tmpfiles-clean.timer.8: man/systemd-tmpfiles.8
-man/systemd-tmpfiles-setup-dev.service.8: man/systemd-tmpfiles.8
-man/systemd-tmpfiles-setup.service.8: man/systemd-tmpfiles.8
-man/systemd-udevd-control.socket.8: man/systemd-udevd.service.8
-man/systemd-udevd-kernel.socket.8: man/systemd-udevd.service.8
-man/systemd-udevd.8: man/systemd-udevd.service.8
-man/systemd-umount.1: man/systemd-mount.1
-man/systemd-update-done.8: man/systemd-update-done.service.8
-man/systemd-user.conf.5: man/systemd-system.conf.5
-man/systemd-volatile-root.8: man/systemd-volatile-root.service.8
-man/udev_device_get_action.3: man/udev_device_get_syspath.3
-man/udev_device_get_devlinks_list_entry.3: man/udev_device_has_tag.3
-man/udev_device_get_devnode.3: man/udev_device_get_syspath.3
-man/udev_device_get_devnum.3: man/udev_device_get_syspath.3
-man/udev_device_get_devpath.3: man/udev_device_get_syspath.3
-man/udev_device_get_devtype.3: man/udev_device_get_syspath.3
-man/udev_device_get_driver.3: man/udev_device_get_syspath.3
-man/udev_device_get_is_initialized.3: man/udev_device_get_syspath.3
-man/udev_device_get_parent.3: man/udev_device_get_syspath.3
-man/udev_device_get_parent_with_subsystem_devtype.3: man/udev_device_get_syspath.3
-man/udev_device_get_properties_list_entry.3: man/udev_device_has_tag.3
-man/udev_device_get_property_value.3: man/udev_device_has_tag.3
-man/udev_device_get_subsystem.3: man/udev_device_get_syspath.3
-man/udev_device_get_sysattr_list_entry.3: man/udev_device_has_tag.3
-man/udev_device_get_sysattr_value.3: man/udev_device_has_tag.3
-man/udev_device_get_sysname.3: man/udev_device_get_syspath.3
-man/udev_device_get_sysnum.3: man/udev_device_get_syspath.3
-man/udev_device_get_tags_list_entry.3: man/udev_device_has_tag.3
-man/udev_device_get_udev.3: man/udev_device_get_syspath.3
-man/udev_device_new_from_device_id.3: man/udev_device_new_from_syspath.3
-man/udev_device_new_from_devnum.3: man/udev_device_new_from_syspath.3
-man/udev_device_new_from_environment.3: man/udev_device_new_from_syspath.3
-man/udev_device_new_from_subsystem_sysname.3: man/udev_device_new_from_syspath.3
-man/udev_device_ref.3: man/udev_device_new_from_syspath.3
-man/udev_device_set_sysattr_value.3: man/udev_device_has_tag.3
-man/udev_device_unref.3: man/udev_device_new_from_syspath.3
-man/udev_enumerate_add_match_is_initialized.3: man/udev_enumerate_add_match_subsystem.3
-man/udev_enumerate_add_match_parent.3: man/udev_enumerate_add_match_subsystem.3
-man/udev_enumerate_add_match_property.3: man/udev_enumerate_add_match_subsystem.3
-man/udev_enumerate_add_match_sysattr.3: man/udev_enumerate_add_match_subsystem.3
-man/udev_enumerate_add_match_sysname.3: man/udev_enumerate_add_match_subsystem.3
-man/udev_enumerate_add_match_tag.3: man/udev_enumerate_add_match_subsystem.3
-man/udev_enumerate_add_nomatch_subsystem.3: man/udev_enumerate_add_match_subsystem.3
-man/udev_enumerate_add_nomatch_sysattr.3: man/udev_enumerate_add_match_subsystem.3
-man/udev_enumerate_add_syspath.3: man/udev_enumerate_scan_devices.3
-man/udev_enumerate_get_list_entry.3: man/udev_enumerate_scan_devices.3
-man/udev_enumerate_get_udev.3: man/udev_enumerate_scan_devices.3
-man/udev_enumerate_ref.3: man/udev_enumerate_new.3
-man/udev_enumerate_scan_subsystems.3: man/udev_enumerate_scan_devices.3
-man/udev_enumerate_unref.3: man/udev_enumerate_new.3
-man/udev_list_entry_get_by_name.3: man/udev_list_entry.3
-man/udev_list_entry_get_name.3: man/udev_list_entry.3
-man/udev_list_entry_get_next.3: man/udev_list_entry.3
-man/udev_list_entry_get_value.3: man/udev_list_entry.3
-man/udev_monitor_enable_receiving.3: man/udev_monitor_receive_device.3
-man/udev_monitor_filter_add_match_subsystem_devtype.3: man/udev_monitor_filter_update.3
-man/udev_monitor_filter_add_match_tag.3: man/udev_monitor_filter_update.3
-man/udev_monitor_filter_remove.3: man/udev_monitor_filter_update.3
-man/udev_monitor_get_fd.3: man/udev_monitor_receive_device.3
-man/udev_monitor_get_udev.3: man/udev_monitor_receive_device.3
-man/udev_monitor_ref.3: man/udev_monitor_new_from_netlink.3
-man/udev_monitor_set_receive_buffer_size.3: man/udev_monitor_receive_device.3
-man/udev_monitor_unref.3: man/udev_monitor_new_from_netlink.3
-man/udev_ref.3: man/udev_new.3
-man/udev_unref.3: man/udev_new.3
-man/user.conf.d.5: man/systemd-system.conf.5
-man/SD_ALERT.html: man/sd-daemon.html
- $(html-alias)
-
-man/SD_BUS_ERROR_ACCESS_DENIED.html: man/sd-bus-errors.html
- $(html-alias)
-
-man/SD_BUS_ERROR_ADDRESS_IN_USE.html: man/sd-bus-errors.html
- $(html-alias)
-
-man/SD_BUS_ERROR_AUTH_FAILED.html: man/sd-bus-errors.html
- $(html-alias)
-
-man/SD_BUS_ERROR_BAD_ADDRESS.html: man/sd-bus-errors.html
- $(html-alias)
-
-man/SD_BUS_ERROR_DISCONNECTED.html: man/sd-bus-errors.html
- $(html-alias)
-
-man/SD_BUS_ERROR_END.html: man/sd_bus_error_add_map.html
- $(html-alias)
-
-man/SD_BUS_ERROR_FAILED.html: man/sd-bus-errors.html
- $(html-alias)
-
-man/SD_BUS_ERROR_FILE_EXISTS.html: man/sd-bus-errors.html
- $(html-alias)
-
-man/SD_BUS_ERROR_FILE_NOT_FOUND.html: man/sd-bus-errors.html
- $(html-alias)
-
-man/SD_BUS_ERROR_INCONSISTENT_MESSAGE.html: man/sd-bus-errors.html
- $(html-alias)
-
-man/SD_BUS_ERROR_INTERACTIVE_AUTHORIZATION_REQUIRED.html: man/sd-bus-errors.html
- $(html-alias)
-
-man/SD_BUS_ERROR_INVALID_ARGS.html: man/sd-bus-errors.html
- $(html-alias)
-
-man/SD_BUS_ERROR_INVALID_SIGNATURE.html: man/sd-bus-errors.html
- $(html-alias)
-
-man/SD_BUS_ERROR_IO_ERROR.html: man/sd-bus-errors.html
- $(html-alias)
-
-man/SD_BUS_ERROR_LIMITS_EXCEEDED.html: man/sd-bus-errors.html
- $(html-alias)
-
-man/SD_BUS_ERROR_MAKE_CONST.html: man/sd_bus_error.html
- $(html-alias)
-
-man/SD_BUS_ERROR_MAP.html: man/sd_bus_error_add_map.html
- $(html-alias)
-
-man/SD_BUS_ERROR_MATCH_RULE_INVALID.html: man/sd-bus-errors.html
- $(html-alias)
-
-man/SD_BUS_ERROR_MATCH_RULE_NOT_FOUND.html: man/sd-bus-errors.html
- $(html-alias)
-
-man/SD_BUS_ERROR_NAME_HAS_NO_OWNER.html: man/sd-bus-errors.html
- $(html-alias)
-
-man/SD_BUS_ERROR_NOT_SUPPORTED.html: man/sd-bus-errors.html
- $(html-alias)
-
-man/SD_BUS_ERROR_NO_MEMORY.html: man/sd-bus-errors.html
- $(html-alias)
-
-man/SD_BUS_ERROR_NO_NETWORK.html: man/sd-bus-errors.html
- $(html-alias)
-
-man/SD_BUS_ERROR_NO_REPLY.html: man/sd-bus-errors.html
- $(html-alias)
-
-man/SD_BUS_ERROR_NO_SERVER.html: man/sd-bus-errors.html
- $(html-alias)
-
-man/SD_BUS_ERROR_NULL.html: man/sd_bus_error.html
- $(html-alias)
-
-man/SD_BUS_ERROR_PROPERTY_READ_ONLY.html: man/sd-bus-errors.html
- $(html-alias)
-
-man/SD_BUS_ERROR_SERVICE_UNKNOWN.html: man/sd-bus-errors.html
- $(html-alias)
-
-man/SD_BUS_ERROR_TIMEOUT.html: man/sd-bus-errors.html
- $(html-alias)
-
-man/SD_BUS_ERROR_UNIX_PROCESS_ID_UNKNOWN.html: man/sd-bus-errors.html
- $(html-alias)
-
-man/SD_BUS_ERROR_UNKNOWN_INTERFACE.html: man/sd-bus-errors.html
- $(html-alias)
-
-man/SD_BUS_ERROR_UNKNOWN_METHOD.html: man/sd-bus-errors.html
- $(html-alias)
-
-man/SD_BUS_ERROR_UNKNOWN_OBJECT.html: man/sd-bus-errors.html
- $(html-alias)
-
-man/SD_BUS_ERROR_UNKNOWN_PROPERTY.html: man/sd-bus-errors.html
- $(html-alias)
-
-man/SD_CRIT.html: man/sd-daemon.html
- $(html-alias)
-
-man/SD_DEBUG.html: man/sd-daemon.html
- $(html-alias)
-
-man/SD_EMERG.html: man/sd-daemon.html
- $(html-alias)
-
-man/SD_ERR.html: man/sd-daemon.html
- $(html-alias)
-
-man/SD_EVENT_ARMED.html: man/sd_event_wait.html
- $(html-alias)
-
-man/SD_EVENT_EXITING.html: man/sd_event_wait.html
- $(html-alias)
-
-man/SD_EVENT_FINISHED.html: man/sd_event_wait.html
- $(html-alias)
-
-man/SD_EVENT_INITIAL.html: man/sd_event_wait.html
- $(html-alias)
-
-man/SD_EVENT_OFF.html: man/sd_event_source_set_enabled.html
- $(html-alias)
-
-man/SD_EVENT_ON.html: man/sd_event_source_set_enabled.html
- $(html-alias)
-
-man/SD_EVENT_ONESHOT.html: man/sd_event_source_set_enabled.html
- $(html-alias)
-
-man/SD_EVENT_PENDING.html: man/sd_event_wait.html
- $(html-alias)
-
-man/SD_EVENT_PREPARING.html: man/sd_event_wait.html
- $(html-alias)
-
-man/SD_EVENT_PRIORITY_IDLE.html: man/sd_event_source_set_priority.html
- $(html-alias)
-
-man/SD_EVENT_PRIORITY_IMPORTANT.html: man/sd_event_source_set_priority.html
- $(html-alias)
-
-man/SD_EVENT_PRIORITY_NORMAL.html: man/sd_event_source_set_priority.html
- $(html-alias)
-
-man/SD_EVENT_RUNNING.html: man/sd_event_wait.html
- $(html-alias)
-
-man/SD_ID128_CONST_STR.html: man/sd-id128.html
- $(html-alias)
-
-man/SD_ID128_FORMAT_STR.html: man/sd-id128.html
- $(html-alias)
-
-man/SD_ID128_FORMAT_VAL.html: man/sd-id128.html
- $(html-alias)
-
-man/SD_ID128_MAKE.html: man/sd-id128.html
- $(html-alias)
-
-man/SD_ID128_MAKE_STR.html: man/sd-id128.html
- $(html-alias)
-
-man/SD_ID128_NULL.html: man/sd-id128.html
- $(html-alias)
-
-man/SD_INFO.html: man/sd-daemon.html
- $(html-alias)
-
-man/SD_JOURNAL_APPEND.html: man/sd_journal_get_fd.html
- $(html-alias)
-
-man/SD_JOURNAL_CURRENT_USER.html: man/sd_journal_open.html
- $(html-alias)
-
-man/SD_JOURNAL_FOREACH.html: man/sd_journal_next.html
- $(html-alias)
-
-man/SD_JOURNAL_FOREACH_BACKWARDS.html: man/sd_journal_next.html
- $(html-alias)
-
-man/SD_JOURNAL_FOREACH_DATA.html: man/sd_journal_get_data.html
- $(html-alias)
-
-man/SD_JOURNAL_FOREACH_FIELD.html: man/sd_journal_enumerate_fields.html
- $(html-alias)
-
-man/SD_JOURNAL_FOREACH_UNIQUE.html: man/sd_journal_query_unique.html
- $(html-alias)
-
-man/SD_JOURNAL_INVALIDATE.html: man/sd_journal_get_fd.html
- $(html-alias)
-
-man/SD_JOURNAL_LOCAL_ONLY.html: man/sd_journal_open.html
- $(html-alias)
-
-man/SD_JOURNAL_NOP.html: man/sd_journal_get_fd.html
- $(html-alias)
-
-man/SD_JOURNAL_OS_ROOT.html: man/sd_journal_open.html
- $(html-alias)
-
-man/SD_JOURNAL_RUNTIME_ONLY.html: man/sd_journal_open.html
- $(html-alias)
-
-man/SD_JOURNAL_SUPPRESS_LOCATION.html: man/sd_journal_print.html
- $(html-alias)
-
-man/SD_JOURNAL_SYSTEM.html: man/sd_journal_open.html
- $(html-alias)
-
-man/SD_LISTEN_FDS_START.html: man/sd_listen_fds.html
- $(html-alias)
-
-man/SD_NOTICE.html: man/sd-daemon.html
- $(html-alias)
-
-man/SD_WARNING.html: man/sd-daemon.html
- $(html-alias)
-
-man/init.html: man/systemd.html
- $(html-alias)
-
-man/journald.conf.d.html: man/journald.conf.html
- $(html-alias)
-
-man/poweroff.html: man/halt.html
- $(html-alias)
-
-man/reboot.html: man/halt.html
- $(html-alias)
-
-man/sd_bus_creds_get_audit_login_uid.html: man/sd_bus_creds_get_pid.html
- $(html-alias)
-
-man/sd_bus_creds_get_audit_session_id.html: man/sd_bus_creds_get_pid.html
- $(html-alias)
-
-man/sd_bus_creds_get_augmented_mask.html: man/sd_bus_creds_new_from_pid.html
- $(html-alias)
-
-man/sd_bus_creds_get_cgroup.html: man/sd_bus_creds_get_pid.html
- $(html-alias)
-
-man/sd_bus_creds_get_cmdline.html: man/sd_bus_creds_get_pid.html
- $(html-alias)
-
-man/sd_bus_creds_get_comm.html: man/sd_bus_creds_get_pid.html
- $(html-alias)
-
-man/sd_bus_creds_get_description.html: man/sd_bus_creds_get_pid.html
- $(html-alias)
-
-man/sd_bus_creds_get_egid.html: man/sd_bus_creds_get_pid.html
- $(html-alias)
-
-man/sd_bus_creds_get_euid.html: man/sd_bus_creds_get_pid.html
- $(html-alias)
-
-man/sd_bus_creds_get_exe.html: man/sd_bus_creds_get_pid.html
- $(html-alias)
-
-man/sd_bus_creds_get_fsgid.html: man/sd_bus_creds_get_pid.html
- $(html-alias)
-
-man/sd_bus_creds_get_fsuid.html: man/sd_bus_creds_get_pid.html
- $(html-alias)
-
-man/sd_bus_creds_get_gid.html: man/sd_bus_creds_get_pid.html
- $(html-alias)
-
-man/sd_bus_creds_get_mask.html: man/sd_bus_creds_new_from_pid.html
- $(html-alias)
-
-man/sd_bus_creds_get_owner_uid.html: man/sd_bus_creds_get_pid.html
- $(html-alias)
-
-man/sd_bus_creds_get_ppid.html: man/sd_bus_creds_get_pid.html
- $(html-alias)
-
-man/sd_bus_creds_get_selinux_context.html: man/sd_bus_creds_get_pid.html
- $(html-alias)
-
-man/sd_bus_creds_get_session.html: man/sd_bus_creds_get_pid.html
- $(html-alias)
-
-man/sd_bus_creds_get_sgid.html: man/sd_bus_creds_get_pid.html
- $(html-alias)
-
-man/sd_bus_creds_get_slice.html: man/sd_bus_creds_get_pid.html
- $(html-alias)
-
-man/sd_bus_creds_get_suid.html: man/sd_bus_creds_get_pid.html
- $(html-alias)
-
-man/sd_bus_creds_get_supplementary_gids.html: man/sd_bus_creds_get_pid.html
- $(html-alias)
-
-man/sd_bus_creds_get_tid.html: man/sd_bus_creds_get_pid.html
- $(html-alias)
-
-man/sd_bus_creds_get_tid_comm.html: man/sd_bus_creds_get_pid.html
- $(html-alias)
-
-man/sd_bus_creds_get_tty.html: man/sd_bus_creds_get_pid.html
- $(html-alias)
-
-man/sd_bus_creds_get_uid.html: man/sd_bus_creds_get_pid.html
- $(html-alias)
-
-man/sd_bus_creds_get_unique_name.html: man/sd_bus_creds_get_pid.html
- $(html-alias)
-
-man/sd_bus_creds_get_unit.html: man/sd_bus_creds_get_pid.html
- $(html-alias)
-
-man/sd_bus_creds_get_user_slice.html: man/sd_bus_creds_get_pid.html
- $(html-alias)
-
-man/sd_bus_creds_get_user_unit.html: man/sd_bus_creds_get_pid.html
- $(html-alias)
-
-man/sd_bus_creds_get_well_known_names.html: man/sd_bus_creds_get_pid.html
- $(html-alias)
-
-man/sd_bus_creds_has_bounding_cap.html: man/sd_bus_creds_get_pid.html
- $(html-alias)
-
-man/sd_bus_creds_has_effective_cap.html: man/sd_bus_creds_get_pid.html
- $(html-alias)
-
-man/sd_bus_creds_has_inheritable_cap.html: man/sd_bus_creds_get_pid.html
- $(html-alias)
-
-man/sd_bus_creds_has_permitted_cap.html: man/sd_bus_creds_get_pid.html
- $(html-alias)
-
-man/sd_bus_creds_ref.html: man/sd_bus_creds_new_from_pid.html
- $(html-alias)
-
-man/sd_bus_creds_unref.html: man/sd_bus_creds_new_from_pid.html
- $(html-alias)
-
-man/sd_bus_creds_unrefp.html: man/sd_bus_creds_new_from_pid.html
- $(html-alias)
-
-man/sd_bus_default_system.html: man/sd_bus_default.html
- $(html-alias)
-
-man/sd_bus_default_user.html: man/sd_bus_default.html
- $(html-alias)
-
-man/sd_bus_error_copy.html: man/sd_bus_error.html
- $(html-alias)
-
-man/sd_bus_error_free.html: man/sd_bus_error.html
- $(html-alias)
-
-man/sd_bus_error_get_errno.html: man/sd_bus_error.html
- $(html-alias)
-
-man/sd_bus_error_has_name.html: man/sd_bus_error.html
- $(html-alias)
-
-man/sd_bus_error_is_set.html: man/sd_bus_error.html
- $(html-alias)
-
-man/sd_bus_error_map.html: man/sd_bus_error_add_map.html
- $(html-alias)
-
-man/sd_bus_error_set.html: man/sd_bus_error.html
- $(html-alias)
-
-man/sd_bus_error_set_const.html: man/sd_bus_error.html
- $(html-alias)
-
-man/sd_bus_error_set_errno.html: man/sd_bus_error.html
- $(html-alias)
-
-man/sd_bus_error_set_errnof.html: man/sd_bus_error.html
- $(html-alias)
-
-man/sd_bus_error_set_errnofv.html: man/sd_bus_error.html
- $(html-alias)
-
-man/sd_bus_error_setf.html: man/sd_bus_error.html
- $(html-alias)
-
-man/sd_bus_message_append_array_iovec.html: man/sd_bus_message_append_array.html
- $(html-alias)
-
-man/sd_bus_message_append_array_memfd.html: man/sd_bus_message_append_array.html
- $(html-alias)
-
-man/sd_bus_message_append_array_space.html: man/sd_bus_message_append_array.html
- $(html-alias)
-
-man/sd_bus_message_append_string_iovec.html: man/sd_bus_message_append_string_memfd.html
- $(html-alias)
-
-man/sd_bus_message_append_string_space.html: man/sd_bus_message_append_string_memfd.html
- $(html-alias)
-
-man/sd_bus_message_appendv.html: man/sd_bus_message_append.html
- $(html-alias)
-
-man/sd_bus_message_get_realtime_usec.html: man/sd_bus_message_get_monotonic_usec.html
- $(html-alias)
-
-man/sd_bus_message_get_reply_cookie.html: man/sd_bus_message_get_cookie.html
- $(html-alias)
-
-man/sd_bus_message_get_seqnum.html: man/sd_bus_message_get_monotonic_usec.html
- $(html-alias)
-
-man/sd_bus_negotiate_creds.html: man/sd_bus_negotiate_fds.html
- $(html-alias)
-
-man/sd_bus_negotiate_timestamp.html: man/sd_bus_negotiate_fds.html
- $(html-alias)
-
-man/sd_bus_open.html: man/sd_bus_default.html
- $(html-alias)
-
-man/sd_bus_open_system.html: man/sd_bus_default.html
- $(html-alias)
-
-man/sd_bus_open_system_machine.html: man/sd_bus_default.html
- $(html-alias)
-
-man/sd_bus_open_system_remote.html: man/sd_bus_default.html
- $(html-alias)
-
-man/sd_bus_open_user.html: man/sd_bus_default.html
- $(html-alias)
-
-man/sd_bus_path_decode.html: man/sd_bus_path_encode.html
- $(html-alias)
-
-man/sd_bus_path_decode_many.html: man/sd_bus_path_encode.html
- $(html-alias)
-
-man/sd_bus_path_encode_many.html: man/sd_bus_path_encode.html
- $(html-alias)
-
-man/sd_bus_ref.html: man/sd_bus_new.html
- $(html-alias)
-
-man/sd_bus_release_name.html: man/sd_bus_request_name.html
- $(html-alias)
-
-man/sd_bus_track_add_sender.html: man/sd_bus_track_add_name.html
- $(html-alias)
-
-man/sd_bus_track_contains.html: man/sd_bus_track_add_name.html
- $(html-alias)
-
-man/sd_bus_track_count.html: man/sd_bus_track_add_name.html
- $(html-alias)
-
-man/sd_bus_track_count_name.html: man/sd_bus_track_add_name.html
- $(html-alias)
-
-man/sd_bus_track_count_sender.html: man/sd_bus_track_add_name.html
- $(html-alias)
-
-man/sd_bus_track_first.html: man/sd_bus_track_add_name.html
- $(html-alias)
-
-man/sd_bus_track_get_bus.html: man/sd_bus_track_new.html
- $(html-alias)
-
-man/sd_bus_track_get_recursive.html: man/sd_bus_track_new.html
- $(html-alias)
-
-man/sd_bus_track_get_userdata.html: man/sd_bus_track_new.html
- $(html-alias)
-
-man/sd_bus_track_next.html: man/sd_bus_track_add_name.html
- $(html-alias)
-
-man/sd_bus_track_ref.html: man/sd_bus_track_new.html
- $(html-alias)
-
-man/sd_bus_track_remove_name.html: man/sd_bus_track_add_name.html
- $(html-alias)
-
-man/sd_bus_track_remove_sender.html: man/sd_bus_track_add_name.html
- $(html-alias)
-
-man/sd_bus_track_set_recursive.html: man/sd_bus_track_new.html
- $(html-alias)
-
-man/sd_bus_track_set_userdata.html: man/sd_bus_track_new.html
- $(html-alias)
-
-man/sd_bus_track_unref.html: man/sd_bus_track_new.html
- $(html-alias)
-
-man/sd_bus_track_unrefp.html: man/sd_bus_track_new.html
- $(html-alias)
-
-man/sd_bus_unref.html: man/sd_bus_new.html
- $(html-alias)
-
-man/sd_bus_unrefp.html: man/sd_bus_new.html
- $(html-alias)
-
-man/sd_event.html: man/sd_event_new.html
- $(html-alias)
-
-man/sd_event_add_exit.html: man/sd_event_add_defer.html
- $(html-alias)
-
-man/sd_event_add_post.html: man/sd_event_add_defer.html
- $(html-alias)
-
-man/sd_event_child_handler_t.html: man/sd_event_add_child.html
- $(html-alias)
-
-man/sd_event_default.html: man/sd_event_new.html
- $(html-alias)
-
-man/sd_event_dispatch.html: man/sd_event_wait.html
- $(html-alias)
-
-man/sd_event_get_exit_code.html: man/sd_event_exit.html
- $(html-alias)
-
-man/sd_event_get_iteration.html: man/sd_event_wait.html
- $(html-alias)
-
-man/sd_event_get_state.html: man/sd_event_wait.html
- $(html-alias)
-
-man/sd_event_get_tid.html: man/sd_event_new.html
- $(html-alias)
-
-man/sd_event_get_watchdog.html: man/sd_event_set_watchdog.html
- $(html-alias)
-
-man/sd_event_handler_t.html: man/sd_event_add_defer.html
- $(html-alias)
-
-man/sd_event_io_handler_t.html: man/sd_event_add_io.html
- $(html-alias)
-
-man/sd_event_loop.html: man/sd_event_run.html
- $(html-alias)
-
-man/sd_event_prepare.html: man/sd_event_wait.html
- $(html-alias)
-
-man/sd_event_ref.html: man/sd_event_new.html
- $(html-alias)
-
-man/sd_event_signal_handler_t.html: man/sd_event_add_signal.html
- $(html-alias)
-
-man/sd_event_source.html: man/sd_event_add_io.html
- $(html-alias)
-
-man/sd_event_source_get_child_pid.html: man/sd_event_add_child.html
- $(html-alias)
-
-man/sd_event_source_get_description.html: man/sd_event_source_set_description.html
- $(html-alias)
-
-man/sd_event_source_get_enabled.html: man/sd_event_source_set_enabled.html
- $(html-alias)
-
-man/sd_event_source_get_io_events.html: man/sd_event_add_io.html
- $(html-alias)
-
-man/sd_event_source_get_io_fd.html: man/sd_event_add_io.html
- $(html-alias)
-
-man/sd_event_source_get_io_revents.html: man/sd_event_add_io.html
- $(html-alias)
-
-man/sd_event_source_get_priority.html: man/sd_event_source_set_priority.html
- $(html-alias)
-
-man/sd_event_source_get_signal.html: man/sd_event_add_signal.html
- $(html-alias)
-
-man/sd_event_source_get_time.html: man/sd_event_add_time.html
- $(html-alias)
-
-man/sd_event_source_get_time_accuracy.html: man/sd_event_add_time.html
- $(html-alias)
-
-man/sd_event_source_get_time_clock.html: man/sd_event_add_time.html
- $(html-alias)
-
-man/sd_event_source_get_userdata.html: man/sd_event_source_set_userdata.html
- $(html-alias)
-
-man/sd_event_source_ref.html: man/sd_event_source_unref.html
- $(html-alias)
-
-man/sd_event_source_set_io_events.html: man/sd_event_add_io.html
- $(html-alias)
-
-man/sd_event_source_set_io_fd.html: man/sd_event_add_io.html
- $(html-alias)
-
-man/sd_event_source_set_time.html: man/sd_event_add_time.html
- $(html-alias)
-
-man/sd_event_source_set_time_accuracy.html: man/sd_event_add_time.html
- $(html-alias)
-
-man/sd_event_source_unrefp.html: man/sd_event_source_unref.html
- $(html-alias)
-
-man/sd_event_time_handler_t.html: man/sd_event_add_time.html
- $(html-alias)
-
-man/sd_event_unref.html: man/sd_event_new.html
- $(html-alias)
-
-man/sd_event_unrefp.html: man/sd_event_new.html
- $(html-alias)
-
-man/sd_id128_equal.html: man/sd-id128.html
- $(html-alias)
-
-man/sd_id128_from_string.html: man/sd_id128_to_string.html
- $(html-alias)
-
-man/sd_id128_get_boot.html: man/sd_id128_get_machine.html
- $(html-alias)
-
-man/sd_id128_get_invocation.html: man/sd_id128_get_machine.html
- $(html-alias)
-
-man/sd_id128_get_machine_app_specific.html: man/sd_id128_get_machine.html
- $(html-alias)
-
-man/sd_id128_is_null.html: man/sd-id128.html
- $(html-alias)
-
-man/sd_id128_t.html: man/sd-id128.html
- $(html-alias)
-
-man/sd_is_mq.html: man/sd_is_fifo.html
- $(html-alias)
-
-man/sd_is_socket.html: man/sd_is_fifo.html
- $(html-alias)
-
-man/sd_is_socket_inet.html: man/sd_is_fifo.html
- $(html-alias)
-
-man/sd_is_socket_sockaddr.html: man/sd_is_fifo.html
- $(html-alias)
-
-man/sd_is_socket_unix.html: man/sd_is_fifo.html
- $(html-alias)
-
-man/sd_is_special.html: man/sd_is_fifo.html
- $(html-alias)
-
-man/sd_journal.html: man/sd_journal_open.html
- $(html-alias)
-
-man/sd_journal_add_conjunction.html: man/sd_journal_add_match.html
- $(html-alias)
-
-man/sd_journal_add_disjunction.html: man/sd_journal_add_match.html
- $(html-alias)
-
-man/sd_journal_close.html: man/sd_journal_open.html
- $(html-alias)
-
-man/sd_journal_enumerate_data.html: man/sd_journal_get_data.html
- $(html-alias)
-
-man/sd_journal_enumerate_unique.html: man/sd_journal_query_unique.html
- $(html-alias)
-
-man/sd_journal_flush_matches.html: man/sd_journal_add_match.html
- $(html-alias)
-
-man/sd_journal_get_catalog_for_message_id.html: man/sd_journal_get_catalog.html
- $(html-alias)
-
-man/sd_journal_get_cutoff_monotonic_usec.html: man/sd_journal_get_cutoff_realtime_usec.html
- $(html-alias)
-
-man/sd_journal_get_data_threshold.html: man/sd_journal_get_data.html
- $(html-alias)
-
-man/sd_journal_get_events.html: man/sd_journal_get_fd.html
- $(html-alias)
-
-man/sd_journal_get_monotonic_usec.html: man/sd_journal_get_realtime_usec.html
- $(html-alias)
-
-man/sd_journal_get_timeout.html: man/sd_journal_get_fd.html
- $(html-alias)
-
-man/sd_journal_has_persistent_files.html: man/sd_journal_has_runtime_files.html
- $(html-alias)
-
-man/sd_journal_next_skip.html: man/sd_journal_next.html
- $(html-alias)
-
-man/sd_journal_open_directory.html: man/sd_journal_open.html
- $(html-alias)
-
-man/sd_journal_open_directory_fd.html: man/sd_journal_open.html
- $(html-alias)
-
-man/sd_journal_open_files.html: man/sd_journal_open.html
- $(html-alias)
-
-man/sd_journal_open_files_fd.html: man/sd_journal_open.html
- $(html-alias)
-
-man/sd_journal_perror.html: man/sd_journal_print.html
- $(html-alias)
-
-man/sd_journal_previous.html: man/sd_journal_next.html
- $(html-alias)
-
-man/sd_journal_previous_skip.html: man/sd_journal_next.html
- $(html-alias)
-
-man/sd_journal_printv.html: man/sd_journal_print.html
- $(html-alias)
-
-man/sd_journal_process.html: man/sd_journal_get_fd.html
- $(html-alias)
-
-man/sd_journal_reliable_fd.html: man/sd_journal_get_fd.html
- $(html-alias)
-
-man/sd_journal_restart_data.html: man/sd_journal_get_data.html
- $(html-alias)
-
-man/sd_journal_restart_fields.html: man/sd_journal_enumerate_fields.html
- $(html-alias)
-
-man/sd_journal_restart_unique.html: man/sd_journal_query_unique.html
- $(html-alias)
-
-man/sd_journal_seek_cursor.html: man/sd_journal_seek_head.html
- $(html-alias)
-
-man/sd_journal_seek_monotonic_usec.html: man/sd_journal_seek_head.html
- $(html-alias)
-
-man/sd_journal_seek_realtime_usec.html: man/sd_journal_seek_head.html
- $(html-alias)
-
-man/sd_journal_seek_tail.html: man/sd_journal_seek_head.html
- $(html-alias)
-
-man/sd_journal_send.html: man/sd_journal_print.html
- $(html-alias)
-
-man/sd_journal_sendv.html: man/sd_journal_print.html
- $(html-alias)
-
-man/sd_journal_set_data_threshold.html: man/sd_journal_get_data.html
- $(html-alias)
-
-man/sd_journal_test_cursor.html: man/sd_journal_get_cursor.html
- $(html-alias)
-
-man/sd_journal_wait.html: man/sd_journal_get_fd.html
- $(html-alias)
-
-man/sd_listen_fds_with_names.html: man/sd_listen_fds.html
- $(html-alias)
-
-man/sd_machine_get_ifindices.html: man/sd_machine_get_class.html
- $(html-alias)
-
-man/sd_notifyf.html: man/sd_notify.html
- $(html-alias)
-
-man/sd_pid_notify.html: man/sd_notify.html
- $(html-alias)
-
-man/sd_pid_notify_with_fds.html: man/sd_notify.html
- $(html-alias)
-
-man/sd_pid_notifyf.html: man/sd_notify.html
- $(html-alias)
-
-man/sleep.conf.d.html: man/systemd-sleep.conf.html
- $(html-alias)
-
-man/system.conf.d.html: man/systemd-system.conf.html
- $(html-alias)
-
-man/systemd-ask-password-console.path.html: man/systemd-ask-password-console.service.html
- $(html-alias)
-
-man/systemd-ask-password-wall.path.html: man/systemd-ask-password-console.service.html
- $(html-alias)
-
-man/systemd-ask-password-wall.service.html: man/systemd-ask-password-console.service.html
- $(html-alias)
-
-man/systemd-fsck-root.service.html: man/systemd-fsck@.service.html
- $(html-alias)
-
-man/systemd-fsck.html: man/systemd-fsck@.service.html
- $(html-alias)
-
-man/systemd-hibernate.service.html: man/systemd-suspend.service.html
- $(html-alias)
-
-man/systemd-hybrid-sleep.service.html: man/systemd-suspend.service.html
- $(html-alias)
-
-man/systemd-initctl.html: man/systemd-initctl.service.html
- $(html-alias)
-
-man/systemd-initctl.socket.html: man/systemd-initctl.service.html
- $(html-alias)
-
-man/systemd-journald-audit.socket.html: man/systemd-journald.service.html
- $(html-alias)
-
-man/systemd-journald-dev-log.socket.html: man/systemd-journald.service.html
- $(html-alias)
-
-man/systemd-journald.html: man/systemd-journald.service.html
- $(html-alias)
-
-man/systemd-journald.socket.html: man/systemd-journald.service.html
- $(html-alias)
-
-man/systemd-kexec.service.html: man/systemd-halt.service.html
- $(html-alias)
-
-man/systemd-poweroff.service.html: man/systemd-halt.service.html
- $(html-alias)
-
-man/systemd-reboot.service.html: man/systemd-halt.service.html
- $(html-alias)
-
-man/systemd-remount-fs.html: man/systemd-remount-fs.service.html
- $(html-alias)
-
-man/systemd-shutdown.html: man/systemd-halt.service.html
- $(html-alias)
-
-man/systemd-sleep.html: man/systemd-suspend.service.html
- $(html-alias)
-
-man/systemd-sysctl.html: man/systemd-sysctl.service.html
- $(html-alias)
-
-man/systemd-sysusers.service.html: man/systemd-sysusers.html
- $(html-alias)
-
-man/systemd-tmpfiles-clean.service.html: man/systemd-tmpfiles.html
- $(html-alias)
-
-man/systemd-tmpfiles-clean.timer.html: man/systemd-tmpfiles.html
- $(html-alias)
-
-man/systemd-tmpfiles-setup-dev.service.html: man/systemd-tmpfiles.html
- $(html-alias)
-
-man/systemd-tmpfiles-setup.service.html: man/systemd-tmpfiles.html
- $(html-alias)
-
-man/systemd-udevd-control.socket.html: man/systemd-udevd.service.html
- $(html-alias)
-
-man/systemd-udevd-kernel.socket.html: man/systemd-udevd.service.html
- $(html-alias)
-
-man/systemd-udevd.html: man/systemd-udevd.service.html
- $(html-alias)
-
-man/systemd-umount.html: man/systemd-mount.html
- $(html-alias)
-
-man/systemd-update-done.html: man/systemd-update-done.service.html
- $(html-alias)
-
-man/systemd-user.conf.html: man/systemd-system.conf.html
- $(html-alias)
-
-man/systemd-volatile-root.html: man/systemd-volatile-root.service.html
- $(html-alias)
-
-man/udev_device_get_action.html: man/udev_device_get_syspath.html
- $(html-alias)
-
-man/udev_device_get_devlinks_list_entry.html: man/udev_device_has_tag.html
- $(html-alias)
-
-man/udev_device_get_devnode.html: man/udev_device_get_syspath.html
- $(html-alias)
-
-man/udev_device_get_devnum.html: man/udev_device_get_syspath.html
- $(html-alias)
-
-man/udev_device_get_devpath.html: man/udev_device_get_syspath.html
- $(html-alias)
-
-man/udev_device_get_devtype.html: man/udev_device_get_syspath.html
- $(html-alias)
-
-man/udev_device_get_driver.html: man/udev_device_get_syspath.html
- $(html-alias)
-
-man/udev_device_get_is_initialized.html: man/udev_device_get_syspath.html
- $(html-alias)
-
-man/udev_device_get_parent.html: man/udev_device_get_syspath.html
- $(html-alias)
-
-man/udev_device_get_parent_with_subsystem_devtype.html: man/udev_device_get_syspath.html
- $(html-alias)
-
-man/udev_device_get_properties_list_entry.html: man/udev_device_has_tag.html
- $(html-alias)
-
-man/udev_device_get_property_value.html: man/udev_device_has_tag.html
- $(html-alias)
-
-man/udev_device_get_subsystem.html: man/udev_device_get_syspath.html
- $(html-alias)
-
-man/udev_device_get_sysattr_list_entry.html: man/udev_device_has_tag.html
- $(html-alias)
-
-man/udev_device_get_sysattr_value.html: man/udev_device_has_tag.html
- $(html-alias)
-
-man/udev_device_get_sysname.html: man/udev_device_get_syspath.html
- $(html-alias)
-
-man/udev_device_get_sysnum.html: man/udev_device_get_syspath.html
- $(html-alias)
-
-man/udev_device_get_tags_list_entry.html: man/udev_device_has_tag.html
- $(html-alias)
-
-man/udev_device_get_udev.html: man/udev_device_get_syspath.html
- $(html-alias)
-
-man/udev_device_new_from_device_id.html: man/udev_device_new_from_syspath.html
- $(html-alias)
-
-man/udev_device_new_from_devnum.html: man/udev_device_new_from_syspath.html
- $(html-alias)
-
-man/udev_device_new_from_environment.html: man/udev_device_new_from_syspath.html
- $(html-alias)
-
-man/udev_device_new_from_subsystem_sysname.html: man/udev_device_new_from_syspath.html
- $(html-alias)
-
-man/udev_device_ref.html: man/udev_device_new_from_syspath.html
- $(html-alias)
-
-man/udev_device_set_sysattr_value.html: man/udev_device_has_tag.html
- $(html-alias)
-
-man/udev_device_unref.html: man/udev_device_new_from_syspath.html
- $(html-alias)
-
-man/udev_enumerate_add_match_is_initialized.html: man/udev_enumerate_add_match_subsystem.html
- $(html-alias)
-
-man/udev_enumerate_add_match_parent.html: man/udev_enumerate_add_match_subsystem.html
- $(html-alias)
-
-man/udev_enumerate_add_match_property.html: man/udev_enumerate_add_match_subsystem.html
- $(html-alias)
-
-man/udev_enumerate_add_match_sysattr.html: man/udev_enumerate_add_match_subsystem.html
- $(html-alias)
-
-man/udev_enumerate_add_match_sysname.html: man/udev_enumerate_add_match_subsystem.html
- $(html-alias)
-
-man/udev_enumerate_add_match_tag.html: man/udev_enumerate_add_match_subsystem.html
- $(html-alias)
-
-man/udev_enumerate_add_nomatch_subsystem.html: man/udev_enumerate_add_match_subsystem.html
- $(html-alias)
-
-man/udev_enumerate_add_nomatch_sysattr.html: man/udev_enumerate_add_match_subsystem.html
- $(html-alias)
-
-man/udev_enumerate_add_syspath.html: man/udev_enumerate_scan_devices.html
- $(html-alias)
-
-man/udev_enumerate_get_list_entry.html: man/udev_enumerate_scan_devices.html
- $(html-alias)
-
-man/udev_enumerate_get_udev.html: man/udev_enumerate_scan_devices.html
- $(html-alias)
-
-man/udev_enumerate_ref.html: man/udev_enumerate_new.html
- $(html-alias)
-
-man/udev_enumerate_scan_subsystems.html: man/udev_enumerate_scan_devices.html
- $(html-alias)
-
-man/udev_enumerate_unref.html: man/udev_enumerate_new.html
- $(html-alias)
-
-man/udev_list_entry_get_by_name.html: man/udev_list_entry.html
- $(html-alias)
-
-man/udev_list_entry_get_name.html: man/udev_list_entry.html
- $(html-alias)
-
-man/udev_list_entry_get_next.html: man/udev_list_entry.html
- $(html-alias)
-
-man/udev_list_entry_get_value.html: man/udev_list_entry.html
- $(html-alias)
-
-man/udev_monitor_enable_receiving.html: man/udev_monitor_receive_device.html
- $(html-alias)
-
-man/udev_monitor_filter_add_match_subsystem_devtype.html: man/udev_monitor_filter_update.html
- $(html-alias)
-
-man/udev_monitor_filter_add_match_tag.html: man/udev_monitor_filter_update.html
- $(html-alias)
-
-man/udev_monitor_filter_remove.html: man/udev_monitor_filter_update.html
- $(html-alias)
-
-man/udev_monitor_get_fd.html: man/udev_monitor_receive_device.html
- $(html-alias)
-
-man/udev_monitor_get_udev.html: man/udev_monitor_receive_device.html
- $(html-alias)
-
-man/udev_monitor_ref.html: man/udev_monitor_new_from_netlink.html
- $(html-alias)
-
-man/udev_monitor_set_receive_buffer_size.html: man/udev_monitor_receive_device.html
- $(html-alias)
-
-man/udev_monitor_unref.html: man/udev_monitor_new_from_netlink.html
- $(html-alias)
-
-man/udev_ref.html: man/udev_new.html
- $(html-alias)
-
-man/udev_unref.html: man/udev_new.html
- $(html-alias)
-
-man/user.conf.d.html: man/systemd-system.conf.html
- $(html-alias)
-
-
-if ENABLE_BACKLIGHT
-MANPAGES += \
- man/systemd-backlight@.service.8
-MANPAGES_ALIAS += \
- man/systemd-backlight.8
-man/systemd-backlight.8: man/systemd-backlight@.service.8
-man/systemd-backlight.html: man/systemd-backlight@.service.html
- $(html-alias)
-
-endif
-
-if ENABLE_BINFMT
-MANPAGES += \
- man/binfmt.d.5 \
- man/systemd-binfmt.service.8
-MANPAGES_ALIAS += \
- man/systemd-binfmt.8
-man/systemd-binfmt.8: man/systemd-binfmt.service.8
-man/systemd-binfmt.html: man/systemd-binfmt.service.html
- $(html-alias)
-
-endif
-
-if ENABLE_COREDUMP
-MANPAGES += \
- man/coredump.conf.5 \
- man/coredumpctl.1 \
- man/systemd-coredump.8
-MANPAGES_ALIAS += \
- man/coredump.conf.d.5 \
- man/systemd-coredump.socket.8 \
- man/systemd-coredump@.service.8
-man/coredump.conf.d.5: man/coredump.conf.5
-man/systemd-coredump.socket.8: man/systemd-coredump.8
-man/systemd-coredump@.service.8: man/systemd-coredump.8
-man/coredump.conf.d.html: man/coredump.conf.html
- $(html-alias)
-
-man/systemd-coredump.socket.html: man/systemd-coredump.html
- $(html-alias)
-
-man/systemd-coredump@.service.html: man/systemd-coredump.html
- $(html-alias)
-
-endif
-
-if ENABLE_EFI
-MANPAGES += \
- man/bootctl.1
-MANPAGES_ALIAS += \
- #
-
-
-endif
-
-if ENABLE_ENVIRONMENT_D
-MANPAGES += \
- man/environment.d.5 \
- man/systemd-environment-d-generator.8 \
- man/systemd.environment-generator.7
-MANPAGES_ALIAS += \
- man/30-systemd-environment-d-generator.8
-man/30-systemd-environment-d-generator.8: man/systemd-environment-d-generator.8
-man/30-systemd-environment-d-generator.html: man/systemd-environment-d-generator.html
- $(html-alias)
-
-endif
-
-if ENABLE_FIRSTBOOT
-MANPAGES += \
- man/systemd-firstboot.1
-MANPAGES_ALIAS += \
- man/systemd-firstboot.service.1
-man/systemd-firstboot.service.1: man/systemd-firstboot.1
-man/systemd-firstboot.service.html: man/systemd-firstboot.html
- $(html-alias)
-
-endif
-
-if ENABLE_HIBERNATE
-MANPAGES += \
- man/systemd-hibernate-resume-generator.8 \
- man/systemd-hibernate-resume@.service.8
-MANPAGES_ALIAS += \
- man/systemd-hibernate-resume.8
-man/systemd-hibernate-resume.8: man/systemd-hibernate-resume@.service.8
-man/systemd-hibernate-resume.html: man/systemd-hibernate-resume@.service.html
- $(html-alias)
-
-endif
-
-if ENABLE_HOSTNAMED
-MANPAGES += \
- man/hostnamectl.1 \
- man/systemd-hostnamed.service.8
-MANPAGES_ALIAS += \
- man/systemd-hostnamed.8
-man/systemd-hostnamed.8: man/systemd-hostnamed.service.8
-man/systemd-hostnamed.html: man/systemd-hostnamed.service.html
- $(html-alias)
-
-endif
-
-if ENABLE_HWDB
-MANPAGES += \
- man/hwdb.7 \
- man/systemd-hwdb.8
-MANPAGES_ALIAS += \
- #
-
-
-endif
-
-if ENABLE_IMPORTD
-MANPAGES += \
- man/systemd-importd.service.8
-MANPAGES_ALIAS += \
- man/systemd-importd.8
-man/systemd-importd.8: man/systemd-importd.service.8
-man/systemd-importd.html: man/systemd-importd.service.html
- $(html-alias)
-
-endif
-
-if ENABLE_LOCALED
-MANPAGES += \
- man/localectl.1 \
- man/systemd-localed.service.8
-MANPAGES_ALIAS += \
- man/systemd-localed.8
-man/systemd-localed.8: man/systemd-localed.service.8
-man/systemd-localed.html: man/systemd-localed.service.html
- $(html-alias)
-
-endif
-
-if ENABLE_LOGIND
-MANPAGES += \
- man/loginctl.1 \
- man/logind.conf.5 \
- man/systemd-logind.service.8
-MANPAGES_ALIAS += \
- man/logind.conf.d.5 \
- man/systemd-logind.8
-man/logind.conf.d.5: man/logind.conf.5
-man/systemd-logind.8: man/systemd-logind.service.8
-man/logind.conf.d.html: man/logind.conf.html
- $(html-alias)
-
-man/systemd-logind.html: man/systemd-logind.service.html
- $(html-alias)
-
-endif
-
-if ENABLE_MACHINED
-MANPAGES += \
- man/machinectl.1 \
- man/nss-mymachines.8 \
- man/systemd-machined.service.8
-MANPAGES_ALIAS += \
- man/libnss_mymachines.so.2.8 \
- man/systemd-machined.8
-man/libnss_mymachines.so.2.8: man/nss-mymachines.8
-man/systemd-machined.8: man/systemd-machined.service.8
-man/libnss_mymachines.so.2.html: man/nss-mymachines.html
- $(html-alias)
-
-man/systemd-machined.html: man/systemd-machined.service.html
- $(html-alias)
-
-endif
-
-if ENABLE_NETWORKD
-MANPAGES += \
- man/networkctl.1 \
- man/networkd.conf.5 \
- man/systemd-networkd-wait-online.service.8 \
- man/systemd-networkd.service.8 \
- man/systemd.netdev.5 \
- man/systemd.network.5
-MANPAGES_ALIAS += \
- man/networkd.conf.d.5 \
- man/systemd-networkd-wait-online.8 \
- man/systemd-networkd.8
-man/networkd.conf.d.5: man/networkd.conf.5
-man/systemd-networkd-wait-online.8: man/systemd-networkd-wait-online.service.8
-man/systemd-networkd.8: man/systemd-networkd.service.8
-man/networkd.conf.d.html: man/networkd.conf.html
- $(html-alias)
-
-man/systemd-networkd-wait-online.html: man/systemd-networkd-wait-online.service.html
- $(html-alias)
-
-man/systemd-networkd.html: man/systemd-networkd.service.html
- $(html-alias)
-
-endif
-
-if ENABLE_NSS_SYSTEMD
-MANPAGES += \
- man/nss-systemd.8
-MANPAGES_ALIAS += \
- man/libnss_systemd.so.2.8
-man/libnss_systemd.so.2.8: man/nss-systemd.8
-man/libnss_systemd.so.2.html: man/nss-systemd.html
- $(html-alias)
-
-endif
-
-if ENABLE_QUOTACHECK
-MANPAGES += \
- man/systemd-quotacheck.service.8
-MANPAGES_ALIAS += \
- man/systemd-quotacheck.8
-man/systemd-quotacheck.8: man/systemd-quotacheck.service.8
-man/systemd-quotacheck.html: man/systemd-quotacheck.service.html
- $(html-alias)
-
-endif
-
-if ENABLE_RANDOMSEED
-MANPAGES += \
- man/systemd-random-seed.service.8
-MANPAGES_ALIAS += \
- man/systemd-random-seed.8
-man/systemd-random-seed.8: man/systemd-random-seed.service.8
-man/systemd-random-seed.html: man/systemd-random-seed.service.html
- $(html-alias)
-
-endif
-
-if ENABLE_RESOLVED
-MANPAGES += \
- man/dnssec-trust-anchors.d.5 \
- man/nss-resolve.8 \
- man/resolved.conf.5 \
- man/systemd-resolve.1 \
- man/systemd-resolved.service.8
-MANPAGES_ALIAS += \
- man/libnss_resolve.so.2.8 \
- man/resolved.conf.d.5 \
- man/systemd-resolved.8 \
- man/systemd.negative.5 \
- man/systemd.positive.5
-man/libnss_resolve.so.2.8: man/nss-resolve.8
-man/resolved.conf.d.5: man/resolved.conf.5
-man/systemd-resolved.8: man/systemd-resolved.service.8
-man/systemd.negative.5: man/dnssec-trust-anchors.d.5
-man/systemd.positive.5: man/dnssec-trust-anchors.d.5
-man/libnss_resolve.so.2.html: man/nss-resolve.html
- $(html-alias)
-
-man/resolved.conf.d.html: man/resolved.conf.html
- $(html-alias)
-
-man/systemd-resolved.html: man/systemd-resolved.service.html
- $(html-alias)
-
-man/systemd.negative.html: man/dnssec-trust-anchors.d.html
- $(html-alias)
-
-man/systemd.positive.html: man/dnssec-trust-anchors.d.html
- $(html-alias)
-
-endif
-
-if ENABLE_RFKILL
-MANPAGES += \
- man/systemd-rfkill.service.8
-MANPAGES_ALIAS += \
- man/systemd-rfkill.8 \
- man/systemd-rfkill.socket.8
-man/systemd-rfkill.8: man/systemd-rfkill.service.8
-man/systemd-rfkill.socket.8: man/systemd-rfkill.service.8
-man/systemd-rfkill.html: man/systemd-rfkill.service.html
- $(html-alias)
-
-man/systemd-rfkill.socket.html: man/systemd-rfkill.service.html
- $(html-alias)
-
-endif
-
-if ENABLE_SYSUSERS
-MANPAGES += \
- man/sysusers.d.5
-MANPAGES_ALIAS += \
- #
-
-
-endif
-
-if ENABLE_TIMEDATED
-MANPAGES += \
- man/systemd-timedated.service.8 \
- man/timedatectl.1
-MANPAGES_ALIAS += \
- man/systemd-timedated.8
-man/systemd-timedated.8: man/systemd-timedated.service.8
-man/systemd-timedated.html: man/systemd-timedated.service.html
- $(html-alias)
-
-endif
-
-if ENABLE_TIMESYNCD
-MANPAGES += \
- man/systemd-timesyncd.service.8 \
- man/timesyncd.conf.5
-MANPAGES_ALIAS += \
- man/systemd-timesyncd.8 \
- man/timesyncd.conf.d.5
-man/systemd-timesyncd.8: man/systemd-timesyncd.service.8
-man/timesyncd.conf.d.5: man/timesyncd.conf.5
-man/systemd-timesyncd.html: man/systemd-timesyncd.service.html
- $(html-alias)
-
-man/timesyncd.conf.d.html: man/timesyncd.conf.html
- $(html-alias)
-
-endif
-
-if ENABLE_VCONSOLE
-MANPAGES += \
- man/systemd-vconsole-setup.service.8 \
- man/vconsole.conf.5
-MANPAGES_ALIAS += \
- man/systemd-vconsole-setup.8
-man/systemd-vconsole-setup.8: man/systemd-vconsole-setup.service.8
-man/systemd-vconsole-setup.html: man/systemd-vconsole-setup.service.html
- $(html-alias)
-
-endif
-
-if HAVE_KMOD
-MANPAGES += \
- man/modules-load.d.5 \
- man/systemd-modules-load.service.8
-MANPAGES_ALIAS += \
- man/systemd-modules-load.8
-man/systemd-modules-load.8: man/systemd-modules-load.service.8
-man/systemd-modules-load.html: man/systemd-modules-load.service.html
- $(html-alias)
-
-endif
-
-if HAVE_LIBCRYPTSETUP
-MANPAGES += \
- man/crypttab.5 \
- man/systemd-cryptsetup-generator.8 \
- man/systemd-cryptsetup@.service.8 \
- man/systemd-veritysetup-generator.8 \
- man/systemd-veritysetup@.service.8
-MANPAGES_ALIAS += \
- man/systemd-cryptsetup.8 \
- man/systemd-veritysetup.8
-man/systemd-cryptsetup.8: man/systemd-cryptsetup@.service.8
-man/systemd-veritysetup.8: man/systemd-veritysetup@.service.8
-man/systemd-cryptsetup.html: man/systemd-cryptsetup@.service.html
- $(html-alias)
-
-man/systemd-veritysetup.html: man/systemd-veritysetup@.service.html
- $(html-alias)
-
-endif
-
-if HAVE_MICROHTTPD
-MANPAGES += \
- man/journal-remote.conf.5 \
- man/journal-upload.conf.5 \
- man/systemd-journal-gatewayd.service.8 \
- man/systemd-journal-remote.8 \
- man/systemd-journal-upload.8
-MANPAGES_ALIAS += \
- man/journal-remote.conf.d.5 \
- man/journal-upload.conf.d.5 \
- man/systemd-journal-gatewayd.8 \
- man/systemd-journal-gatewayd.socket.8
-man/journal-remote.conf.d.5: man/journal-remote.conf.5
-man/journal-upload.conf.d.5: man/journal-upload.conf.5
-man/systemd-journal-gatewayd.8: man/systemd-journal-gatewayd.service.8
-man/systemd-journal-gatewayd.socket.8: man/systemd-journal-gatewayd.service.8
-man/journal-remote.conf.d.html: man/journal-remote.conf.html
- $(html-alias)
-
-man/journal-upload.conf.d.html: man/journal-upload.conf.html
- $(html-alias)
-
-man/systemd-journal-gatewayd.html: man/systemd-journal-gatewayd.service.html
- $(html-alias)
-
-man/systemd-journal-gatewayd.socket.html: man/systemd-journal-gatewayd.service.html
- $(html-alias)
-
-endif
-
-if HAVE_MYHOSTNAME
-MANPAGES += \
- man/nss-myhostname.8
-MANPAGES_ALIAS += \
- man/libnss_myhostname.so.2.8
-man/libnss_myhostname.so.2.8: man/nss-myhostname.8
-man/libnss_myhostname.so.2.html: man/nss-myhostname.html
- $(html-alias)
-
-endif
-
-if HAVE_PAM
-MANPAGES += \
- man/pam_systemd.8 \
- man/sd-login.3 \
- man/sd_get_seats.3 \
- man/sd_login_monitor_new.3 \
- man/sd_pid_get_session.3 \
- man/sd_seat_get_active.3 \
- man/sd_session_is_active.3 \
- man/sd_uid_get_state.3 \
- man/systemd-user-sessions.service.8
-MANPAGES_ALIAS += \
- man/sd_get_machine_names.3 \
- man/sd_get_sessions.3 \
- man/sd_get_uids.3 \
- man/sd_login_monitor.3 \
- man/sd_login_monitor_flush.3 \
- man/sd_login_monitor_get_events.3 \
- man/sd_login_monitor_get_fd.3 \
- man/sd_login_monitor_get_timeout.3 \
- man/sd_login_monitor_unref.3 \
- man/sd_login_monitor_unrefp.3 \
- man/sd_peer_get_cgroup.3 \
- man/sd_peer_get_machine_name.3 \
- man/sd_peer_get_owner_uid.3 \
- man/sd_peer_get_session.3 \
- man/sd_peer_get_slice.3 \
- man/sd_peer_get_unit.3 \
- man/sd_peer_get_user_slice.3 \
- man/sd_peer_get_user_unit.3 \
- man/sd_pid_get_cgroup.3 \
- man/sd_pid_get_machine_name.3 \
- man/sd_pid_get_owner_uid.3 \
- man/sd_pid_get_slice.3 \
- man/sd_pid_get_unit.3 \
- man/sd_pid_get_user_slice.3 \
- man/sd_pid_get_user_unit.3 \
- man/sd_seat_can_graphical.3 \
- man/sd_seat_can_multi_session.3 \
- man/sd_seat_can_tty.3 \
- man/sd_seat_get_sessions.3 \
- man/sd_session_get_class.3 \
- man/sd_session_get_desktop.3 \
- man/sd_session_get_display.3 \
- man/sd_session_get_remote_host.3 \
- man/sd_session_get_remote_user.3 \
- man/sd_session_get_seat.3 \
- man/sd_session_get_service.3 \
- man/sd_session_get_state.3 \
- man/sd_session_get_tty.3 \
- man/sd_session_get_type.3 \
- man/sd_session_get_uid.3 \
- man/sd_session_get_vt.3 \
- man/sd_session_is_remote.3 \
- man/sd_uid_get_display.3 \
- man/sd_uid_get_seats.3 \
- man/sd_uid_get_sessions.3 \
- man/sd_uid_is_on_seat.3 \
- man/systemd-user-sessions.8
-man/sd_get_machine_names.3: man/sd_get_seats.3
-man/sd_get_sessions.3: man/sd_get_seats.3
-man/sd_get_uids.3: man/sd_get_seats.3
-man/sd_login_monitor.3: man/sd_login_monitor_new.3
-man/sd_login_monitor_flush.3: man/sd_login_monitor_new.3
-man/sd_login_monitor_get_events.3: man/sd_login_monitor_new.3
-man/sd_login_monitor_get_fd.3: man/sd_login_monitor_new.3
-man/sd_login_monitor_get_timeout.3: man/sd_login_monitor_new.3
-man/sd_login_monitor_unref.3: man/sd_login_monitor_new.3
-man/sd_login_monitor_unrefp.3: man/sd_login_monitor_new.3
-man/sd_peer_get_cgroup.3: man/sd_pid_get_session.3
-man/sd_peer_get_machine_name.3: man/sd_pid_get_session.3
-man/sd_peer_get_owner_uid.3: man/sd_pid_get_session.3
-man/sd_peer_get_session.3: man/sd_pid_get_session.3
-man/sd_peer_get_slice.3: man/sd_pid_get_session.3
-man/sd_peer_get_unit.3: man/sd_pid_get_session.3
-man/sd_peer_get_user_slice.3: man/sd_pid_get_session.3
-man/sd_peer_get_user_unit.3: man/sd_pid_get_session.3
-man/sd_pid_get_cgroup.3: man/sd_pid_get_session.3
-man/sd_pid_get_machine_name.3: man/sd_pid_get_session.3
-man/sd_pid_get_owner_uid.3: man/sd_pid_get_session.3
-man/sd_pid_get_slice.3: man/sd_pid_get_session.3
-man/sd_pid_get_unit.3: man/sd_pid_get_session.3
-man/sd_pid_get_user_slice.3: man/sd_pid_get_session.3
-man/sd_pid_get_user_unit.3: man/sd_pid_get_session.3
-man/sd_seat_can_graphical.3: man/sd_seat_get_active.3
-man/sd_seat_can_multi_session.3: man/sd_seat_get_active.3
-man/sd_seat_can_tty.3: man/sd_seat_get_active.3
-man/sd_seat_get_sessions.3: man/sd_seat_get_active.3
-man/sd_session_get_class.3: man/sd_session_is_active.3
-man/sd_session_get_desktop.3: man/sd_session_is_active.3
-man/sd_session_get_display.3: man/sd_session_is_active.3
-man/sd_session_get_remote_host.3: man/sd_session_is_active.3
-man/sd_session_get_remote_user.3: man/sd_session_is_active.3
-man/sd_session_get_seat.3: man/sd_session_is_active.3
-man/sd_session_get_service.3: man/sd_session_is_active.3
-man/sd_session_get_state.3: man/sd_session_is_active.3
-man/sd_session_get_tty.3: man/sd_session_is_active.3
-man/sd_session_get_type.3: man/sd_session_is_active.3
-man/sd_session_get_uid.3: man/sd_session_is_active.3
-man/sd_session_get_vt.3: man/sd_session_is_active.3
-man/sd_session_is_remote.3: man/sd_session_is_active.3
-man/sd_uid_get_display.3: man/sd_uid_get_state.3
-man/sd_uid_get_seats.3: man/sd_uid_get_state.3
-man/sd_uid_get_sessions.3: man/sd_uid_get_state.3
-man/sd_uid_is_on_seat.3: man/sd_uid_get_state.3
-man/systemd-user-sessions.8: man/systemd-user-sessions.service.8
-man/sd_get_machine_names.html: man/sd_get_seats.html
- $(html-alias)
-
-man/sd_get_sessions.html: man/sd_get_seats.html
- $(html-alias)
-
-man/sd_get_uids.html: man/sd_get_seats.html
- $(html-alias)
-
-man/sd_login_monitor.html: man/sd_login_monitor_new.html
- $(html-alias)
-
-man/sd_login_monitor_flush.html: man/sd_login_monitor_new.html
- $(html-alias)
-
-man/sd_login_monitor_get_events.html: man/sd_login_monitor_new.html
- $(html-alias)
-
-man/sd_login_monitor_get_fd.html: man/sd_login_monitor_new.html
- $(html-alias)
-
-man/sd_login_monitor_get_timeout.html: man/sd_login_monitor_new.html
- $(html-alias)
-
-man/sd_login_monitor_unref.html: man/sd_login_monitor_new.html
- $(html-alias)
-
-man/sd_login_monitor_unrefp.html: man/sd_login_monitor_new.html
- $(html-alias)
-
-man/sd_peer_get_cgroup.html: man/sd_pid_get_session.html
- $(html-alias)
-
-man/sd_peer_get_machine_name.html: man/sd_pid_get_session.html
- $(html-alias)
-
-man/sd_peer_get_owner_uid.html: man/sd_pid_get_session.html
- $(html-alias)
-
-man/sd_peer_get_session.html: man/sd_pid_get_session.html
- $(html-alias)
-
-man/sd_peer_get_slice.html: man/sd_pid_get_session.html
- $(html-alias)
-
-man/sd_peer_get_unit.html: man/sd_pid_get_session.html
- $(html-alias)
-
-man/sd_peer_get_user_slice.html: man/sd_pid_get_session.html
- $(html-alias)
-
-man/sd_peer_get_user_unit.html: man/sd_pid_get_session.html
- $(html-alias)
-
-man/sd_pid_get_cgroup.html: man/sd_pid_get_session.html
- $(html-alias)
-
-man/sd_pid_get_machine_name.html: man/sd_pid_get_session.html
- $(html-alias)
-
-man/sd_pid_get_owner_uid.html: man/sd_pid_get_session.html
- $(html-alias)
-
-man/sd_pid_get_slice.html: man/sd_pid_get_session.html
- $(html-alias)
-
-man/sd_pid_get_unit.html: man/sd_pid_get_session.html
- $(html-alias)
-
-man/sd_pid_get_user_slice.html: man/sd_pid_get_session.html
- $(html-alias)
-
-man/sd_pid_get_user_unit.html: man/sd_pid_get_session.html
- $(html-alias)
-
-man/sd_seat_can_graphical.html: man/sd_seat_get_active.html
- $(html-alias)
-
-man/sd_seat_can_multi_session.html: man/sd_seat_get_active.html
- $(html-alias)
-
-man/sd_seat_can_tty.html: man/sd_seat_get_active.html
- $(html-alias)
-
-man/sd_seat_get_sessions.html: man/sd_seat_get_active.html
- $(html-alias)
-
-man/sd_session_get_class.html: man/sd_session_is_active.html
- $(html-alias)
-
-man/sd_session_get_desktop.html: man/sd_session_is_active.html
- $(html-alias)
-
-man/sd_session_get_display.html: man/sd_session_is_active.html
- $(html-alias)
-
-man/sd_session_get_remote_host.html: man/sd_session_is_active.html
- $(html-alias)
-
-man/sd_session_get_remote_user.html: man/sd_session_is_active.html
- $(html-alias)
-
-man/sd_session_get_seat.html: man/sd_session_is_active.html
- $(html-alias)
-
-man/sd_session_get_service.html: man/sd_session_is_active.html
- $(html-alias)
-
-man/sd_session_get_state.html: man/sd_session_is_active.html
- $(html-alias)
-
-man/sd_session_get_tty.html: man/sd_session_is_active.html
- $(html-alias)
-
-man/sd_session_get_type.html: man/sd_session_is_active.html
- $(html-alias)
-
-man/sd_session_get_uid.html: man/sd_session_is_active.html
- $(html-alias)
-
-man/sd_session_get_vt.html: man/sd_session_is_active.html
- $(html-alias)
-
-man/sd_session_is_remote.html: man/sd_session_is_active.html
- $(html-alias)
-
-man/sd_uid_get_display.html: man/sd_uid_get_state.html
- $(html-alias)
-
-man/sd_uid_get_seats.html: man/sd_uid_get_state.html
- $(html-alias)
-
-man/sd_uid_get_sessions.html: man/sd_uid_get_state.html
- $(html-alias)
-
-man/sd_uid_is_on_seat.html: man/sd_uid_get_state.html
- $(html-alias)
-
-man/systemd-user-sessions.html: man/systemd-user-sessions.service.html
- $(html-alias)
-
-endif
-
-if HAVE_PYTHON
-MANPAGES += \
- man/systemd.directives.7 \
- man/systemd.index.7
-MANPAGES_ALIAS += \
- #
-
-
-endif
-
-if HAVE_SYSV_COMPAT
-MANPAGES += \
- man/systemd-sysv-generator.8
-MANPAGES_ALIAS += \
- #
-
-
-endif
-
-if HAVE_UTMP
-MANPAGES += \
- man/runlevel.8 \
- man/systemd-update-utmp.service.8
-MANPAGES_ALIAS += \
- man/systemd-update-utmp-runlevel.service.8 \
- man/systemd-update-utmp.8
-man/systemd-update-utmp-runlevel.service.8: man/systemd-update-utmp.service.8
-man/systemd-update-utmp.8: man/systemd-update-utmp.service.8
-man/systemd-update-utmp-runlevel.service.html: man/systemd-update-utmp.service.html
- $(html-alias)
-
-man/systemd-update-utmp.html: man/systemd-update-utmp.service.html
- $(html-alias)
-
-endif
-
-# Really, do not edit this file.
-
-EXTRA_DIST += \
- man/binfmt.d.xml \
- man/bootctl.xml \
- man/bootup.xml \
- man/busctl.xml \
- man/coredump.conf.xml \
- man/coredumpctl.xml \
- man/crypttab.xml \
- man/daemon.xml \
- man/dnssec-trust-anchors.d.xml \
- man/environment.d.xml \
- man/file-hierarchy.xml \
- man/halt.xml \
- man/hostname.xml \
- man/hostnamectl.xml \
- man/hwdb.xml \
- man/journal-remote.conf.xml \
- man/journal-upload.conf.xml \
- man/journalctl.xml \
- man/journald.conf.xml \
- man/kernel-command-line.xml \
- man/kernel-install.xml \
- man/less-variables.xml \
- man/libsystemd-pkgconfig.xml \
- man/libudev.xml \
- man/locale.conf.xml \
- man/localectl.xml \
- man/localtime.xml \
- man/loginctl.xml \
- man/logind.conf.xml \
- man/machine-id.xml \
- man/machine-info.xml \
- man/machinectl.xml \
- man/modules-load.d.xml \
- man/networkctl.xml \
- man/networkd.conf.xml \
- man/nss-myhostname.xml \
- man/nss-mymachines.xml \
- man/nss-resolve.xml \
- man/nss-systemd.xml \
- man/os-release.xml \
- man/pam_systemd.xml \
- man/resolved.conf.xml \
- man/runlevel.xml \
- man/sd-bus-errors.xml \
- man/sd-bus.xml \
- man/sd-daemon.xml \
- man/sd-event.xml \
- man/sd-id128.xml \
- man/sd-journal.xml \
- man/sd-login.xml \
- man/sd_booted.xml \
- man/sd_bus_add_match.xml \
- man/sd_bus_creds_get_pid.xml \
- man/sd_bus_creds_new_from_pid.xml \
- man/sd_bus_default.xml \
- man/sd_bus_error.xml \
- man/sd_bus_error_add_map.xml \
- man/sd_bus_get_fd.xml \
- man/sd_bus_message_append.xml \
- man/sd_bus_message_append_array.xml \
- man/sd_bus_message_append_basic.xml \
- man/sd_bus_message_append_string_memfd.xml \
- man/sd_bus_message_append_strv.xml \
- man/sd_bus_message_get_cookie.xml \
- man/sd_bus_message_get_monotonic_usec.xml \
- man/sd_bus_message_read_basic.xml \
- man/sd_bus_negotiate_fds.xml \
- man/sd_bus_new.xml \
- man/sd_bus_path_encode.xml \
- man/sd_bus_process.xml \
- man/sd_bus_request_name.xml \
- man/sd_bus_track_add_name.xml \
- man/sd_bus_track_new.xml \
- man/sd_event_add_child.xml \
- man/sd_event_add_defer.xml \
- man/sd_event_add_io.xml \
- man/sd_event_add_signal.xml \
- man/sd_event_add_time.xml \
- man/sd_event_exit.xml \
- man/sd_event_get_fd.xml \
- man/sd_event_new.xml \
- man/sd_event_now.xml \
- man/sd_event_run.xml \
- man/sd_event_set_watchdog.xml \
- man/sd_event_source_get_event.xml \
- man/sd_event_source_get_pending.xml \
- man/sd_event_source_set_description.xml \
- man/sd_event_source_set_enabled.xml \
- man/sd_event_source_set_prepare.xml \
- man/sd_event_source_set_priority.xml \
- man/sd_event_source_set_userdata.xml \
- man/sd_event_source_unref.xml \
- man/sd_event_wait.xml \
- man/sd_get_seats.xml \
- man/sd_id128_get_machine.xml \
- man/sd_id128_randomize.xml \
- man/sd_id128_to_string.xml \
- man/sd_is_fifo.xml \
- man/sd_journal_add_match.xml \
- man/sd_journal_enumerate_fields.xml \
- man/sd_journal_get_catalog.xml \
- man/sd_journal_get_cursor.xml \
- man/sd_journal_get_cutoff_realtime_usec.xml \
- man/sd_journal_get_data.xml \
- man/sd_journal_get_fd.xml \
- man/sd_journal_get_realtime_usec.xml \
- man/sd_journal_get_usage.xml \
- man/sd_journal_has_runtime_files.xml \
- man/sd_journal_next.xml \
- man/sd_journal_open.xml \
- man/sd_journal_print.xml \
- man/sd_journal_query_unique.xml \
- man/sd_journal_seek_head.xml \
- man/sd_journal_stream_fd.xml \
- man/sd_listen_fds.xml \
- man/sd_login_monitor_new.xml \
- man/sd_machine_get_class.xml \
- man/sd_notify.xml \
- man/sd_pid_get_session.xml \
- man/sd_seat_get_active.xml \
- man/sd_session_is_active.xml \
- man/sd_uid_get_state.xml \
- man/sd_watchdog_enabled.xml \
- man/shutdown.xml \
- man/standard-conf.xml \
- man/standard-options.xml \
- man/sysctl.d.xml \
- man/systemctl.xml \
- man/systemd-analyze.xml \
- man/systemd-ask-password-console.service.xml \
- man/systemd-ask-password.xml \
- man/systemd-backlight@.service.xml \
- man/systemd-binfmt.service.xml \
- man/systemd-cat.xml \
- man/systemd-cgls.xml \
- man/systemd-cgtop.xml \
- man/systemd-coredump.xml \
- man/systemd-cryptsetup-generator.xml \
- man/systemd-cryptsetup@.service.xml \
- man/systemd-debug-generator.xml \
- man/systemd-delta.xml \
- man/systemd-detect-virt.xml \
- man/systemd-environment-d-generator.xml \
- man/systemd-escape.xml \
- man/systemd-firstboot.xml \
- man/systemd-fsck@.service.xml \
- man/systemd-fstab-generator.xml \
- man/systemd-getty-generator.xml \
- man/systemd-gpt-auto-generator.xml \
- man/systemd-halt.service.xml \
- man/systemd-hibernate-resume-generator.xml \
- man/systemd-hibernate-resume@.service.xml \
- man/systemd-hostnamed.service.xml \
- man/systemd-hwdb.xml \
- man/systemd-importd.service.xml \
- man/systemd-inhibit.xml \
- man/systemd-initctl.service.xml \
- man/systemd-journal-gatewayd.service.xml \
- man/systemd-journal-remote.xml \
- man/systemd-journal-upload.xml \
- man/systemd-journald.service.xml \
- man/systemd-localed.service.xml \
- man/systemd-logind.service.xml \
- man/systemd-machine-id-commit.service.xml \
- man/systemd-machine-id-setup.xml \
- man/systemd-machined.service.xml \
- man/systemd-modules-load.service.xml \
- man/systemd-mount.xml \
- man/systemd-networkd-wait-online.service.xml \
- man/systemd-networkd.service.xml \
- man/systemd-notify.xml \
- man/systemd-nspawn.xml \
- man/systemd-path.xml \
- man/systemd-quotacheck.service.xml \
- man/systemd-random-seed.service.xml \
- man/systemd-remount-fs.service.xml \
- man/systemd-resolve.xml \
- man/systemd-resolved.service.xml \
- man/systemd-rfkill.service.xml \
- man/systemd-run.xml \
- man/systemd-sleep.conf.xml \
- man/systemd-socket-activate.xml \
- man/systemd-socket-proxyd.xml \
- man/systemd-suspend.service.xml \
- man/systemd-sysctl.service.xml \
- man/systemd-system-update-generator.xml \
- man/systemd-system.conf.xml \
- man/systemd-sysusers.xml \
- man/systemd-sysv-generator.xml \
- man/systemd-timedated.service.xml \
- man/systemd-timesyncd.service.xml \
- man/systemd-tmpfiles.xml \
- man/systemd-tty-ask-password-agent.xml \
- man/systemd-udevd.service.xml \
- man/systemd-update-done.service.xml \
- man/systemd-update-utmp.service.xml \
- man/systemd-user-sessions.service.xml \
- man/systemd-vconsole-setup.service.xml \
- man/systemd-veritysetup-generator.xml \
- man/systemd-veritysetup@.service.xml \
- man/systemd-volatile-root.service.xml \
- man/systemd.automount.xml \
- man/systemd.device.xml \
- man/systemd.environment-generator.xml \
- man/systemd.exec.xml \
- man/systemd.generator.xml \
- man/systemd.journal-fields.xml \
- man/systemd.kill.xml \
- man/systemd.link.xml \
- man/systemd.mount.xml \
- man/systemd.netdev.xml \
- man/systemd.network.xml \
- man/systemd.nspawn.xml \
- man/systemd.offline-updates.xml \
- man/systemd.path.xml \
- man/systemd.preset.xml \
- man/systemd.resource-control.xml \
- man/systemd.scope.xml \
- man/systemd.service.xml \
- man/systemd.slice.xml \
- man/systemd.socket.xml \
- man/systemd.special.xml \
- man/systemd.swap.xml \
- man/systemd.target.xml \
- man/systemd.time.xml \
- man/systemd.timer.xml \
- man/systemd.unit.xml \
- man/systemd.xml \
- man/sysusers.d.xml \
- man/telinit.xml \
- man/timedatectl.xml \
- man/timesyncd.conf.xml \
- man/tmpfiles.d.xml \
- man/udev.conf.xml \
- man/udev.xml \
- man/udev_device_get_syspath.xml \
- man/udev_device_has_tag.xml \
- man/udev_device_new_from_syspath.xml \
- man/udev_enumerate_add_match_subsystem.xml \
- man/udev_enumerate_new.xml \
- man/udev_enumerate_scan_devices.xml \
- man/udev_list_entry.xml \
- man/udev_monitor_filter_update.xml \
- man/udev_monitor_new_from_netlink.xml \
- man/udev_monitor_receive_device.xml \
- man/udev_new.xml \
- man/udevadm.xml \
- man/user-system-options.xml \
- man/vconsole.conf.xml
diff --git a/Makefile.am b/Makefile.am
deleted file mode 100644
index c16e62280b..0000000000
--- a/Makefile.am
+++ /dev/null
@@ -1,6915 +0,0 @@
-# -*- Mode: makefile; indent-tabs-mode: t -*-
-#
-# This file is part of systemd.
-#
-# Copyright 2010-2012 Lennart Poettering
-# Copyright 2010-2012 Kay Sievers
-# Copyright 2013 Zbigniew Jędrzejewski-Szmek
-# Copyright 2013 David Strauss
-#
-# systemd is free software; you can redistribute it and/or modify it
-# under the terms of the GNU Lesser General Public License as published by
-# the Free Software Foundation; either version 2.1 of the License, or
-# (at your option) any later version.
-#
-# systemd is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public License
-# along with systemd; If not, see <http://www.gnu.org/licenses/>.
-
-ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}
-AM_MAKEFLAGS = --no-print-directory
-AUTOMAKE_OPTIONS = color-tests parallel-tests
-
-GCC_COLORS ?= 'ooh, shiny!'
-export GCC_COLORS
-
-SUBDIRS = . po
-
-# remove targets if the command fails
-.DELETE_ON_ERROR:
-
-# keep intermediate files
-.SECONDARY:
-
-# Keep the test-suite.log
-.PRECIOUS: $(TEST_SUITE_LOG) Makefile
-
-LIBUDEV_CURRENT=7
-LIBUDEV_REVISION=6
-LIBUDEV_AGE=6
-
-LIBSYSTEMD_CURRENT=19
-LIBSYSTEMD_REVISION=0
-LIBSYSTEMD_AGE=19
-
-# Dirs of external packages
-dbuspolicydir=@dbuspolicydir@
-dbussessionservicedir=@dbussessionservicedir@
-dbussystemservicedir=@dbussystemservicedir@
-pamlibdir=@pamlibdir@
-pamconfdir=@pamconfdir@
-pkgconfigdatadir=$(datadir)/pkgconfig
-pkgconfiglibdir=$(libdir)/pkgconfig
-polkitpolicydir=$(datadir)/polkit-1/actions
-polkitrulesdir=$(datadir)/polkit-1/rules.d
-polkitpkladir=$(localstatedir)/lib/polkit-1/localauthority/10-vendor.d
-bashcompletiondir=@bashcompletiondir@
-zshcompletiondir=@zshcompletiondir@
-rpmmacrosdir=@rpmmacrosdir@
-sysvinitdir=$(SYSTEM_SYSVINIT_PATH)
-sysvrcnddir=$(SYSTEM_SYSVRCND_PATH)
-varlogdir=$(localstatedir)/log
-systemdstatedir=$(localstatedir)/lib/systemd
-catalogstatedir=$(systemdstatedir)/catalog
-xinitrcdir=$(sysconfdir)/X11/xinit/xinitrc.d
-
-# Our own, non-special dirs
-environmentdir=$(prefix)/lib/environment.d
-pkgsysconfdir=$(sysconfdir)/systemd
-userunitdir=$(prefix)/lib/systemd/user
-userpresetdir=$(prefix)/lib/systemd/user-preset
-tmpfilesdir=$(prefix)/lib/tmpfiles.d
-sysusersdir=$(prefix)/lib/sysusers.d
-sysctldir=$(prefix)/lib/sysctl.d
-binfmtdir=$(prefix)/lib/binfmt.d
-modulesloaddir=$(prefix)/lib/modules-load.d
-networkdir=$(rootprefix)/lib/systemd/network
-pkgincludedir=$(includedir)/systemd
-systemgeneratordir=$(rootlibexecdir)/system-generators
-usergeneratordir=$(prefix)/lib/systemd/user-generators
-systemenvgeneratordir=$(prefix)/lib/systemd/system-environment-generators
-userenvgeneratordir=$(prefix)/lib/systemd/user-environment-generators
-systemshutdowndir=$(rootlibexecdir)/system-shutdown
-systemsleepdir=$(rootlibexecdir)/system-sleep
-systemunitdir=$(rootprefix)/lib/systemd/system
-systempresetdir=$(rootprefix)/lib/systemd/system-preset
-udevlibexecdir=$(rootprefix)/lib/udev
-udevhomedir=$(udevlibexecdir)
-udevrulesdir=$(udevlibexecdir)/rules.d
-udevhwdbdir=$(udevlibexecdir)/hwdb.d
-catalogdir=$(prefix)/lib/systemd/catalog
-kernelinstalldir = $(prefix)/lib/kernel/install.d
-factory_etcdir = $(datadir)/factory/etc
-factory_pamdir = $(datadir)/factory/etc/pam.d
-bootlibdir = $(prefix)/lib/systemd/boot/efi
-testsdir = $(prefix)/lib/systemd/tests
-
-# And these are the special ones for /
-rootprefix=@rootprefix@
-rootbindir=$(rootprefix)/bin
-rootlibexecdir=$(rootprefix)/lib/systemd
-
-EXTRA_DIST =
-BUILT_SOURCES =
-INSTALL_EXEC_HOOKS =
-UNINSTALL_EXEC_HOOKS =
-INSTALL_DATA_HOOKS =
-UNINSTALL_DATA_HOOKS =
-DISTCLEAN_LOCAL_HOOKS =
-CLEAN_LOCAL_HOOKS =
-pkginclude_HEADERS =
-noinst_LTLIBRARIES =
-lib_LTLIBRARIES =
-rootlibexec_LTLIBRARIES =
-include_HEADERS =
-noinst_DATA =
-pkgconfigdata_DATA =
-pkgconfiglib_DATA =
-polkitpolicy_in_in_files =
-polkitpolicy_in_files =
-polkitpolicy_files =
-polkitrules_files =
-polkitpkla_files =
-dist_udevrules_DATA =
-nodist_udevrules_DATA =
-dist_pkgsysconf_DATA =
-nodist_pkgsysconf_DATA =
-dist_dbuspolicy_DATA =
-dist_dbussystemservice_DATA =
-dist_systemunit_DATA_busnames =
-dist_sysusers_DATA =
-check_PROGRAMS =
-check_DATA =
-dist_rootlibexec_DATA =
-tests=
-manual_tests =
-TEST_DATA_FILES =
-TEST_EXTENSIONS = .py
-PY_LOG_COMPILER = $(PYTHON)
-DISABLE_HARD_ERRORS = yes
-if ENABLE_TESTS
-noinst_PROGRAMS = $(manual_tests) $(tests) $(unsafe_tests)
-TESTS = $(tests)
-if ENABLE_UNSAFE_TESTS
-TESTS += \
- $(unsafe_tests)
-endif
-else
-noinst_PROGRAMS =
-TESTS =
-endif
-AM_TESTS_ENVIRONMENT = \
- export SYSTEMD_KBD_MODEL_MAP=$(abs_top_srcdir)/src/locale/kbd-model-map; \
- export SYSTEMD_LANGUAGE_FALLBACK_MAP=$(abs_top_srcdir)/src/locale/language-fallback-map; \
- export PATH=$(abs_top_builddir):$$PATH;
-
-if ENABLE_BASH_COMPLETION
-dist_bashcompletion_DATA = $(dist_bashcompletion_data)
-nodist_bashcompletion_DATA = $(nodist_bashcompletion_data)
-endif
-if ENABLE_ZSH_COMPLETION
-dist_zshcompletion_DATA = $(dist_zshcompletion_data)
-nodist_zshcompletion_DATA = $(nodist_zshcompletion_data)
-endif
-udevlibexec_PROGRAMS =
-gperf_gperf_sources =
-rootlib_LTLIBRARIES =
-
-in_files = $(filter %.in,$(EXTRA_DIST))
-in_in_files = $(filter %.in.in, $(in_files))
-m4_files = $(filter %.m4,$(EXTRA_DIST) $(in_files:.m4.in=.m4))
-
-CLEANFILES = $(BUILT_SOURCES) \
- $(pkgconfigdata_DATA) \
- $(pkgconfiglib_DATA) \
- $(nodist_bashcompletion_data) \
- $(nodist_zshcompletion_data) \
- $(nodist_rpmmacros_DATA) \
- $(in_files:.in=) $(in_in_files:.in.in=) \
- $(m4_files:.m4=)
-
-.PHONY: $(INSTALL_EXEC_HOOKS) $(UNINSTALL_EXEC_HOOKS) \
- $(INSTALL_DATA_HOOKS) $(UNINSTALL_DATA_HOOKS) \
- $(DISTCLEAN_LOCAL_HOOKS) $(CLEAN_LOCAL_HOOKS)
-
-AM_CPPFLAGS = \
- -include $(top_builddir)/config.h \
- -DPKGSYSCONFDIR=\"$(pkgsysconfdir)\" \
- -DSYSTEM_CONFIG_UNIT_PATH=\"$(pkgsysconfdir)/system\" \
- -DSYSTEM_DATA_UNIT_PATH=\"$(systemunitdir)\" \
- -DSYSTEM_SYSVINIT_PATH=\"$(SYSTEM_SYSVINIT_PATH)\" \
- -DSYSTEM_SYSVRCND_PATH=\"$(SYSTEM_SYSVRCND_PATH)\" \
- -DUSER_CONFIG_UNIT_PATH=\"$(pkgsysconfdir)/user\" \
- -DUSER_DATA_UNIT_PATH=\"$(userunitdir)\" \
- -DCERTIFICATE_ROOT=\"$(CERTIFICATEROOT)\" \
- -DCATALOG_DATABASE=\"$(catalogstatedir)/database\" \
- -DSYSTEMD_CGROUP_AGENT_PATH=\"$(rootlibexecdir)/systemd-cgroups-agent\" \
- -DSYSTEMD_BINARY_PATH=\"$(rootlibexecdir)/systemd\" \
- -DSYSTEMD_FSCK_PATH=\"$(rootlibexecdir)/systemd-fsck\" \
- -DSYSTEMD_SHUTDOWN_BINARY_PATH=\"$(rootlibexecdir)/systemd-shutdown\" \
- -DSYSTEMD_SLEEP_BINARY_PATH=\"$(rootlibexecdir)/systemd-sleep\" \
- -DSYSTEMCTL_BINARY_PATH=\"$(rootbindir)/systemctl\" \
- -DSYSTEMD_TTY_ASK_PASSWORD_AGENT_BINARY_PATH=\"$(rootbindir)/systemd-tty-ask-password-agent\" \
- -DSYSTEMD_STDIO_BRIDGE_BINARY_PATH=\"$(bindir)/systemd-stdio-bridge\" \
- -DROOTPREFIX=\"$(rootprefix)\" \
- -DRANDOM_SEED_DIR=\"$(localstatedir)/lib/systemd/\" \
- -DRANDOM_SEED=\"$(localstatedir)/lib/systemd/random-seed\" \
- -DSYSTEMD_CRYPTSETUP_PATH=\"$(rootlibexecdir)/systemd-cryptsetup\" \
- -DSYSTEM_GENERATOR_PATH=\"$(systemgeneratordir)\" \
- -DUSER_GENERATOR_PATH=\"$(usergeneratordir)\" \
- -DSYSTEM_ENV_GENERATOR_PATH=\"$(systemenvgeneratordir)\" \
- -DUSER_ENV_GENERATOR_PATH=\"$(userenvgeneratordir)\" \
- -DSYSTEM_SHUTDOWN_PATH=\"$(systemshutdowndir)\" \
- -DSYSTEM_SLEEP_PATH=\"$(systemsleepdir)\" \
- -DSYSTEMD_KBD_MODEL_MAP=\"$(pkgdatadir)/kbd-model-map\" \
- -DSYSTEMD_LANGUAGE_FALLBACK_MAP=\"$(pkgdatadir)/language-fallback-map\" \
- -DUDEVLIBEXECDIR=\"$(udevlibexecdir)\" \
- -DPOLKIT_AGENT_BINARY_PATH=\"$(bindir)/pkttyagent\" \
- -DQUOTACHECK=\"$(QUOTACHECK)\" \
- -DKEXEC=\"$(KEXEC)\" \
- -DMOUNT_PATH=\"$(MOUNT_PATH)\" \
- -DUMOUNT_PATH=\"$(UMOUNT_PATH)\" \
- -DLIBDIR=\"$(libdir)\" \
- -DROOTLIBDIR=\"$(rootlibdir)\" \
- -DROOTLIBEXECDIR=\"$(rootlibexecdir)\" \
- -I $(top_srcdir)/src \
- -I $(top_builddir)/src/basic \
- -I $(top_srcdir)/src/basic \
- -I $(top_srcdir)/src/shared \
- -I $(top_builddir)/src/shared \
- -I $(top_srcdir)/src/network \
- -I $(top_srcdir)/src/locale \
- -I $(top_srcdir)/src/login \
- -I $(top_srcdir)/src/journal \
- -I $(top_builddir)/src/journal \
- -I $(top_srcdir)/src/timedate \
- -I $(top_srcdir)/src/timesync \
- -I $(top_srcdir)/src/nspawn \
- -I $(top_srcdir)/src/resolve \
- -I $(top_builddir)/src/resolve \
- -I $(top_srcdir)/src/systemd \
- -I $(top_builddir)/src/core \
- -I $(top_srcdir)/src/core \
- -I $(top_srcdir)/src/libudev \
- -I $(top_srcdir)/src/udev \
- -I $(top_srcdir)/src/udev/net \
- -I $(top_builddir)/src/udev \
- -I $(top_srcdir)/src/libsystemd/sd-bus \
- -I $(top_srcdir)/src/libsystemd/sd-event \
- -I $(top_srcdir)/src/libsystemd/sd-login \
- -I $(top_srcdir)/src/libsystemd/sd-netlink \
- -I $(top_srcdir)/src/libsystemd/sd-network \
- -I $(top_srcdir)/src/libsystemd/sd-hwdb \
- -I $(top_srcdir)/src/libsystemd/sd-device \
- -I $(top_srcdir)/src/libsystemd/sd-id128 \
- -I $(top_srcdir)/src/libsystemd-network \
- -DABS_SRC_DIR=\"$(abs_top_srcdir)\" \
- -DABS_BUILD_DIR=\"$(abs_top_builddir)\" \
- $(OUR_CPPFLAGS)
-
-AM_CFLAGS = $(OUR_CFLAGS)
-AM_LDFLAGS = $(OUR_LDFLAGS)
-
-# ------------------------------------------------------------------------------
-INSTALL_DIRS =
-
-SHUTDOWN_TARGET_WANTS =
-LOCAL_FS_TARGET_WANTS =
-REMOTE_FS_TARGET_WANTS =
-MULTI_USER_TARGET_WANTS =
-GRAPHICAL_TARGET_WANTS =
-MACHINES_TARGET_WANTS =
-RESCUE_TARGET_WANTS =
-SYSINIT_TARGET_WANTS =
-SOCKETS_TARGET_WANTS =
-BUSNAMES_TARGET_WANTS =
-TIMERS_TARGET_WANTS =
-USER_SOCKETS_TARGET_WANTS =
-USER_DEFAULT_TARGET_WANTS =
-USER_BUSNAMES_TARGET_WANTS =
-
-SYSTEM_UNIT_ALIASES =
-USER_UNIT_ALIASES =
-GENERAL_ALIASES =
-
-install-target-wants-hook:
- what="$(SHUTDOWN_TARGET_WANTS)" && wants=shutdown.target && dir=$(systemunitdir) && $(add-wants)
- what="$(LOCAL_FS_TARGET_WANTS)" && wants=local-fs.target && dir=$(systemunitdir) && $(add-wants)
- what="$(REMOTE_FS_TARGET_WANTS)" && wants=remote-fs.target && dir=$(systemunitdir) && $(add-wants)
- what="$(MACHINES_TARGET_WANTS)" && wants=machines.target && dir=$(systemunitdir) && $(add-wants)
- what="$(MULTI_USER_TARGET_WANTS)" && wants=multi-user.target && dir=$(systemunitdir) && $(add-wants)
- what="$(GRAPHICAL_TARGET_WANTS)" && wants=graphical.target && dir=$(systemunitdir) && $(add-wants)
- what="$(RESCUE_TARGET_WANTS)" && wants=rescue.target && dir=$(systemunitdir) && $(add-wants)
- what="$(SYSINIT_TARGET_WANTS)" && wants=sysinit.target && dir=$(systemunitdir) && $(add-wants)
- what="$(SOCKETS_TARGET_WANTS)" && wants=sockets.target && dir=$(systemunitdir) && $(add-wants)
- what="$(TIMERS_TARGET_WANTS)" && wants=timers.target && dir=$(systemunitdir) && $(add-wants)
- what="$(SLICES_TARGET_WANTS)" && wants=slices.target && dir=$(systemunitdir) && $(add-wants)
- what="$(USER_SOCKETS_TARGET_WANTS)" && wants=sockets.target && dir=$(userunitdir) && $(add-wants)
- what="$(USER_DEFAULT_TARGET_WANTS)" && wants=default.target && dir=$(userunitdir) && $(add-wants)
-
-install-busnames-target-wants-hook:
- what="$(BUSNAMES_TARGET_WANTS)" && wants=busnames.target && dir=$(systemunitdir) && $(add-wants)
- what="$(USER_BUSNAMES_TARGET_WANTS)" && wants=busnames.target && dir=$(userunitdir) && $(add-wants)
-
-define add-wants
- [ -z "$$what" ] || ( \
- dir=$(DESTDIR)$$dir/$$wants.wants && \
- $(MKDIR_P) -m 0755 $$dir && \
- cd $$dir && \
- rm -f $$what && \
- for i in $$what; do $(LN_S) ../$$i . || exit $$? ; done )
-endef
-
-install-directories-hook:
- $(MKDIR_P) $(addprefix $(DESTDIR),$(INSTALL_DIRS))
-
-install-environment-conf-hook: install-directories-hook
- $(AM_V_LN)$(LN_S) --relative -f $(DESTDIR)$(sysconfdir)/environment \
- $(DESTDIR)$(environmentdir)/99-environment.conf
-
-install-aliases-hook:
- set -- $(SYSTEM_UNIT_ALIASES) && \
- dir=$(systemunitdir) && $(install-aliases)
- set -- $(USER_UNIT_ALIASES) && \
- dir=$(userunitdir) && $(install-relative-aliases)
- set -- $(GENERAL_ALIASES) && \
- dir= && $(install-relative-aliases)
-
-define install-aliases
- while [ -n "$$1" ]; do \
- $(MKDIR_P) `dirname $(DESTDIR)$$dir/$$2` && \
- rm -f $(DESTDIR)$$dir/$$2 && \
- $(LN_S) $$1 $(DESTDIR)$$dir/$$2 && \
- shift 2 || exit $$?; \
- done
-endef
-
-define install-relative-aliases
- while [ -n "$$1" ]; do \
- $(MKDIR_P) `dirname $(DESTDIR)$$dir/$$2` && \
- rm -f $(DESTDIR)$$dir/$$2 && \
- $(LN_S) --relative $(DESTDIR)$$1 $(DESTDIR)$$dir/$$2 && \
- shift 2 || exit $$?; \
- done
-endef
-
-install-touch-usr-hook:
- touch -c $(DESTDIR)/$(prefix)
-
-INSTALL_EXEC_HOOKS += \
- install-target-wants-hook \
- install-directories-hook \
- install-aliases-hook \
- install-touch-usr-hook \
- install-busnames-target-wants-hook
-
-if ENABLE_ENVIRONMENT_D
-INSTALL_EXEC_HOOKS += \
- install-environment-conf-hook
-endif
-
-# ------------------------------------------------------------------------------
-AM_V_M4 = $(AM_V_M4_$(V))
-AM_V_M4_ = $(AM_V_M4_$(AM_DEFAULT_VERBOSITY))
-AM_V_M4_0 = @echo " M4 " $@;
-
-AM_V_XSLT = $(AM_V_XSLT_$(V))
-AM_V_XSLT_ = $(AM_V_XSLT_$(AM_DEFAULT_VERBOSITY))
-AM_V_XSLT_0 = @echo " XSLT " $@;
-
-AM_V_GPERF = $(AM_V_GPERF_$(V))
-AM_V_GPERF_ = $(AM_V_GPERF_$(AM_DEFAULT_VERBOSITY))
-AM_V_GPERF_0 = @echo " GPERF " $@;
-
-AM_V_LN = $(AM_V_LN_$(V))
-AM_V_LN_ = $(AM_V_LN_$(AM_DEFAULT_VERBOSITY))
-AM_V_LN_0 = @echo " LN " $@;
-
-AM_V_RM = $(AM_V_RM_$(V))
-AM_V_RM_ = $(AM_V_RM_$(AM_DEFAULT_VERBOSITY))
-AM_V_RM_0 = @echo " RM " $@;
-
-# ------------------------------------------------------------------------------
-rootbin_PROGRAMS = \
- systemctl \
- systemd-notify \
- systemd-ask-password \
- systemd-tty-ask-password-agent \
- systemd-machine-id-setup \
- systemd-escape
-
-bin_PROGRAMS = \
- systemd-cgls \
- systemd-cgtop \
- systemd-nspawn \
- systemd-detect-virt \
- systemd-delta \
- systemd-analyze \
- systemd-run \
- systemd-mount \
- systemd-stdio-bridge \
- systemd-path
-
-dist_bin_SCRIPTS = \
- src/kernel-install/kernel-install
-
-dist_kernelinstall_SCRIPTS = \
- src/kernel-install/50-depmod.install \
- src/kernel-install/90-loaderentry.install
-
-rootlibexec_PROGRAMS = \
- systemd \
- systemd-cgroups-agent \
- systemd-initctl \
- systemd-shutdown \
- systemd-remount-fs \
- systemd-volatile-root \
- systemd-reply-password \
- systemd-fsck \
- systemd-ac-power \
- systemd-sysctl \
- systemd-sleep \
- systemd-socket-proxyd \
- systemd-update-done
-
-if HAVE_BLKID
-rootlibexec_PROGRAMS += \
- systemd-dissect
-endif
-
-if HAVE_UTMP
-rootlibexec_PROGRAMS += \
- systemd-update-utmp
-endif
-
-systemgenerator_PROGRAMS = \
- systemd-getty-generator \
- systemd-fstab-generator \
- systemd-system-update-generator \
- systemd-debug-generator
-
-if ENABLE_ENVIRONMENT_D
-userenvgenerator_PROGRAMS = \
- 30-systemd-environment-d-generator
-endif
-
-rootlibexec_SCRIPTS = \
- src/sulogin-shell/systemd-sulogin-shell
-
-EXTRA_DIST += \
- src/sulogin-shell/systemd-sulogin-shell.in
-
-dist_bashcompletion_data = \
- shell-completion/bash/busctl \
- shell-completion/bash/journalctl \
- shell-completion/bash/systemd-analyze \
- shell-completion/bash/systemd-cat \
- shell-completion/bash/systemd-cgls \
- shell-completion/bash/systemd-cgtop \
- shell-completion/bash/systemd-delta \
- shell-completion/bash/systemd-detect-virt \
- shell-completion/bash/systemd-nspawn \
- shell-completion/bash/systemd-path \
- shell-completion/bash/systemd-run \
- shell-completion/bash/udevadm \
- shell-completion/bash/kernel-install
-
-nodist_bashcompletion_data = \
- shell-completion/bash/systemctl
-
-dist_zshcompletion_data = \
- shell-completion/zsh/_busctl \
- shell-completion/zsh/_journalctl \
- shell-completion/zsh/_udevadm \
- shell-completion/zsh/_kernel-install \
- shell-completion/zsh/_systemd-nspawn \
- shell-completion/zsh/_systemd-analyze \
- shell-completion/zsh/_systemd-run \
- shell-completion/zsh/_sd_hosts_or_user_at_host \
- shell-completion/zsh/_sd_outputmodes \
- shell-completion/zsh/_sd_unit_files \
- shell-completion/zsh/_systemd-delta \
- shell-completion/zsh/_systemd
-
-nodist_zshcompletion_data = \
- shell-completion/zsh/_systemctl
-
-EXTRA_DIST += \
- shell-completion/bash/systemctl.in \
- shell-completion/zsh/_systemctl.in
-
-dist_sysctl_DATA = \
- sysctl.d/50-default.conf
-
-dist_systemunit_DATA = \
- units/graphical.target \
- units/multi-user.target \
- units/emergency.target \
- units/sysinit.target \
- units/basic.target \
- units/getty.target \
- units/halt.target \
- units/kexec.target \
- units/exit.target \
- units/local-fs.target \
- units/local-fs-pre.target \
- units/initrd.target \
- units/initrd-fs.target \
- units/initrd-root-device.target \
- units/initrd-root-fs.target \
- units/remote-fs.target \
- units/remote-fs-pre.target \
- units/network.target \
- units/network-pre.target \
- units/network-online.target \
- units/nss-lookup.target \
- units/nss-user-lookup.target \
- units/poweroff.target \
- units/reboot.target \
- units/rescue.target \
- units/rpcbind.target \
- units/time-sync.target \
- units/shutdown.target \
- units/final.target \
- units/umount.target \
- units/sigpwr.target \
- units/sleep.target \
- units/sockets.target \
- units/timers.target \
- units/paths.target \
- units/suspend.target \
- units/swap.target \
- units/slices.target \
- units/system.slice \
- units/systemd-initctl.socket \
- units/syslog.socket \
- units/dev-hugepages.mount \
- units/dev-mqueue.mount \
- units/sys-kernel-config.mount \
- units/sys-kernel-debug.mount \
- units/sys-fs-fuse-connections.mount \
- units/tmp.mount \
- units/printer.target \
- units/sound.target \
- units/bluetooth.target \
- units/smartcard.target \
- units/systemd-ask-password-wall.path \
- units/systemd-ask-password-console.path \
- units/systemd-udevd-control.socket \
- units/systemd-udevd-kernel.socket \
- units/system-update.target \
- units/initrd-switch-root.target \
- units/machines.target
-
-dist_systemunit_DATA += \
- $(dist_systemunit_DATA_busnames)
-
-dist_systemunit_DATA_busnames += \
- units/busnames.target
-
-nodist_systemunit_DATA = \
- units/getty@.service \
- units/serial-getty@.service \
- units/console-getty.service \
- units/container-getty@.service \
- units/system-update-cleanup.service \
- units/systemd-initctl.service \
- units/systemd-remount-fs.service \
- units/systemd-volatile-root.service \
- units/systemd-ask-password-wall.service \
- units/systemd-ask-password-console.service \
- units/systemd-sysctl.service \
- units/emergency.service \
- units/rescue.service \
- units/user@.service \
- units/systemd-suspend.service \
- units/systemd-halt.service \
- units/systemd-poweroff.service \
- units/systemd-reboot.service \
- units/systemd-kexec.service \
- units/systemd-exit.service \
- units/systemd-fsck@.service \
- units/systemd-fsck-root.service \
- units/systemd-machine-id-commit.service \
- units/systemd-udevd.service \
- units/systemd-udev-trigger.service \
- units/systemd-udev-settle.service \
- units/systemd-hwdb-update.service \
- units/debug-shell.service \
- units/initrd-parse-etc.service \
- units/initrd-cleanup.service \
- units/initrd-udevadm-cleanup-db.service \
- units/initrd-switch-root.service \
- units/systemd-nspawn@.service \
- units/systemd-update-done.service
-
-if HAVE_UTMP
-nodist_systemunit_DATA += \
- units/systemd-update-utmp.service \
- units/systemd-update-utmp-runlevel.service
-endif
-
-dist_userunit_DATA = \
- units/user/basic.target \
- units/user/default.target \
- units/user/exit.target \
- units/user/graphical-session.target \
- units/user/graphical-session-pre.target \
- units/user/bluetooth.target \
- units/user/busnames.target \
- units/user/paths.target \
- units/user/printer.target \
- units/user/shutdown.target \
- units/user/smartcard.target \
- units/user/sockets.target \
- units/user/sound.target \
- units/user/timers.target
-
-nodist_userunit_DATA = \
- units/user/systemd-exit.service
-
-dist_systempreset_DATA = \
- system-preset/90-systemd.preset
-
-EXTRA_DIST += \
- units/getty@.service.m4 \
- units/serial-getty@.service.m4 \
- units/console-getty.service.m4.in \
- units/container-getty@.service.m4.in \
- units/rescue.service.in \
- units/system-update-cleanup.service.in \
- units/systemd-initctl.service.in \
- units/systemd-remount-fs.service.in \
- units/systemd-volatile-root.service.in \
- units/systemd-update-utmp.service.in \
- units/systemd-update-utmp-runlevel.service.in \
- units/systemd-ask-password-wall.service.in \
- units/systemd-ask-password-console.service.in \
- units/systemd-sysctl.service.in \
- units/emergency.service.in \
- units/systemd-halt.service.in \
- units/systemd-poweroff.service.in \
- units/systemd-reboot.service.in \
- units/systemd-kexec.service.in \
- units/systemd-exit.service.in \
- units/user/systemd-exit.service.in \
- units/systemd-fsck@.service.in \
- units/systemd-fsck-root.service.in \
- units/systemd-machine-id-commit.service.in \
- units/user@.service.m4.in \
- units/debug-shell.service.in \
- units/systemd-suspend.service.in \
- units/quotaon.service.in \
- units/initrd-parse-etc.service.in \
- units/initrd-cleanup.service.in \
- units/initrd-udevadm-cleanup-db.service.in \
- units/initrd-switch-root.service.in \
- units/systemd-nspawn@.service.in \
- units/systemd-update-done.service.in \
- units/tmp.mount.m4
-
-if HAVE_SYSV_COMPAT
-nodist_systemunit_DATA += \
- units/rc-local.service \
- units/halt-local.service
-
-systemgenerator_PROGRAMS += \
- systemd-sysv-generator \
- systemd-rc-local-generator
-endif
-
-EXTRA_DIST += \
- src/systemctl/systemd-sysv-install.SKELETON \
- units/rc-local.service.in \
- units/halt-local.service.in
-
-GENERAL_ALIASES += \
- $(systemunitdir)/machines.target $(pkgsysconfdir)/system/multi-user.target.wants/machines.target
-
-dist_doc_DATA = \
- README \
- NEWS \
- CODING_STYLE \
- LICENSE.LGPL2.1 \
- LICENSE.GPL2 \
- DISTRO_PORTING \
- src/libsystemd/sd-bus/GVARIANT-SERIALIZATION
-
-EXTRA_DIST += \
- README.md \
- autogen.sh \
- .dir-locals.el \
- .editorconfig \
- .vimrc \
- .ycm_extra_conf.py \
- .travis.yml \
- .mailmap
-
-@INTLTOOL_POLICY_RULE@
-
-systemd-mount-install-hook:
- -$(LN_S) systemd-mount $(DESTDIR)$(bindir)/systemd-umount
-
-systemd-mount-uninstall-hook:
- -rm $(DESTDIR)$(bindir)/systemd-umount
-
-INSTALL_EXEC_HOOKS += systemd-mount-install-hook
-UNINSTALL_EXEC_HOOKS += systemd-mount-uninstall-hook
-
-# ------------------------------------------------------------------------------
-
-MANPAGES =
-MANPAGES_ALIAS =
-
-include Makefile-man.am
-
-.PHONY: man update-man-list
-man: $(MANPAGES) $(MANPAGES_ALIAS) $(HTML_FILES) $(HTML_ALIAS)
-
-XML_FILES = \
- ${patsubst %.1,%.xml,${patsubst %.3,%.xml,${patsubst %.5,%.xml,${patsubst %.7,%.xml,${patsubst %.8,%.xml,$(MANPAGES)}}}}}
-HTML_FILES = \
- ${XML_FILES:.xml=.html}
-HTML_ALIAS = \
- ${patsubst %.1,%.html,${patsubst %.3,%.html,${patsubst %.5,%.html,${patsubst %.7,%.html,${patsubst %.8,%.html,$(MANPAGES_ALIAS)}}}}}
-
-if ENABLE_MANPAGES
-man_MANS = \
- $(MANPAGES) \
- $(MANPAGES_ALIAS)
-
-noinst_DATA += \
- $(HTML_FILES) \
- $(HTML_ALIAS) \
- docs/html/man
-endif
-
-CLEANFILES += \
- $(man_MANS) \
- $(HTML_FILES) \
- $(HTML_ALIAS) \
- docs/html/man
-
-docs/html/man:
- $(AM_V_at)$(MKDIR_P) $(dir $@)
- $(AM_V_LN)$(LN_S) -f ../../man $@
-
-man/index.html: man/systemd.index.html
- $(AM_V_LN)$(LN_S) -f systemd.index.html $@
-
-if HAVE_PYTHON
-if ENABLE_MANPAGES
-noinst_DATA += \
- man/index.html
-endif
-endif
-
-CLEANFILES += \
- man/index.html
-
-XML_GLOB = $(wildcard $(top_srcdir)/man/*.xml)
-NON_INDEX_XML_FILES = $(filter-out man/systemd.index.xml,$(XML_FILES))
-SOURCE_XML_FILES = ${patsubst %,$(top_srcdir)/%,$(filter-out man/systemd.directives.xml,$(NON_INDEX_XML_FILES))}
-
-# This target should only be run manually. It recreates Makefile-man.am
-# file in the source directory based on all man/*.xml files. Run it after
-# adding, removing, or changing the conditional in a man page.
-update-man-list: $(top_srcdir)/tools/make-man-rules.py $(XML_GLOB) man/custom-entities.ent
- $(AM_V_GEN)$(PYTHON) $< $(XML_GLOB) > $(top_srcdir)/Makefile-man.tmp
- $(AM_V_at)mv $(top_srcdir)/Makefile-man.tmp $(top_srcdir)/Makefile-man.am
- @echo "Makefile-man.am has been regenerated"
-
-man/systemd.index.xml: $(top_srcdir)/tools/make-man-index.py $(NON_INDEX_XML_FILES)
- $(AM_V_at)$(MKDIR_P) $(dir $@)
- $(AM_V_GEN)$(PYTHON) $< $@ $(filter-out $<,$^)
-
-man/systemd.directives.xml: $(top_srcdir)/tools/make-directive-index.py man/custom-entities.ent $(SOURCE_XML_FILES)
- $(AM_V_at)$(MKDIR_P) $(dir $@)
- $(AM_V_GEN)$(PYTHON) $< $@ $(SOURCE_XML_FILES)
-
-CLEANFILES += \
- man/systemd.index.xml \
- man/systemd.directives.xml
-
-EXTRA_DIST += \
- $(filter-out man/systemd.directives.xml man/systemd.index.xml,$(XML_FILES)) \
- tools/make-man-index.py \
- tools/make-man-rules.py \
- tools/make-directive-index.py \
- tools/xml_helper.py \
- man/glib-event-glue.c \
- man/50-xdg-data-dirs.sh \
- man/90-rearrange-path.py
-
-# ------------------------------------------------------------------------------
-noinst_LTLIBRARIES += \
- libbasic.la
-
-libbasic_la_SOURCES = \
- src/basic/missing.h \
- src/basic/missing_syscall.h \
- src/basic/raw-clone.h \
- src/basic/capability-util.c \
- src/basic/capability-util.h \
- src/basic/conf-files.c \
- src/basic/conf-files.h \
- src/basic/stdio-util.h \
- src/basic/hostname-util.h \
- src/basic/hostname-util.c \
- src/basic/unit-name.c \
- src/basic/unit-name.h \
- src/basic/ioprio.h \
- src/basic/securebits.h \
- src/basic/special.h \
- src/basic/list.h \
- src/basic/unaligned.h \
- src/basic/macro.h \
- src/basic/def.h \
- src/basic/sparse-endian.h \
- src/basic/refcnt.h \
- src/basic/util.c \
- src/basic/util.h \
- src/basic/io-util.c \
- src/basic/io-util.h \
- src/basic/string-util.c \
- src/basic/string-util.h \
- src/basic/fd-util.c \
- src/basic/fd-util.h \
- src/basic/parse-util.c \
- src/basic/parse-util.h \
- src/basic/user-util.c \
- src/basic/user-util.h \
- src/basic/rlimit-util.c \
- src/basic/rlimit-util.h \
- src/basic/dirent-util.c \
- src/basic/dirent-util.h \
- src/basic/xattr-util.c \
- src/basic/xattr-util.h \
- src/basic/chattr-util.c \
- src/basic/chattr-util.h \
- src/basic/proc-cmdline.c \
- src/basic/proc-cmdline.h \
- src/basic/fs-util.c \
- src/basic/fs-util.h \
- src/basic/syslog-util.c \
- src/basic/syslog-util.h \
- src/basic/stat-util.c \
- src/basic/stat-util.h \
- src/basic/mount-util.c \
- src/basic/mount-util.h \
- src/basic/hexdecoct.c \
- src/basic/hexdecoct.h \
- src/basic/glob-util.h \
- src/basic/glob-util.c \
- src/basic/extract-word.c \
- src/basic/extract-word.h \
- src/basic/escape.c \
- src/basic/escape.h \
- src/basic/cpu-set-util.c \
- src/basic/cpu-set-util.h \
- src/basic/lockfile-util.c \
- src/basic/lockfile-util.h \
- src/basic/path-util.c \
- src/basic/path-util.h \
- src/basic/time-util.c \
- src/basic/time-util.h \
- src/basic/locale-util.c \
- src/basic/locale-util.h \
- src/basic/umask-util.h \
- src/basic/signal-util.c \
- src/basic/signal-util.h \
- src/basic/string-table.c \
- src/basic/string-table.h \
- src/basic/mempool.c \
- src/basic/mempool.h \
- src/basic/hashmap.c \
- src/basic/hashmap.h \
- src/basic/hash-funcs.c \
- src/basic/hash-funcs.h \
- src/basic/siphash24.c \
- src/basic/siphash24.h \
- src/basic/set.h \
- src/basic/ordered-set.h \
- src/basic/ordered-set.c \
- src/basic/bitmap.c \
- src/basic/bitmap.h \
- src/basic/prioq.c \
- src/basic/prioq.h \
- src/basic/web-util.c \
- src/basic/web-util.h \
- src/basic/strv.c \
- src/basic/strv.h \
- src/basic/env-util.c \
- src/basic/env-util.h \
- src/basic/strbuf.c \
- src/basic/strbuf.h \
- src/basic/strxcpyx.c \
- src/basic/strxcpyx.h \
- src/basic/log.c \
- src/basic/log.h \
- src/basic/bus-label.c \
- src/basic/bus-label.h \
- src/basic/ratelimit.h \
- src/basic/ratelimit.c \
- src/basic/exec-util.c \
- src/basic/exec-util.h \
- src/basic/exit-status.c \
- src/basic/exit-status.h \
- src/basic/virt.c \
- src/basic/virt.h \
- src/basic/architecture.c \
- src/basic/architecture.h \
- src/basic/smack-util.c \
- src/basic/smack-util.h \
- src/basic/device-nodes.c \
- src/basic/device-nodes.h \
- src/basic/utf8.c \
- src/basic/utf8.h \
- src/basic/gunicode.c \
- src/basic/gunicode.h \
- src/basic/socket-util.c \
- src/basic/socket-util.h \
- src/basic/in-addr-util.c \
- src/basic/in-addr-util.h \
- src/basic/ether-addr-util.h \
- src/basic/ether-addr-util.c \
- src/basic/replace-var.c \
- src/basic/replace-var.h \
- src/basic/clock-util.c \
- src/basic/clock-util.h \
- src/basic/calendarspec.c \
- src/basic/calendarspec.h \
- src/basic/fileio.c \
- src/basic/fileio.h \
- src/basic/MurmurHash2.c \
- src/basic/MurmurHash2.h \
- src/basic/mkdir.c \
- src/basic/mkdir.h \
- src/basic/cgroup-util.c \
- src/basic/cgroup-util.h \
- src/basic/errno-list.c \
- src/basic/errno-list.h \
- src/basic/af-list.c \
- src/basic/af-list.h \
- src/basic/arphrd-list.c \
- src/basic/arphrd-list.h \
- src/basic/terminal-util.c \
- src/basic/terminal-util.h \
- src/basic/login-util.h \
- src/basic/login-util.c \
- src/basic/cap-list.c \
- src/basic/cap-list.h \
- src/basic/audit-util.c \
- src/basic/audit-util.h \
- src/basic/xml.c \
- src/basic/xml.h \
- src/basic/barrier.c \
- src/basic/barrier.h \
- src/basic/async.c \
- src/basic/async.h \
- src/basic/memfd-util.c \
- src/basic/memfd-util.h \
- src/basic/process-util.c \
- src/basic/process-util.h \
- src/basic/random-util.c \
- src/basic/random-util.h \
- src/basic/verbs.c \
- src/basic/verbs.h \
- src/basic/sigbus.c \
- src/basic/sigbus.h \
- src/basic/build.h \
- src/basic/socket-label.c \
- src/basic/label.c \
- src/basic/label.h \
- src/basic/btrfs-util.c \
- src/basic/btrfs-util.h \
- src/basic/btrfs-ctree.h \
- src/basic/selinux-util.c \
- src/basic/selinux-util.h \
- src/basic/mkdir-label.c \
- src/basic/fileio-label.c \
- src/basic/fileio-label.h \
- src/basic/rm-rf.c \
- src/basic/rm-rf.h \
- src/basic/copy.c \
- src/basic/copy.h \
- src/basic/alloc-util.h \
- src/basic/alloc-util.c \
- src/basic/format-util.h \
- src/basic/nss-util.h \
- src/basic/khash.h \
- src/basic/khash.c \
- src/basic/journal-importer.h \
- src/basic/journal-importer.c
-
-nodist_libbasic_la_SOURCES = \
- src/basic/errno-from-name.h \
- src/basic/errno-to-name.h \
- src/basic/af-from-name.h \
- src/basic/af-to-name.h \
- src/basic/arphrd-from-name.h \
- src/basic/arphrd-to-name.h \
- src/basic/cap-from-name.h \
- src/basic/cap-to-name.h
-
-libbasic_la_CFLAGS = \
- $(AM_CFLAGS) \
- $(SELINUX_CFLAGS) \
- $(CAP_CFLAGS) \
- -pthread
-
-libbasic_la_LIBADD = \
- $(SELINUX_LIBS) \
- $(CAP_LIBS) \
- -lrt
-
-# -----------------------------------------------------------------------------
-noinst_LTLIBRARIES += \
- libshared.la
-
-libshared_la_SOURCES = \
- src/shared/output-mode.h \
- src/shared/output-mode.c \
- src/shared/gpt.h \
- src/shared/udev-util.h \
- src/shared/udev-util.c \
- src/shared/linux/auto_dev-ioctl.h \
- src/shared/linux-3.13/dm-ioctl.h \
- src/shared/initreq.h \
- src/shared/dns-domain.c \
- src/shared/dns-domain.h \
- src/shared/efivars.c \
- src/shared/efivars.h \
- src/shared/fstab-util.c \
- src/shared/fstab-util.h \
- src/shared/sleep-config.c \
- src/shared/sleep-config.h \
- src/shared/conf-parser.c \
- src/shared/conf-parser.h \
- src/shared/pager.c \
- src/shared/pager.h \
- src/shared/spawn-polkit-agent.c \
- src/shared/spawn-polkit-agent.h \
- src/shared/apparmor-util.c \
- src/shared/apparmor-util.h \
- src/shared/ima-util.c \
- src/shared/ima-util.h \
- src/shared/journal-util.c \
- src/shared/journal-util.h \
- src/shared/ptyfwd.c \
- src/shared/ptyfwd.h \
- src/shared/base-filesystem.c \
- src/shared/base-filesystem.h \
- src/shared/uid-range.c \
- src/shared/uid-range.h \
- src/shared/install.c \
- src/shared/install.h \
- src/shared/install-printf.c \
- src/shared/install-printf.h \
- src/shared/path-lookup.c \
- src/shared/path-lookup.h \
- src/shared/specifier.c \
- src/shared/specifier.h \
- src/shared/dev-setup.c \
- src/shared/dev-setup.h \
- src/shared/dropin.c \
- src/shared/dropin.h \
- src/shared/condition.c \
- src/shared/condition.h \
- src/shared/clean-ipc.c \
- src/shared/clean-ipc.h \
- src/shared/generator.h \
- src/shared/generator.c \
- src/shared/acpi-fpdt.h \
- src/shared/acpi-fpdt.c \
- src/shared/boot-timestamps.h \
- src/shared/boot-timestamps.c \
- src/shared/cgroup-show.c \
- src/shared/cgroup-show.h \
- src/shared/utmp-wtmp.h \
- src/shared/watchdog.c \
- src/shared/watchdog.h \
- src/shared/spawn-ask-password-agent.c \
- src/shared/spawn-ask-password-agent.h \
- src/shared/ask-password-api.c \
- src/shared/ask-password-api.h \
- src/shared/switch-root.h \
- src/shared/switch-root.c \
- src/shared/import-util.c \
- src/shared/import-util.h \
- src/shared/sysctl-util.c \
- src/shared/sysctl-util.h \
- src/shared/bus-util.c \
- src/shared/bus-util.h \
- src/shared/logs-show.c \
- src/shared/logs-show.h \
- src/shared/machine-image.c \
- src/shared/machine-image.h \
- src/shared/machine-pool.c \
- src/shared/machine-pool.h \
- src/shared/loop-util.c \
- src/shared/loop-util.h \
- src/shared/resolve-util.c \
- src/shared/resolve-util.h \
- src/shared/bus-unit-util.c \
- src/shared/bus-unit-util.h \
- src/shared/vlan-util.h \
- src/shared/vlan-util.c \
- src/shared/tests.h \
- src/shared/tests.c \
- src/shared/fdset.c \
- src/shared/fdset.h \
- src/shared/nsflags.h \
- src/shared/nsflags.c \
- src/shared/dissect-image.c \
- src/shared/dissect-image.h \
- src/shared/volatile-util.c \
- src/shared/volatile-util.h
-
-if HAVE_UTMP
-libshared_la_SOURCES += \
- src/shared/utmp-wtmp.c
-endif
-
-if HAVE_SECCOMP
-libshared_la_SOURCES += \
- src/shared/seccomp-util.h \
- src/shared/seccomp-util.c
-endif
-
-if HAVE_ACL
-libshared_la_SOURCES += \
- src/shared/acl-util.c \
- src/shared/acl-util.h
-endif
-
-libshared_la_CFLAGS = \
- $(AM_CFLAGS) \
- $(ACL_CFLAGS) \
- $(LIBIDN_CFLAGS) \
- $(LIBIDN2_CFLAGS) \
- $(SECCOMP_CFLAGS) \
- $(BLKID_CFLAGS) \
- $(LIBCRYPTSETUP_CFLAGS)
-
-libshared_la_LIBADD = \
- libsystemd-internal.la \
- libbasic.la \
- libsystemd-journal-internal.la \
- libudev-internal.la \
- $(ACL_LIBS) \
- $(LIBIDN_LIBS) \
- $(LIBIDN2_LIBS) \
- $(SECCOMP_LIBS) \
- $(BLKID_LIBS) \
- $(LIBCRYPTSETUP_LIBS)
-
-rootlibexec_LTLIBRARIES += \
- libsystemd-shared.la
-
-libsystemd_shared_la_SOURCES = \
- $(libbasic_la_SOURCES) \
- $(libshared_la_SOURCES) \
- $(libsystemd_internal_la_SOURCES) \
- $(libsystemd_journal_internal_la_SOURCES) \
- $(libudev_internal_la_SOURCES)
-
-libsystemd_shared_la_CFLAGS = \
- $(AM_CFLAGS) \
- $(libbasic_la_CFLAGS) \
- $(libshared_la_CFLAGS) \
- $(libsystemd_internal_la_CFLAGS) \
- $(libsystemd_journal_internal_la_CFLAGS) \
- $(libudev_internal_la_CFLAGS) \
- $(ACL_CFLAGS) \
- $(LIBIDN_CFLAGS) \
- $(LIBIDN2_CFLAGS) \
- $(SECCOMP_CFLAGS) \
- $(BLKID_CFLAGS) \
- $(LIBCRYPTSETUP_CFLAGS) \
- -fvisibility=default
-
-# We can't use libshared_la_LIBADD here because it would
-# pull in libsystemd*-internal.la
-libsystemd_shared_la_LIBADD = \
- $(libbasic_la_LIBADD) \
- $(libsystemd_internal_la_LIBADD) \
- $(libsystemd_journal_internal_la_LIBADD) \
- $(libudev_internal_la_LIBADD) \
- $(ACL_LIBS) \
- $(LIBIDN_LIBS) \
- $(LIBIDN2_LIBS) \
- $(SECCOMP_LIBS) \
- $(BLKID_LIBS) \
- $(LIBCRYPTSETUP_LIBS)
-
-libsystemd_shared_la_LDFLAGS = \
- $(AM_LDFLAGS) \
- -release $(PACKAGE_VERSION)
-
-
-# -----------------------------------------------------------------------------
-if HAVE_LIBIPTC
-noinst_LTLIBRARIES += \
- libfirewall.la
-
-libfirewall_la_SOURCES = \
- src/shared/firewall-util.h \
- src/shared/firewall-util.c
-
-libfirewall_la_CFLAGS = \
- $(AM_CFLAGS) \
- $(LIBIPTC_CFLAGS)
-
-libfirewall_la_LIBADD = \
- $(LIBIPTC_LIBS)
-endif
-
-# -----------------------------------------------------------------------------
-if ENABLE_LDCONFIG
-dist_systemunit_DATA += \
- units/ldconfig.service
-
-SYSINIT_TARGET_WANTS += \
- ldconfig.service
-endif
-
-# ------------------------------------------------------------------------------
-noinst_LTLIBRARIES += \
- libcore.la
-
-libcore_la_SOURCES = \
- src/core/unit.c \
- src/core/unit.h \
- src/core/unit-printf.c \
- src/core/unit-printf.h \
- src/core/job.c \
- src/core/job.h \
- src/core/manager.c \
- src/core/manager.h \
- src/core/transaction.c \
- src/core/transaction.h \
- src/core/load-fragment.c \
- src/core/load-fragment.h \
- src/core/service.c \
- src/core/service.h \
- src/core/socket.c \
- src/core/socket.h \
- src/core/busname.c \
- src/core/busname.h \
- src/core/bus-policy.c \
- src/core/bus-policy.h \
- src/core/target.c \
- src/core/target.h \
- src/core/device.c \
- src/core/device.h \
- src/core/mount.c \
- src/core/mount.h \
- src/core/automount.c \
- src/core/automount.h \
- src/core/swap.c \
- src/core/swap.h \
- src/core/timer.c \
- src/core/timer.h \
- src/core/path.c \
- src/core/path.h \
- src/core/slice.c \
- src/core/slice.h \
- src/core/scope.c \
- src/core/scope.h \
- src/core/load-dropin.c \
- src/core/load-dropin.h \
- src/core/execute.c \
- src/core/execute.h \
- src/core/dynamic-user.c \
- src/core/dynamic-user.h \
- src/core/kill.c \
- src/core/kill.h \
- src/core/dbus.c \
- src/core/dbus.h \
- src/core/dbus-manager.c \
- src/core/dbus-manager.h \
- src/core/dbus-unit.c \
- src/core/dbus-unit.h \
- src/core/dbus-job.c \
- src/core/dbus-job.h \
- src/core/dbus-service.c \
- src/core/dbus-service.h \
- src/core/dbus-socket.c \
- src/core/dbus-socket.h \
- src/core/dbus-busname.c \
- src/core/dbus-busname.h \
- src/core/dbus-target.c \
- src/core/dbus-target.h \
- src/core/dbus-device.c \
- src/core/dbus-device.h \
- src/core/dbus-mount.c \
- src/core/dbus-mount.h \
- src/core/dbus-automount.c \
- src/core/dbus-automount.h \
- src/core/dbus-swap.c \
- src/core/dbus-swap.h \
- src/core/dbus-timer.c \
- src/core/dbus-timer.h \
- src/core/dbus-path.c \
- src/core/dbus-path.h \
- src/core/dbus-slice.c \
- src/core/dbus-slice.h \
- src/core/dbus-scope.c \
- src/core/dbus-scope.h \
- src/core/dbus-execute.c \
- src/core/dbus-execute.h \
- src/core/dbus-kill.c \
- src/core/dbus-kill.h \
- src/core/dbus-cgroup.c \
- src/core/dbus-cgroup.h \
- src/core/cgroup.c \
- src/core/cgroup.h \
- src/core/selinux-access.c \
- src/core/selinux-access.h \
- src/core/selinux-setup.c \
- src/core/selinux-setup.h \
- src/core/smack-setup.c \
- src/core/smack-setup.h \
- src/core/ima-setup.c \
- src/core/ima-setup.h \
- src/core/locale-setup.h \
- src/core/locale-setup.c \
- src/core/hostname-setup.c \
- src/core/hostname-setup.h \
- src/core/machine-id-setup.c \
- src/core/machine-id-setup.h \
- src/core/mount-setup.c \
- src/core/mount-setup.h \
- src/core/kmod-setup.c \
- src/core/kmod-setup.h \
- src/core/loopback-setup.h \
- src/core/loopback-setup.c \
- src/core/namespace.c \
- src/core/namespace.h \
- src/core/killall.h \
- src/core/killall.c \
- src/core/audit-fd.c \
- src/core/audit-fd.h \
- src/core/show-status.c \
- src/core/show-status.h \
- src/core/emergency-action.c \
- src/core/emergency-action.h
-
-nodist_libcore_la_SOURCES = \
- src/core/load-fragment-gperf.c \
- src/core/load-fragment-gperf-nulstr.c
-
-libcore_la_CFLAGS = \
- $(AM_CFLAGS) \
- $(PAM_CFLAGS) \
- $(AUDIT_CFLAGS) \
- $(KMOD_CFLAGS) \
- $(APPARMOR_CFLAGS) \
- $(MOUNT_CFLAGS) \
- $(SECCOMP_CFLAGS)
-
-libcore_la_LIBADD = \
- libsystemd-shared.la \
- $(PAM_LIBS) \
- $(AUDIT_LIBS) \
- $(KMOD_LIBS) \
- $(APPARMOR_LIBS) \
- $(MOUNT_LIBS)
-
-src/core/load-fragment-gperf-nulstr.c: src/core/load-fragment-gperf.gperf
- $(AM_V_at)$(MKDIR_P) $(dir $@)
- $(AM_V_GEN)$(AWK) 'BEGIN{ keywords=0 ; FS="," ; print "extern const char load_fragment_gperf_nulstr[];" ; print "const char load_fragment_gperf_nulstr[] ="} ; keyword==1 { print "\"" $$1 "\\0\"" } ; /%%/ { keyword=1} ; END { print ";" }' < $< > $@
-
-gperf_gperf_m4_sources = \
- src/core/load-fragment-gperf.gperf.m4
-
-gperf_txt_sources = \
- src/basic/errno-list.txt \
- src/basic/af-list.txt \
- src/basic/arphrd-list.txt \
- src/basic/cap-list.txt
-
-BUILT_SOURCES += \
- $(gperf_gperf_m4_sources:-gperf.gperf.m4=-gperf.c) \
- $(gperf_gperf_m4_sources:-gperf.gperf.m4=-gperf-nulstr.c) \
- $(gperf_gperf_sources:-gperf.gperf=-gperf.c) \
- $(gperf_txt_sources:-list.txt=-from-name.h) \
- $(filter-out %keyboard-keys-to-name.h,$(gperf_txt_sources:-list.txt=-to-name.h))
-
-CLEANFILES += \
- $(gperf_txt_sources:-list.txt=-from-name.gperf)
-DISTCLEANFILES = \
- $(gperf_txt_sources)
-
-EXTRA_DIST += \
- $(gperf_gperf_m4_sources) \
- $(gperf_gperf_sources)
-
-CLEANFILES += \
- $(gperf_txt_sources)
-
-%-from-name.gperf: %-list.txt
- $(AM_V_at)$(MKDIR_P) $(dir $@)
- $(AM_V_GEN)$(AWK) 'BEGIN{ print "struct $(notdir $*)_name { const char* name; int id; };"; print "%null-strings"; print "%%";} { printf "%s, %s\n", $$1, $$1 }' <$< >$@
-
-%-from-name.h: %-from-name.gperf
- $(AM_V_at)$(MKDIR_P) $(dir $@)
- $(AM_V_GPERF)$(GPERF) -L ANSI-C -t --ignore-case -N lookup_$(notdir $*) -H hash_$(notdir $*)_name -p -C <$< >$@
-
-
-src/basic/errno-list.txt:
- $(AM_V_at)$(MKDIR_P) $(dir $@)
- $(AM_V_GEN)$(CPP) $(CFLAGS) $(AM_CPPFLAGS) $(CPPFLAGS) -dM -include errno.h - </dev/null | $(AWK) '/^#define[ \t]+E[^ _]+[ \t]+/ { print $$2; }' >$@
-
-src/basic/errno-to-name.h: src/basic/errno-list.txt
- $(AM_V_at)$(MKDIR_P) $(dir $@)
- $(AM_V_GEN)$(AWK) 'BEGIN{ print "static const char* const errno_names[] = { "} !/EDEADLOCK/ && !/EWOULDBLOCK/ && !/ENOTSUP/ { printf "[%s] = \"%s\",\n", $$1, $$1 } END{print "};"}' <$< >$@
-
-
-src/basic/af-list.txt:
- $(AM_V_at)$(MKDIR_P) $(dir $@)
- $(AM_V_GEN)$(CPP) $(CFLAGS) $(AM_CPPFLAGS) $(CPPFLAGS) -dM -include sys/socket.h - </dev/null | grep -v AF_UNSPEC | grep -v AF_MAX | $(AWK) '/^#define[ \t]+AF_[^ \t]+[ \t]+PF_[^ \t]/ { print $$2; }' >$@
-
-src/basic/af-to-name.h: src/basic/af-list.txt
- $(AM_V_at)$(MKDIR_P) $(dir $@)
- $(AM_V_GEN)$(AWK) 'BEGIN{ print "static const char* const af_names[] = { "} !/AF_FILE/ && !/AF_ROUTE/ && !/AF_LOCAL/ { printf "[%s] = \"%s\",\n", $$1, $$1 } END{print "};"}' <$< >$@
-
-
-src/basic/arphrd-list.txt:
- $(AM_V_at)$(MKDIR_P) $(dir $@)
- $(AM_V_GEN)$(CPP) $(CFLAGS) $(AM_CPPFLAGS) $(CPPFLAGS) -dM -include net/if_arp.h - </dev/null | $(AWK) '/^#define[ \t]+ARPHRD_[^ \t]+[ \t]+[^ \t]/ { print $$2; }' | sed -e 's/ARPHRD_//' >$@
-
-src/basic/arphrd-to-name.h: src/basic/arphrd-list.txt
- $(AM_V_at)$(MKDIR_P) $(dir $@)
- $(AM_V_GEN)$(AWK) 'BEGIN{ print "static const char* const arphrd_names[] = { "} !/CISCO/ { printf "[ARPHRD_%s] = \"%s\",\n", $$1, $$1 } END{print "};"}' <$< >$@
-
-src/basic/arphrd-from-name.gperf: src/basic/arphrd-list.txt
- $(AM_V_at)$(MKDIR_P) $(dir $@)
- $(AM_V_GEN)$(AWK) 'BEGIN{ print "struct arphrd_name { const char* name; int id; };"; print "%null-strings"; print "%%";} { printf "%s, ARPHRD_%s\n", $$1, $$1 }' <$< >$@
-
-
-src/basic/cap-list.txt:
- $(AM_V_at)$(MKDIR_P) $(dir $@)
- $(AM_V_GEN)$(CPP) $(CFLAGS) $(AM_CPPFLAGS) $(CPPFLAGS) -dM -include linux/capability.h -include missing.h - </dev/null | $(AWK) '/^#define[ \t]+CAP_[A-Z_]+[ \t]+/ { print $$2; }' | grep -v CAP_LAST_CAP >$@
-
-src/basic/cap-to-name.h: src/basic/cap-list.txt
- $(AM_V_at)$(MKDIR_P) $(dir $@)
- $(AM_V_GEN)$(AWK) 'BEGIN{ print "static const char* const capability_names[] = { "} { printf "[%s] = \"%s\",\n", $$1, tolower($$1) } END{print "};"}' <$< >$@
-
-src/basic/cap-from-name.gperf: src/basic/cap-list.txt
- $(AM_V_at)$(MKDIR_P) $(dir $@)
- $(AM_V_GEN)$(AWK) 'BEGIN{ print "struct capability_name { const char* name; int id; };"; print "%null-strings"; print "%%";} { printf "%s, %s\n", $$1, $$1 }' <$< >$@
-
-src/basic/cap-from-name.h: src/basic/cap-from-name.gperf
- $(AM_V_at)$(MKDIR_P) $(dir $@)
- $(AM_V_GPERF)$(GPERF) -L ANSI-C -t --ignore-case -N lookup_capability -H hash_capability_name -p -C <$< >$@
-
-audit_list_includes = -include linux/audit.h -include missing.h
-if HAVE_AUDIT
-audit_list_includes += -include libaudit.h
-endif
-
-src/journal/audit_type-list.txt:
- $(AM_V_at)$(MKDIR_P) $(dir $@)
- $(AM_V_GEN)$(CPP) $(CFLAGS) $(AM_CPPFLAGS) $(CPPFLAGS) -dM $(audit_list_includes) - </dev/null | grep -vE 'AUDIT_.*(FIRST|LAST)_' | $(SED) -r -n 's/^#define\s+AUDIT_(\w+)\s+([0-9]{4})\s*$$/\1\t\2/p' | sort -k2 >$@
-
-src/journal/audit_type-to-name.h: src/journal/audit_type-list.txt
- $(AM_V_at)$(MKDIR_P) $(dir $@)
- $(AM_V_GEN)$(AWK) 'BEGIN{ print "const char *audit_type_to_string(int type) {\n\tswitch(type) {" } {printf " case AUDIT_%s: return \"%s\";\n", $$1, $$1 } END{ print " default: return NULL;\n\t}\n}\n" }' <$< >$@
-
-
-src/resolve/dns_type-list.txt: src/resolve/dns-type.h
- $(AM_V_at)$(MKDIR_P) $(dir $@)
- $(AM_V_GEN)$(SED) -n -r 's/.* DNS_TYPE_(\w+).*/\1/p' <$< >$@
-
-src/resolve/dns_type-to-name.h: src/resolve/dns_type-list.txt
- $(AM_V_at)$(MKDIR_P) $(dir $@)
- $(AM_V_GEN)$(AWK) 'BEGIN{ print "const char *dns_type_to_string(int type) {\n\tswitch(type) {" } {printf " case DNS_TYPE_%s: return ", $$1; sub(/_/, "-"); printf "\"%s\";\n", $$1 } END{ print " default: return NULL;\n\t}\n}\n" }' <$< >$@
-
-src/resolve/dns_type-from-name.gperf: src/resolve/dns_type-list.txt
- $(AM_V_at)$(MKDIR_P) $(dir $@)
- $(AM_V_GEN)$(AWK) 'BEGIN{ print "struct dns_type_name { const char* name; int id; };"; print "%null-strings"; print "%%";} { s=$$1; sub(/_/, "-", s); printf "%s, ", $$s; printf "DNS_TYPE_%s\n", $$1 }' <$< >$@
-
-# ------------------------------------------------------------------------------
-systemd_SOURCES = \
- src/core/main.c
-
-systemd_CFLAGS = \
- $(AM_CFLAGS) \
- $(SECCOMP_CFLAGS) \
- $(MOUNT_CFLAGS)
-
-systemd_LDADD = \
- libcore.la
-
-dist_pkgsysconf_DATA += \
- src/core/system.conf \
- src/core/user.conf
-
-dist_dbuspolicy_DATA += \
- src/core/org.freedesktop.systemd1.conf
-
-dist_dbussystemservice_DATA += \
- src/core/org.freedesktop.systemd1.service
-
-polkitpolicy_in_in_files += \
- src/core/org.freedesktop.systemd1.policy.in.in
-
-pkgconfigdata_DATA += \
- src/core/systemd.pc
-
-if ENABLE_RPM_MACROS
-nodist_rpmmacros_DATA = \
- src/core/macros.systemd
-endif
-
-BUILT_SOURCES += \
- src/core/triggers.systemd
-
-EXTRA_DIST += \
- src/core/systemd.pc.in \
- src/core/macros.systemd.in \
- src/core/triggers.systemd.in
-
-# ------------------------------------------------------------------------------
-
-manual_tests += \
- test-ns \
- test-cgroup \
- test-install \
- test-btrfs \
- test-acd \
- test-ipv4ll-manual \
- test-ask-password-api \
- test-dissect-image
-
-unsafe_tests = \
- test-hostname \
- test-ipcrm
-
-if HAVE_LIBIPTC
-manual_tests += \
- test-firewall-util
-endif
-
-if HAVE_KMOD
-manual_tests += \
- test-netlink-manual
-endif
-
-tests += \
- test-daemon \
- test-log \
- test-loopback \
- test-engine \
- test-watchdog \
- test-cgroup-mask \
- test-job-type \
- test-env-util \
- test-strbuf \
- test-strv \
- test-path \
- test-path-util \
- test-strxcpyx \
- test-siphash24 \
- test-unit-name \
- test-unit-file \
- test-utf8 \
- test-ellipsize \
- test-util \
- test-mount-util \
- test-exec-util \
- test-cpu-set-util \
- test-hexdecoct \
- test-escape \
- test-alloc-util \
- test-proc-cmdline \
- test-io-util \
- test-glob-util \
- test-xattr-util \
- test-fs-util \
- test-web-util \
- test-stat-util \
- test-fd-util \
- test-string-util \
- test-extract-word \
- test-parse-util \
- test-user-util \
- test-hostname-util \
- test-process-util \
- test-terminal-util \
- test-path-lookup \
- test-barrier \
- test-tmpfiles \
- test-namespace \
- test-date \
- test-sleep \
- test-replace-var \
- test-sched-prio \
- test-calendarspec \
- test-strip-tab-ansi \
- test-cgroup-util \
- test-fstab-util \
- test-prioq \
- test-fileio \
- test-time \
- test-clock \
- test-hashmap \
- test-set \
- test-bitmap \
- test-list \
- test-unaligned \
- test-tables \
- test-device-nodes \
- test-xml \
- test-architecture \
- test-socket-util \
- test-fdset \
- test-conf-files \
- test-conf-parser \
- test-capability \
- test-async \
- test-random-util \
- test-ratelimit \
- test-condition \
- test-uid-range \
- test-locale-util \
- test-execute \
- test-copy \
- test-cap-list \
- test-sigbus \
- test-verbs \
- test-af-list \
- test-arphrd-list \
- test-dns-domain \
- test-install-root \
- test-rlimit-util \
- test-signal-util \
- test-selinux \
- test-sizeof \
- test-journal-importer
-
-if HAVE_ACL
-tests += \
- test-acl-util
-endif
-
-if HAVE_SECCOMP
-tests += \
- test-seccomp
-endif
-
-TEST_DATA_FILES += \
- test/a.service \
- test/basic.target \
- test/b.service \
- test/c.service \
- test/daughter.service \
- test/d.service \
- test/end.service \
- test/e.service \
- test/f.service \
- test/grandchild.service \
- test/g.service \
- test/hello-after-sleep.target \
- test/hello.service \
- test/h.service \
- test/parent-deep.slice \
- test/parent.slice \
- test/sched_idle_bad.service \
- test/sched_idle_ok.service \
- test/sched_rr_bad.service \
- test/sched_rr_change.service \
- test/sched_rr_ok.service \
- test/shutdown.target \
- test/sleep.service \
- test/sockets.target \
- test/son.service \
- test/sysinit.target \
- test/testsuite.target \
- test/timers.target \
- test/unstoppable.service \
- test/test-path/paths.target \
- test/test-path/basic.target \
- test/test-path/sysinit.target \
- test/test-path/path-changed.service \
- test/test-path/path-directorynotempty.service \
- test/test-path/path-existsglob.service \
- test/test-path/path-exists.service \
- test/test-path/path-makedirectory.service \
- test/test-path/path-modified.service \
- test/test-path/path-mycustomunit.service \
- test/test-path/path-service.service \
- test/test-path/path-changed.path \
- test/test-path/path-directorynotempty.path \
- test/test-path/path-existsglob.path \
- test/test-path/path-exists.path \
- test/test-path/path-makedirectory.path \
- test/test-path/path-modified.path \
- test/test-path/path-unit.path \
- test/test-execute/exec-environment-empty.service \
- test/test-execute/exec-environment-multiple.service \
- test/test-execute/exec-environment.service \
- test/test-execute/exec-passenvironment-absent.service \
- test/test-execute/exec-passenvironment-empty.service \
- test/test-execute/exec-passenvironment-repeated.service \
- test/test-execute/exec-passenvironment.service \
- test/test-execute/exec-group.service \
- test/test-execute/exec-group-nfsnobody.service \
- test/test-execute/exec-supplementarygroups.service \
- test/test-execute/exec-supplementarygroups-single-group.service \
- test/test-execute/exec-supplementarygroups-single-group-user.service \
- test/test-execute/exec-supplementarygroups-multiple-groups-default-group-user.service \
- test/test-execute/exec-supplementarygroups-multiple-groups-withgid.service \
- test/test-execute/exec-supplementarygroups-multiple-groups-withuid.service \
- test/test-execute/exec-dynamicuser-fixeduser.service \
- test/test-execute/exec-dynamicuser-fixeduser-one-supplementarygroup.service \
- test/test-execute/exec-dynamicuser-supplementarygroups.service \
- test/test-execute/exec-ignoresigpipe-no.service \
- test/test-execute/exec-ignoresigpipe-yes.service \
- test/test-execute/exec-personality-x86-64.service \
- test/test-execute/exec-personality-x86.service \
- test/test-execute/exec-personality-s390.service \
- test/test-execute/exec-personality-ppc64.service \
- test/test-execute/exec-personality-ppc64le.service \
- test/test-execute/exec-personality-aarch64.service \
- test/test-execute/exec-privatedevices-no.service \
- test/test-execute/exec-privatedevices-yes.service \
- test/test-execute/exec-privatedevices-no-capability-mknod.service \
- test/test-execute/exec-privatedevices-yes-capability-mknod.service \
- test/test-execute/exec-protectkernelmodules-no-capabilities.service \
- test/test-execute/exec-protectkernelmodules-yes-capabilities.service \
- test/test-execute/exec-protectkernelmodules-yes-mount-propagation.service \
- test/test-execute/exec-privatetmp-no.service \
- test/test-execute/exec-privatetmp-yes.service \
- test/test-execute/exec-readonlypaths.service \
- test/test-execute/exec-readonlypaths-mount-propagation.service \
- test/test-execute/exec-readwritepaths-mount-propagation.service \
- test/test-execute/exec-inaccessiblepaths-mount-propagation.service \
- test/test-execute/exec-inaccessiblepaths-proc.service \
- test/test-execute/exec-spec-interpolation.service \
- test/test-execute/exec-systemcallerrornumber.service \
- test/test-execute/exec-systemcallfilter-failing2.service \
- test/test-execute/exec-systemcallfilter-failing.service \
- test/test-execute/exec-systemcallfilter-not-failing2.service \
- test/test-execute/exec-systemcallfilter-not-failing.service \
- test/test-execute/exec-systemcallfilter-system-user.service \
- test/test-execute/exec-systemcallfilter-system-user-nfsnobody.service \
- test/test-execute/exec-user.service \
- test/test-execute/exec-user-nfsnobody.service \
- test/test-execute/exec-workingdirectory.service \
- test/test-execute/exec-umask-0177.service \
- test/test-execute/exec-umask-default.service \
- test/test-execute/exec-privatenetwork-yes.service \
- test/test-execute/exec-environmentfile.service \
- test/test-execute/exec-oomscoreadjust-positive.service \
- test/test-execute/exec-oomscoreadjust-negative.service \
- test/test-execute/exec-ioschedulingclass-best-effort.service \
- test/test-execute/exec-ioschedulingclass-idle.service \
- test/test-execute/exec-ioschedulingclass-none.service \
- test/test-execute/exec-ioschedulingclass-realtime.service \
- test/test-execute/exec-capabilityboundingset-invert.service \
- test/test-execute/exec-capabilityboundingset-merge.service \
- test/test-execute/exec-capabilityboundingset-reset.service \
- test/test-execute/exec-capabilityboundingset-simple.service \
- test/test-execute/exec-capabilityambientset.service \
- test/test-execute/exec-capabilityambientset-nfsnobody.service \
- test/test-execute/exec-capabilityambientset-merge.service \
- test/test-execute/exec-capabilityambientset-merge-nfsnobody.service \
- test/test-execute/exec-runtimedirectory.service \
- test/test-execute/exec-runtimedirectory-mode.service \
- test/test-execute/exec-runtimedirectory-owner.service \
- test/test-execute/exec-runtimedirectory-owner-nfsnobody.service \
- test/test-execute/exec-restrict-namespaces-no.service \
- test/test-execute/exec-restrict-namespaces-yes.service \
- test/test-execute/exec-restrict-namespaces-mnt.service \
- test/test-execute/exec-restrict-namespaces-mnt-blacklist.service \
- test/test-execute/exec-read-only-path-succeed.service \
- test/test-execute/exec-privatedevices-yes-capability-sys-rawio.service \
- test/test-execute/exec-privatedevices-no-capability-sys-rawio.service \
- test/bus-policy/hello.conf \
- test/bus-policy/methods.conf \
- test/bus-policy/ownerships.conf \
- test/bus-policy/signals.conf \
- test/bus-policy/check-own-rules.conf \
- test/bus-policy/many-rules.conf \
- test/bus-policy/test.conf \
- test/hwdb/10-bad.hwdb
-
-
-EXTRA_DIST += \
- src/test/test-helper.h
-
-test_device_nodes_SOURCES = \
- src/test/test-device-nodes.c
-
-test_device_nodes_LDADD = \
- libsystemd-shared.la
-
-test_engine_SOURCES = \
- src/test/test-engine.c
-
-test_engine_CFLAGS = \
- $(AM_CFLAGS) \
- $(SECCOMP_CFLAGS) \
- $(MOUNT_CFLAGS)
-
-test_engine_LDADD = \
- libcore.la
-
-test_job_type_SOURCES = \
- src/test/test-job-type.c
-
-test_job_type_CFLAGS = \
- $(AM_CFLAGS) \
- $(SECCOMP_CFLAGS) \
- $(MOUNT_CFLAGS)
-
-test_job_type_LDADD = \
- libcore.la
-
-test_ns_SOURCES = \
- src/test/test-ns.c
-
-test_ns_CFLAGS = \
- $(AM_CFLAGS) \
- $(SECCOMP_CFLAGS)
-
-test_ns_LDADD = \
- libcore.la
-
-test_loopback_SOURCES = \
- src/test/test-loopback.c
-
-test_loopback_LDADD = \
- libcore.la
-
-test_hostname_SOURCES = \
- src/test/test-hostname.c
-
-test_hostname_LDADD = \
- libcore.la
-
-test_dns_domain_SOURCES = \
- src/test/test-dns-domain.c
-
-test_dns_domain_LDADD = \
- libsystemd-network.la \
- libsystemd-shared.la
-
-
-if ENABLE_EFI
-tests += \
- test-boot-timestamps
-
-test_boot_timestamps_SOURCES = \
- src/test/test-boot-timestamps.c
-
-test_boot_timestamps_LDADD = \
- libsystemd-shared.la
-endif
-
-test_unit_name_SOURCES = \
- src/test/test-unit-name.c
-
-test_unit_name_CFLAGS = \
- $(AM_CFLAGS) \
- $(SECCOMP_CFLAGS) \
- $(MOUNT_CFLAGS)
-
-test_unit_name_LDADD = \
- libcore.la
-
-test_unit_file_SOURCES = \
- src/test/test-unit-file.c
-
-test_unit_file_CFLAGS = \
- $(AM_CFLAGS) \
- $(SECCOMP_CFLAGS) \
- $(MOUNT_CFLAGS)
-
-test_unit_file_LDADD = \
- libcore.la
-
-test_utf8_SOURCES = \
- src/test/test-utf8.c
-
-test_utf8_LDADD = \
- libsystemd-shared.la
-
-test_capability_SOURCES = \
- src/test/test-capability.c
-
-test_capability_CFLAGS = \
- $(AM_CFLAGS) \
- $(CAP_CFLAGS)
-
-test_capability_LDADD = \
- libsystemd-shared.la \
- $(CAP_LIBS)
-
-test_async_SOURCES = \
- src/test/test-async.c
-
-test_async_LDADD = \
- libsystemd-shared.la
-
-test_locale_util_SOURCES = \
- src/test/test-locale-util.c
-
-test_locale_util_LDADD = \
- libsystemd-shared.la
-
-test_copy_SOURCES = \
- src/test/test-copy.c
-
-# Link statically to ensure file is large
-test_copy_LDADD = \
- libshared.la
-
-test_sigbus_SOURCES = \
- src/test/test-sigbus.c
-
-test_sigbus_LDADD = \
- libsystemd-shared.la
-
-test_condition_SOURCES = \
- src/test/test-condition.c
-
-test_condition_LDADD = \
- libsystemd-shared.la
-
-test_fdset_SOURCES = \
- src/test/test-fdset.c
-
-test_fdset_LDADD = \
- libsystemd-shared.la
-
-test_fstab_util_SOURCES = \
- src/test/test-fstab-util.c
-
-test_fstab_util_LDADD = \
- libsystemd-shared.la
-
-test_random_util_SOURCES = \
- src/test/test-random-util.c
-
-test_random_util_LDADD = \
- libsystemd-shared.la
-
-test_ratelimit_SOURCES = \
- src/test/test-ratelimit.c
-
-test_ratelimit_LDADD = \
- libsystemd-shared.la
-
-test_util_SOURCES = \
- src/test/test-util.c
-
-test_util_LDADD = \
- libsystemd-shared.la
-
-test_mount_util_SOURCES = \
- src/test/test-mount-util.c
-
-test_mount_util_LDADD = \
- libsystemd-shared.la
-
-test_exec_util_SOURCES = \
- src/test/test-exec-util.c
-
-test_exec_util_LDADD = \
- libsystemd-shared.la
-
-test_hexdecoct_SOURCES = \
- src/test/test-hexdecoct.c
-
-test_hexdecoct_LDADD = \
- libsystemd-shared.la
-
-test_alloc_util_SOURCES = \
- src/test/test-alloc-util.c
-
-test_alloc_util_LDADD = \
- libsystemd-shared.la
-
-test_xattr_util_SOURCES = \
- src/test/test-xattr-util.c
-
-test_xattr_util_LDADD = \
- libsystemd-shared.la
-
-test_io_util_SOURCES = \
- src/test/test-io-util.c
-
-test_io_util_LDADD = \
- libsystemd-shared.la
-
-test_glob_util_SOURCES = \
- src/test/test-glob-util.c
-
-test_glob_util_LDADD = \
- libsystemd-shared.la
-
-test_fs_util_SOURCES = \
- src/test/test-fs-util.c
-
-test_fs_util_LDADD = \
- libsystemd-shared.la
-
-test_proc_cmdline_SOURCES = \
- src/test/test-proc-cmdline.c
-
-test_proc_cmdline_LDADD = \
- libsystemd-shared.la
-
-test_fd_util_SOURCES = \
- src/test/test-fd-util.c
-
-test_fd_util_LDADD = \
- libsystemd-shared.la
-
-test_web_util_SOURCES = \
- src/test/test-web-util.c
-
-test_web_util_LDADD = \
- libsystemd-shared.la
-
-test_cpu_set_util_SOURCES = \
- src/test/test-cpu-set-util.c
-
-test_cpu_set_util_LDADD = \
- libsystemd-shared.la
-
-test_stat_util_SOURCES = \
- src/test/test-stat-util.c
-
-test_stat_util_LDADD = \
- libsystemd-shared.la
-
-test_escape_SOURCES = \
- src/test/test-escape.c
-
-test_escape_LDADD = \
- libsystemd-shared.la
-
-test_string_util_SOURCES = \
- src/test/test-string-util.c
-
-test_string_util_LDADD = \
- libsystemd-shared.la
-
-test_extract_word_SOURCES = \
- src/test/test-extract-word.c
-
-test_extract_word_LDADD = \
- libsystemd-shared.la
-
-test_parse_util_SOURCES = \
- src/test/test-parse-util.c
-
-test_parse_util_LDADD = \
- libsystemd-shared.la
-
-test_user_util_SOURCES = \
- src/test/test-user-util.c
-
-test_user_util_LDADD = \
- libsystemd-shared.la
-
-test_hostname_util_SOURCES = \
- src/test/test-hostname-util.c
-
-test_hostname_util_LDADD = \
- libsystemd-shared.la
-
-test_process_util_SOURCES = \
- src/test/test-process-util.c
-
-test_process_util_LDADD = \
- libsystemd-shared.la
-
-test_terminal_util_SOURCES = \
- src/test/test-terminal-util.c
-
-test_terminal_util_LDADD = \
- libsystemd-shared.la
-
-test_path_lookup_SOURCES = \
- src/test/test-path-lookup.c
-
-test_path_lookup_LDADD = \
- libsystemd-shared.la
-
-test_uid_range_SOURCES = \
- src/test/test-uid-range.c
-
-test_uid_range_LDADD = \
- libsystemd-shared.la
-
-test_cap_list_SOURCES = \
- src/test/test-cap-list.c
-
-test_cap_list_CFLAGS = \
- $(AM_CFLAGS) \
- $(CAP_CFLAGS)
-
-test_cap_list_LDADD = \
- libsystemd-shared.la \
- $(CAP_LIBS)
-
-test_socket_util_SOURCES = \
- src/test/test-socket-util.c
-
-test_socket_util_LDADD = \
- libsystemd-shared.la
-
-test_barrier_SOURCES = \
- src/test/test-barrier.c
-
-test_barrier_LDADD = \
- libsystemd-shared.la
-
-test_tmpfiles_SOURCES = \
- src/test/test-tmpfiles.c
-
-test_tmpfiles_LDADD = \
- libsystemd-shared.la
-
-test_namespace_SOURCES = \
- src/test/test-namespace.c
-
-test_verbs_SOURCES = \
- src/test/test-verbs.c
-
-test_verbs_LDADD = \
- libsystemd-shared.la
-
-test_install_root_SOURCES = \
- src/test/test-install-root.c
-
-test_install_root_LDADD = \
- libsystemd-shared.la
-
-test_acl_util_SOURCES = \
- src/test/test-acl-util.c
-
-test_acl_util_LDADD = \
- libsystemd-shared.la
-
-test_seccomp_SOURCES = \
- src/test/test-seccomp.c
-
-test_seccomp_CFLAGS = \
- $(AM_CFLAGS) \
- $(SECCOMP_CFLAGS)
-
-test_seccomp_LDADD = \
- libsystemd-shared.la \
- $(SECCOMP_LIBS)
-
-test_namespace_LDADD = \
- libcore.la
-
-test_rlimit_util_SOURCES = \
- src/test/test-rlimit-util.c
-
-test_rlimit_util_LDADD = \
- libsystemd-shared.la
-
-test_ask_password_api_SOURCES = \
- src/test/test-ask-password-api.c
-
-test_ask_password_api_LDADD = \
- libsystemd-shared.la
-
-test_dissect_image_SOURCES = \
- src/test/test-dissect-image.c
-
-test_dissect_image_CFLAGS = \
- $(AM_CFLAGS) \
- $(BLKID_CFLAGS)
-
-test_dissect_image_LDADD = \
- libsystemd-shared.la \
- $(BLKID_LIBS)
-
-test_signal_util_SOURCES = \
- src/test/test-signal-util.c
-
-test_signal_util_LDADD = \
- libsystemd-shared.la
-
-test_selinux_SOURCES = \
- src/test/test-selinux.c
-
-test_selinux_LDADD = \
- libsystemd-shared.la
-
-test_sizeof_SOURCES = \
- src/test/test-sizeof.c
-
-BUILT_SOURCES += \
- src/test/test-hashmap-ordered.c
-
-src/test/test-hashmap-ordered.c: src/test/test-hashmap-plain.c
- $(AM_V_at)$(MKDIR_P) $(dir $@)
- $(AM_V_GEN)$(AWK) 'BEGIN { print "/* GENERATED FILE */\n#define ORDERED" } \
- { if (!match($$0, "^#include")) \
- gsub(/hashmap/, "ordered_hashmap"); \
- gsub(/HASHMAP/, "ORDERED_HASHMAP"); \
- gsub(/Hashmap/, "OrderedHashmap"); \
- print }' <$< >$@
-
-nodist_test_hashmap_SOURCES = \
- src/test/test-hashmap-ordered.c
-
-test_hashmap_SOURCES = \
- src/test/test-hashmap.c \
- src/test/test-hashmap-plain.c
-
-test_hashmap_LDADD = \
- libsystemd-shared.la
-
-test_set_SOURCES = \
- src/test/test-set.c
-
-test_set_LDADD = \
- libsystemd-shared.la
-
-test_bitmap_SOURCES = \
- src/test/test-bitmap.c
-
-test_bitmap_LDADD = \
- libsystemd-shared.la
-
-test_xml_SOURCES = \
- src/test/test-xml.c
-
-test_xml_LDADD = \
- libsystemd-shared.la
-
-test_list_SOURCES = \
- src/test/test-list.c
-
-test_list_LDADD = \
- libsystemd-shared.la
-
-test_unaligned_LDADD = \
- libsystemd-shared.la
-
-test_unaligned_SOURCES = \
- src/test/test-unaligned.c
-
-test_tables_SOURCES = \
- src/test/test-tables.c \
- src/shared/test-tables.h \
- src/journal/journald-server.c \
- src/journal/journald-server.h
-
-test_tables_CPPFLAGS = \
- $(AM_CPPFLAGS)
-
-test_tables_CFLAGS = \
- $(AM_CFLAGS) \
- $(SECCOMP_CFLAGS) \
- $(MOUNT_CFLAGS)
-
-test_tables_LDADD = \
- libjournal-core.la \
- libcore.la \
- libudev-core.la
-
-test_prioq_SOURCES = \
- src/test/test-prioq.c
-
-test_prioq_LDADD = \
- libsystemd-shared.la
-
-test_fileio_SOURCES = \
- src/test/test-fileio.c
-
-test_fileio_LDADD = \
- libsystemd-shared.la
-
-test_time_SOURCES = \
- src/test/test-time.c
-
-test_time_LDADD = \
- libsystemd-shared.la
-
-test_clock_SOURCES = \
- src/test/test-clock.c
-
-test_clock_LDADD = \
- libsystemd-shared.la
-
-test_architecture_SOURCES = \
- src/test/test-architecture.c
-
-test_architecture_LDADD = \
- libsystemd-shared.la
-
-test_log_SOURCES = \
- src/test/test-log.c
-
-test_log_LDADD = \
- libsystemd-shared.la
-
-test_ipcrm_SOURCES = \
- src/test/test-ipcrm.c
-
-test_ipcrm_LDADD = \
- libsystemd-shared.la
-
-test_btrfs_SOURCES = \
- src/test/test-btrfs.c
-
-test_btrfs_LDADD = \
- libsystemd-shared.la
-
-if HAVE_LIBIPTC
-test_firewall_util_SOURCES = \
- src/test/test-firewall-util.c
-
-test_firewall_util_CFLAGS = \
- $(AM_CFLAGS) \
- $(LIBIPTC_CFLAGS)
-
-test_firewall_util_LDADD = \
- libfirewall.la \
- libsystemd-shared.la \
- $(LIBIPTC_LIBS)
-endif
-
-test_netlink_manual_SOURCES = \
- src/test/test-netlink-manual.c
-
-test_netlink_manual_CFLAGS = \
- $(AM_CFLAGS) \
- $(KMOD_CFLAGS)
-
-test_netlink_manual_LDADD = \
- libsystemd-shared.la \
- $(KMOD_LIBS)
-
-test_ellipsize_SOURCES = \
- src/test/test-ellipsize.c
-
-test_ellipsize_LDADD = \
- libsystemd-shared.la
-
-test_date_SOURCES = \
- src/test/test-date.c
-
-test_date_LDADD = \
- libsystemd-shared.la
-
-test_sleep_SOURCES = \
- src/test/test-sleep.c
-
-test_sleep_LDADD = \
- libcore.la
-
-test_replace_var_SOURCES = \
- src/test/test-replace-var.c
-
-test_replace_var_LDADD = \
- libsystemd-shared.la
-
-test_calendarspec_SOURCES = \
- src/test/test-calendarspec.c
-
-test_calendarspec_LDADD = \
- libsystemd-shared.la
-
-test_strip_tab_ansi_SOURCES = \
- src/test/test-strip-tab-ansi.c
-
-test_strip_tab_ansi_LDADD = \
- libsystemd-shared.la
-
-test_daemon_SOURCES = \
- src/test/test-daemon.c
-
-test_daemon_LDADD = \
- libsystemd-shared.la
-
-test_cgroup_SOURCES = \
- src/test/test-cgroup.c
-
-test_cgroup_LDADD = \
- libsystemd-shared.la
-
-test_cgroup_mask_SOURCES = \
- src/test/test-cgroup-mask.c
-
-test_cgroup_mask_CPPFLAGS = \
- $(AM_CPPFLAGS) \
- $(MOUNT_CFLAGS)
-
-test_cgroup_mask_CFLAGS = \
- $(AM_CFLAGS) \
- $(SECCOMP_CFLAGS)
-
-test_cgroup_mask_LDADD = \
- libcore.la
-
-test_cgroup_util_SOURCES = \
- src/test/test-cgroup-util.c
-
-test_cgroup_util_LDADD = \
- libsystemd-shared.la
-
-test_env_util_SOURCES = \
- src/test/test-env-util.c
-
-test_env_util_LDADD = \
- libsystemd-shared.la
-
-test_strbuf_SOURCES = \
- src/test/test-strbuf.c
-
-test_strbuf_LDADD = \
- libsystemd-shared.la
-
-test_strv_SOURCES = \
- src/test/test-strv.c
-
-test_strv_LDADD = \
- libsystemd-shared.la
-
-test_path_util_SOURCES = \
- src/test/test-path-util.c
-
-test_path_util_LDADD = \
- libsystemd-shared.la
-
-test_path_SOURCES = \
- src/test/test-path.c
-
-test_path_CFLAGS = \
- $(AM_CFLAGS) \
- $(MOUNT_CFLAGS)
-
-test_path_LDADD = \
- libcore.la
-
-test_execute_SOURCES = \
- src/test/test-execute.c
-
-test_execute_CFLAGS = \
- $(AM_CFLAGS) \
- $(SECCOMP_CFLAGS) \
- $(MOUNT_CFLAGS)
-
-test_execute_LDADD = \
- libcore.la
-
-test_siphash24_SOURCES = \
- src/test/test-siphash24.c
-
-test_siphash24_LDADD = \
- libsystemd-shared.la
-
-test_strxcpyx_SOURCES = \
- src/test/test-strxcpyx.c
-
-test_strxcpyx_LDADD = \
- libsystemd-shared.la
-
-test_install_SOURCES = \
- src/test/test-install.c
-
-test_install_LDADD = \
- libsystemd-shared.la
-
-test_watchdog_SOURCES = \
- src/test/test-watchdog.c
-
-test_watchdog_LDADD = \
- libsystemd-shared.la
-
-test_sched_prio_SOURCES = \
- src/test/test-sched-prio.c
-
-test_sched_prio_CPPFLAGS = \
- $(AM_CPPFLAGS) \
- $(MOUNT_CFLAGS)
-
-test_sched_prio_CFLAGS = \
- $(AM_CFLAGS) \
- $(SECCOMP_CFLAGS)
-
-test_sched_prio_LDADD = \
- libcore.la
-
-test_conf_files_SOURCES = \
- src/test/test-conf-files.c
-
-test_conf_files_LDADD = \
- libsystemd-shared.la
-
-test_conf_parser_SOURCES = \
- src/test/test-conf-parser.c
-
-test_conf_parser_LDADD = \
- libsystemd-shared.la
-
-test_af_list_SOURCES = \
- src/test/test-af-list.c
-
-test_af_list_LDADD = \
- libsystemd-shared.la
-
-test_arphrd_list_SOURCES = \
- src/test/test-arphrd-list.c
-
-test_arphrd_list_LDADD = \
- libsystemd-shared.la
-
-test_journal_importer_SOURCES = \
- src/test/test-journal-importer.c
-
-test_journal_importer_LDADD = \
- libsystemd-shared.la
-
-TEST_DATA_FILES += \
- test/journal-data/journal-1.txt \
- test/journal-data/journal-2.txt
-
-# ------------------------------------------------------------------------------
-## .PHONY so it always rebuilds it
-.PHONY: coverage lcov-run lcov-report coverage-sync
-
-# run lcov from scratch, always
-coverage: all
- $(MAKE) lcov-run
- $(MAKE) lcov-report
-
-coverage_dir = coverage
-coverage_opts = --base-directory $(srcdir) --directory $(builddir) --rc 'geninfo_adjust_src_path=$(abspath $(srcdir))=>$(abspath $(builddir))'
-
-if ENABLE_COVERAGE
-# reset run coverage tests
-lcov-run:
- @rm -rf $(coverage_dir)
- lcov $(coverage_opts) --zerocounters
- -$(MAKE) check
-
-# generate report based on current coverage data
-lcov-report:
- $(MKDIR_P) $(coverage_dir)
- lcov $(coverage_opts) --compat-libtool --capture --no-external \
- | sed 's|$(abspath $(builddir))|$(abspath $(srcdir))|' > $(coverage_dir)/.lcov.info
- lcov --remove $(coverage_dir)/.lcov.info --output-file $(coverage_dir)/.lcov-clean.info 'test-*'
- genhtml -t "systemd test coverage" -o $(coverage_dir) $(coverage_dir)/.lcov-clean.info
- @echo "Coverage report generated in $(abs_builddir)/$(coverage_dir)/index.html"
-
-# lcov doesn't work properly with vpath builds, make sure that bad
-# output is not uploaded by mistake.
-coverage-sync: coverage
- test "$(builddir)" = "$(srcdir)"
- rsync -rlv --delete --omit-dir-times coverage/ $(www_target)/coverage
-
-else
-lcov-run lcov-report:
- echo "Need to reconfigure with --enable-coverage"
-endif
-
-# ------------------------------------------------------------------------------
-systemd_analyze_SOURCES = \
- src/analyze/analyze.c \
- src/analyze/analyze-verify.c \
- src/analyze/analyze-verify.h
-
-systemd_analyze_CFLAGS = \
- $(AM_CFLAGS) \
- $(SECCOMP_CFLAGS) \
- $(MOUNT_CFLAGS)
-
-systemd_analyze_LDADD = \
- libcore.la
-
-# ------------------------------------------------------------------------------
-systemd_initctl_SOURCES = \
- src/initctl/initctl.c
-
-systemd_initctl_LDADD = \
- libsystemd-shared.la
-
-# ------------------------------------------------------------------------------
-systemd_update_utmp_SOURCES = \
- src/update-utmp/update-utmp.c
-
-systemd_update_utmp_CFLAGS = \
- $(AM_CFLAGS) \
- $(AUDIT_CFLAGS)
-
-systemd_update_utmp_LDADD = \
- libsystemd-shared.la \
- $(AUDIT_LIBS)
-
-# ------------------------------------------------------------------------------
-systemd_update_done_SOURCES = \
- src/update-done/update-done.c
-
-systemd_update_done_LDADD = \
- libsystemd-shared.la
-
-# ------------------------------------------------------------------------------
-systemd_shutdown_SOURCES = \
- src/core/umount.c \
- src/core/umount.h \
- src/core/shutdown.c \
- src/core/mount-setup.c \
- src/core/mount-setup.h \
- src/core/killall.h \
- src/core/killall.c
-
-systemd_shutdown_LDADD = \
- libsystemd-shared.la
-
-# ------------------------------------------------------------------------------
-if HAVE_KMOD
-systemd_modules_load_SOURCES = \
- src/modules-load/modules-load.c
-
-systemd_modules_load_CFLAGS = \
- $(AM_CFLAGS) \
- $(KMOD_CFLAGS)
-
-systemd_modules_load_LDADD = \
- libsystemd-shared.la \
- $(KMOD_LIBS)
-
-rootlibexec_PROGRAMS += \
- systemd-modules-load
-
-nodist_systemunit_DATA += \
- units/systemd-modules-load.service
-
-SYSINIT_TARGET_WANTS += \
- systemd-modules-load.service
-
-if ENABLE_TMPFILES
-nodist_systemunit_DATA += \
- units/kmod-static-nodes.service
-
-SYSINIT_TARGET_WANTS += \
- kmod-static-nodes.service
-endif
-endif
-
-EXTRA_DIST += \
- units/systemd-modules-load.service.in \
- units/kmod-static-nodes.service.in
-
-# ------------------------------------------------------------------------------
-if ENABLE_TMPFILES
-systemd_tmpfiles_SOURCES = \
- src/tmpfiles/tmpfiles.c
-
-systemd_tmpfiles_CFLAGS = \
- $(AM_CFLAGS) \
- $(ACL_CFLAGS)
-
-systemd_tmpfiles_LDADD = \
- libsystemd-shared.la \
- $(ACL_LIBS)
-
-rootbin_PROGRAMS += \
- systemd-tmpfiles
-
-dist_systemunit_DATA += \
- units/systemd-tmpfiles-clean.timer
-
-nodist_systemunit_DATA += \
- units/systemd-tmpfiles-setup-dev.service \
- units/systemd-tmpfiles-setup.service \
- units/systemd-tmpfiles-clean.service
-
-nodist_tmpfiles_DATA = \
- tmpfiles.d/systemd.conf \
- tmpfiles.d/var.conf \
- tmpfiles.d/etc.conf
-
-dist_tmpfiles_DATA = \
- tmpfiles.d/systemd-nologin.conf \
- tmpfiles.d/tmp.conf \
- tmpfiles.d/x11.conf \
- tmpfiles.d/home.conf \
- tmpfiles.d/systemd-nspawn.conf \
- tmpfiles.d/journal-nocow.conf
-
-if HAVE_SYSV_COMPAT
-dist_tmpfiles_DATA += \
- tmpfiles.d/legacy.conf
-endif
-
-if HAVE_REMOTE
-nodist_tmpfiles_DATA += \
- tmpfiles.d/systemd-remote.conf
-endif
-
-SYSINIT_TARGET_WANTS += \
- systemd-tmpfiles-setup-dev.service \
- systemd-tmpfiles-setup.service
-
-dist_zshcompletion_data += \
- shell-completion/zsh/_systemd-tmpfiles
-
-TIMERS_TARGET_WANTS += \
- systemd-tmpfiles-clean.timer
-
-INSTALL_DIRS += \
- $(tmpfilesdir) \
- $(sysconfdir)/tmpfiles.d
-endif
-
-EXTRA_DIST += \
- tmpfiles.d/systemd.conf.m4 \
- tmpfiles.d/systemd-remote.conf.m4 \
- tmpfiles.d/etc.conf.m4 \
- tmpfiles.d/var.conf.m4 \
- units/systemd-tmpfiles-setup-dev.service.in \
- units/systemd-tmpfiles-setup.service.in \
- units/systemd-tmpfiles-clean.service.in
-
-# ------------------------------------------------------------------------------
-if ENABLE_SYSUSERS
-systemd_sysusers_SOURCES = \
- src/sysusers/sysusers.c
-
-systemd_sysusers_LDADD = \
- libsystemd-shared.la
-
-rootbin_PROGRAMS += \
- systemd-sysusers
-
-nodist_systemunit_DATA += \
- units/systemd-sysusers.service
-
-SYSINIT_TARGET_WANTS += \
- systemd-sysusers.service
-
-nodist_sysusers_DATA = \
- sysusers.d/systemd.conf \
- sysusers.d/basic.conf
-
-if HAVE_REMOTE
-nodist_sysusers_DATA += \
- sysusers.d/systemd-remote.conf
-endif
-
-INSTALL_DIRS += \
- $(sysusersdir)
-endif
-
-EXTRA_DIST += \
- units/systemd-sysusers.service.in \
- sysusers.d/systemd.conf.m4 \
- sysusers.d/systemd-remote.conf.m4 \
- sysusers.d/basic.conf.in
-
-# ------------------------------------------------------------------------------
-dist_factory_etc_DATA = \
- factory/etc/nsswitch.conf
-
-if HAVE_PAM
-dist_factory_pam_DATA = \
- factory/etc/pam.d/system-auth \
- factory/etc/pam.d/other
-endif
-
-# ------------------------------------------------------------------------------
-if ENABLE_FIRSTBOOT
-systemd_firstboot_SOURCES = \
- src/firstboot/firstboot.c
-
-systemd_firstboot_LDADD = \
- libsystemd-shared.la \
- -lcrypt
-
-rootbin_PROGRAMS += \
- systemd-firstboot
-
-nodist_systemunit_DATA += \
- units/systemd-firstboot.service
-
-SYSINIT_TARGET_WANTS += \
- systemd-firstboot.service
-endif
-
-EXTRA_DIST += \
- units/systemd-firstboot.service.in
-
-# ------------------------------------------------------------------------------
-systemd_machine_id_setup_SOURCES = \
- src/machine-id-setup/machine-id-setup-main.c \
- src/core/machine-id-setup.c \
- src/core/machine-id-setup.h
-
-systemd_machine_id_setup_LDADD = \
- libsystemd-shared.la
-
-SYSINIT_TARGET_WANTS += \
- systemd-machine-id-commit.service
-
-# ------------------------------------------------------------------------------
-systemd_sysctl_SOURCES = \
- src/sysctl/sysctl.c
-
-systemd_sysctl_LDADD = \
- libsystemd-shared.la
-
-# ------------------------------------------------------------------------------
-systemd_sleep_SOURCES = \
- src/sleep/sleep.c
-
-systemd_sleep_LDADD = \
- libsystemd-shared.la
-
-# ------------------------------------------------------------------------------
-systemd_fsck_SOURCES = \
- src/fsck/fsck.c
-
-systemd_fsck_LDADD = \
- libsystemd-shared.la
-
-# ------------------------------------------------------------------------------
-systemd_ac_power_SOURCES = \
- src/ac-power/ac-power.c
-
-systemd_ac_power_LDADD = \
- libsystemd-shared.la
-
-# ------------------------------------------------------------------------------
-systemd_detect_virt_SOURCES = \
- src/detect-virt/detect-virt.c
-
-systemd_detect_virt_LDADD = \
- libsystemd-shared.la
-
-# ------------------------------------------------------------------------------
-systemd_delta_SOURCES = \
- src/delta/delta.c
-
-systemd_delta_LDADD = \
- libsystemd-shared.la
-
-# ------------------------------------------------------------------------------
-systemd_getty_generator_SOURCES = \
- src/getty-generator/getty-generator.c
-
-systemd_getty_generator_LDADD = \
- libsystemd-shared.la
-
-# ------------------------------------------------------------------------------
-systemd_debug_generator_SOURCES = \
- src/debug-generator/debug-generator.c
-
-systemd_debug_generator_LDADD = \
- libsystemd-shared.la
-
-# ------------------------------------------------------------------------------
-systemd_fstab_generator_SOURCES = \
- src/fstab-generator/fstab-generator.c \
- src/core/mount-setup.c
-
-systemd_fstab_generator_LDADD = \
- libsystemd-shared.la
-
-# ------------------------------------------------------------------------------
-systemd_system_update_generator_SOURCES = \
- src/system-update-generator/system-update-generator.c
-
-systemd_system_update_generator_LDADD = \
- libsystemd-shared.la
-
-# ------------------------------------------------------------------------------
-30_systemd_environment_d_generator_SOURCES = \
- src/environment-d-generator/environment-d-generator.c
-
-30_systemd_environment_d_generator_LDADD = \
- libsystemd-shared.la
-
-# ------------------------------------------------------------------------------
-if ENABLE_HIBERNATE
-systemgenerator_PROGRAMS += \
- systemd-hibernate-resume-generator
-
-rootlibexec_PROGRAMS += \
- systemd-hibernate-resume
-
-systemd_hibernate_resume_SOURCES = \
- src/hibernate-resume/hibernate-resume.c
-
-systemd_hibernate_resume_LDADD = \
- libsystemd-shared.la
-
-systemd_hibernate_resume_generator_SOURCES = \
- src/hibernate-resume/hibernate-resume-generator.c
-
-systemd_hibernate_resume_generator_LDADD = \
- libsystemd-shared.la
-
-dist_systemunit_DATA += \
- units/hibernate.target \
- units/hybrid-sleep.target
-
-nodist_systemunit_DATA += \
- units/systemd-hibernate.service \
- units/systemd-hibernate-resume@.service \
- units/systemd-hybrid-sleep.service
-endif
-
-EXTRA_DIST += \
- units/systemd-hibernate.service.in \
- units/systemd-hibernate-resume@.service.in \
- units/systemd-hybrid-sleep.service.in
-
-# ------------------------------------------------------------------------------
-if ENABLE_EFI
-if HAVE_BLKID
-bootctl_SOURCES = \
- src/boot/bootctl.c
-
-bootctl_CPPFLAGS = \
- $(AM_CPPFLAGS) \
- -DEFI_MACHINE_TYPE_NAME=\"$(EFI_MACHINE_TYPE_NAME)\" \
- -DBOOTLIBDIR=\"$(bootlibdir)\"
-
-bootctl_CFLAGS = \
- $(AM_CFLAGS) \
- $(BLKID_CFLAGS)
-
-bootctl_LDADD = \
- libsystemd-shared.la \
- $(BLKID_LIBS)
-
-bin_PROGRAMS += \
- bootctl
-
-dist_bashcompletion_data += \
- shell-completion/bash/bootctl
-
-dist_zshcompletion_data += \
- shell-completion/zsh/_bootctl
-endif
-
-# ------------------------------------------------------------------------------
-if HAVE_GNUEFI
-efi_cppflags = \
- $(EFI_CPPFLAGS) \
- -I$(top_builddir) -include config.h \
- -I$(EFI_INC_DIR)/efi \
- -I$(EFI_INC_DIR)/efi/$(EFI_ARCH) \
- -DEFI_MACHINE_TYPE_NAME=\"$(EFI_MACHINE_TYPE_NAME)\"
-
-efi_cflags = \
- $(EFI_CFLAGS) \
- -Wall \
- -Wextra \
- -std=gnu90 \
- -nostdinc \
- -ggdb -O0 \
- -fpic \
- -fshort-wchar \
- -nostdinc \
- -ffreestanding \
- -fno-strict-aliasing \
- -fno-stack-protector \
- -Wsign-compare \
- -Wno-missing-field-initializers
-
-if ARCH_X86_64
-efi_cflags += \
- -mno-red-zone \
- -mno-sse \
- -mno-mmx \
- -DEFI_FUNCTION_WRAPPER \
- -DGNU_EFI_USE_MS_ABI
-endif
-
-if ARCH_IA32
-efi_cflags += \
- -mno-sse \
- -mno-mmx
-endif
-
-efi_ldflags = \
- $(EFI_LDFLAGS) \
- -T $(EFI_LDS_DIR)/elf_$(EFI_ARCH)_efi.lds \
- -shared \
- -Bsymbolic \
- -nostdlib \
- -znocombreloc \
- -L $(EFI_LIB_DIR) \
- $(EFI_LDS_DIR)/crt0-efi-$(EFI_ARCH).o
-
-# Aarch64 and ARM32 don't have an EFI capable objcopy. Use 'binary' instead,
-# and add required symbols manually.
-if ARCH_AARCH64
-efi_ldflags += --defsym=EFI_SUBSYSTEM=0xa
-EFI_FORMAT = -O binary
-else
-if ARCH_ARM
-efi_ldflags += --defsym=EFI_SUBSYSTEM=0xa
-EFI_FORMAT = -O binary
-else
-EFI_FORMAT = --target=efi-app-$(EFI_ARCH)
-endif
-endif
-endif
-endif
-
-# ------------------------------------------------------------------------------
-efi_headers = \
- src/boot/efi/console.h \
- src/boot/efi/disk.h \
- src/boot/efi/graphics.h \
- src/boot/efi/linux.h \
- src/boot/efi/measure.h \
- src/boot/efi/pe.h \
- src/boot/efi/splash.h \
- src/boot/efi/util.h \
- src/boot/efi/shim.h
-
-systemd_boot_sources = \
- src/boot/efi/boot.c \
- src/boot/efi/console.c \
- src/boot/efi/disk.c \
- src/boot/efi/graphics.c \
- src/boot/efi/measure.c \
- src/boot/efi/pe.c \
- src/boot/efi/util.c \
- src/boot/efi/shim.c
-
-EXTRA_DIST += $(systemd_boot_sources) $(systemd_boot_headers)
-
-systemd_boot_objects = $(addprefix $(top_builddir)/,$(systemd_boot_sources:.c=.o))
-systemd_boot_solib = $(top_builddir)/src/boot/efi/systemd_boot.so
-systemd_boot = systemd-boot$(EFI_MACHINE_TYPE_NAME).efi
-
-if ENABLE_EFI
-if HAVE_GNUEFI
-bootlib_DATA = $(systemd_boot)
-
-$(top_builddir)/src/boot/efi/%.o: $(top_srcdir)/src/boot/efi/%.c $(addprefix $(top_srcdir)/,$(efi_headers))
- @$(MKDIR_P) $(top_builddir)/src/boot/efi/
- $(AM_V_CC)$(EFI_CC) $(efi_cppflags) $(efi_cflags) -c $< -o $@
-
-$(systemd_boot_solib): $(systemd_boot_objects)
- $(AM_V_CCLD)$(LD) $(efi_ldflags) $(systemd_boot_objects) \
- -o $@ -lefi -lgnuefi $(shell $(CC) -print-libgcc-file-name); \
- nm -D -u $@ | grep ' U ' && exit 1 || :
-
-$(systemd_boot): $(systemd_boot_solib)
- $(AM_V_GEN)$(OBJCOPY) -j .text -j .sdata -j .data -j .dynamic \
- -j .dynsym -j .rel -j .rela -j .reloc $(EFI_FORMAT) $< $@
-endif
-endif
-
-CLEANFILES += $(systemd_boot_objects) $(systemd_boot_solib) $(systemd_boot)
-
-# ------------------------------------------------------------------------------
-stub_sources = \
- src/boot/efi/disk.c \
- src/boot/efi/graphics.c \
- src/boot/efi/linux.c \
- src/boot/efi/measure.c \
- src/boot/efi/pe.c \
- src/boot/efi/splash.c \
- src/boot/efi/stub.c \
- src/boot/efi/util.c
-
-EXTRA_DIST += \
- $(stub_sources) \
- $(stub_headers) \
- test/splash.bmp
-
-stub_objects = $(addprefix $(top_builddir)/,$(stub_sources:.c=.o))
-stub_solib = $(top_builddir)/src/boot/efi/stub.so
-stub = linux$(EFI_MACHINE_TYPE_NAME).efi.stub
-
-if ENABLE_EFI
-if HAVE_GNUEFI
-bootlib_DATA += $(stub)
-
-$(stub_solib): $(stub_objects)
- $(AM_V_CCLD)$(LD) $(efi_ldflags) $(stub_objects) \
- -o $@ -lefi -lgnuefi $(shell $(CC) -print-libgcc-file-name); \
- nm -D -u $@ | grep ' U ' && exit 1 || :
-
-$(stub): $(stub_solib)
- $(AM_V_GEN)$(OBJCOPY) -j .text -j .sdata -j .data -j .dynamic \
- -j .dynsym -j .rel -j .rela -j .reloc $(EFI_FORMAT) $< $@
-endif
-endif
-
-CLEANFILES += $(stub_objects) $(stub_solib) $(stub)
-
-
-# ------------------------------------------------------------------------------
-CLEANFILES += test-efi-disk.img
-
-test-efi-disk.img: $(systemd_boot) $(stub) test/splash.bmp test/test-efi-create-disk.sh
- $(AM_V_GEN)test/test-efi-create-disk.sh $@ $(systemd_boot) $(stub) test/splash.bmp
-
-test-efi: test-efi-disk.img
- $(QEMU) -machine accel=kvm -m 1024 -bios $(QEMU_BIOS) -snapshot test-efi-disk.img
-
-EXTRA_DIST += test/test-efi-create-disk.sh
-
-# ------------------------------------------------------------------------------
-if HAVE_BLKID
-systemgenerator_PROGRAMS += \
- systemd-gpt-auto-generator
-
-systemd_gpt_auto_generator_SOURCES = \
- src/gpt-auto-generator/gpt-auto-generator.c \
- src/basic/blkid-util.h
-
-systemd_gpt_auto_generator_LDADD = \
- libsystemd-shared.la \
- $(BLKID_LIBS)
-
-systemd_gpt_auto_generator_CFLAGS = \
- $(AM_CFLAGS) \
- $(BLKID_CFLAGS)
-endif
-
-# ------------------------------------------------------------------------------
-dist_xinitrc_SCRIPTS = \
- xorg/50-systemd-user.sh
-
-# ------------------------------------------------------------------------------
-systemd_sysv_generator_SOURCES = \
- src/sysv-generator/sysv-generator.c
-
-systemd_sysv_generator_LDADD = \
- libcore.la
-
-# ------------------------------------------------------------------------------
-systemd_rc_local_generator_SOURCES = \
- src/rc-local-generator/rc-local-generator.c
-
-systemd_rc_local_generator_LDADD = \
- libsystemd-shared.la
-
-# ------------------------------------------------------------------------------
-systemd_remount_fs_SOURCES = \
- src/remount-fs/remount-fs.c \
- src/core/mount-setup.c \
- src/core/mount-setup.h
-
-systemd_remount_fs_LDADD = \
- libsystemd-shared.la
-
-# ------------------------------------------------------------------------------
-systemd_volatile_root_SOURCES = \
- src/volatile-root/volatile-root.c
-
-systemd_volatile_root_LDADD = \
- libsystemd-shared.la
-
-# ------------------------------------------------------------------------------
-systemd_cgroups_agent_SOURCES = \
- src/cgroups-agent/cgroups-agent.c
-
-systemd_cgroups_agent_LDADD = \
- libsystemd-shared.la
-
-# ------------------------------------------------------------------------------
-systemd_escape_SOURCES = \
- src/escape/escape.c
-
-systemd_escape_LDADD = \
- libsystemd-shared.la
-
-# -----------------------------------------------------------------------------
-systemctl_SOURCES = \
- src/systemctl/systemctl.c
-
-systemctl_LDADD = \
- libsystemd-shared.la
-
-# ------------------------------------------------------------------------------
-systemd_notify_SOURCES = \
- src/notify/notify.c
-
-systemd_notify_LDADD = \
- libsystemd-shared.la
-
-# ------------------------------------------------------------------------------
-systemd_dissect_SOURCES = \
- src/dissect/dissect.c
-
-systemd_dissect_LDADD = \
- libsystemd-shared.la
-
-# ------------------------------------------------------------------------------
-systemd_path_SOURCES = \
- src/path/path.c
-
-systemd_path_LDADD = \
- libsystemd-shared.la
-
-# ------------------------------------------------------------------------------
-systemd_ask_password_SOURCES = \
- src/ask-password/ask-password.c
-
-systemd_ask_password_LDADD = \
- libsystemd-shared.la
-
-# ------------------------------------------------------------------------------
-systemd_reply_password_SOURCES = \
- src/reply-password/reply-password.c
-
-systemd_reply_password_LDADD = \
- libsystemd-shared.la
-
-# ------------------------------------------------------------------------------
-systemd_cgls_SOURCES = \
- src/cgls/cgls.c
-
-systemd_cgls_LDADD = \
- libsystemd-shared.la
-
-# ------------------------------------------------------------------------------
-systemd_cgtop_SOURCES = \
- src/cgtop/cgtop.c
-
-systemd_cgtop_LDADD = \
- libsystemd-shared.la
-
-# ------------------------------------------------------------------------------
-systemd_nspawn_SOURCES = \
- src/nspawn/nspawn.c \
- src/nspawn/nspawn-settings.c \
- src/nspawn/nspawn-settings.h \
- src/nspawn/nspawn-mount.c \
- src/nspawn/nspawn-mount.h \
- src/nspawn/nspawn-network.c \
- src/nspawn/nspawn-network.h \
- src/nspawn/nspawn-expose-ports.c \
- src/nspawn/nspawn-expose-ports.h \
- src/nspawn/nspawn-cgroup.c \
- src/nspawn/nspawn-cgroup.h \
- src/nspawn/nspawn-seccomp.c \
- src/nspawn/nspawn-seccomp.h \
- src/nspawn/nspawn-register.c \
- src/nspawn/nspawn-register.h \
- src/nspawn/nspawn-setuid.c \
- src/nspawn/nspawn-setuid.h \
- src/nspawn/nspawn-stub-pid1.c \
- src/nspawn/nspawn-stub-pid1.h \
- src/nspawn/nspawn-patch-uid.c \
- src/nspawn/nspawn-patch-uid.h \
- src/core/mount-setup.c \
- src/core/mount-setup.h \
- src/core/loopback-setup.c \
- src/core/loopback-setup.h
-
-nodist_systemd_nspawn_SOURCES = \
- src/nspawn/nspawn-gperf.c
-
-gperf_gperf_sources += \
- src/nspawn/nspawn-gperf.gperf
-
-systemd_nspawn_CFLAGS = \
- $(AM_CFLAGS) \
- $(ACL_CFLAGS) \
- $(BLKID_CFLAGS) \
- $(SECCOMP_CFLAGS) \
- $(SELINUX_CFLAGS)
-
-systemd_nspawn_LDADD = \
- libsystemd-shared.la \
- $(ACL_LIBS) \
- $(BLKID_LIBS) \
- $(SECCOMP_LIBS) \
- $(SELINUX_LIBS)
-
-if HAVE_LIBIPTC
-systemd_nspawn_LDADD += \
- libfirewall.la
-endif
-
-test_patch_uid_SOURCES = \
- src/nspawn/nspawn-patch-uid.c \
- src/nspawn/nspawn-patch-uid.h \
- src/nspawn/test-patch-uid.c
-
-test_patch_uid_CFLAGS = \
- $(AM_CFLAGS) \
- $(ACL_CFLAGS)
-
-test_patch_uid_LDADD = \
- libsystemd-shared.la \
- $(ACL_LIBS)
-
-manual_tests += \
- test-patch-uid
-
-# ------------------------------------------------------------------------------
-systemd_run_SOURCES = \
- src/run/run.c
-
-systemd_run_LDADD = \
- libsystemd-shared.la
-
-# ------------------------------------------------------------------------------
-systemd_mount_SOURCES = \
- src/mount/mount-tool.c
-
-systemd_mount_LDADD = \
- libsystemd-shared.la
-
-# ------------------------------------------------------------------------------
-systemd_stdio_bridge_SOURCES = \
- src/stdio-bridge/stdio-bridge.c
-
-systemd_stdio_bridge_LDADD = \
- libsystemd-shared.la
-
-# ------------------------------------------------------------------------------
-systemd_tty_ask_password_agent_SOURCES = \
- src/tty-ask-password-agent/tty-ask-password-agent.c
-
-systemd_tty_ask_password_agent_LDADD = \
- libsystemd-shared.la
-
-# ------------------------------------------------------------------------------
-libsystemd_internal_la_SOURCES = \
- src/systemd/sd-bus.h \
- src/systemd/sd-bus-protocol.h \
- src/systemd/sd-bus-vtable.h \
- src/systemd/sd-utf8.h \
- src/systemd/sd-event.h \
- src/systemd/sd-netlink.h \
- src/systemd/sd-resolve.h \
- src/systemd/sd-login.h \
- src/systemd/sd-id128.h \
- src/systemd/sd-daemon.h \
- src/systemd/sd-path.h \
- src/systemd/sd-network.h \
- src/systemd/sd-hwdb.h \
- src/systemd/sd-device.h \
- src/libsystemd/libsystemd.sym \
- src/libsystemd/sd-bus/sd-bus.c \
- src/libsystemd/sd-bus/bus-control.c \
- src/libsystemd/sd-bus/bus-control.h \
- src/libsystemd/sd-bus/bus-error.c \
- src/libsystemd/sd-bus/bus-error.h \
- src/libsystemd/sd-bus/bus-common-errors.h \
- src/libsystemd/sd-bus/bus-common-errors.c \
- src/libsystemd/sd-bus/bus-internal.c \
- src/libsystemd/sd-bus/bus-internal.h \
- src/libsystemd/sd-bus/bus-socket.c \
- src/libsystemd/sd-bus/bus-socket.h \
- src/libsystemd/sd-bus/bus-kernel.c \
- src/libsystemd/sd-bus/bus-kernel.h \
- src/libsystemd/sd-bus/bus-container.c \
- src/libsystemd/sd-bus/bus-container.h \
- src/libsystemd/sd-bus/bus-message.c \
- src/libsystemd/sd-bus/bus-message.h \
- src/libsystemd/sd-bus/bus-creds.c \
- src/libsystemd/sd-bus/bus-creds.h \
- src/libsystemd/sd-bus/bus-signature.c \
- src/libsystemd/sd-bus/bus-signature.h \
- src/libsystemd/sd-bus/bus-type.c \
- src/libsystemd/sd-bus/bus-type.h \
- src/libsystemd/sd-bus/bus-match.c \
- src/libsystemd/sd-bus/bus-match.h \
- src/libsystemd/sd-bus/bus-bloom.c \
- src/libsystemd/sd-bus/bus-bloom.h \
- src/libsystemd/sd-bus/bus-introspect.c \
- src/libsystemd/sd-bus/bus-introspect.h \
- src/libsystemd/sd-bus/bus-objects.c \
- src/libsystemd/sd-bus/bus-objects.h \
- src/libsystemd/sd-bus/bus-gvariant.c \
- src/libsystemd/sd-bus/bus-gvariant.h \
- src/libsystemd/sd-bus/bus-convenience.c \
- src/libsystemd/sd-bus/bus-track.c \
- src/libsystemd/sd-bus/bus-track.h \
- src/libsystemd/sd-bus/bus-slot.c \
- src/libsystemd/sd-bus/bus-slot.h \
- src/libsystemd/sd-bus/bus-protocol.h \
- src/libsystemd/sd-bus/kdbus.h \
- src/libsystemd/sd-bus/bus-dump.c \
- src/libsystemd/sd-bus/bus-dump.h \
- src/libsystemd/sd-utf8/sd-utf8.c \
- src/libsystemd/sd-event/sd-event.c \
- src/libsystemd/sd-netlink/sd-netlink.c \
- src/libsystemd/sd-netlink/netlink-internal.h \
- src/libsystemd/sd-netlink/netlink-message.c \
- src/libsystemd/sd-netlink/netlink-socket.c \
- src/libsystemd/sd-netlink/rtnl-message.c \
- src/libsystemd/sd-netlink/netlink-types.h \
- src/libsystemd/sd-netlink/netlink-types.c \
- src/libsystemd/sd-netlink/netlink-util.h \
- src/libsystemd/sd-netlink/netlink-util.c \
- src/libsystemd/sd-netlink/local-addresses.h \
- src/libsystemd/sd-netlink/local-addresses.c \
- src/libsystemd/sd-id128/sd-id128.c \
- src/libsystemd/sd-id128/id128-util.h \
- src/libsystemd/sd-id128/id128-util.c \
- src/libsystemd/sd-daemon/sd-daemon.c \
- src/libsystemd/sd-login/sd-login.c \
- src/libsystemd/sd-path/sd-path.c \
- src/libsystemd/sd-network/sd-network.c \
- src/libsystemd/sd-network/network-util.h \
- src/libsystemd/sd-network/network-util.c \
- src/libsystemd/sd-hwdb/sd-hwdb.c \
- src/libsystemd/sd-hwdb/hwdb-util.h \
- src/libsystemd/sd-hwdb/hwdb-internal.h \
- src/libsystemd/sd-device/device-internal.h \
- src/libsystemd/sd-device/device-util.h \
- src/libsystemd/sd-device/device-enumerator.c \
- src/libsystemd/sd-device/device-enumerator-private.h \
- src/libsystemd/sd-device/sd-device.c \
- src/libsystemd/sd-device/device-private.c \
- src/libsystemd/sd-device/device-private.h \
- src/libsystemd/sd-resolve/sd-resolve.c
-
-libsystemd_internal_la_LIBADD = \
- -lresolv
-
-noinst_LTLIBRARIES += \
- libsystemd-internal.la
-
-EXTRA_DIST += \
- src/libsystemd/libsystemd.pc.in \
- src/libsystemd/sd-bus/GVARIANT-SERIALIZATION
-
-libsystemd_la_SOURCES =
-
-libsystemd_la_LDFLAGS = \
- $(AM_LDFLAGS) \
- -version-info $(LIBSYSTEMD_CURRENT):$(LIBSYSTEMD_REVISION):$(LIBSYSTEMD_AGE) \
- -Wl,--version-script=$(top_srcdir)/src/libsystemd/libsystemd.sym
-
-libsystemd_la_LIBADD = \
- libsystemd-internal.la \
- libbasic.la \
- libsystemd-journal-internal.la
-
-pkgconfiglib_DATA += \
- src/libsystemd/libsystemd.pc
-
-pkginclude_HEADERS += \
- src/systemd/sd-bus.h \
- src/systemd/sd-bus-protocol.h \
- src/systemd/sd-bus-vtable.h \
- src/systemd/sd-event.h \
- src/systemd/sd-login.h \
- src/systemd/sd-id128.h \
- src/systemd/sd-daemon.h
-
-rootlib_LTLIBRARIES += \
- libsystemd.la
-
-tests += \
- test-bus-marshal \
- test-bus-signature \
- test-bus-benchmark \
- test-bus-chat \
- test-bus-cleanup \
- test-bus-server \
- test-bus-match \
- test-bus-kernel \
- test-bus-kernel-bloom \
- test-bus-zero-copy \
- test-bus-introspect \
- test-bus-objects \
- test-bus-vtable \
- test-bus-error \
- test-bus-creds \
- test-bus-gvariant \
- test-bus-track \
- test-event \
- test-netlink \
- test-local-addresses \
- test-resolve
-
-bin_PROGRAMS += \
- busctl
-
-test_bus_marshal_SOURCES = \
- src/libsystemd/sd-bus/test-bus-marshal.c
-
-test_bus_marshal_LDADD = \
- libsystemd-shared.la \
- $(GLIB_LIBS) \
- $(DBUS_LIBS)
-
-test_bus_marshal_CFLAGS = \
- $(AM_CFLAGS) \
- $(GLIB_CFLAGS) \
- $(DBUS_CFLAGS)
-
-test_bus_signature_SOURCES = \
- src/libsystemd/sd-bus/test-bus-signature.c
-
-test_bus_signature_LDADD = \
- libsystemd-shared.la
-
-test_bus_chat_SOURCES = \
- src/libsystemd/sd-bus/test-bus-chat.c
-
-test_bus_chat_LDADD = \
- libsystemd-shared.la
-
-test_bus_cleanup_SOURCES = \
- src/libsystemd/sd-bus/test-bus-cleanup.c
-
-test_bus_cleanup_CFLAGS = \
- $(AM_CFLAGS) \
- $(SECCOMP_CFLAGS)
-
-test_bus_cleanup_LDADD = \
- libsystemd-shared.la
-
-test_bus_track_SOURCES = \
- src/libsystemd/sd-bus/test-bus-track.c
-
-test_bus_track_CFLAGS = \
- $(AM_CFLAGS) \
- $(SECCOMP_CFLAGS)
-
-test_bus_track_LDADD = \
- libsystemd-shared.la
-
-test_bus_server_SOURCES = \
- src/libsystemd/sd-bus/test-bus-server.c
-
-test_bus_server_LDADD = \
- libsystemd-shared.la
-
-test_bus_objects_SOURCES = \
- src/libsystemd/sd-bus/test-bus-objects.c
-
-test_bus_objects_LDADD = \
- libsystemd-shared.la
-
-test_bus_vtable_SOURCES = \
- src/libsystemd/sd-bus/test-bus-vtable.c
-
-test_bus_vtable_LDADD = \
- libsystemd-shared.la
-
-test_bus_error_SOURCES = \
- src/libsystemd/sd-bus/test-bus-error.c
-
-# Link statically because this test uses BUS_ERROR_MAP_ELF_REGISTER
-test_bus_error_LDADD = \
- libshared.la
-
-test_bus_gvariant_SOURCES = \
- src/libsystemd/sd-bus/test-bus-gvariant.c
-
-test_bus_gvariant_LDADD = \
- libsystemd-shared.la \
- $(GLIB_LIBS)
-
-test_bus_gvariant_CFLAGS = \
- $(AM_CFLAGS) \
- $(GLIB_CFLAGS)
-
-test_bus_creds_SOURCES = \
- src/libsystemd/sd-bus/test-bus-creds.c
-
-test_bus_creds_LDADD = \
- libsystemd-shared.la
-
-test_bus_match_SOURCES = \
- src/libsystemd/sd-bus/test-bus-match.c
-
-test_bus_match_LDADD = \
- libsystemd-shared.la
-
-test_bus_kernel_SOURCES = \
- src/libsystemd/sd-bus/test-bus-kernel.c
-
-test_bus_kernel_LDADD = \
- libsystemd-shared.la
-
-test_bus_kernel_bloom_SOURCES = \
- src/libsystemd/sd-bus/test-bus-kernel-bloom.c
-
-test_bus_kernel_bloom_LDADD = \
- libsystemd-shared.la
-
-test_bus_benchmark_SOURCES = \
- src/libsystemd/sd-bus/test-bus-benchmark.c
-
-test_bus_benchmark_LDADD = \
- libsystemd-shared.la
-
-test_bus_zero_copy_SOURCES = \
- src/libsystemd/sd-bus/test-bus-zero-copy.c
-
-test_bus_zero_copy_LDADD = \
- libsystemd-shared.la
-
-test_bus_introspect_SOURCES = \
- src/libsystemd/sd-bus/test-bus-introspect.c
-
-test_bus_introspect_LDADD = \
- libsystemd-shared.la
-
-test_event_SOURCES = \
- src/libsystemd/sd-event/test-event.c
-
-test_event_LDADD = \
- libsystemd-shared.la
-
-test_netlink_SOURCES = \
- src/libsystemd/sd-netlink/test-netlink.c
-
-test_netlink_LDADD = \
- libsystemd-shared.la
-
-test_local_addresses_SOURCES = \
- src/libsystemd/sd-netlink/test-local-addresses.c
-
-test_local_addresses_LDADD = \
- libsystemd-shared.la
-
-test_resolve_SOURCES = \
- src/libsystemd/sd-resolve/test-resolve.c
-
-test_resolve_LDADD = \
- libsystemd-shared.la
-
-busctl_SOURCES = \
- src/busctl/busctl.c \
- src/busctl/busctl-introspect.c \
- src/busctl/busctl-introspect.h
-
-busctl_LDADD = \
- libsystemd-shared.la
-
-# ------------------------------------------------------------------------------
-noinst_LTLIBRARIES += \
- libsystemd-network.la
-
-libsystemd_network_la_CFLAGS = \
- $(AM_CFLAGS) \
- $(KMOD_CFLAGS)
-
-libsystemd_network_la_SOURCES = \
- src/systemd/sd-dhcp-client.h \
- src/systemd/sd-dhcp-server.h \
- src/systemd/sd-dhcp-lease.h \
- src/systemd/sd-ipv4ll.h \
- src/systemd/sd-ipv4acd.h \
- src/systemd/sd-ndisc.h \
- src/systemd/sd-radv.h \
- src/systemd/sd-dhcp6-client.h \
- src/systemd/sd-dhcp6-lease.h \
- src/systemd/sd-lldp.h \
- src/libsystemd-network/sd-dhcp-client.c \
- src/libsystemd-network/sd-dhcp-server.c \
- src/libsystemd-network/dhcp-network.c \
- src/libsystemd-network/dhcp-option.c \
- src/libsystemd-network/dhcp-packet.c \
- src/libsystemd-network/dhcp-internal.h \
- src/libsystemd-network/dhcp-server-internal.h \
- src/libsystemd-network/dhcp-protocol.h \
- src/libsystemd-network/dhcp-lease-internal.h \
- src/libsystemd-network/sd-dhcp-lease.c \
- src/libsystemd-network/sd-ipv4ll.c \
- src/libsystemd-network/sd-ipv4acd.c \
- src/libsystemd-network/arp-util.h \
- src/libsystemd-network/arp-util.c \
- src/libsystemd-network/network-internal.c \
- src/libsystemd-network/network-internal.h \
- src/libsystemd-network/sd-ndisc.c \
- src/libsystemd-network/ndisc-internal.h \
- src/libsystemd-network/ndisc-router.h \
- src/libsystemd-network/ndisc-router.c \
- src/libsystemd-network/sd-radv.c \
- src/libsystemd-network/radv-internal.h \
- src/libsystemd-network/icmp6-util.h \
- src/libsystemd-network/icmp6-util.c \
- src/libsystemd-network/sd-dhcp6-client.c \
- src/libsystemd-network/dhcp6-internal.h \
- src/libsystemd-network/dhcp6-protocol.h \
- src/libsystemd-network/dhcp6-network.c \
- src/libsystemd-network/dhcp6-option.c \
- src/libsystemd-network/dhcp6-lease-internal.h \
- src/libsystemd-network/sd-dhcp6-lease.c \
- src/libsystemd-network/dhcp-identifier.h \
- src/libsystemd-network/dhcp-identifier.c \
- src/libsystemd-network/lldp-internal.h \
- src/libsystemd-network/lldp-network.h \
- src/libsystemd-network/lldp-network.c \
- src/libsystemd-network/lldp-neighbor.h \
- src/libsystemd-network/lldp-neighbor.c \
- src/libsystemd-network/sd-lldp.c
-
-libsystemd_network_la_LIBADD = \
- $(KMOD_LIBS)
-
-test_dhcp_option_SOURCES = \
- src/libsystemd-network/dhcp-protocol.h \
- src/libsystemd-network/dhcp-internal.h \
- src/libsystemd-network/test-dhcp-option.c
-
-test_dhcp_option_LDADD = \
- libsystemd-network.la \
- libsystemd-shared.la
-
-test_sd_dhcp_lease_SOURCES = \
- src/libsystemd-network/dhcp-lease-internal.h \
- src/libsystemd-network/test-sd-dhcp-lease.c
-
-test_sd_dhcp_lease_LDADD = \
- libsystemd-network.la \
- libsystemd-shared.la
-
-test_dhcp_client_SOURCES = \
- src/systemd/sd-dhcp-client.h \
- src/libsystemd-network/dhcp-protocol.h \
- src/libsystemd-network/dhcp-internal.h \
- src/libsystemd-network/test-dhcp-client.c
-
-test_dhcp_client_LDADD = \
- libsystemd-network.la \
- libsystemd-shared.la
-
-test_dhcp_server_SOURCES = \
- src/libsystemd-network/test-dhcp-server.c
-
-test_dhcp_server_LDADD = \
- libsystemd-network.la \
- libsystemd-shared.la
-
-test_ipv4ll_SOURCES = \
- src/systemd/sd-ipv4ll.h \
- src/libsystemd-network/arp-util.h \
- src/libsystemd-network/test-ipv4ll.c
-
-test_ipv4ll_LDADD = \
- libsystemd-network.la \
- libsystemd-shared.la
-
-test_ipv4ll_manual_SOURCES = \
- src/systemd/sd-ipv4ll.h \
- src/libsystemd-network/test-ipv4ll-manual.c
-
-test_ipv4ll_manual_LDADD = \
- libsystemd-network.la \
- libsystemd-shared.la
-
-test_acd_SOURCES = \
- src/systemd/sd-ipv4acd.h \
- src/libsystemd-network/test-acd.c
-
-test_acd_LDADD = \
- libsystemd-network.la \
- libsystemd-shared.la
-
-test_ndisc_rs_SOURCES = \
- src/systemd/sd-dhcp6-client.h \
- src/systemd/sd-ndisc.h \
- src/libsystemd-network/icmp6-util.h \
- src/libsystemd-network/test-ndisc-rs.c \
- src/libsystemd-network/dhcp-identifier.h \
- src/libsystemd-network/dhcp-identifier.c
-
-test_ndisc_rs_LDADD = \
- libsystemd-network.la \
- libudev.la \
- libsystemd-shared.la
-
-test_ndisc_ra_SOURCES = \
- src/systemd/sd-ndisc.h \
- src/libsystemd-network/icmp6-util.h \
- src/libsystemd-network/test-ndisc-ra.c
-
-test_ndisc_ra_LDADD = \
- libsystemd-network.la \
- libudev.la \
- libsystemd-shared.la
-
-test_dhcp6_client_SOURCES = \
- src/systemd/sd-dhcp6-client.h \
- src/libsystemd-network/dhcp6-internal.h \
- src/libsystemd-network/test-dhcp6-client.c \
- src/libsystemd-network/dhcp-identifier.h \
- src/libsystemd-network/dhcp-identifier.c
-
-test_dhcp6_client_LDADD = \
- libsystemd-network.la \
- libudev.la \
- libsystemd-shared.la
-
-test_lldp_SOURCES = \
- src/libsystemd-network/test-lldp.c
-
-test_lldp_LDADD = \
- libsystemd-network.la \
- libsystemd-shared.la
-
-tests += \
- test-dhcp-option \
- test-dhcp-client \
- test-dhcp-server \
- test-sd-dhcp-lease \
- test-ipv4ll \
- test-ndisc-rs \
- test-ndisc-ra \
- test-dhcp6-client \
- test-lldp
-
-# ------------------------------------------------------------------------------
-include_HEADERS += \
- src/libudev/libudev.h
-
-rootlib_LTLIBRARIES += \
- libudev.la
-
-libudev_la_SOURCES =\
- src/libudev/libudev.sym \
- src/libudev/libudev-private.h \
- src/libudev/libudev-device-internal.h \
- src/libudev/libudev.c \
- src/libudev/libudev-list.c \
- src/libudev/libudev-util.c \
- src/libudev/libudev-device.c \
- src/libudev/libudev-device-private.c \
- src/libudev/libudev-enumerate.c \
- src/libudev/libudev-monitor.c \
- src/libudev/libudev-queue.c \
- src/libudev/libudev-hwdb.c
-
-libudev_la_LDFLAGS = \
- $(AM_LDFLAGS) \
- -version-info $(LIBUDEV_CURRENT):$(LIBUDEV_REVISION):$(LIBUDEV_AGE) \
- -Wl,--version-script=$(top_srcdir)/src/libudev/libudev.sym
-
-libudev_la_LIBADD = \
- libsystemd-internal.la \
- libbasic.la
-
-pkgconfiglib_DATA += \
- src/libudev/libudev.pc
-
-EXTRA_DIST += \
- src/libudev/libudev.pc.in
-
-# ------------------------------------------------------------------------------
-noinst_LTLIBRARIES += \
- libudev-internal.la
-
-libudev_internal_la_SOURCES =\
- $(libudev_la_SOURCES)
-
-# ------------------------------------------------------------------------------
-INSTALL_DIRS += \
- $(sysconfdir)/udev/rules.d
-
-dist_network_DATA = \
- network/99-default.link \
- network/80-container-host0.network \
- network/80-container-ve.network \
- network/80-container-vz.network
-
-dist_udevrules_DATA += \
- rules/60-block.rules \
- rules/60-drm.rules \
- rules/60-evdev.rules \
- rules/60-input-id.rules \
- rules/60-persistent-storage-tape.rules \
- rules/60-persistent-input.rules \
- rules/60-persistent-alsa.rules \
- rules/60-persistent-storage.rules \
- rules/60-sensor.rules \
- rules/60-serial.rules \
- rules/64-btrfs.rules \
- rules/70-joystick.rules \
- rules/70-mouse.rules \
- rules/70-touchpad.rules \
- rules/75-net-description.rules \
- rules/78-sound-card.rules \
- rules/80-net-setup-link.rules
-
-nodist_udevrules_DATA += \
- rules/50-udev-default.rules \
- rules/99-systemd.rules
-
-udevconfdir = $(sysconfdir)/udev
-dist_udevconf_DATA = \
- src/udev/udev.conf
-
-pkgconfigdata_DATA += \
- src/udev/udev.pc
-
-EXTRA_DIST += \
- rules/50-udev-default.rules.in \
- rules/99-systemd.rules.in \
- src/udev/udev.pc.in
-
-EXTRA_DIST += \
- units/systemd-udevd.service.in \
- units/systemd-udev-trigger.service.in \
- units/systemd-udev-settle.service.in
-
-SOCKETS_TARGET_WANTS += \
- systemd-udevd-control.socket \
- systemd-udevd-kernel.socket
-
-SYSINIT_TARGET_WANTS += \
- systemd-udevd.service \
- systemd-udev-trigger.service
-
-rootbin_PROGRAMS += \
- udevadm
-
-rootlibexec_PROGRAMS += \
- systemd-udevd
-
-noinst_LTLIBRARIES += \
- libudev-core.la
-
-src/udev/keyboard-keys-list.txt:
- $(AM_V_at)$(MKDIR_P) $(dir $@)
- $(AM_V_GEN)$(top_srcdir)/src/udev/generate-keyboard-keys-list.sh "$(CPP) $(CFLAGS) $(AM_CPPFLAGS) $(CPPFLAGS)" > $@
-
-src/udev/keyboard-keys-from-name.gperf: src/udev/keyboard-keys-list.txt
- $(AM_V_GEN)$(top_srcdir)/src/udev/generate-keyboard-keys-gperf.sh $< > $@
-
-src/udev/keyboard-keys-from-name.h: src/udev/keyboard-keys-from-name.gperf
- $(AM_V_GPERF)$(GPERF) -L ANSI-C -t -N keyboard_lookup_key -H hash_key_name -p -C < $< > $@
-
-gperf_txt_sources += \
- src/udev/keyboard-keys-list.txt
-
-libudev_core_la_SOURCES = \
- src/udev/udev.h \
- src/udev/udev-event.c \
- src/udev/udev-watch.c \
- src/udev/udev-node.c \
- src/udev/udev-rules.c \
- src/udev/udev-ctrl.c \
- src/udev/udev-builtin.c \
- src/udev/udev-builtin-btrfs.c \
- src/udev/udev-builtin-hwdb.c \
- src/udev/udev-builtin-input_id.c \
- src/udev/udev-builtin-keyboard.c \
- src/udev/udev-builtin-net_id.c \
- src/udev/udev-builtin-net_setup_link.c \
- src/udev/udev-builtin-path_id.c \
- src/udev/udev-builtin-usb_id.c \
- src/udev/net/link-config.h \
- src/udev/net/link-config.c \
- src/udev/net/ethtool-util.h \
- src/udev/net/ethtool-util.c
-
-nodist_libudev_core_la_SOURCES = \
- src/udev/keyboard-keys-from-name.h \
- src/udev/net/link-config-gperf.c
-
-gperf_gperf_sources += \
- src/udev/net/link-config-gperf.gperf
-
-libudev_core_la_CFLAGS = \
- $(AM_CFLAGS) \
- $(BLKID_CFLAGS) \
- $(KMOD_CFLAGS) \
- -DLOG_REALM=LOG_REALM_UDEV
-
-libudev_core_la_LIBADD = \
- libsystemd-network.la \
- libshared.la \
- $(BLKID_LIBS) \
- $(KMOD_LIBS)
-
-if HAVE_KMOD
-libudev_core_la_SOURCES += \
- src/udev/udev-builtin-kmod.c
-
-dist_udevrules_DATA += \
- rules/80-drivers.rules
-endif
-
-if HAVE_BLKID
-libudev_core_la_SOURCES += \
- src/udev/udev-builtin-blkid.c
-endif
-
-if HAVE_ACL
-libudev_core_la_SOURCES += \
- src/udev/udev-builtin-uaccess.c \
- src/login/logind-acl.c \
- src/libsystemd/sd-login/sd-login.c \
- src/systemd/sd-login.h
-endif
-
-systemd_udevd_SOURCES = \
- src/udev/udevd.c
-
-systemd_udevd_CFLAGS = \
- $(AM_CFLAGS) \
- -DLOG_REALM=LOG_REALM_UDEV
-
-systemd_udevd_LDADD = \
- libudev-core.la \
- libbasic.la
-
-udevadm_SOURCES = \
- src/udev/udevadm.c \
- src/udev/udevadm-info.c \
- src/udev/udevadm-control.c \
- src/udev/udevadm-monitor.c \
- src/udev/udevadm-hwdb.c \
- src/udev/udevadm-settle.c \
- src/udev/udevadm-trigger.c \
- src/udev/udevadm-test.c \
- src/udev/udevadm-test-builtin.c \
- src/udev/udevadm-util.c \
- src/udev/udevadm-util.h
-
-udevadm_LDADD = \
- libudev-core.la \
- libbasic.la
-
-# ------------------------------------------------------------------------------
-if ENABLE_HWDB
-INSTALL_DIRS += \
- $(sysconfdir)/udev/hwdb.d
-
-systemd_hwdb_SOURCES = \
- src/libsystemd/sd-hwdb/hwdb-internal.h \
- src/hwdb/hwdb.c
-
-systemd_hwdb_LDADD = \
- libshared.la
-
-rootbin_PROGRAMS += \
- systemd-hwdb
-
-dist_udevhwdb_DATA = \
- hwdb/20-pci-vendor-model.hwdb \
- hwdb/20-pci-classes.hwdb \
- hwdb/20-usb-vendor-model.hwdb \
- hwdb/20-usb-classes.hwdb \
- hwdb/20-sdio-vendor-model.hwdb \
- hwdb/20-sdio-classes.hwdb \
- hwdb/20-bluetooth-vendor-product.hwdb \
- hwdb/20-acpi-vendor.hwdb \
- hwdb/20-OUI.hwdb \
- hwdb/20-net-ifname.hwdb \
- hwdb/60-evdev.hwdb \
- hwdb/60-keyboard.hwdb \
- hwdb/60-sensor.hwdb \
- hwdb/70-mouse.hwdb \
- hwdb/70-pointingstick.hwdb \
- hwdb/70-touchpad.hwdb
-
-SYSINIT_TARGET_WANTS += \
- systemd-hwdb-update.service
-
-# Update hwdb on installation. Do not bother if installing
-# in DESTDIR, since this is likely for packaging purposes.
-hwdb-update-hook:
- -test -n "$(DESTDIR)" || $(rootbindir)/systemd-hwdb update
-
-INSTALL_DATA_HOOKS += \
- hwdb-update-hook
-
-hwdb-remove-hook:
- -test -n "$(DESTDIR)" || rm -f /etc/udev/hwdb.bin
-endif
-
-EXTRA_DIST += \
- units/systemd-hwdb-update.service.in \
- hwdb/ids-update.pl \
- hwdb/sdio.ids
-
-# ------------------------------------------------------------------------------
-if ENABLE_TESTS
-TESTS += \
- test/udev-test.pl \
- test/hwdb-test.sh
-
-if HAVE_PYTHON
-TESTS += \
- test/rule-syntax-check.py \
- hwdb/parse_hwdb.py
-
-if HAVE_SYSV_COMPAT
-TESTS += \
- test/sysv-generator-test.py
-endif
-endif
-endif
-
-tests += \
- test-libudev
-
-manual_tests += \
- test-udev
-
-test_libudev_SOURCES = \
- src/test/test-libudev.c
-
-test_libudev_LDADD = \
- libsystemd-shared.la
-
-test_udev_SOURCES = \
- src/test/test-udev.c
-
-test_udev_LDADD = \
- libudev-core.la \
- libsystemd-shared.la \
- $(BLKID_LIBS) \
- $(KMOD_LIBS) \
- -lrt
-
-if ENABLE_TESTS
-check_DATA += \
- test/sys
-endif
-
-# sysfs test tree
-test/sys: test/sys-script.py
- -rm -rf $@
- $(AM_V_at)$(MKDIR_P) $(dir $@)
- $(AM_V_GEN)$(top_srcdir)/test/sys-script.py $(dir $@)
- -touch $@
-
-test-sys-distclean:
- -rm -rf test/sys
-DISTCLEAN_LOCAL_HOOKS += test-sys-distclean
-
-EXTRA_DIST += \
- test/sys-script.py \
- test/udev-test.pl \
- test/hwdb-test.sh \
- test/rule-syntax-check.py \
- test/sysv-generator-test.py \
- test/mocks/fsck \
- hwdb/parse_hwdb.py
-
-# ------------------------------------------------------------------------------
-ata_id_SOURCES = \
- src/udev/ata_id/ata_id.c
-
-ata_id_CFLAGS = \
- $(AM_CFLAGS) \
- -DLOG_REALM=LOG_REALM_UDEV
-
-ata_id_LDADD = \
- libshared.la
-
-udevlibexec_PROGRAMS += \
- ata_id
-
-# ------------------------------------------------------------------------------
-cdrom_id_SOURCES = \
- src/udev/cdrom_id/cdrom_id.c
-
-cdrom_id_CFLAGS = \
- $(AM_CFLAGS) \
- -DLOG_REALM=LOG_REALM_UDEV
-
-cdrom_id_LDADD = \
- libshared.la
-
-udevlibexec_PROGRAMS += \
- cdrom_id
-
-dist_udevrules_DATA += \
- rules/60-cdrom_id.rules
-
-# ------------------------------------------------------------------------------
-collect_SOURCES = \
- src/udev/collect/collect.c
-
-collect_CFLAGS = \
- $(AM_CFLAGS) \
- -DLOG_REALM=LOG_REALM_UDEV
-
-collect_LDADD = \
- libshared.la
-
-udevlibexec_PROGRAMS += \
- collect
-
-# ------------------------------------------------------------------------------
-scsi_id_SOURCES =\
- src/udev/scsi_id/scsi_id.c \
- src/udev/scsi_id/scsi_serial.c \
- src/udev/scsi_id/scsi.h \
- src/udev/scsi_id/scsi_id.h
-
-scsi_id_CFLAGS = \
- $(AM_CFLAGS) \
- -DLOG_REALM=LOG_REALM_UDEV
-
-scsi_id_LDADD = \
- libshared.la
-
-udevlibexec_PROGRAMS += \
- scsi_id
-
-EXTRA_DIST += \
- src/udev/scsi_id/README
-
-# ------------------------------------------------------------------------------
-v4l_id_SOURCES = \
- src/udev/v4l_id/v4l_id.c
-
-v4l_id_CFLAGS = \
- $(AM_CFLAGS) \
- -DLOG_REALM=LOG_REALM_UDEV
-
-v4l_id_LDADD = \
- libshared.la
-
-udevlibexec_PROGRAMS += \
- v4l_id
-
-dist_udevrules_DATA += \
- rules/60-persistent-v4l.rules
-
-# ------------------------------------------------------------------------------
-mtd_probe_SOURCES = \
- src/udev/mtd_probe/mtd_probe.c \
- src/udev/mtd_probe/mtd_probe.h \
- src/udev/mtd_probe/probe_smartmedia.c
-
-mtd_probe_CFLAGS = \
- $(AM_CFLAGS) \
- -DLOG_REALM=LOG_REALM_UDEV
-
-dist_udevrules_DATA += \
- rules/75-probe_mtd.rules
-
-udevlibexec_PROGRAMS += \
- mtd_probe
-
-# ------------------------------------------------------------------------------
-test_id128_SOURCES = \
- src/test/test-id128.c
-
-test_id128_LDADD = \
- libsystemd-shared.la
-
-tests += \
- test-id128
-
-# ------------------------------------------------------------------------------
-test_hash_SOURCES = \
- src/test/test-hash.c
-
-test_hash_LDADD = \
- libsystemd-shared.la
-
-tests += \
- test-hash
-
-# ------------------------------------------------------------------------------
-
-bin_PROGRAMS += \
- systemd-socket-activate
-
-systemd_socket_activate_SOURCES = \
- src/activate/activate.c
-
-systemd_socket_activate_LDADD = \
- libsystemd-shared.la
-
-# ------------------------------------------------------------------------------
-systemd_journald_SOURCES = \
- src/journal/journald.c \
- src/journal/journald-server.h
-
-systemd_journald_LDADD = \
- libjournal-core.la \
- libsystemd-shared.la
-
-systemd_cat_SOURCES = \
- src/journal/cat.c
-
-systemd_cat_LDADD = \
- libjournal-core.la
-
-if HAVE_LIBCURL
-rootlibexec_PROGRAMS += \
- systemd-journal-upload
-
-systemd_journal_upload_SOURCES = \
- src/journal-remote/journal-upload.h \
- src/journal-remote/journal-upload.c \
- src/journal-remote/journal-upload-journal.c
-
-systemd_journal_upload_CFLAGS = \
- $(AM_CFLAGS) \
- $(LIBCURL_CFLAGS)
-
-systemd_journal_upload_LDADD = \
- libsystemd-shared.la \
- $(LIBCURL_LIBS)
-
-nodist_systemunit_DATA += \
- units/systemd-journal-upload.service
-
-nodist_pkgsysconf_DATA += \
- src/journal-remote/journal-upload.conf
-endif
-
-EXTRA_DIST += \
- units/systemd-journal-upload.service.in \
- src/journal-remote/journal-upload.conf.in
-
-if HAVE_MICROHTTPD
-rootlibexec_PROGRAMS += \
- systemd-journal-remote
-
-systemd_journal_remote_SOURCES = \
- src/journal-remote/journal-remote-parse.h \
- src/journal-remote/journal-remote-parse.c \
- src/journal-remote/journal-remote-write.h \
- src/journal-remote/journal-remote-write.c \
- src/journal-remote/journal-remote.h \
- src/journal-remote/journal-remote.c
-
-systemd_journal_remote_LDADD = \
- libjournal-core.la
-
-systemd_journal_remote_SOURCES += \
- src/journal-remote/microhttpd-util.h \
- src/journal-remote/microhttpd-util.c
-
-systemd_journal_remote_CFLAGS = \
- $(AM_CFLAGS) \
- $(MICROHTTPD_CFLAGS)
-
-systemd_journal_remote_LDADD += \
- $(MICROHTTPD_LIBS)
-
-if HAVE_GNUTLS
-systemd_journal_remote_LDADD += \
- $(GNUTLS_LIBS)
-endif
-
-# systemd-journal-remote make sense mostly with full crypto stack
-dist_systemunit_DATA += \
- units/systemd-journal-remote.socket
-
-nodist_systemunit_DATA += \
- units/systemd-journal-remote.service
-
-journal-remote-install-hook: journal-install-hook
- -$(MKDIR_P) $(DESTDIR)/var/log/journal/remote
- -chown 0:0 $(DESTDIR)/var/log/journal/remote
- -chmod 755 $(DESTDIR)/var/log/journal/remote
-
-INSTALL_EXEC_HOOKS += journal-remote-install-hook
-
-nodist_pkgsysconf_DATA += \
- src/journal-remote/journal-remote.conf
-
-EXTRA_DIST += \
- units/systemd-journal-remote.service.in \
- src/journal-remote/journal-remote.conf.in \
- src/journal-remote/log-generator.py
-endif
-
-# using _CFLAGS = in the conditional below would suppress AM_CFLAGS
-journalctl_CFLAGS = \
- $(AM_CFLAGS)
-
-journalctl_SOURCES = \
- src/journal/journalctl.c
-
-journalctl_LDADD = \
- libsystemd-shared.la \
- libudev-core.la
-
-if HAVE_QRENCODE
-journalctl_SOURCES += \
- src/journal/journal-qrcode.c \
- src/journal/journal-qrcode.h
-
-journalctl_CFLAGS += \
- $(QRENCODE_CFLAGS)
-
-journalctl_LDADD += \
- $(QRENCODE_LIBS)
-endif
-
-test_journal_SOURCES = \
- src/journal/test-journal.c
-
-test_journal_LDADD = \
- libjournal-core.la
-
-test_journal_send_SOURCES = \
- src/journal/test-journal-send.c
-
-test_journal_send_LDADD = \
- libjournal-core.la
-
-test_journal_syslog_SOURCES = \
- src/journal/test-journal-syslog.c
-
-test_journal_syslog_LDADD = \
- libjournal-core.la
-
-test_journal_match_SOURCES = \
- src/journal/test-journal-match.c
-
-test_journal_match_LDADD = \
- libjournal-core.la
-
-test_journal_enum_SOURCES = \
- src/journal/test-journal-enum.c
-
-test_journal_enum_LDADD = \
- libjournal-core.la
-
-test_journal_stream_SOURCES = \
- src/journal/test-journal-stream.c
-
-test_journal_stream_LDADD = \
- libjournal-core.la
-
-test_journal_flush_SOURCES = \
- src/journal/test-journal-flush.c
-
-test_journal_flush_LDADD = \
- libjournal-core.la
-
-test_journal_init_SOURCES = \
- src/journal/test-journal-init.c
-
-test_journal_init_LDADD = \
- libjournal-core.la
-
-test_journal_verify_SOURCES = \
- src/journal/test-journal-verify.c
-
-test_journal_verify_LDADD = \
- libjournal-core.la
-
-test_journal_interleaving_SOURCES = \
- src/journal/test-journal-interleaving.c
-
-test_journal_interleaving_LDADD = \
- libjournal-core.la
-
-test_mmap_cache_SOURCES = \
- src/journal/test-mmap-cache.c
-
-test_mmap_cache_LDADD = \
- libjournal-core.la
-
-test_catalog_SOURCES = \
- src/journal/test-catalog.c
-
-test_catalog_CPPFLAGS = \
- $(AM_CPPFLAGS) \
- -DCATALOG_DIR=\"$(abs_top_builddir)/catalog\"
-
-test_catalog_LDADD = \
- libjournal-core.la
-
-test_compress_SOURCES = \
- src/journal/test-compress.c
-
-test_compress_LDADD = \
- libsystemd-shared.la
-
-if HAVE_LZ4
-test_compress_LDADD += \
- -llz4
-endif
-
-test_compress_benchmark_SOURCES = \
- src/journal/test-compress-benchmark.c
-
-test_compress_benchmark_LDADD = \
- libsystemd-shared.la
-
-test_audit_type_SOURCES = \
- src/journal/test-audit-type.c
-
-test_audit_type_LDADD = \
- libjournal-core.la
-
-libjournal_core_la_SOURCES = \
- src/journal/journald-kmsg.c \
- src/journal/journald-kmsg.h \
- src/journal/journald-syslog.c \
- src/journal/journald-syslog.h \
- src/journal/journald-stream.c \
- src/journal/journald-stream.h \
- src/journal/journald-server.c \
- src/journal/journald-server.h \
- src/journal/journald-console.c \
- src/journal/journald-console.h \
- src/journal/journald-wall.c \
- src/journal/journald-wall.h \
- src/journal/journald-native.c \
- src/journal/journald-native.h \
- src/journal/journald-audit.c \
- src/journal/journald-audit.h \
- src/journal/journald-rate-limit.c \
- src/journal/journald-rate-limit.h \
- src/journal/journal-internal.h
-
-nodist_libjournal_core_la_SOURCES = \
- src/journal/journald-gperf.c
-
-libjournal_core_la_LIBADD = \
- libsystemd-shared.la
-
-noinst_LTLIBRARIES += \
- libjournal-core.la
-
-journal-install-hook:
- -$(MKDIR_P) $(DESTDIR)/var/log/journal
- -chown 0:0 $(DESTDIR)/var/log/journal
- -chmod 755 $(DESTDIR)/var/log/journal
- -setfacl -nm g:adm:rx,d:g:adm:rx $(DESTDIR)/var/log/journal/
- -setfacl -nm g:wheel:rx,d:g:wheel:rx $(DESTDIR)/var/log/journal/
-
-journal-uninstall-hook:
- -rmdir $(DESTDIR)/var/log/journal/remote
- -rmdir $(DESTDIR)/var/log/journal/
-
-INSTALL_EXEC_HOOKS += journal-install-hook
-UNINSTALL_EXEC_HOOKS += journal-uninstall-hook
-
-# ------------------------------------------------------------------------------
-# Update catalog on installation. Do not bother if installing
-# in DESTDIR, since this is likely for packaging purposes.
-catalog-update-hook:
- -test -n "$(DESTDIR)" || $(rootbindir)/journalctl --update-catalog
-
-INSTALL_DATA_HOOKS += \
- catalog-update-hook
-
-catalog-remove-hook:
- -test -n "$(DESTDIR)" || rm -f $(catalogstatedir)/database
-
-UNINSTALL_DATA_HOOKS += \
- catalog-remove-hook
-
-tests += \
- test-journal \
- test-journal-enum \
- test-journal-send \
- test-journal-syslog \
- test-journal-match \
- test-journal-stream \
- test-journal-init \
- test-journal-verify \
- test-journal-interleaving \
- test-journal-flush \
- test-mmap-cache \
- test-catalog \
- test-audit-type
-
-if HAVE_COMPRESSION
-tests += \
- test-compress \
- test-compress-benchmark
-endif
-
-pkginclude_HEADERS += \
- src/systemd/sd-journal.h \
- src/systemd/sd-messages.h \
- src/systemd/_sd-common.h
-
-libsystemd_journal_internal_la_SOURCES = \
- src/journal/sd-journal.c \
- src/systemd/sd-journal.h \
- src/systemd/_sd-common.h \
- src/journal/journal-file.c \
- src/journal/journal-file.h \
- src/journal/journal-vacuum.c \
- src/journal/journal-vacuum.h \
- src/journal/journal-verify.c \
- src/journal/journal-verify.h \
- src/journal/lookup3.c \
- src/journal/lookup3.h \
- src/journal/journal-send.c \
- src/journal/journal-def.h \
- src/journal/compress.h \
- src/journal/catalog.c \
- src/journal/catalog.h \
- src/journal/mmap-cache.c \
- src/journal/mmap-cache.h \
- src/journal/compress.c \
- src/journal/audit-type.h \
- src/journal/audit-type.c \
- src/shared/gcrypt-util.h \
- src/shared/gcrypt-util.c
-
-nodist_libsystemd_journal_internal_la_SOURCES = \
- src/journal/audit_type-to-name.h
-
-gperf_txt_sources += \
- src/journal/audit_type-list.txt
-
-# using _CFLAGS = in the conditional below would suppress AM_CFLAGS
-libsystemd_journal_internal_la_CFLAGS = \
- $(AM_CFLAGS)
-
-libsystemd_journal_internal_la_LIBADD =
-
-if HAVE_XZ
-libsystemd_journal_internal_la_CFLAGS += \
- $(XZ_CFLAGS)
-
-libsystemd_journal_internal_la_LIBADD += \
- $(XZ_LIBS)
-endif
-
-if HAVE_LZ4
-libsystemd_journal_internal_la_LIBADD += \
- -llz4
-endif
-
-if HAVE_GCRYPT
-libsystemd_journal_internal_la_SOURCES += \
- src/journal/journal-authenticate.c \
- src/journal/journal-authenticate.h \
- src/journal/fsprg.c \
- src/journal/fsprg.h
-
-libsystemd_journal_internal_la_LIBADD += \
- $(GCRYPT_LIBS)
-
-libsystemd_journal_internal_la_CFLAGS += \
- $(GCRYPT_CFLAGS)
-endif
-
-noinst_LTLIBRARIES += \
- libsystemd-journal-internal.la
-
-rootlibexec_PROGRAMS += \
- systemd-journald
-
-rootbin_PROGRAMS += \
- journalctl
-
-bin_PROGRAMS += \
- systemd-cat
-
-dist_systemunit_DATA += \
- units/systemd-journald.socket \
- units/systemd-journald-dev-log.socket \
- units/systemd-journald-audit.socket
-
-nodist_systemunit_DATA += \
- units/systemd-journald.service \
- units/systemd-journal-flush.service \
- units/systemd-journal-catalog-update.service
-
-dist_pkgsysconf_DATA += \
- src/journal/journald.conf
-
-nodist_catalog_DATA = \
- catalog/systemd.bg.catalog \
- catalog/systemd.be.catalog \
- catalog/systemd.be@latin.catalog \
- catalog/systemd.fr.catalog \
- catalog/systemd.it.catalog \
- catalog/systemd.pl.catalog \
- catalog/systemd.pt_BR.catalog \
- catalog/systemd.ru.catalog \
- catalog/systemd.zh_CN.catalog \
- catalog/systemd.zh_TW.catalog \
- catalog/systemd.catalog
-
-EXTRA_DIST += \
- $(nodist_catalog_DATA:.catalog=.catalog.in)
-
-# Note that we don't use @@ for replacement markers here, but %%. This is
-# because the catalog uses @@ already for its runtime replacement handling and
-# we don't want to conflict with that.
-catalog/%.catalog: catalog/%.catalog.in
- $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \
- $(SED) -e 's~%SUPPORT_URL%~$(SUPPORT_URL)~' < $< > $@
-
-SOCKETS_TARGET_WANTS += \
- systemd-journald.socket \
- systemd-journald-dev-log.socket \
- systemd-journald-audit.socket
-
-SYSINIT_TARGET_WANTS += \
- systemd-journald.service \
- systemd-journal-flush.service \
- systemd-journal-catalog-update.service
-
-EXTRA_DIST += \
- units/systemd-journald.service.in \
- units/systemd-journal-flush.service.in \
- units/systemd-journal-catalog-update.service.in
-
-gperf_gperf_sources += \
- src/journal/journald-gperf.gperf
-
-# ------------------------------------------------------------------------------
-if HAVE_MICROHTTPD
-gatewayddocumentrootdir=$(pkgdatadir)/gatewayd
-
-rootlibexec_PROGRAMS += \
- systemd-journal-gatewayd
-
-systemd_journal_gatewayd_SOURCES = \
- src/journal-remote/journal-gatewayd.c \
- src/journal-remote/microhttpd-util.h \
- src/journal-remote/microhttpd-util.c
-
-systemd_journal_gatewayd_LDADD = \
- libsystemd-shared.la \
- $(MICROHTTPD_LIBS)
-
-if HAVE_GNUTLS
-systemd_journal_gatewayd_LDADD += \
- $(GNUTLS_LIBS)
-endif
-
-systemd_journal_gatewayd_CFLAGS = \
- $(AM_CFLAGS) \
- $(MICROHTTPD_CFLAGS)
-
-systemd_journal_gatewayd_CPPFLAGS = \
- $(AM_CPPFLAGS) \
- -DDOCUMENT_ROOT=\"$(gatewayddocumentrootdir)\"
-
-dist_systemunit_DATA += \
- units/systemd-journal-gatewayd.socket
-
-nodist_systemunit_DATA += \
- units/systemd-journal-gatewayd.service
-
-dist_gatewayddocumentroot_DATA = \
- src/journal-remote/browse.html
-
-endif
-
-EXTRA_DIST += \
- units/systemd-journal-gatewayd.service.in
-
-# ------------------------------------------------------------------------------
-
-systemd_socket_proxyd_SOURCES = \
- src/socket-proxy/socket-proxyd.c
-
-systemd_socket_proxyd_LDADD = \
- libsystemd-shared.la
-
-# ------------------------------------------------------------------------------
-if ENABLE_COREDUMP
-systemd_coredump_SOURCES = \
- src/coredump/coredump.c \
- src/coredump/coredump-vacuum.c \
- src/coredump/coredump-vacuum.h
-
-systemd_coredump_CFLAGS = \
- $(AM_CFLAGS) \
- $(ACL_CFLAGS)
-
-systemd_coredump_LDADD = \
- libsystemd-shared.la \
- $(ACL_LIBS)
-
-if HAVE_ELFUTILS
-systemd_coredump_SOURCES += \
- src/coredump/stacktrace.c \
- src/coredump/stacktrace.h
-
-systemd_coredump_LDADD += \
- $(ELFUTILS_LIBS)
-endif
-
-nodist_systemunit_DATA += \
- units/systemd-coredump@.service
-
-dist_systemunit_DATA += \
- units/systemd-coredump.socket
-
-SOCKETS_TARGET_WANTS += \
- systemd-coredump.socket
-
-rootlibexec_PROGRAMS += \
- systemd-coredump
-
-dist_pkgsysconf_DATA += \
- src/coredump/coredump.conf
-
-coredumpctl_SOURCES = \
- src/coredump/coredumpctl.c
-
-coredumpctl_LDADD = \
- libsystemd-shared.la
-
-bin_PROGRAMS += \
- coredumpctl
-
-manual_tests += \
- test-coredump-vacuum
-
-test_coredump_vacuum_SOURCES = \
- src/coredump/test-coredump-vacuum.c \
- src/coredump/coredump-vacuum.c \
- src/coredump/coredump-vacuum.h
-
-test_coredump_vacuum_LDADD = \
- libsystemd-shared.la
-
-dist_bashcompletion_data += \
- shell-completion/bash/coredumpctl
-
-dist_zshcompletion_data += \
- shell-completion/zsh/_coredumpctl
-
-nodist_sysctl_DATA = \
- sysctl.d/50-coredump.conf
-
-CLEANFILES += \
- sysctl.d/50-coredump.conf
-endif
-
-EXTRA_DIST += \
- sysctl.d/50-coredump.conf.in \
- units/systemd-coredump@.service.in
-
-# ------------------------------------------------------------------------------
-if ENABLE_BINFMT
-systemd_binfmt_SOURCES = \
- src/binfmt/binfmt.c
-
-systemd_binfmt_LDADD = \
- libsystemd-shared.la
-
-rootlibexec_PROGRAMS += \
- systemd-binfmt
-
-dist_systemunit_DATA += \
- units/proc-sys-fs-binfmt_misc.automount \
- units/proc-sys-fs-binfmt_misc.mount
-
-nodist_systemunit_DATA += \
- units/systemd-binfmt.service
-
-INSTALL_DIRS += \
- $(prefix)/lib/binfmt.d \
- $(sysconfdir)/binfmt.d
-
-SYSINIT_TARGET_WANTS += \
- systemd-binfmt.service \
- proc-sys-fs-binfmt_misc.automount
-
-endif
-
-EXTRA_DIST += \
- units/systemd-binfmt.service.in
-
-# ------------------------------------------------------------------------------
-if ENABLE_VCONSOLE
-systemd_vconsole_setup_SOURCES = \
- src/vconsole/vconsole-setup.c
-
-systemd_vconsole_setup_LDADD = \
- libsystemd-shared.la
-
-rootlibexec_PROGRAMS += \
- systemd-vconsole-setup
-
-nodist_udevrules_DATA += \
- src/vconsole/90-vconsole.rules
-
-nodist_systemunit_DATA += \
- units/systemd-vconsole-setup.service
-endif
-
-EXTRA_DIST += \
- src/vconsole/90-vconsole.rules.in \
- units/systemd-vconsole-setup.service.in
-
-# ------------------------------------------------------------------------------
-if ENABLE_QUOTACHECK
-rootlibexec_PROGRAMS += \
- systemd-quotacheck
-
-nodist_systemunit_DATA += \
- units/systemd-quotacheck.service
-
-systemd_quotacheck_SOURCES = \
- src/quotacheck/quotacheck.c
-
-systemd_quotacheck_LDADD = \
- libsystemd-shared.la
-endif
-
-EXTRA_DIST += \
- units/systemd-quotacheck.service.in
-
-nodist_systemunit_DATA += \
- units/quotaon.service
-
-# ------------------------------------------------------------------------------
-if ENABLE_RANDOMSEED
-rootlibexec_PROGRAMS += \
- systemd-random-seed
-
-nodist_systemunit_DATA += \
- units/systemd-random-seed.service
-
-systemd_random_seed_SOURCES = \
- src/random-seed/random-seed.c
-
-systemd_random_seed_LDADD = \
- libsystemd-shared.la
-
-SYSINIT_TARGET_WANTS += \
- systemd-random-seed.service
-
-endif
-
-EXTRA_DIST += \
- units/systemd-random-seed.service.in
-
-# ------------------------------------------------------------------------------
-if ENABLE_BACKLIGHT
-rootlibexec_PROGRAMS += \
- systemd-backlight
-
-nodist_systemunit_DATA += \
- units/systemd-backlight@.service
-
-systemd_backlight_SOURCES = \
- src/backlight/backlight.c
-
-systemd_backlight_LDADD = \
- libsystemd-shared.la
-endif
-
-EXTRA_DIST += \
- units/systemd-backlight@.service.in
-
-# ------------------------------------------------------------------------------
-if ENABLE_RFKILL
-rootlibexec_PROGRAMS += \
- systemd-rfkill
-
-nodist_systemunit_DATA += \
- units/systemd-rfkill.service
-
-dist_systemunit_DATA += \
- units/systemd-rfkill.socket
-
-systemd_rfkill_SOURCES = \
- src/rfkill/rfkill.c
-
-systemd_rfkill_LDADD = \
- libsystemd-shared.la
-endif
-
-EXTRA_DIST += \
- units/systemd-rfkill.service.in
-
-# ------------------------------------------------------------------------------
-if HAVE_LIBCRYPTSETUP
-rootlibexec_PROGRAMS += \
- systemd-cryptsetup \
- systemd-veritysetup
-
-systemgenerator_PROGRAMS += \
- systemd-cryptsetup-generator \
- systemd-veritysetup-generator
-
-dist_systemunit_DATA += \
- units/cryptsetup.target \
- units/cryptsetup-pre.target
-
-systemd_cryptsetup_SOURCES = \
- src/cryptsetup/cryptsetup.c
-
-systemd_cryptsetup_CFLAGS = \
- $(AM_CFLAGS) \
- $(LIBCRYPTSETUP_CFLAGS)
-
-systemd_cryptsetup_LDADD = \
- libsystemd-shared.la \
- $(LIBCRYPTSETUP_LIBS)
-
-systemd_cryptsetup_generator_SOURCES = \
- src/cryptsetup/cryptsetup-generator.c
-
-systemd_cryptsetup_generator_LDADD = \
- libsystemd-shared.la
-
-systemd_veritysetup_SOURCES = \
- src/veritysetup/veritysetup.c
-
-systemd_veritysetup_CFLAGS = \
- $(AM_CFLAGS) \
- $(LIBCRYPTSETUP_CFLAGS)
-
-systemd_veritysetup_LDADD = \
- libsystemd-shared.la \
- $(LIBCRYPTSETUP_LIBS)
-
-systemd_veritysetup_generator_SOURCES = \
- src/veritysetup/veritysetup-generator.c
-
-systemd_veritysetup_generator_LDADD = \
- libsystemd-shared.la
-
-SYSINIT_TARGET_WANTS += \
- cryptsetup.target
-
-endif
-
-# ------------------------------------------------------------------------------
-if ENABLE_HOSTNAMED
-systemd_hostnamed_SOURCES = \
- src/hostname/hostnamed.c
-
-systemd_hostnamed_LDADD = \
- libsystemd-shared.la
-
-rootlibexec_PROGRAMS += \
- systemd-hostnamed
-
-nodist_systemunit_DATA += \
- units/systemd-hostnamed.service
-
-dist_systemunit_DATA_busnames += \
- units/org.freedesktop.hostname1.busname
-
-dist_dbuspolicy_DATA += \
- src/hostname/org.freedesktop.hostname1.conf
-
-dist_dbussystemservice_DATA += \
- src/hostname/org.freedesktop.hostname1.service
-
-polkitpolicy_files += \
- src/hostname/org.freedesktop.hostname1.policy
-
-SYSTEM_UNIT_ALIASES += \
- systemd-hostnamed.service dbus-org.freedesktop.hostname1.service
-
-BUSNAMES_TARGET_WANTS += \
- org.freedesktop.hostname1.busname
-
-hostnamectl_SOURCES = \
- src/hostname/hostnamectl.c
-
-hostnamectl_LDADD = \
- libsystemd-shared.la
-
-bin_PROGRAMS += \
- hostnamectl
-
-dist_bashcompletion_data += \
- shell-completion/bash/hostnamectl
-
-dist_zshcompletion_data += \
- shell-completion/zsh/_hostnamectl
-endif
-
-polkitpolicy_in_files += \
- src/hostname/org.freedesktop.hostname1.policy.in
-
-EXTRA_DIST += \
- units/systemd-hostnamed.service.in
-
-# ------------------------------------------------------------------------------
-dist_systemunit_DATA_busnames += \
- units/org.freedesktop.systemd1.busname
-
-BUSNAMES_TARGET_WANTS += \
- org.freedesktop.systemd1.busname
-
-# ------------------------------------------------------------------------------
-if ENABLE_LOCALED
-systemd_localed_SOURCES = \
- src/locale/localed.c \
- src/locale/keymap-util.c \
- src/locale/keymap-util.h
-
-systemd_localed_LDADD = \
- libsystemd-shared.la \
- -ldl
-
-nodist_systemunit_DATA += \
- units/systemd-localed.service
-
-dist_systemunit_DATA_busnames += \
- units/org.freedesktop.locale1.busname
-
-rootlibexec_PROGRAMS += \
- systemd-localed
-
-dist_dbuspolicy_DATA += \
- src/locale/org.freedesktop.locale1.conf
-
-dist_dbussystemservice_DATA += \
- src/locale/org.freedesktop.locale1.service
-
-polkitpolicy_files += \
- src/locale/org.freedesktop.locale1.policy
-
-SYSTEM_UNIT_ALIASES += \
- systemd-localed.service dbus-org.freedesktop.locale1.service
-
-BUSNAMES_TARGET_WANTS += \
- org.freedesktop.locale1.busname
-
-dist_pkgdata_DATA = \
- src/locale/kbd-model-map \
- src/locale/language-fallback-map
-
-test_keymap_util_SOURCES = \
- src/locale/test-keymap-util.c \
- src/locale/keymap-util.c \
- src/locale/keymap-util.h
-
-test_keymap_util_LDADD = \
- libsystemd-shared.la \
- -ldl
-
-tests += \
- test-keymap-util
-
-localectl_SOURCES = \
- src/locale/localectl.c
-
-localectl_LDADD = \
- libsystemd-shared.la
-
-bin_PROGRAMS += \
- localectl
-
-dist_bashcompletion_data += \
- shell-completion/bash/localectl
-
-dist_zshcompletion_data += \
- shell-completion/zsh/_localectl
-endif
-
-polkitpolicy_in_files += \
- src/locale/org.freedesktop.locale1.policy.in
-
-EXTRA_DIST += \
- units/systemd-localed.service.in
-
-# ------------------------------------------------------------------------------
-if ENABLE_TIMEDATED
-systemd_timedated_SOURCES = \
- src/timedate/timedated.c
-
-systemd_timedated_LDADD = \
- libsystemd-shared.la
-
-rootlibexec_PROGRAMS += \
- systemd-timedated
-
-dist_dbussystemservice_DATA += \
- src/timedate/org.freedesktop.timedate1.service
-
-dist_dbuspolicy_DATA += \
- src/timedate/org.freedesktop.timedate1.conf
-
-nodist_systemunit_DATA += \
- units/systemd-timedated.service
-
-dist_systemunit_DATA_busnames += \
- units/org.freedesktop.timedate1.busname
-
-polkitpolicy_files += \
- src/timedate/org.freedesktop.timedate1.policy
-
-SYSTEM_UNIT_ALIASES += \
- systemd-timedated.service dbus-org.freedesktop.timedate1.service
-
-BUSNAMES_TARGET_WANTS += \
- org.freedesktop.timedate1.busname
-
-timedatectl_SOURCES = \
- src/timedate/timedatectl.c
-
-timedatectl_LDADD = \
- libsystemd-shared.la
-
-bin_PROGRAMS += \
- timedatectl
-
-dist_bashcompletion_data += \
- shell-completion/bash/timedatectl
-
-dist_zshcompletion_data += \
- shell-completion/zsh/_timedatectl
-endif
-
-polkitpolicy_in_files += \
- src/timedate/org.freedesktop.timedate1.policy.in
-
-EXTRA_DIST += \
- units/systemd-timedated.service.in
-
-# ------------------------------------------------------------------------------
-if ENABLE_TIMESYNCD
-systemd_timesyncd_SOURCES = \
- src/timesync/timesyncd.c \
- src/timesync/timesyncd-manager.c \
- src/timesync/timesyncd-manager.h \
- src/timesync/timesyncd-conf.c \
- src/timesync/timesyncd-conf.h \
- src/timesync/timesyncd-server.c \
- src/timesync/timesyncd-server.h
-
-nodist_systemd_timesyncd_SOURCES = \
- src/timesync/timesyncd-gperf.c
-
-systemd_timesyncd_LDADD = \
- libsystemd-network.la \
- libsystemd-shared.la \
- -lm
-
-test_timesync_SOURCES = \
- src/timesync/test-timesync.c \
- src/timesync/timesyncd-manager.c \
- src/timesync/timesyncd-manager.h \
- src/timesync/timesyncd-conf.c \
- src/timesync/timesyncd-conf.h \
- src/timesync/timesyncd-server.c \
- src/timesync/timesyncd-server.h
-
-nodist_test_timesync_SOURCES = \
- src/timesync/timesyncd-gperf.c
-
-test_timesync_LDADD = \
- libsystemd-shared.la \
- -lm
-
-tests += \
- test-timesync
-
-rootlibexec_PROGRAMS += \
- systemd-timesyncd
-
-nodist_systemunit_DATA += \
- units/systemd-timesyncd.service
-
-GENERAL_ALIASES += \
- $(systemunitdir)/systemd-timesyncd.service $(pkgsysconfdir)/system/sysinit.target.wants/systemd-timesyncd.service
-
-nodist_pkgsysconf_DATA += \
- src/timesync/timesyncd.conf
-
-endif
-
-gperf_gperf_sources += \
- src/timesync/timesyncd-gperf.gperf
-
-EXTRA_DIST += \
- units/systemd-timesyncd.service.in \
- src/timesync/timesyncd.conf.in
-
-# ------------------------------------------------------------------------------
-test_nss_SOURCES = \
- src/test/test-nss.c
-
-test_nss_LDADD = \
- libsystemd-internal.la \
- libbasic.la \
- -ldl
-
-manual_tests += \
- test-nss
-
-# ------------------------------------------------------------------------------
-if ENABLE_NSS_SYSTEMD
-libnss_systemd_la_SOURCES = \
- src/nss-systemd/nss-systemd.sym \
- src/nss-systemd/nss-systemd.c
-
-libnss_systemd_la_LDFLAGS = \
- $(AM_LDFLAGS) \
- -module \
- -export-dynamic \
- -avoid-version \
- -shared \
- -shrext .so.2 \
- -Wl,--version-script=$(top_srcdir)/src/nss-systemd/nss-systemd.sym
-
-libnss_systemd_la_LIBADD = \
- libsystemd-internal.la \
- libbasic.la
-
-rootlib_LTLIBRARIES += \
- libnss_systemd.la
-endif
-
-# ------------------------------------------------------------------------------
-if HAVE_MYHOSTNAME
-libnss_myhostname_la_SOURCES = \
- src/nss-myhostname/nss-myhostname.sym \
- src/nss-myhostname/nss-myhostname.c
-
-libnss_myhostname_la_LDFLAGS = \
- $(AM_LDFLAGS) \
- -module \
- -export-dynamic \
- -avoid-version \
- -shared \
- -shrext .so.2 \
- -Wl,--version-script=$(top_srcdir)/src/nss-myhostname/nss-myhostname.sym
-
-libnss_myhostname_la_LIBADD = \
- libsystemd-internal.la \
- libbasic.la
-
-rootlib_LTLIBRARIES += \
- libnss_myhostname.la
-endif
-
-# ------------------------------------------------------------------------------
-if ENABLE_MACHINED
-
-dist_systemunit_DATA += \
- units/var-lib-machines.mount
-
-systemd_machined_SOURCES = \
- src/machine/machined.c \
- src/machine/machined.h
-
-systemd_machined_LDADD = \
- libmachine-core.la
-
-rootlibexec_PROGRAMS += \
- systemd-machined
-
-libmachine_core_la_SOURCES = \
- src/machine/machine.c \
- src/machine/machine.h \
- src/machine/machined-dbus.c \
- src/machine/machine-dbus.c \
- src/machine/machine-dbus.h \
- src/machine/image-dbus.c \
- src/machine/image-dbus.h \
- src/machine/operation.c \
- src/machine/operation.h
-
-libmachine_core_la_LIBADD = \
- libsystemd-shared.la
-
-noinst_LTLIBRARIES += \
- libmachine-core.la
-
-machinectl_SOURCES = \
- src/machine/machinectl.c
-
-machinectl_LDADD = \
- libsystemd-shared.la
-
-rootbin_PROGRAMS += \
- machinectl
-
-test_machine_tables_SOURCES = \
- src/machine/test-machine-tables.c
-
-test_machine_tables_LDADD = \
- libmachine-core.la
-
-tests += \
- test-machine-tables
-
-nodist_systemunit_DATA += \
- units/systemd-machined.service
-
-dist_systemunit_DATA += \
- units/machine.slice
-
-dist_systemunit_DATA_busnames += \
- units/org.freedesktop.machine1.busname
-
-dist_dbussystemservice_DATA += \
- src/machine/org.freedesktop.machine1.service
-
-dist_dbuspolicy_DATA += \
- src/machine/org.freedesktop.machine1.conf
-
-polkitpolicy_files += \
- src/machine/org.freedesktop.machine1.policy
-
-dist_bashcompletion_data += \
- shell-completion/bash/machinectl
-
-dist_zshcompletion_data += \
- shell-completion/zsh/_machinectl \
- shell-completion/zsh/_sd_machines
-
-SYSTEM_UNIT_ALIASES += \
- systemd-machined.service dbus-org.freedesktop.machine1.service
-
-BUSNAMES_TARGET_WANTS += \
- org.freedesktop.machine1.busname
-
-libnss_mymachines_la_SOURCES = \
- src/nss-mymachines/nss-mymachines.sym \
- src/nss-mymachines/nss-mymachines.c
-
-libnss_mymachines_la_LDFLAGS = \
- $(AM_LDFLAGS) \
- -module \
- -export-dynamic \
- -avoid-version \
- -shared \
- -shrext .so.2 \
- -Wl,--version-script=$(top_srcdir)/src/nss-mymachines/nss-mymachines.sym
-
-libnss_mymachines_la_LIBADD = \
- libsystemd-internal.la \
- libbasic.la
-
-rootlib_LTLIBRARIES += \
- libnss_mymachines.la
-
-endif
-
-polkitpolicy_in_files += \
- src/machine/org.freedesktop.machine1.policy.in
-
-EXTRA_DIST += \
- units/systemd-machined.service.in
-
-# ------------------------------------------------------------------------------
-if ENABLE_IMPORTD
-
-if HAVE_LIBCURL
-if HAVE_XZ
-if HAVE_ZLIB
-if HAVE_BZIP2
-if HAVE_GCRYPT
-
-rootlibexec_PROGRAMS += \
- systemd-importd \
- systemd-pull \
- systemd-import \
- systemd-export
-
-systemd_importd_SOURCES = \
- src/import/importd.c
-
-systemd_importd_CFLAGS = \
- $(AM_CFLAGS) \
- -D SYSTEMD_PULL_PATH=\"$(rootlibexecdir)/systemd-pull\" \
- -D SYSTEMD_IMPORT_PATH=\"$(rootlibexecdir)/systemd-import\" \
- -D SYSTEMD_EXPORT_PATH=\"$(rootlibexecdir)/systemd-export\"
-
-systemd_importd_LDADD = \
- libsystemd-shared.la
-
-systemd_pull_SOURCES = \
- src/import/pull.c \
- src/import/pull-raw.c \
- src/import/pull-raw.h \
- src/import/pull-tar.c \
- src/import/pull-tar.h \
- src/import/pull-job.c \
- src/import/pull-job.h \
- src/import/pull-common.c \
- src/import/pull-common.h \
- src/import/import-common.c \
- src/import/import-common.h \
- src/import/import-compress.c \
- src/import/import-compress.h \
- src/import/curl-util.c \
- src/import/curl-util.h \
- src/import/qcow2-util.c \
- src/import/qcow2-util.h
-
-systemd_pull_CFLAGS = \
- $(AM_CFLAGS) \
- $(LIBCURL_CFLAGS) \
- $(XZ_CFLAGS) \
- $(ZLIB_CFLAGS) \
- $(GCRYPT_CFLAGS) \
- -D VENDOR_KEYRING_PATH=\"$(rootlibexecdir)/import-pubring.gpg\" \
- -D USER_KEYRING_PATH=\"$(pkgsysconfdir)/import-pubring.gpg\"
-
-systemd_pull_LDADD = \
- libsystemd-shared.la \
- $(LIBCURL_LIBS) \
- $(XZ_LIBS) \
- $(ZLIB_LIBS) \
- -lbz2 \
- $(GCRYPT_LIBS)
-
-systemd_import_SOURCES = \
- src/import/import.c \
- src/import/import-raw.c \
- src/import/import-raw.h \
- src/import/import-tar.c \
- src/import/import-tar.h \
- src/import/import-common.c \
- src/import/import-common.h \
- src/import/import-compress.c \
- src/import/import-compress.h \
- src/import/qcow2-util.c \
- src/import/qcow2-util.h
-
-systemd_import_CFLAGS = \
- $(AM_CFLAGS) \
- $(XZ_CFLAGS) \
- $(ZLIB_CFLAGS)
-
-systemd_import_LDADD = \
- libsystemd-shared.la \
- $(XZ_LIBS) \
- $(ZLIB_LIBS) \
- -lbz2
-
-systemd_export_SOURCES = \
- src/import/export.c \
- src/import/export-tar.c \
- src/import/export-tar.h \
- src/import/export-raw.c \
- src/import/export-raw.h \
- src/import/import-common.c \
- src/import/import-common.h \
- src/import/import-compress.c \
- src/import/import-compress.h
-
-systemd_export_CFLAGS = \
- $(AM_CFLAGS) \
- $(XZ_CFLAGS) \
- $(ZLIB_CFLAGS)
-
-systemd_export_LDADD = \
- libsystemd-shared.la \
- $(XZ_LIBS) \
- $(ZLIB_LIBS) \
- -lbz2
-
-dist_rootlibexec_DATA += \
- src/import/import-pubring.gpg
-
-nodist_systemunit_DATA += \
- units/systemd-importd.service
-
-dist_systemunit_DATA_busnames += \
- units/org.freedesktop.import1.busname
-
-BUSNAMES_TARGET_WANTS += \
- org.freedesktop.import1.busname
-
-SYSTEM_UNIT_ALIASES += \
- systemd-importd.service dbus-org.freedesktop.import1.service
-
-dist_dbussystemservice_DATA += \
- src/import/org.freedesktop.import1.service
-
-dist_dbuspolicy_DATA += \
- src/import/org.freedesktop.import1.conf
-
-polkitpolicy_files += \
- src/import/org.freedesktop.import1.policy
-
-manual_tests += \
- test-qcow2
-
-test_qcow2_SOURCES = \
- src/import/test-qcow2.c \
- src/import/qcow2-util.c \
- src/import/qcow2-util.h
-
-test_qcow2_CFLAGS = \
- $(AM_CFLAGS) \
- $(ZLIB_CFLAGS)
-
-test_qcow2_LDADD = \
- libsystemd-shared.la \
- $(ZLIB_LIBS)
-
-endif
-endif
-endif
-endif
-endif
-
-endif
-
-polkitpolicy_in_files += \
- src/import/org.freedesktop.import1.policy.in
-
-EXTRA_DIST += \
- units/systemd-importd.service.in
-
-
-# ------------------------------------------------------------------------------
-if ENABLE_RESOLVED
-
-basic_dns_sources = \
- src/resolve/resolved-dns-dnssec.c \
- src/resolve/resolved-dns-dnssec.h \
- src/resolve/resolved-dns-packet.c \
- src/resolve/resolved-dns-packet.h \
- src/resolve/resolved-dns-rr.c \
- src/resolve/resolved-dns-rr.h \
- src/resolve/resolved-dns-answer.c \
- src/resolve/resolved-dns-answer.h \
- src/resolve/resolved-dns-question.c \
- src/resolve/resolved-dns-question.h \
- src/resolve/dns-type.c \
- src/resolve/dns-type.h
-
-systemd_resolved_SOURCES = \
- src/resolve/resolved.c \
- src/resolve/resolved-manager.c \
- src/resolve/resolved-manager.h \
- src/resolve/resolved-conf.c \
- src/resolve/resolved-conf.h \
- src/resolve/resolved-resolv-conf.c \
- src/resolve/resolved-resolv-conf.h \
- src/resolve/resolved-bus.c \
- src/resolve/resolved-bus.h \
- src/resolve/resolved-link.h \
- src/resolve/resolved-link.c \
- src/resolve/resolved-link-bus.c \
- src/resolve/resolved-link-bus.h \
- src/resolve/resolved-llmnr.h \
- src/resolve/resolved-llmnr.c \
- src/resolve/resolved-mdns.h \
- src/resolve/resolved-mdns.c \
- src/resolve/resolved-def.h \
- $(basic_dns_sources) \
- src/resolve/resolved-dns-query.h \
- src/resolve/resolved-dns-query.c \
- src/resolve/resolved-dns-synthesize.h \
- src/resolve/resolved-dns-synthesize.c \
- src/resolve/resolved-dns-transaction.h \
- src/resolve/resolved-dns-transaction.c \
- src/resolve/resolved-dns-scope.h \
- src/resolve/resolved-dns-scope.c \
- src/resolve/resolved-dns-server.h \
- src/resolve/resolved-dns-server.c \
- src/resolve/resolved-dns-search-domain.h \
- src/resolve/resolved-dns-search-domain.c \
- src/resolve/resolved-dns-cache.h \
- src/resolve/resolved-dns-cache.c \
- src/resolve/resolved-dns-zone.h \
- src/resolve/resolved-dns-zone.c \
- src/resolve/resolved-dns-stream.h \
- src/resolve/resolved-dns-stream.c \
- src/resolve/resolved-dns-trust-anchor.h \
- src/resolve/resolved-dns-trust-anchor.c \
- src/resolve/resolved-dns-stub.h \
- src/resolve/resolved-dns-stub.c \
- src/resolve/resolved-etc-hosts.h \
- src/resolve/resolved-etc-hosts.c \
- src/shared/gcrypt-util.c \
- src/shared/gcrypt-util.h
-
-nodist_systemd_resolved_SOURCES = \
- src/resolve/dns_type-from-name.h \
- src/resolve/dns_type-to-name.h \
- src/resolve/resolved-gperf.c
-
-systemd_resolved_CFLAGS = \
- $(AM_CFLAGS) \
- $(GCRYPT_CFLAGS)
-
-systemd_resolved_LDADD = \
- libsystemd-network.la \
- libsystemd-shared.la \
- $(GCRYPT_LIBS) \
- -lm
-
-rootlibexec_PROGRAMS += \
- systemd-resolved
-
-nodist_systemunit_DATA += \
- units/systemd-resolved.service
-
-dist_systemunit_DATA_busnames += \
- units/org.freedesktop.resolve1.busname
-
-dist_dbuspolicy_DATA += \
- src/resolve/org.freedesktop.resolve1.conf
-
-dist_dbussystemservice_DATA += \
- src/resolve/org.freedesktop.resolve1.service
-
-BUSNAMES_TARGET_WANTS += \
- org.freedesktop.resolve1.busname
-
-GENERAL_ALIASES += \
- $(systemunitdir)/systemd-resolved.service $(pkgsysconfdir)/system/multi-user.target.wants/systemd-resolved.service \
- $(systemunitdir)/systemd-resolved.service $(pkgsysconfdir)/system/dbus-org.freedesktop.resolve1.service
-
-nodist_pkgsysconf_DATA += \
- src/resolve/resolved.conf
-
-dist_rootlibexec_DATA += \
- src/resolve/resolv.conf
-
-libnss_resolve_la_SOURCES = \
- src/nss-resolve/nss-resolve.sym \
- src/nss-resolve/nss-resolve.c
-
-libnss_resolve_la_LDFLAGS = \
- $(AM_LDFLAGS) \
- -module \
- -export-dynamic \
- -avoid-version \
- -shared \
- -shrext .so.2 \
- -Wl,--version-script=$(top_srcdir)/src/nss-resolve/nss-resolve.sym
-
-libnss_resolve_la_LIBADD = \
- libsystemd-internal.la \
- libbasic.la
-
-rootlib_LTLIBRARIES += \
- libnss_resolve.la
-
-systemd_resolve_SOURCES = \
- src/resolve/resolve-tool.c \
- $(basic_dns_sources) \
- src/shared/gcrypt-util.c \
- src/shared/gcrypt-util.h
-
-nodist_systemd_resolve_SOURCES = \
- src/resolve/dns_type-from-name.h \
- src/resolve/dns_type-to-name.h
-
-systemd_resolve_CFLAGS = \
- $(AM_CFLAGS) \
- $(GCRYPT_CFLAGS)
-
-systemd_resolve_LDADD = \
- libsystemd-shared.la \
- $(GCRYPT_LIBS) \
- -lm
-
-bin_PROGRAMS += \
- systemd-resolve
-
-dist_bashcompletion_data += \
- shell-completion/bash/systemd-resolve
-
-dist_zshcompletion_data += \
- shell-completion/zsh/_systemd-resolve
-
-tests += \
- test-dns-packet \
- test-resolve-tables \
- test-resolved-packet \
- test-dnssec
-
-manual_tests += \
- test-dnssec-complex
-
-test_resolve_tables_SOURCES = \
- src/resolve/test-resolve-tables.c \
- src/resolve/dns_type-from-name.h \
- src/resolve/dns_type-to-name.h \
- $(basic_dns_sources) \
- src/shared/test-tables.h
-
-test_resolve_tables_CFLAGS = \
- $(AM_CFLAGS) \
- $(GCRYPT_CFLAGS)
-
-test_resolve_tables_LDADD = \
- libsystemd-shared.la \
- $(GCRYPT_LIBS) \
- -lm
-
-test_resolved_packet_SOURCES = \
- src/resolve/test-resolved-packet.c \
- $(basic_dns_sources)
-
-test_resolved_packet_CFLAGS = \
- $(AM_CFLAGS) \
- $(GCRYPT_CFLAGS)
-
-test_resolved_packet_LDADD = \
- libsystemd-shared.la \
- $(GCRYPT_LIBS) \
- -lm
-
-test_dns_packet_SOURCES = \
- src/resolve/test-dns-packet.c \
- $(basic_dns_sources)
-
-test_dns_packet_CPPFLAGS = \
- $(AM_CPPFLAGS) \
- -I $(top_srcdir)/src/test
-
-test_dns_packet_CFLAGS = \
- $(AM_CFLAGS) \
- $(GCRYPT_CFLAGS)
-
-test_dns_packet_LDADD = \
- libsystemd-shared.la \
- $(GCRYPT_LIBS) \
- -lm
-
-TEST_DATA_FILES += \
- test/test-resolve/_openpgpkey.fedoraproject.org.pkts \
- test/test-resolve/fedoraproject.org.pkts \
- test/test-resolve/gandi.net.pkts \
- test/test-resolve/google.com.pkts \
- test/test-resolve/root.pkts \
- test/test-resolve/sw1a1aa-sw1a2aa-sw1a2ab-sw1a2ac.find.me.uk.pkts \
- test/test-resolve/teamits.com.pkts \
- test/test-resolve/zbyszek@fedoraproject.org.pkts \
- test/test-resolve/_443._tcp.fedoraproject.org.pkts \
- test/test-resolve/kyhwana.org.pkts \
- test/test-resolve/fake-caa.pkts
-
-EXTRA_DIST += $(TEST_DATA_FILES)
-
-test_dnssec_SOURCES = \
- src/resolve/test-dnssec.c \
- $(basic_dns_sources)
-
-test_dnssec_CFLAGS = \
- $(AM_CFLAGS) \
- $(GCRYPT_CFLAGS)
-
-test_dnssec_LDADD = \
- libsystemd-shared.la \
- $(GCRYPT_LIBS) \
- -lm
-
-test_dnssec_complex_SOURCES = \
- src/resolve/test-dnssec-complex.c \
- src/resolve/dns-type.c \
- src/resolve/dns-type.h
-
-test_dnssec_complex_LDADD = \
- libsystemd-shared.la
-
-endif
-
-gperf_txt_sources += \
- src/resolve/dns_type-list.txt
-
-gperf_gperf_sources += \
- src/resolve/resolved-gperf.gperf
-
-EXTRA_DIST += \
- units/systemd-resolved.service.m4.in \
- src/resolve/resolved.conf.in
-
-# ------------------------------------------------------------------------------
-if ENABLE_NETWORKD
-rootlibexec_PROGRAMS += \
- systemd-networkd
-
-systemd_networkd_SOURCES = \
- src/network/networkd.c
-
-systemd_networkd_LDADD = \
- libnetworkd-core.la
-
-if HAVE_LIBIPTC
-systemd_networkd_LDADD += \
- libfirewall.la
-endif
-
-noinst_LTLIBRARIES += \
- libnetworkd-core.la
-
-libnetworkd_core_la_CFLAGS = \
- $(AM_CFLAGS)
-
-libnetworkd_core_la_SOURCES = \
- src/libsystemd-network/network-internal.h \
- src/network/netdev/netdev.h \
- src/network/netdev/netdev.c \
- src/network/netdev/vrf.h \
- src/network/netdev/vrf.c \
- src/network/netdev/tunnel.h \
- src/network/netdev/tunnel.c \
- src/network/netdev/veth.h \
- src/network/netdev/veth.c \
- src/network/netdev/vxlan.h \
- src/network/netdev/vxlan.c \
- src/network/netdev/geneve.h \
- src/network/netdev/geneve.c \
- src/network/netdev/vlan.h \
- src/network/netdev/vlan.c \
- src/network/netdev/macvlan.h \
- src/network/netdev/macvlan.c \
- src/network/netdev/ipvlan.h \
- src/network/netdev/ipvlan.c \
- src/network/netdev/dummy.h \
- src/network/netdev/dummy.c \
- src/network/netdev/tuntap.h \
- src/network/netdev/tuntap.c \
- src/network/netdev/bond.h \
- src/network/netdev/bond.c \
- src/network/netdev/bridge.h \
- src/network/netdev/bridge.c \
- src/network/netdev/vcan.h \
- src/network/netdev/vcan.c \
- src/network/networkd-manager.h \
- src/network/networkd-manager.c \
- src/network/networkd-manager-bus.c \
- src/network/networkd-conf.h \
- src/network/networkd-conf.c \
- src/network/networkd-link.h \
- src/network/networkd-link.c \
- src/network/networkd-link-bus.c \
- src/network/networkd-ipv4ll.c \
- src/network/networkd-ipv6-proxy-ndp.h \
- src/network/networkd-ipv6-proxy-ndp.c \
- src/network/networkd-dhcp4.c \
- src/network/networkd-dhcp6.c \
- src/network/networkd-ndisc.h \
- src/network/networkd-radv.c \
- src/network/networkd-radv.h \
- src/network/networkd-ndisc.c \
- src/network/networkd-network.h \
- src/network/networkd-network.c \
- src/network/networkd-network-bus.c \
- src/network/networkd-address.h \
- src/network/networkd-address.c \
- src/network/networkd-address-label.h \
- src/network/networkd-address-label.c \
- src/network/networkd-route.h \
- src/network/networkd-route.c \
- src/network/networkd-fdb.h \
- src/network/networkd-fdb.c \
- src/network/networkd-brvlan.h \
- src/network/networkd-brvlan.c \
- src/network/networkd-address-pool.h \
- src/network/networkd-address-pool.c \
- src/network/networkd-util.h \
- src/network/networkd-util.c \
- src/network/networkd-lldp-tx.h \
- src/network/networkd-lldp-tx.c
-
-nodist_libnetworkd_core_la_SOURCES = \
- src/network/networkd-gperf.c \
- src/network/networkd-network-gperf.c \
- src/network/netdev/netdev-gperf.c
-
-libnetworkd_core_la_LIBADD = \
- libsystemd-network.la \
- libsystemd-shared.la
-
-rootlibexec_PROGRAMS += \
- systemd-networkd-wait-online
-
-systemd_networkd_wait_online_CFLAGS = \
- $(AM_CFLAGS)
-
-systemd_networkd_wait_online_SOURCES = \
- src/libsystemd-network/network-internal.h \
- src/network/wait-online/link.h \
- src/network/wait-online/link.c \
- src/network/wait-online/manager.h \
- src/network/wait-online/manager.c \
- src/network/wait-online/wait-online.c
-
-systemd_networkd_wait_online_LDADD = \
- libsystemd-network.la \
- libsystemd-shared.la
-
-rootbin_PROGRAMS += \
- networkctl
-
-networkctl_SOURCES = \
- src/network/networkctl.c
-
-networkctl_LDADD = \
- libsystemd-shared.la \
- libsystemd-network.la
-
-dist_bashcompletion_data += \
- shell-completion/bash/networkctl
-
-dist_zshcompletion_data += \
- shell-completion/zsh/_networkctl
-
-test_networkd_conf_SOURCES = \
- src/network/test-networkd-conf.c
-
-test_networkd_conf_LDADD = \
- libnetworkd-core.la
-
-test_network_SOURCES = \
- src/network/test-network.c
-
-test_network_LDADD = \
- libnetworkd-core.la
-
-if HAVE_LIBIPTC
-test_network_LDADD += \
- libfirewall.la
-endif
-
-test_network_tables_SOURCES = \
- src/network/test-network-tables.c \
- src/shared/test-tables.h
-
-test_network_tables_LDADD = \
- libnetworkd-core.la \
- libudev-core.la
-
-if HAVE_LIBIPTC
-test_network_tables_LDADD += \
- libfirewall.la
-endif
-
-tests += \
- test-networkd-conf \
- test-network \
- test-network-tables
-
-dist_systemunit_DATA += \
- units/systemd-networkd.socket
-
-nodist_systemunit_DATA += \
- units/systemd-networkd.service \
- units/systemd-networkd-wait-online.service
-
-dist_systemunit_DATA_busnames += \
- units/org.freedesktop.network1.busname
-
-dist_dbussystemservice_DATA += \
- src/network/org.freedesktop.network1.service
-
-dist_dbuspolicy_DATA += \
- src/network/org.freedesktop.network1.conf
-
-GENERAL_ALIASES += \
- $(systemunitdir)/systemd-networkd.socket $(pkgsysconfdir)/system/sockets.target.wants/systemd-networkd.socket \
- $(systemunitdir)/systemd-networkd.service $(pkgsysconfdir)/system/multi-user.target.wants/systemd-networkd.service \
- $(systemunitdir)/systemd-networkd-wait-online.service $(pkgsysconfdir)/system/network-online.target.wants/systemd-networkd-wait-online.service \
- $(systemunitdir)/systemd-networkd.service $(pkgsysconfdir)/system/dbus-org.freedesktop.network1.service
-
-BUSNAMES_TARGET_WANTS += \
- org.freedesktop.network1.busname
-
-polkitrules_files += \
- src/network/systemd-networkd.rules
-
-polkitpkla_files += \
- src/network/systemd-networkd.pkla
-
-endif
-
-gperf_gperf_sources += \
- src/network/networkd-gperf.gperf \
- src/network/networkd-network-gperf.gperf \
- src/network/netdev/netdev-gperf.gperf
-
-EXTRA_DIST += \
- src/network/systemd-networkd.rules \
- src/network/systemd-networkd.pkla \
- units/systemd-networkd.service.m4.in \
- units/systemd-networkd-wait-online.service.in \
- test/networkd-test.py \
- test/test-exec-deserialization.py
-
-# ------------------------------------------------------------------------------
-if ENABLE_LOGIND
-systemd_logind_SOURCES = \
- src/login/logind.c \
- src/login/logind.h
-
-nodist_systemd_logind_SOURCES = \
- src/login/logind-gperf.c
-
-systemd_logind_LDADD = \
- liblogind-core.la
-
-liblogind_core_la_SOURCES = \
- src/login/logind-core.c \
- src/login/logind-device.c \
- src/login/logind-device.h \
- src/login/logind-button.c \
- src/login/logind-button.h \
- src/login/logind-action.c \
- src/login/logind-action.h \
- src/login/logind-seat.c \
- src/login/logind-seat.h \
- src/login/logind-session.c \
- src/login/logind-session.h \
- src/login/logind-session-device.c \
- src/login/logind-session-device.h \
- src/login/logind-user.c \
- src/login/logind-user.h \
- src/login/logind-inhibit.c \
- src/login/logind-inhibit.h \
- src/login/logind-dbus.c \
- src/login/logind-session-dbus.c \
- src/login/logind-seat-dbus.c \
- src/login/logind-user-dbus.c \
- src/login/logind-utmp.c \
- src/login/logind-acl.h
-
-liblogind_core_la_LIBADD = \
- libsystemd-shared.la
-
-if HAVE_ACL
-liblogind_core_la_SOURCES += \
- src/login/logind-acl.c
-endif
-
-noinst_LTLIBRARIES += \
- liblogind-core.la
-
-rootlibexec_PROGRAMS += \
- systemd-logind
-
-loginctl_SOURCES = \
- src/login/loginctl.c \
- src/login/sysfs-show.h \
- src/login/sysfs-show.c
-
-loginctl_LDADD = \
- libsystemd-shared.la
-
-rootbin_PROGRAMS += \
- loginctl
-
-dist_bashcompletion_data += \
- shell-completion/bash/loginctl
-
-dist_zshcompletion_data += \
- shell-completion/zsh/_loginctl \
- shell-completion/zsh/_systemd-inhibit
-
-systemd_inhibit_SOURCES = \
- src/login/inhibit.c
-
-systemd_inhibit_LDADD = \
- libsystemd-shared.la
-
-rootbin_PROGRAMS += \
- systemd-inhibit
-
-test_login_SOURCES = \
- src/libsystemd/sd-login/test-login.c
-
-test_login_LDADD = \
- libsystemd-shared.la
-
-test_login_shared_SOURCES = \
- src/login/test-login-shared.c
-
-test_login_shared_LDADD = \
- libsystemd-shared.la
-
-test_inhibit_SOURCES = \
- src/login/test-inhibit.c
-
-test_inhibit_LDADD = \
- libsystemd-shared.la
-
-test_login_tables_SOURCES = \
- src/login/test-login-tables.c
-
-test_login_tables_LDADD = \
- liblogind-core.la
-
-manual_tests += \
- test-inhibit
-
-tests += \
- test-login \
- test-login-tables \
- test-login-shared
-
-if HAVE_PAM
-pam_systemd_la_SOURCES = \
- src/login/pam_systemd.sym \
- src/login/pam_systemd.c
-
-pam_systemd_la_CFLAGS = \
- $(AM_CFLAGS) \
- $(PAM_CFLAGS)
-
-pam_systemd_la_LDFLAGS = \
- $(AM_LDFLAGS) \
- -module \
- -export-dynamic \
- -avoid-version \
- -shared \
- -Wl,--version-script=$(top_srcdir)/src/login/pam_systemd.sym
-
-pam_systemd_la_LIBADD = \
- libshared.la \
- $(PAM_LIBS)
-
-pamlib_LTLIBRARIES = \
- pam_systemd.la
-
-if ENABLE_PAM_CONFIG
-dist_pamconf_DATA = \
- src/login/systemd-user
-endif
-
-EXTRA_DIST += \
- src/login/systemd-user.m4
-endif
-
-nodist_systemunit_DATA += \
- units/systemd-logind.service
-
-dist_systemunit_DATA += \
- units/user.slice
-
-dist_systemunit_DATA_busnames += \
- units/org.freedesktop.login1.busname
-
-dist_dbussystemservice_DATA += \
- src/login/org.freedesktop.login1.service
-
-dist_dbuspolicy_DATA += \
- src/login/org.freedesktop.login1.conf
-
-nodist_pkgsysconf_DATA += \
- src/login/logind.conf
-
-polkitpolicy_files += \
- src/login/org.freedesktop.login1.policy
-
-INSTALL_DIRS += \
- $(systemdstatedir)
-
-MULTI_USER_TARGET_WANTS += \
- systemd-logind.service
-
-SYSTEM_UNIT_ALIASES += \
- systemd-logind.service dbus-org.freedesktop.login1.service
-
-BUSNAMES_TARGET_WANTS += \
- org.freedesktop.login1.busname
-
-dist_udevrules_DATA += \
- src/login/70-uaccess.rules \
- src/login/70-power-switch.rules
-
-nodist_udevrules_DATA += \
- src/login/71-seat.rules \
- src/login/73-seat-late.rules
-
-endif
-
-polkitpolicy_in_files += \
- src/login/org.freedesktop.login1.policy.in
-
-gperf_gperf_sources += \
- src/login/logind-gperf.gperf
-
-EXTRA_DIST += \
- src/login/71-seat.rules.in \
- src/login/73-seat-late.rules.in \
- units/systemd-logind.service.in \
- src/login/logind.conf.in
-
-# ------------------------------------------------------------------------------
-if HAVE_PAM
-
-systemd_user_sessions_SOURCES = \
- src/user-sessions/user-sessions.c
-
-systemd_user_sessions_LDADD = \
- libsystemd-shared.la
-
-rootlibexec_PROGRAMS += \
- systemd-user-sessions
-
-nodist_systemunit_DATA += \
- units/systemd-user-sessions.service
-
-MULTI_USER_TARGET_WANTS += \
- systemd-user-sessions.service
-
-endif
-
-EXTRA_DIST += \
- units/systemd-user-sessions.service.in
-
-# ------------------------------------------------------------------------------
-EXTRA_DIST += \
- test/Makefile \
- test/README.testsuite \
- test/TEST-01-BASIC \
- test/TEST-01-BASIC/Makefile \
- test/TEST-01-BASIC/test.sh \
- test/TEST-02-CRYPTSETUP \
- test/TEST-02-CRYPTSETUP/Makefile \
- test/TEST-02-CRYPTSETUP/test.sh \
- test/TEST-03-JOBS \
- test/TEST-03-JOBS/Makefile \
- test/TEST-03-JOBS/test-jobs.sh \
- test/TEST-03-JOBS/test.sh \
- test/TEST-04-JOURNAL/Makefile \
- test/TEST-04-JOURNAL/test-journal.sh \
- test/TEST-04-JOURNAL/test.sh \
- test/TEST-05-RLIMITS/Makefile \
- test/TEST-05-RLIMITS/test-rlimits.sh \
- test/TEST-05-RLIMITS/test.sh \
- test/TEST-06-SELINUX/Makefile \
- test/TEST-06-SELINUX/test-selinux-checks.sh \
- test/TEST-06-SELINUX/test.sh \
- test/TEST-06-SELINUX/systemd_test.te \
- test/TEST-06-SELINUX/systemd_test.if \
- test/TEST-07-ISSUE-1981/Makefile \
- test/TEST-07-ISSUE-1981/test-segfault.sh \
- test/TEST-07-ISSUE-1981/test.sh \
- test/TEST-08-ISSUE-2730/Makefile \
- test/TEST-08-ISSUE-2730/test.sh \
- test/TEST-09-ISSUE-2691/Makefile \
- test/TEST-09-ISSUE-2691/test.sh \
- test/TEST-10-ISSUE-2467/Makefile \
- test/TEST-10-ISSUE-2467/test.sh \
- test/TEST-11-ISSUE-3166/Makefile \
- test/TEST-11-ISSUE-3166/test.sh \
- test/TEST-12-ISSUE-3171/Makefile \
- test/TEST-12-ISSUE-3171/test.sh \
- test/TEST-13-NSPAWN-SMOKE/Makefile \
- test/TEST-13-NSPAWN-SMOKE/create-busybox-container \
- test/TEST-13-NSPAWN-SMOKE/test.sh \
- test/TEST-14-MACHINE-ID/Makefile \
- test/TEST-14-MACHINE-ID/test.sh \
- test/test-functions
-
-EXTRA_DIST += \
- test/loopy2.service \
- test/loopy3.service \
- test/loopy4.service \
- test/loopy.service \
- test/loopy.service.d \
- test/loopy.service.d/compat.conf
-
-# ------------------------------------------------------------------------------
-substitutions = \
- '|rootlibdir=$(rootlibdir)|' \
- '|rootlibexecdir=$(rootlibexecdir)|' \
- '|rootbindir=$(rootbindir)|' \
- '|bindir=$(bindir)|' \
- '|SYSTEMCTL=$(rootbindir)/systemctl|' \
- '|SYSTEMD_NOTIFY=$(rootbindir)/systemd-notify|' \
- '|pkgsysconfdir=$(pkgsysconfdir)|' \
- '|SYSTEM_CONFIG_UNIT_PATH=$(pkgsysconfdir)/system|' \
- '|USER_CONFIG_UNIT_PATH=$(pkgsysconfdir)/user|' \
- '|pkgdatadir=$(pkgdatadir)|' \
- '|systemunitdir=$(systemunitdir)|' \
- '|userunitdir=$(userunitdir)|' \
- '|systempresetdir=$(systempresetdir)|' \
- '|userpresetdir=$(userpresetdir)|' \
- '|udevhwdbdir=$(udevhwdbdir)|' \
- '|udevrulesdir=$(udevrulesdir)|' \
- '|catalogdir=$(catalogdir)|' \
- '|tmpfilesdir=$(tmpfilesdir)|' \
- '|sysusersdir=$(sysusersdir)|' \
- '|sysctldir=$(sysctldir)|' \
- '|systemgeneratordir=$(systemgeneratordir)|' \
- '|usergeneratordir=$(usergeneratordir)|' \
- '|systemenvgeneratordir=$(systemenvgeneratordir)|' \
- '|userenvgeneratordir=$(userenvgeneratordir)|' \
- '|CERTIFICATEROOT=$(CERTIFICATEROOT)|' \
- '|PACKAGE_VERSION=$(PACKAGE_VERSION)|' \
- '|PACKAGE_NAME=$(PACKAGE_NAME)|' \
- '|PACKAGE_URL=$(PACKAGE_URL)|' \
- '|RANDOM_SEED_DIR=$(localstatedir)/lib/systemd/|' \
- '|RANDOM_SEED=$(localstatedir)/lib/systemd/random-seed|' \
- '|prefix=$(prefix)|' \
- '|exec_prefix=$(exec_prefix)|' \
- '|libdir=$(libdir)|' \
- '|includedir=$(includedir)|' \
- '|rootprefix=$(rootprefix)|' \
- '|udevlibexecdir=$(udevlibexecdir)|' \
- '|SUSHELL=$(SUSHELL)|' \
- '|SULOGIN=$(SULOGIN)|' \
- '|DEBUGTTY=$(DEBUGTTY)|' \
- '|KILL=$(KILL)|' \
- '|KMOD=$(KMOD)|' \
- '|MOUNT_PATH=$(MOUNT_PATH)|' \
- '|UMOUNT_PATH=$(UMOUNT_PATH)|' \
- '|MKDIR_P=$(MKDIR_P)|' \
- '|QUOTAON=$(QUOTAON)|' \
- '|QUOTACHECK=$(QUOTACHECK)|' \
- '|SYSTEM_SYSVINIT_PATH=$(sysvinitdir)|' \
- '|VARLOGDIR=$(varlogdir)|' \
- '|RC_LOCAL_SCRIPT_PATH_START=$(RC_LOCAL_SCRIPT_PATH_START)|' \
- '|RC_LOCAL_SCRIPT_PATH_STOP=$(RC_LOCAL_SCRIPT_PATH_STOP)|' \
- '|PYTHON=$(PYTHON)|' \
- '|NTP_SERVERS=$(NTP_SERVERS)|' \
- '|DNS_SERVERS=$(DNS_SERVERS)|' \
- '|DEFAULT_DNSSEC_MODE=$(DEFAULT_DNSSEC_MODE)|' \
- '|KILL_USER_PROCESSES=$(KILL_USER_PROCESSES)|' \
- '|systemuidmax=$(SYSTEM_UID_MAX)|' \
- '|systemgidmax=$(SYSTEM_GID_MAX)|' \
- '|DEV_KVM_MODE=$(DEV_KVM_MODE)|' \
- '|TTY_GID=$(TTY_GID)|' \
- '|systemsleepdir=$(systemsleepdir)|' \
- '|systemshutdowndir=$(systemshutdowndir)|' \
- '|binfmtdir=$(binfmtdir)|' \
- '|modulesloaddir=$(modulesloaddir)|'
-
-SED_PROCESS = \
- $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \
- $(SED) $(subst '|,-e 's|@,$(subst =,\@|,$(subst |',|g',$(substitutions)))) \
- -e '/^\#\# /d' \
- < $< > $@
-
-units/%: units/%.in
- $(SED_PROCESS)
-
-man/%: man/%.in
- $(SED_PROCESS)
-
-sysctl.d/%: sysctl.d/%.in
- $(SED_PROCESS)
-
-%.pc: %.pc.in
- $(SED_PROCESS)
-
-%.conf: %.conf.in
- $(SED_PROCESS)
-
-src/core/%.systemd: src/core/%.systemd.in
- $(SED_PROCESS)
-
-src/%.policy.in: src/%.policy.in.in
- $(SED_PROCESS)
-
-src/sulogin-shell/%: src/sulogin-shell/%.in
- $(SED_PROCESS)
- $(AM_V_GEN)chmod +x $@
-
-shell-completion/%: shell-completion/%.in
- $(SED_PROCESS)
-
-%.rules: %.rules.in
- $(SED_PROCESS)
-
-%.conf: %.conf.in
- $(SED_PROCESS)
-
-%.sh: %.sh.in
- $(SED_PROCESS)
- $(AM_V_GEN)chmod +x $@
-
-src/%.c: src/%.gperf
- $(AM_V_at)$(MKDIR_P) $(dir $@)
- $(AM_V_GPERF)$(GPERF) < $< > $@
-
-src/%: src/%.m4 $(top_builddir)/config.status
- $(AM_V_at)$(MKDIR_P) $(dir $@)
- $(AM_V_M4)$(M4) -P $(M4_DEFINES) < $< > $@
-
-sysusers.d/%: sysusers.d/%.m4 $(top_builddir)/config.status
- $(AM_V_at)$(MKDIR_P) $(dir $@)
- $(AM_V_M4)$(M4) -P $(M4_DEFINES) < $< > $@
-
-tmpfiles.d/%: tmpfiles.d/%.m4 $(top_builddir)/config.status
- $(AM_V_at)$(MKDIR_P) $(dir $@)
- $(AM_V_M4)$(M4) -P $(M4_DEFINES) < $< > $@
-
-
-units/%: units/%.m4 $(top_builddir)/config.status
- $(AM_V_at)$(MKDIR_P) $(dir $@)
- $(AM_V_M4)$(M4) -P $(M4_DEFINES) -DFOR_SYSTEM=1 < $< > $@
-
-units/user/%: units/user/%.m4 $(top_builddir)/config.status
- $(AM_V_at)$(MKDIR_P) $(dir $@)
- $(AM_V_M4)$(M4) -P $(M4_DEFINES) -DFOR_USER=1 < $< > $@
-
-if ENABLE_POLKIT
-nodist_polkitpolicy_DATA = \
- $(polkitpolicy_files) \
- $(polkitpolicy_in_in_files:.policy.in.in=.policy)
-polkitrules_DATA = $(polkitrules_files)
-if ENABLE_POLKIT_PKLA
-polkitpkla_DATA = $(polkitpkla_files)
-endif
-endif
-
-EXTRA_DIST += \
- $(polkitpolicy_in_files) \
- $(polkitpolicy_in_in_files)
-
-# ------------------------------------------------------------------------------
-man/custom-entities.ent: configure.ac
- $(AM_V_GEN)$(MKDIR_P) $(dir $@)
- $(AM_V_GEN)(echo '<?xml version="1.0" encoding="utf-8" ?>' && \
- printf '$(subst '|,<!ENTITY ,$(subst =, ",$(subst |',">\n,$(substitutions))))') \
- > $@ # '
-
-CLEANFILES += \
- man/custom-entities.ent
-
-XSLTPROC_FLAGS = \
- --nonet \
- --xinclude \
- --stringparam man.output.quietly 1 \
- --stringparam funcsynopsis.style ansi \
- --stringparam man.authors.section.enabled 0 \
- --stringparam man.copyright.section.enabled 0 \
- --stringparam systemd.version $(PACKAGE_VERSION) \
- --path '$(builddir)/man:$(srcdir)/man'
-
-XSLT = $(if $(XSLTPROC), $(XSLTPROC), xsltproc)
-XSLTPROC_PROCESS_MAN = \
- $(AM_V_XSLT)$(XSLT) -o $@ $(XSLTPROC_FLAGS) $(srcdir)/man/custom-man.xsl $<
-
-XSLTPROC_PROCESS_HTML = \
- $(AM_V_XSLT)$(XSLT) -o $@ $(XSLTPROC_FLAGS) $(srcdir)/man/custom-html.xsl $<
-
-man/%.1: man/%.xml man/custom-man.xsl man/custom-entities.ent
- $(XSLTPROC_PROCESS_MAN)
-
-man/%.3: man/%.xml man/custom-man.xsl man/custom-entities.ent
- $(XSLTPROC_PROCESS_MAN)
-
-man/%.5: man/%.xml man/custom-man.xsl man/custom-entities.ent
- $(XSLTPROC_PROCESS_MAN)
-
-man/%.7: man/%.xml man/custom-man.xsl man/custom-entities.ent
- $(XSLTPROC_PROCESS_MAN)
-
-man/%.8: man/%.xml man/custom-man.xsl man/custom-entities.ent
- $(XSLTPROC_PROCESS_MAN)
-
-man/%.html: man/%.xml man/custom-html.xsl man/custom-entities.ent
- $(XSLTPROC_PROCESS_HTML)
-
-define html-alias
- $(AM_V_LN)$(LN_S) -f $(notdir $<) $@
-endef
-
-EXTRA_DIST += \
- man/custom-html.xsl \
- man/custom-man.xsl
-
-# ------------------------------------------------------------------------------
-if HAVE_SYSV_COMPAT
-sysvinit_DATA = \
- docs/sysvinit/README
-
-varlog_DATA = \
- docs/var-log/README
-
-docs/sysvinit/README: docs/sysvinit/README.in
- $(SED_PROCESS)
-
-docs/var-log/README: docs/var-log/README.in
- $(SED_PROCESS)
-
-CLEANFILES += \
- docs/sysvinit/README \
- docs/var-log/README
-endif
-
-EXTRA_DIST += \
- docs/sysvinit/README.in \
- docs/var-log/README.in
-
-SOCKETS_TARGET_WANTS += \
- systemd-initctl.socket
-
-if HAVE_UTMP
-if HAVE_SYSV_COMPAT
-MULTI_USER_TARGET_WANTS += \
- systemd-update-utmp-runlevel.service
-GRAPHICAL_TARGET_WANTS += \
- systemd-update-utmp-runlevel.service
-RESCUE_TARGET_WANTS += \
- systemd-update-utmp-runlevel.service
-endif
-
-SYSINIT_TARGET_WANTS += \
- systemd-update-utmp.service
-endif
-
-SYSINIT_TARGET_WANTS += \
- systemd-update-done.service
-
-LOCAL_FS_TARGET_WANTS += \
- systemd-remount-fs.service \
- tmp.mount
-
-REMOTE_FS_TARGET_WANTS += \
- var-lib-machines.mount
-
-MULTI_USER_TARGET_WANTS += \
- getty.target \
- systemd-ask-password-wall.path
-
-SYSINIT_TARGET_WANTS += \
- dev-hugepages.mount \
- dev-mqueue.mount \
- sys-kernel-config.mount \
- sys-kernel-debug.mount \
- sys-fs-fuse-connections.mount \
- systemd-sysctl.service \
- systemd-ask-password-console.path
-
-if ENABLE_MACHINED
-MACHINES_TARGET_WANTS += \
- var-lib-machines.mount
-endif
-
-if HAVE_SYSV_COMPAT
-SYSTEM_UNIT_ALIASES += \
- poweroff.target runlevel0.target \
- rescue.target runlevel1.target \
- multi-user.target runlevel2.target \
- multi-user.target runlevel3.target \
- multi-user.target runlevel4.target \
- graphical.target runlevel5.target \
- reboot.target runlevel6.target
-endif
-
-SYSTEM_UNIT_ALIASES += \
- graphical.target default.target \
- reboot.target ctrl-alt-del.target \
- getty@.service autovt@.service
-
-GENERAL_ALIASES += \
- $(systemunitdir)/remote-fs.target $(pkgsysconfdir)/system/multi-user.target.wants/remote-fs.target \
- $(systemunitdir)/getty@.service $(pkgsysconfdir)/system/getty.target.wants/getty@tty1.service \
- $(pkgsysconfdir)/user $(sysconfdir)/xdg/systemd/user \
- $(dbussystemservicedir)/org.freedesktop.systemd1.service $(dbussessionservicedir)/org.freedesktop.systemd1.service
-
-if HAVE_SYSV_COMPAT
-INSTALL_DIRS += \
- $(systemunitdir)/runlevel1.target.wants \
- $(systemunitdir)/runlevel2.target.wants \
- $(systemunitdir)/runlevel3.target.wants \
- $(systemunitdir)/runlevel4.target.wants \
- $(systemunitdir)/runlevel5.target.wants
-endif
-
-INSTALL_DIRS += \
- $(environmentdir) \
- $(prefix)/lib/modules-load.d \
- $(sysconfdir)/modules-load.d \
- $(prefix)/lib/systemd/network \
- $(sysconfdir)/systemd/network \
- $(prefix)/lib/sysctl.d \
- $(sysconfdir)/sysctl.d \
- $(prefix)/lib/kernel/install.d \
- $(sysconfdir)/kernel/install.d \
- $(systemshutdowndir) \
- $(systemsleepdir) \
- $(systemgeneratordir) \
- $(usergeneratordir) \
- \
- $(userunitdir) \
- $(pkgsysconfdir)/system \
- $(pkgsysconfdir)/system/multi-user.target.wants \
- $(pkgsysconfdir)/system/getty.target.wants \
- $(pkgsysconfdir)/user \
- $(dbussessionservicedir) \
- $(sysconfdir)/xdg/systemd
-
-install-exec-hook: $(INSTALL_EXEC_HOOKS)
-
-uninstall-hook: $(UNINSTALL_DATA_HOOKS) $(UNINSTALL_EXEC_HOOKS)
-
-install-data-hook: $(INSTALL_DATA_HOOKS)
-
-distclean-local: $(DISTCLEAN_LOCAL_HOOKS)
-
-clean-local: $(CLEAN_LOCAL_HOOKS)
- rm -rf $(abs_srcdir)/install-tree
- rm -f $(abs_srcdir)/hwdb/usb.ids $(abs_srcdir)/hwdb/pci.ids $(abs_srcdir)/hwdb/oui.txt \
- $(abs_srcdir)/hwdb/iab.txt
-
-DISTCHECK_CONFIGURE_FLAGS = \
- --with-dbuspolicydir=$$dc_install_base/$(dbuspolicydir) \
- --with-dbussessionservicedir=$$dc_install_base/$(dbussessionservicedir) \
- --with-dbussystemservicedir=$$dc_install_base/$(dbussystemservicedir) \
- --with-bashcompletiondir=$$dc_install_base/$(bashcompletiondir) \
- --with-zshcompletiondir=$$dc_install_base/$(zshcompletiondir) \
- --with-pamlibdir=$$dc_install_base/$(pamlibdir) \
- --with-pamconfdir=$$dc_install_base/$(pamconfdir) \
- --with-rpmmacrosdir=$$dc_install_base/$(rpmmacrosdir) \
- --with-rootprefix=$$dc_install_base \
- --enable-compat-libs
-
-if HAVE_SYSV_COMPAT
-DISTCHECK_CONFIGURE_FLAGS += \
- --with-sysvinit-path=$$dc_install_base/$(sysvinitdir) \
- --with-sysvrcnd-path=$$dc_install_base/$(sysvrcnddir)
-else
-DISTCHECK_CONFIGURE_FLAGS += \
- --with-sysvinit-path= \
- --with-sysvrcnd-path=
-endif
-
-if ENABLE_SPLIT_USR
-DISTCHECK_CONFIGURE_FLAGS += \
- --enable-split-usr
-else
-DISTCHECK_CONFIGURE_FLAGS += \
- --disable-split-usr
-endif
-
-.PHONY: dist-check-help
-dist-check-help: $(rootbin_PROGRAMS) $(bin_PROGRAMS)
- for i in $(abspath $^); do \
- if $$i --help | grep -v 'default:' | grep -E -q '.{80}.' ; then \
- echo "$(basename $$i) --help output is too wide:"; \
- $$i --help | awk 'length > 80' | grep -E --color=yes '.{80}'; \
- exit 1; \
- fi; done
-
-include_compilers = "$(CC)" "$(CC) -ansi" "$(CC) -std=iso9899:1990"
-public_headers = $(filter-out src/systemd/_sd-common.h, $(pkginclude_HEADERS) $(include_HEADERS))
-.PHONY: dist-check-includes
-dist-check-includes: $(public_headers)
- @res=0; \
- for i in $(abspath $^); do \
- for cc in $(include_compilers); do \
- echo "$$cc -o/dev/null -c -x c -include "$$i" - </dev/null"; \
- $$cc -o/dev/null -c -x c -include "$$i" - </dev/null || res=1; \
- done; \
- done; exit $$res
-
-.PHONY: hwdb-update
-hwdb-update: tools/meson-hwdb-update.sh
- $< $(top_srcdir)/hwdb
-
-.PHONY: built-sources
-built-sources: $(BUILT_SOURCES)
-
-.PHONY: git-tag
-git-tag:
- git tag -s "v$(PACKAGE_VERSION)" -m "systemd $(PACKAGE_VERSION)"
-
-.PHONY: git-tar
-git-tar:
- git archive -o systemd-$(PACKAGE_VERSION).tar.gz --prefix=systemd-$(PACKAGE_VERSION)/ HEAD
-
-%.asc: %
- gpg2 --detach-sign -a -o $@ $<
-
-www_target = www.freedesktop.org:/srv/www.freedesktop.org/www/software/systemd
-
-.PHONY: doc-sync
-doc-sync: man
- rsync -rlv --delete-excluded --include="*.html" --exclude="*" --omit-dir-times man/ $(www_target)/man/
-
-.PHONY: install-tree
-install-tree: all
- rm -rf $(abs_srcdir)/install-tree
- $(MAKE) install DESTDIR=$(abs_srcdir)/install-tree
- tree $(abs_srcdir)/install-tree
-
-# Let's run all tests of the test suite, but under valgrind. Let's
-# exclude perl/python/shell scripts we have in there
-.PHONY: valgrind-tests
-valgrind-tests: $(TESTS)
- $(AM_V_GEN)for f in $(filter-out %.pl %.py, $^); do \
- if $(LIBTOOL) --mode=execute file $$f | grep -q shell; then \
- echo -e "$${x}Skipping non-binary $$f"; else \
- echo -e "$${x}Running $$f"; \
- $(AM_TESTS_ENVIRONMENT) $(LIBTOOL) --mode=execute valgrind -q --leak-check=full --max-stackframe=5242880 --error-exitcode=55 $(builddir)/$$f ; fi; \
- x="\n\n"; \
- done
-
-exported-%: %
- $(AM_V_GEN)$(NM) -g --defined-only $(builddir)/.libs/$(<:.la=.so) 2>&1 /dev/null | grep " T " | cut -d" " -f3 > $@
-
-exported: $(addprefix exported-, $(lib_LTLIBRARIES))
- $(AM_V_GEN)sort -u $^ > $@
-
-.PHONY: check-api-docs
-check-api-docs: exported man
- $(AM_V_GEN)for symbol in `cat exported` ; do \
- if test -f $(builddir)/man/$$symbol.html ; then \
- echo " Symbol $$symbol() is documented." ; \
- else \
- echo "‣ Symbol $$symbol() lacks documentation." ; \
- fi ; \
- done
-
-OBJECT_VARIABLES:=$(filter %_OBJECTS,$(.VARIABLES))
-ALL_OBJECTS:=$(foreach v,$(OBJECT_VARIABLES),$($(v)))
-
-undefined defined: $(ALL_OBJECTS)
- $(AM_V_GEN)for f in $(ALL_OBJECTS) ; do \
- $(NM) -g --$@-only `echo $(builddir)/"$$f" | sed -e 's,\([^/]*\).lo$$,.libs/\1.o,'` ; \
- done | cut -c 20- | cut -d @ -f 1 | sort -u > $@
-
-CLEANFILES += \
- defined \
- undefined
-
-.PHONY: check-api-unused
-check-api-unused: defined undefined exported
- ( cat exported undefined ) | sort -u | diff -u - defined | grep ^+ | grep -v ^+++ | cut -c2-
-
-.PHONY: check-includes
-check-includes: $(top_srcdir)/tools/check-includes.pl
- $(AM_V_GEN) find * -name '*.[hcS]' -type f -print | sort -u \
- | xargs $(top_srcdir)/tools/check-includes.pl
-
-EXTRA_DIST += \
- $(top_srcdir)/tools/check-includes.pl
-
-# Stupid test that everything purported to be exported really is
-define generate-sym-test
- $(AM_V_at)$(MKDIR_P) $(dir $@)
- $(AM_V_at)printf '#include <stdio.h>\n' > $@
- $(AM_V_at)printf '#include "%s"\n' $(notdir $(filter %.h, $^)) >> $@
- $(AM_V_at)printf 'void* functions[] = {\n' >> $@
- $(AM_V_GEN)sed -r -n 's/^ +([a-zA-Z0-9_]+);/\1,/p' $< >> $@
- $(AM_V_at)printf '};\nint main(void) {\n' >> $@
- $(AM_V_at)printf 'unsigned i; for (i=0;i<sizeof(functions)/sizeof(void*);i++) printf("%%p\\n", functions[i]);\n' >> $@
- $(AM_V_at)printf 'return 0; }\n' >> $@
-endef
-
-test-libsystemd-sym.c: \
- $(top_builddir)/src/libsystemd/libsystemd.sym \
- src/systemd/sd-journal.h \
- src/systemd/sd-daemon.h \
- src/systemd/sd-login.h \
- src/systemd/sd-bus.h \
- src/systemd/sd-utf8.h \
- src/systemd/sd-resolve.h \
- src/systemd/sd-path.h \
- src/systemd/sd-event.h
- $(generate-sym-test)
-
-test-libudev-sym.c: \
- src/libudev/libudev.sym \
- src/udev/udev.h
- $(generate-sym-test)
-
-nodist_test_libsystemd_sym_SOURCES = \
- test-libsystemd-sym.c
-test_libsystemd_sym_LDADD = \
- libsystemd.la
-
-nodist_test_libudev_sym_SOURCES = \
- test-libudev-sym.c
-test_libudev_sym_CFLAGS = \
- $(AM_CFLAGS) \
- -Wno-deprecated-declarations
-test_libudev_sym_LDADD = \
- libudev.la
-
-BUILT_SOURCES += \
- test-libsystemd-sym.c \
- test-libudev-sym.c
-
-CLEANFILES += \
- test-libsystemd-sym.c \
- test-libudev-sym.c
-
-tests += \
- test-libsystemd-sym \
- test-libudev-sym
-
-.PHONY: install-tests
-install-tests: $(tests) $(TEST_DATA_FILES)
- for f in $(tests); do \
- if [ -x $(top_builddir)/.libs/$$f ]; then \
- install -D -m 755 $(top_builddir)/.libs/$$f $(DESTDIR)/$(testsdir)/$$f; \
- else \
- install -D -m 755 $(top_builddir)/$$f $(DESTDIR)/$(testsdir)/$$f; \
- fi; \
- done
- for f in $(TEST_DATA_FILES); do \
- install -D -m 644 $(top_srcdir)/$$f $(DESTDIR)/$(testsdir)/testdata/$${f#test/}; \
- done
-
-
-.PHONY: cppcheck
-cppcheck:
- cppcheck --enable=all -q $(top_srcdir)
-
-# Used to extract compile flags for YCM.
-print-%:
- @echo $($*)
-
-.PHONY: git-contrib
-git-contrib:
- @git shortlog -s `git describe --abbrev=0`.. | cut -c8- | sed 's/ / /g' | awk '{ print $$0 "," }' | sort -u
-
-EXTRA_DIST += \
- tools/gdb-sd_dump_hashmaps.py
-
-.PHONY: list-keys
-list-keys:
- gpg --verbose --no-options --no-default-keyring --no-auto-key-locate --batch --trust-model=always --keyring=$(srcdir)/src/import/import-pubring.gpg --list-keys
-
-.PHONY: add-key
-add-key:
- gpg --verbose --no-options --no-default-keyring --no-auto-key-locate --batch --trust-model=always --keyring=$(srcdir)/src/import/import-pubring.gpg --import -
diff --git a/README b/README
index 60388eebe6..5ae581e338 100644
--- a/README
+++ b/README
@@ -8,9 +8,6 @@ WEB SITE:
GIT:
git@github.com:systemd/systemd.git
- https://github.com/systemd/systemd.git
-
-GITWEB:
https://github.com/systemd/systemd
MAILING LIST:
@@ -110,6 +107,15 @@ REQUIREMENTS:
fixed, and it's best to disable group scheduling hence.
CONFIG_RT_GROUP_SCHED=n
+ It's a good idea to disable the implicit creation of networking bonding
+ devices by the kernel networking bonding module, so that the
+ automatically created "bond0" interface doesn't conflict with any such
+ device created by systemd-networkd (or other tools). Please make sure
+ that the kernel module bonding.ko is shipped with max_bonds=0 set by
+ default. Ideally there would be a kernel compile-time option for this,
+ but there currently isn't. The next best thing is to make this change
+ through a modprobe.d drop-in.
+
Note that kernel auditing is broken when used with systemd's
container code. When using systemd in conjunction with
containers, please make sure to either turn off auditing at
@@ -145,7 +151,13 @@ REQUIREMENTS:
libpython (optional)
libidn2 or libidn (optional)
elfutils >= 158 (optional)
- make, gcc, and similar tools
+ pkg-config
+ gperf >= 3.1
+ docbook-xsl (optional, required for documentation)
+ xsltproc (optional, required for documentation)
+ python-lxml (optional, required to build the indices)
+ python, meson, ninja
+ gcc, awk, sed, grep, m4, and similar tools
During runtime, you need the following additional
dependencies:
@@ -157,18 +169,6 @@ REQUIREMENTS:
dracut (optional)
PolicyKit (optional)
- Two build systems are supported: meson + ninja-build and autools + make.
-
- The following tools are needed with both systems:
-
- pkg-config
- gperf >= 3.1
- docbook-xsl (optional, required for documentation)
- xsltproc (optional, required for documentation)
- python-lxml (optional, required to build the indices)
-
- When building with meson, python and ninja-build are required.
-
To build in directory build/:
meson build/ && ninja -C build
@@ -185,19 +185,7 @@ REQUIREMENTS:
sudo ninja install
DESTDIR=... ninja install
- When building with autotools, the following tools are needed:
-
- automake
- autoconf
- libtool
- intltool
- python (optional)
-
- The build system is initialized with ./autogen.sh and the usual
- ./configure && make
- should be used.
-
- A tar ball can be created with:
+ A tarball can be created with:
git archive --format=tar --prefix=systemd-222/ v222 | xz > systemd-222.tar.xz
When systemd-hostnamed is used, it is strongly recommended to
diff --git a/TODO b/TODO
index 61efa5e9f3..8f54148403 100644
--- a/TODO
+++ b/TODO
@@ -435,25 +435,18 @@ Features:
* sd-bus:
- EBADSLT handling
- GetAllProperties() on a non-existing object does not result in a failure currently
- - kdbus: process fd=-1 for incoming msgs
- port to sd-resolve for connecting to TCP dbus servers
- - kdbus: maybe add controlling tty metadata fields
- see if we can introduce a new sd_bus_get_owner_machine_id() call to retrieve the machine ID of the machine of the bus itself
- - when kdbus does not take our message without memfds, try again with memfds
- see if we can drop more message validation on the sending side
- add API to clone sd_bus_message objects
- make AddMatch calls on dbus1 transports async?
- - kdbus: matches against source or destination pids for an "strace -p"-like feel. Problem: The PID info needs to be available in userspace too...
- longer term: priority inheritance
- dbus spec updates:
- - kdbus mapping
- NameLost/NameAcquired obsolete
- GVariant
- path escaping
- update systemd.special(7) to mention that dbus.socket is only about the compatibility socket now
- test bloom filter generation indexes
- - kdbus: introduce a concept of "send-only" connections
- - kdbus: add counter for refused unicast messages that is passed out via the RECV ioctl. SImilar to the counter for dropped multicast messages we already have.
* sd-event
- allow multiple signal handlers per signal?
diff --git a/autogen.sh b/autogen.sh
deleted file mode 100755
index 1897e23b53..0000000000
--- a/autogen.sh
+++ /dev/null
@@ -1,94 +0,0 @@
-#!/bin/sh
-
-# This file is part of systemd.
-#
-# systemd is free software; you can redistribute it and/or modify it
-# under the terms of the GNU Lesser General Public License as published by
-# the Free Software Foundation; either version 2.1 of the License, or
-# (at your option) any later version.
-#
-# systemd is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public License
-# along with systemd; If not, see <http://www.gnu.org/licenses/>.
-
-set -e
-
-verb="$1"
-
-case "$verb" in
-"") ;;
-[cgals]) shift ;;
-*) echo "Unexpected argument: $verb" >&2; exit 1 ;;
-esac
-
-oldpwd=$(pwd)
-topdir=$(dirname $0)
-cd $topdir
-
-if [ -f .git/hooks/pre-commit.sample ] && [ ! -f .git/hooks/pre-commit ]; then
- # This part is allowed to fail
- cp -p .git/hooks/pre-commit.sample .git/hooks/pre-commit && \
- chmod +x .git/hooks/pre-commit && \
- echo "Activated pre-commit hook." || :
-fi
-
-intltoolize --force --automake
-autoreconf --force --install --symlink
-
-libdir() {
- echo $(cd "$1/$(gcc -print-multi-os-directory)"; pwd)
-}
-
-args="\
---sysconfdir=/etc \
---localstatedir=/var \
---libdir=$(libdir /usr/lib) \
-"
-
-if [ -f "$topdir/.config.args" ]; then
- args="$args $(cat $topdir/.config.args)"
-fi
-
-if [ ! -L /bin ]; then
-args="$args \
---with-rootprefix=/ \
---with-rootlibdir=$(libdir /lib) \
-"
-fi
-
-args="$args $@"
-cd $oldpwd
-
-if [ "$verb" = "c" ]; then
- set -x
- $topdir/configure CFLAGS='-g -O0 -ftrapv' $args
- make clean >/dev/null
-elif [ "$verb" = "g" ]; then
- set -x
- $topdir/configure CFLAGS='-g -Og -ftrapv' $args
- make clean >/dev/null
-elif [ "$verb" = "a" ]; then
- set -x
- $topdir/configure CFLAGS='-g -O0 -Wsuggest-attribute=pure -Wsuggest-attribute=const -ftrapv' $args
- make clean >/dev/null
-elif [ "$verb" = "l" ]; then
- set -x
- $topdir/configure CC=clang CFLAGS='-g -O0 -ftrapv' $args
- make clean >/dev/null
-elif [ "$verb" = "s" ]; then
- set -x
- scan-build $topdir/configure CFLAGS='-std=gnu99 -g -O0 -ftrapv' $args
- scan-build make
-else
- echo
- echo "----------------------------------------------------------------"
- echo "Initialized build system. For a common configuration please run:"
- echo "----------------------------------------------------------------"
- echo
- echo "$topdir/configure CFLAGS='-g -O0 -ftrapv' $args"
- echo
-fi
diff --git a/catalog/.gitignore b/catalog/.gitignore
deleted file mode 100644
index ff695342e3..0000000000
--- a/catalog/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-*.catalog
diff --git a/catalog/Makefile b/catalog/Makefile
deleted file mode 120000
index bd1047548b..0000000000
--- a/catalog/Makefile
+++ /dev/null
@@ -1 +0,0 @@
-../src/Makefile \ No newline at end of file
diff --git a/configure b/configure
new file mode 100755
index 0000000000..a9db8a1cff
--- /dev/null
+++ b/configure
@@ -0,0 +1,21 @@
+#!/bin/bash -e
+
+cflags=CFLAGS="$CFLAGS"
+cxxflags=CXXFLAGS="$CXXFLAGS"
+declare -a args
+j=0
+for i in "$@"; do
+ case "$i" in
+ CFLAGS=*)
+ cflags="$i";;
+ CXXFLAGS=*)
+ cxxflags="$i";;
+ *)
+ args[$j]="$i"
+ j=$((j+1))
+ esac
+done
+
+export "$cflags" "$cxxflags"
+set -x
+exec meson build "${args[@]}"
diff --git a/configure.ac b/configure.ac
deleted file mode 100644
index c7537aafc0..0000000000
--- a/configure.ac
+++ /dev/null
@@ -1,1863 +0,0 @@
-#
-# This file is part of systemd.
-#
-# Copyright 2010-2012 Lennart Poettering
-# Copyright 2010-2012 Kay Sievers
-#
-# systemd is free software; you can redistribute it and/or modify it
-# under the terms of the GNU Lesser General Public License as published by
-# the Free Software Foundation; either version 2.1 of the License, or
-# (at your option) any later version.
-#
-# systemd is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public License
-# along with systemd; If not, see <http://www.gnu.org/licenses/>.
-
-AC_PREREQ([2.64])
-
-AC_INIT([systemd],
- [234],
- [https://github.com/systemd/systemd/issues],
- [systemd],
- [https://www.freedesktop.org/wiki/Software/systemd])
-
-AC_CONFIG_SRCDIR([src/core/main.c])
-AC_CONFIG_MACRO_DIR([m4])
-AC_CONFIG_HEADERS([config.h])
-AC_CONFIG_AUX_DIR([build-aux])
-
-AC_USE_SYSTEM_EXTENSIONS
-AC_SYS_LARGEFILE
-AC_PREFIX_DEFAULT([/usr])
-AM_MAINTAINER_MODE([enable])
-AM_INIT_AUTOMAKE([foreign 1.11 -Wall -Wno-portability silent-rules tar-pax no-dist-gzip dist-xz subdir-objects parallel-tests])
-AM_SILENT_RULES([yes])
-AC_CANONICAL_HOST
-AC_DEFINE_UNQUOTED([CANONICAL_HOST], "$host", [Canonical host string.])
-
-AC_PROG_CC_C99
-
-AX_COMPILER_VENDOR
-AS_IF([test "x$ax_cv_c_compiler_vendor" = "xgnu"], [
- AC_CHECK_TOOLS([AR], [gcc-ar ar], [:])
- AC_CHECK_TOOLS([NM], [gcc-nm nm], [:])
- AC_CHECK_TOOLS([RANLIB], [gcc-ranlib ranlib], [:])
-])
-
-LT_PREREQ(2.2)
-LT_INIT([disable-static])
-
-AS_IF([test "x$enable_static" = "xyes"], [AC_MSG_ERROR([--enable-static is not supported by systemd])])
-AS_IF([test "x$enable_largefile" = "xno"], [AC_MSG_ERROR([--disable-largefile is not supported by systemd])])
-
-SET_ARCH(X86_64, x86_64*)
-SET_ARCH(IA32, i*86*)
-SET_ARCH(MIPS, mips*)
-SET_ARCH(ARM, arm*)
-SET_ARCH(AARCH64, aarch64*)
-
-# i18n stuff for the PolicyKit policy files, heck whether intltool can be found, disable NLS otherwise
-AC_CHECK_PROG(intltool_found, [intltool-merge], [yes], [no])
-AS_IF([test x"$intltool_found" != xyes],
- [AS_IF([test x"$enable_nls" = xyes],
- [AC_MSG_ERROR([--enable-nls requested but intltool not found])],
- [AS_IF([test x"$enable_nls" != xno],
- [AC_MSG_WARN([*** Disabling NLS support because intltool was not found])
- enable_nls=no])
- ])
- ])
-
-AM_NLS
-AS_IF([test x"$enable_nls" != xno -o "x$enable_polkit" != xno], [
- # intltoolize greps for '^(AC|IT)_PROG_INTLTOOL', so it needs to be on its own line
-IT_PROG_INTLTOOL([0.40.0])
-])
-
-AS_IF([test -z "$INTLTOOL_POLICY_RULE"], [
- # If intltool is not available, provide a dummy rule to fail generation of %.policy files with a meaningful error message
- INTLTOOL_POLICY_RULE='%.policy: %.policy.in ; @echo " ITMRG " $@ && echo "*** intltool support required to build target $@" && false'
- AC_SUBST(INTLTOOL_POLICY_RULE)
-])
-
-GETTEXT_PACKAGE=systemd
-AC_SUBST(GETTEXT_PACKAGE)
-AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE", [systemd])
-
-AC_PROG_MKDIR_P
-AC_PROG_LN_S
-AC_PROG_SED
-AC_PROG_GREP
-AC_PROG_AWK
-
-AC_PATH_PROG([M4], [m4])
-
-AC_PATH_PROG([QUOTAON], [quotaon], [/usr/sbin/quotaon], [$PATH:/usr/sbin:/sbin])
-AC_PATH_PROG([QUOTACHECK], [quotacheck], [/usr/sbin/quotacheck], [$PATH:/usr/sbin:/sbin])
-
-AC_PATH_PROG([KILL], [kill], [/usr/bin/kill], [$PATH:/usr/sbin:/sbin])
-
-AC_PATH_PROG([KMOD], [kmod], [/usr/bin/kmod], [$PATH:/usr/sbin:/sbin])
-
-AC_PATH_PROG([KEXEC], [kexec], [/usr/sbin/kexec], [$PATH:/usr/sbin:/sbin])
-
-AC_PATH_PROG([SULOGIN], [sulogin], [/usr/sbin/sulogin], [$PATH:/usr/sbin:/sbin])
-
-AC_PATH_PROG([MOUNT_PATH], [mount], [/usr/bin/mount], [$PATH:/usr/sbin:/sbin])
-AC_PATH_PROG([UMOUNT_PATH], [umount], [/usr/bin/umount], [$PATH:/usr/sbin:/sbin])
-
-AS_IF([! ln --relative --help > /dev/null 2>&1], [AC_MSG_ERROR([*** ln doesn't support --relative ***])])
-
-M4_DEFINES=
-
-AC_CHECK_TOOL(OBJCOPY, objcopy)
-AC_CHECK_TOOL(STRINGS, strings)
-AC_CHECK_TOOL(GPERF, gperf)
-if test -z "$GPERF" ; then
- AC_MSG_ERROR([*** gperf not found])
-fi
-
-# ------------------------------------------------------------------------------
-address_sanitizer_cflags=
-address_sanitizer_cppflags=
-address_sanitizer_ldflags=
-AC_ARG_ENABLE(address-sanitizer, AS_HELP_STRING([--enable-address-sanitizer], [enable -fsanitize=address]))
-AS_IF([test "x$enable_address_sanitizer" = "xyes"], [
- CC_CHECK_FLAG_APPEND([with_as_cflags], [CFLAGS], [-fsanitize=address])
- AS_IF([test -z "$with_as_cflags"],
- [AC_MSG_ERROR([*** -fsanitize=address is not supported])])
- address_sanitizer_cflags="$with_as_cflags -fno-omit-frame-pointer -DVALGRIND=1"
- address_sanitizer_cppflags="-DVALGRIND=1"
- address_sanitizer_ldflags="-Wc,-fsanitize=address"
- ])
-
-undefined_sanitizer_cflags=
-undefined_sanitizer_cppflags=
-undefined_sanitizer_ldflags=
-AC_ARG_ENABLE(undefined-sanitizer, AS_HELP_STRING([--enable-undefined-sanitizer], [enable -fsanitize=undefined]))
-AS_IF([test "x$enable_undefined_sanitizer" = "xyes"], [
- CC_CHECK_FLAG_APPEND([with_us_cflags], [CFLAGS], [-fsanitize=undefined])
- AS_IF([test -z "$with_us_cflags"],
- [AC_MSG_ERROR([*** -fsanitize=undefined is not supported])])
- undefined_sanitizer_cflags="$with_us_cflags -fno-omit-frame-pointer -DVALGRIND=1"
- undefined_sanitizer_cppflags="-DVALGRIND=1"
- undefined_sanitizer_ldflags="-Wc,-fsanitize=undefined"
- ])
-
-sanitizer_cflags="$address_sanitizer_cflags $undefined_sanitizer_cflags"
-sanitizer_cppflags="$address_sanitizer_cppflags $undefined_sanitizer_cppflags"
-sanitizer_ldflags="$address_sanitizer_ldflags $undefined_sanitizer_ldflags"
-
-CC_CHECK_FLAGS_APPEND([with_cflags], [CFLAGS], [\
- -pipe \
- -Wall \
- -Wextra \
- -Wundef \
- -Wlogical-op \
- -Wmissing-include-dirs \
- -Wold-style-definition \
- -Wpointer-arith \
- -Winit-self \
- -Wdeclaration-after-statement \
- -Wfloat-equal \
- -Wsuggest-attribute=noreturn \
- -Werror=missing-prototypes \
- -Werror=implicit-function-declaration \
- -Werror=missing-declarations \
- -Werror=return-type \
- -Werror=incompatible-pointer-types \
- -Werror=format=2 \
- -Wstrict-prototypes \
- -Wredundant-decls \
- -Wmissing-noreturn \
- -Wshadow \
- -Wendif-labels \
- -Wstrict-aliasing=2 \
- -Wwrite-strings \
- -Wno-unused-parameter \
- -Wno-missing-field-initializers \
- -Wno-unused-result \
- -Wno-format-signedness \
- -Werror=overflow \
- -Wdate-time \
- -Wnested-externs \
- -ffast-math \
- -fno-common \
- -fdiagnostics-show-option \
- -fno-strict-aliasing \
- -fvisibility=hidden \
- -fstack-protector \
- -fstack-protector-strong \
- -fPIE \
- --param=ssp-buffer-size=4])
-
-CC_CHECK_FLAG_APPEND([with_cflags], [CFLAGS], [-Werror=shadow], [
-#include <time.h>
-#include <inttypes.h>
-typedef uint64_t usec_t;
-usec_t now(clockid_t clock);
-int main(void) {
- struct timespec now;
- return 0;
-}
-])
-
-AS_CASE([$CC], [*clang*],
- [CC_CHECK_FLAGS_APPEND([with_cppflags], [CPPFLAGS], [\
- -Wno-typedef-redefinition \
- -Wno-gnu-variable-sized-type-not-at-end \
- ])])
-
-AC_ARG_ENABLE([lto], [AS_HELP_STRING([--disable-lto], [disable -flto])],
- [], [enable_lto=yes])
-AS_CASE([$CFLAGS], [*-O[[12345sz\ ]]*],
- [AS_IF([test "x$enable_lto" = "xyes"],
- [CC_CHECK_FLAGS_APPEND([with_cflags], [CFLAGS], [-flto])],
- [AC_MSG_RESULT([disabling -flto as requested])])],
- [AC_MSG_RESULT([skipping -flto, optimization not enabled])])
-
-AS_CASE([$CFLAGS], [*-O[[12345sz\ ]]*],
- [CC_CHECK_FLAGS_APPEND([with_cppflags], [CPPFLAGS], [\
- -Wp,-D_FORTIFY_SOURCE=2])],
- [AC_MSG_RESULT([skipping -D_FORTIFY_SOURCE, optimization not enabled])])
-
-AS_CASE([$CFLAGS], [*-O[[12345sz\ ]]*],
- [CC_CHECK_FLAGS_APPEND([with_ldflags], [LDFLAGS], [\
- -Wl,--gc-sections])],
- [AC_MSG_RESULT([skipping --gc-sections, optimization not enabled])])
-
-AS_CASE([$CFLAGS], [*-O[[12345sz\ ]]*],
- [CC_CHECK_FLAGS_APPEND([with_cflags], [CFLAGS], [\
- -ffunction-sections -fdata-sections])],
- [AC_MSG_RESULT([skipping -ffunction/data-section, optimization not enabled])])
-
-CC_CHECK_FLAGS_APPEND([with_ldflags], [LDFLAGS], [\
- -Wl,--as-needed \
- -Wl,--no-undefined \
- -Wl,-z,relro \
- -Wl,-z,now \
- -pie \
- -Wl,-fuse-ld=gold])
-
-AC_SUBST([OUR_CPPFLAGS], "$with_cppflags $sanitizer_cppflags")
-AC_SUBST([OUR_CFLAGS], "-D__SANE_USERSPACE_TYPES__ $with_cflags $sanitizer_cflags")
-AC_SUBST([OUR_LDFLAGS], "$with_ldflags $sanitizer_ldflags")
-
-AC_CHECK_SIZEOF(pid_t)
-AC_CHECK_SIZEOF(uid_t)
-AC_CHECK_SIZEOF(gid_t)
-AC_CHECK_SIZEOF(time_t)
-AC_CHECK_SIZEOF(dev_t)
-AC_CHECK_SIZEOF(ino_t)
-AC_CHECK_SIZEOF(rlim_t,,[
- #include <sys/time.h>
- #include <sys/resource.h>
-])
-
-GPERF_TEST="$(echo foo,bar | ${GPERF} -L ANSI-C)"
-
-AC_COMPILE_IFELSE(
- [AC_LANG_PROGRAM([
- #include <string.h>
- const char * in_word_set(const char *, size_t);
- $GPERF_TEST]
- )],
- [GPERF_LEN_TYPE=size_t],
- [AC_COMPILE_IFELSE(
- [AC_LANG_PROGRAM([
- #include <string.h>
- const char * in_word_set(const char *, unsigned);
- $GPERF_TEST]
- )],
- [GPERF_LEN_TYPE=unsigned],
- [AC_MSG_ERROR([** unable to determine gperf len type])]
- )]
-)
-
-AC_DEFINE_UNQUOTED([GPERF_LEN_TYPE], [$GPERF_LEN_TYPE], [gperf len type])
-
-# ------------------------------------------------------------------------------
-# we use python to build the man page index
-have_python=no
-AC_ARG_WITH([python],
- [AS_HELP_STRING([--without-python], [disable building the man page index and systemd-python (default: test)])])
-
-have_lxml=no
-AS_IF([test "x$with_python" != "xno"], [
- AM_PATH_PYTHON([3],, [:])
- AS_IF([test "x$PYTHON" != "x:"], [
- AC_MSG_CHECKING([for python lxml module])
- AS_IF(["$PYTHON" -c 'import lxml' 2>/dev/null], [have_lxml=yes])
- AC_MSG_RESULT([$have_lxml])
- AS_IF([test "x$have_lxml" = "xyes"], [have_python=yes],
- [AC_MSG_WARN([*** python support requires python-lxml module installed])])
- ])
-])
-AS_IF([test "$have_python" != "yes"], [
- AS_IF([test "$with_python" = "yes"],
- [AC_MSG_ERROR([*** python support requested but python support not found])])
- AS_IF([test "$with_python" != "no"],
- [AC_MSG_WARN([*** python support not found, some documentation cannot be built])])
-])
-AM_CONDITIONAL([HAVE_PYTHON], [test "x$have_python" = "xyes"])
-
-# ------------------------------------------------------------------------------
-
-AC_CHECK_HEADERS([sys/capability.h], [], [AC_MSG_ERROR([*** POSIX caps headers not found])])
-AC_CHECK_HEADERS([linux/btrfs.h], [], [])
-AC_CHECK_HEADERS([linux/memfd.h], [], [])
-AC_CHECK_HEADERS([linux/vm_sockets.h], [], [], [#include <sys/socket.h>])
-
-# unconditionally pull-in librt with old glibc versions
-AC_SEARCH_LIBS([clock_gettime], [rt], [], [])
-
-save_LIBS="$LIBS"
-LIBS=
-AC_SEARCH_LIBS([cap_init], [cap], [], [AC_MSG_ERROR([*** POSIX caps library not found])])
-CAP_LIBS="$LIBS"
-LIBS="$save_LIBS"
-AC_SUBST(CAP_LIBS)
-
-AC_CHECK_FUNCS([__secure_getenv secure_getenv])
-AC_CHECK_DECLS([
- memfd_create,
- gettid,
- pivot_root,
- name_to_handle_at,
- setns,
- renameat2,
- kcmp,
- keyctl,
- LO_FLAGS_PARTSCAN,
- copy_file_range,
- explicit_bzero],
- [], [], [[
-#include <sys/types.h>
-#include <unistd.h>
-#include <sys/mount.h>
-#include <fcntl.h>
-#include <sched.h>
-#include <string.h>
-#include <linux/loop.h>
-]])
-
-AC_CHECK_DECLS([getrandom],
- [AC_DEFINE([USE_SYS_RANDOM_H], [], [sys/random.h is usable])],
- [AC_CHECK_DECLS([getrandom], [], [], [[
-#include <sys/random.h>
-]])], [[
-#include <linux/random.h>
-]])
-
-AC_CHECK_TYPES([char16_t, char32_t, key_serial_t, struct ethtool_link_settings],
- [], [], [[
-#include <uchar.h>
-#include <linux/ethtool.h>
-]])
-
-AC_CHECK_DECLS([IFLA_INET6_ADDR_GEN_MODE,
- IN6_ADDR_GEN_MODE_STABLE_PRIVACY,
- IFLA_VRF_TABLE,
- IFLA_MACVLAN_FLAGS,
- IFLA_IPVLAN_MODE,
- IFLA_VTI_REMOTE,
- IFLA_PHYS_PORT_ID,
- IFLA_BOND_AD_INFO,
- IFLA_VLAN_PROTOCOL,
- IFLA_VXLAN_GPE,
- IFLA_GENEVE_LABEL,
- IFLA_IPTUN_ENCAP_DPORT,
- IFLA_GRE_ENCAP_DPORT,
- IFLA_BRIDGE_VLAN_INFO,
- IFLA_BRPORT_PROXYARP,
- IFLA_BRPORT_LEARNING_SYNC,
- IFLA_BR_VLAN_DEFAULT_PVID,
- NDA_IFINDEX,
- IFA_FLAGS],
-[], [], [[
-#include <inttypes.h>
-#include <netinet/in.h>
-#include <netinet/ether.h>
-#include <linux/rtnetlink.h>
-#include <net/if.h>
-#include <linux/ip.h>
-#include <linux/if_tunnel.h>
-#include <linux/if_link.h>
-#include <linux/if_bridge.h>
-#include <linux/if_addr.h>
-#include <linux/neighbour.h>
-]])
-
-# This makes sure pkg.m4 is available.
-m4_pattern_forbid([^_?PKG_[A-Z_]+$],[*** pkg.m4 missing, please install pkg-config])
-
-# ------------------------------------------------------------------------------
-have_dbus=no
-AC_ARG_ENABLE(dbus, AS_HELP_STRING([--disable-dbus], [disable usage of dbus-1 in tests]))
-AS_IF([test "x$enable_dbus" != "xno"], [
- PKG_CHECK_MODULES(DBUS, [dbus-1 >= 1.3.2],
- [AC_DEFINE(HAVE_DBUS, 1, [Define if dbus-1 library is available]) have_dbus=yes],
- [have_dbus=no])
- AS_IF([test "x$have_dbus" = "xno" -a "x$enable_dbus" = "xyes"],
- [AC_MSG_ERROR([*** dbus-1 support requested but libraries not found])])])
-AM_CONDITIONAL(HAVE_DBUS, [test "$have_dbus" = "yes"])
-
-# ------------------------------------------------------------------------------
-have_glib=no
-AC_ARG_ENABLE(glib, AS_HELP_STRING([--disable-glib], [disable usage of glib,gobject,gio in tests]))
-AS_IF([test "x$enable_glib" != "xno"], [
- PKG_CHECK_MODULES(GLIB, [glib-2.0 >= 2.22.0 gobject-2.0 >= 2.22.0 gio-2.0],
- [AC_DEFINE(HAVE_GLIB, 1, [Define if glib,gobject,gio are available]) have_glib=yes],
- [have_glib=no])
- AS_IF([test "x$have_glib" = "xno" -a "x$enable_glib" = "xyes"],
- [AC_MSG_ERROR([*** glib support requested but libraries not found])])])
-
-# ------------------------------------------------------------------------------
-have_utmp=yes
-AC_ARG_ENABLE([utmp], AS_HELP_STRING([--disable-utmp], [disable utmp/wtmp log handling]),
- AS_CASE("x${enableval}",
- [xyes], [have_utmp=yes],
- [xno], [have_utmp=no],
- AC_MSG_ERROR(bad value ${enableval} for --enable-utmp)))
-AS_IF([test "x$have_utmp" = "xyes"], [
- AC_DEFINE(HAVE_UTMP, 1, [Define if utmp/wtmp support is enabled])
- have_utmp=yes
- M4_DEFINES="$M4_DEFINES -DHAVE_UTMP"],
- [have_utmp=no])
-AM_CONDITIONAL([HAVE_UTMP], [test "x$have_utmp" = "xyes"])
-
-# ------------------------------------------------------------------------------
-have_coverage=no
-AC_ARG_ENABLE(coverage, AS_HELP_STRING([--enable-coverage], [enable test coverage]))
-if test "x$enable_coverage" = "xyes" ; then
- AC_CHECK_PROG(lcov_found, [lcov], [yes], [no])
- if test "x$lcov_found" = xno ; then
- AC_MSG_ERROR([*** lcov support requested but the program was not found])
- else
- lcov_version_major="`lcov --version | cut -d ' ' -f 4 | cut -d '.' -f 1`"
- lcov_version_minor="`lcov --version | cut -d ' ' -f 4 | cut -d '.' -f 2`"
- if test "$lcov_version_major" -eq 1 -a "$lcov_version_minor" -lt 10; then
- AC_MSG_ERROR([*** lcov version is too old. 1.10 required])
- else
- have_coverage=yes
- CC_CHECK_FLAGS_APPEND([with_coverage_cflags], [CFLAGS], [\
- -fprofile-arcs \
- -ftest-coverage])
- AC_SUBST([OUR_CFLAGS], "$with_cflags $with_coverage_cflags")
- fi
- fi
-fi
-AM_CONDITIONAL(ENABLE_COVERAGE, [test "$have_coverage" = "yes"])
-
-# ------------------------------------------------------------------------------
-have_kmod=no
-AC_ARG_ENABLE(kmod, AS_HELP_STRING([--disable-kmod], [disable loadable modules support]))
-if test "x$enable_kmod" != "xno"; then
- PKG_CHECK_EXISTS([ libkmod ], have_kmod=yes, have_kmod=no)
- if test "x$have_kmod" = "xyes"; then
- PKG_CHECK_MODULES(KMOD, [ libkmod >= 15 ],
- [AC_DEFINE(HAVE_KMOD, 1, [Define if kmod is available])],
- AC_MSG_ERROR([*** kmod version >= 15 not found]))
- fi
- if test "x$have_kmod" = xno -a "x$enable_kmod" = xyes; then
- AC_MSG_ERROR([*** kmod support requested, but libraries not found])
- fi
-fi
-AM_CONDITIONAL(HAVE_KMOD, [test "$have_kmod" = "yes"])
-
-# ------------------------------------------------------------------------------
-have_xkbcommon=no
-AC_ARG_ENABLE(xkbcommon, AS_HELP_STRING([--disable-xkbcommon], [disable xkbcommon keymap support]))
-if test "x$enable_xkbcommon" != "xno"; then
- PKG_CHECK_MODULES(XKBCOMMON, [ xkbcommon >= 0.3.0 ],
- [AC_DEFINE(HAVE_XKBCOMMON, 1, [Define if libxkbcommon is available]) have_xkbcommon=yes], have_xkbcommon=no)
- if test "x$have_xkbcommon" = xno -a "x$enable_xkbcommon" = xyes; then
- AC_MSG_ERROR([*** xkbcommon support requested but libraries not found])
- fi
-fi
-AM_CONDITIONAL(HAVE_XKBCOMMON, [test "$have_xkbcommon" = "yes"])
-
-# ------------------------------------------------------------------------------
-have_blkid=no
-AC_ARG_ENABLE(blkid, AS_HELP_STRING([--disable-blkid], [disable blkid support]))
-if test "x$enable_blkid" != "xno"; then
- PKG_CHECK_MODULES(BLKID, [ blkid >= 2.24 ],
- [AC_DEFINE(HAVE_BLKID, 1, [Define if blkid is available]) have_blkid=yes], have_blkid=no)
- if test "x$have_blkid" = xno -a "x$enable_blkid" = xyes; then
- AC_MSG_ERROR([*** blkid support requested but libraries not found])
- fi
-fi
-AM_CONDITIONAL(HAVE_BLKID, [test "$have_blkid" = "yes"])
-
-# ------------------------------------------------------------------------------
-have_libmount=no
-PKG_CHECK_MODULES(MOUNT, [ mount >= 2.27 ],
- [AC_DEFINE(HAVE_LIBMOUNT, 1, [Define if libmount is available]) have_libmount=yes], have_libmount=no)
-if test "x$have_libmount" = xno; then
- AC_MSG_ERROR([*** libmount support required but libraries not found])
-fi
-AM_CONDITIONAL(HAVE_LIBMOUNT, [test "$have_libmount" = "yes"])
-
-# ------------------------------------------------------------------------------
-have_seccomp=no
-AC_ARG_ENABLE(seccomp, AS_HELP_STRING([--disable-seccomp], [disable optional SECCOMP support]))
-if test "x$enable_seccomp" != "xno"; then
- PKG_CHECK_MODULES(SECCOMP, [libseccomp >= 2.3.1],
- [AC_DEFINE(HAVE_SECCOMP, 1, [Define if seccomp is available])
- have_seccomp=yes
- M4_DEFINES="$M4_DEFINES -DHAVE_SECCOMP"],
- [have_seccomp=no])
- if test "x$have_seccomp" = "xno" -a "x$enable_seccomp" = "xyes"; then
- AC_MSG_ERROR([*** seccomp support requested but libraries not found])
- fi
-fi
-AM_CONDITIONAL(HAVE_SECCOMP, [test "$have_seccomp" = "yes"])
-
-# ------------------------------------------------------------------------------
-have_ima=yes
-AC_ARG_ENABLE([ima], AS_HELP_STRING([--disable-ima], [disable optional IMA support]),
- [case "${enableval}" in
- yes) have_ima=yes ;;
- no) have_ima=no ;;
- *) AC_MSG_ERROR(bad value ${enableval} for --disable-ima) ;;
- esac],
- [have_ima=yes])
-
-if test "x${have_ima}" != xno ; then
- AC_DEFINE(HAVE_IMA, 1, [Define if IMA is available])
-fi
-
-# ------------------------------------------------------------------------------
-have_selinux=no
-AC_ARG_ENABLE(selinux, AS_HELP_STRING([--disable-selinux], [disable optional SELINUX support]))
-if test "x$enable_selinux" != "xno"; then
- PKG_CHECK_MODULES([SELINUX], [libselinux >= 2.1.9],
- [AC_DEFINE(HAVE_SELINUX, 1, [Define if SELinux is available])
- have_selinux=yes
- M4_DEFINES="$M4_DEFINES -DHAVE_SELINUX"],
- [have_selinux=no])
- if test "x$have_selinux" = xno -a "x$enable_selinux" = xyes; then
- AC_MSG_ERROR([*** SELinux support requested but libraries not found])
- fi
-fi
-AM_CONDITIONAL(HAVE_SELINUX, [test "$have_selinux" = "yes"])
-
-have_apparmor=no
-AC_ARG_ENABLE(apparmor, AS_HELP_STRING([--disable-apparmor], [disable optional AppArmor support]))
-if test "x$enable_apparmor" != "xno"; then
- PKG_CHECK_MODULES([APPARMOR], [libapparmor],
- [AC_DEFINE(HAVE_APPARMOR, 1, [Define if AppArmor is available])
- have_apparmor=yes
- M4_DEFINES="$M4_DEFINES -DHAVE_APPARMOR"],
- [have_apparmor=no])
- if test "x$have_apparmor" = xno -a "x$enable_apparmor" = xyes; then
- AC_MSG_ERROR([*** AppArmor support requested but libraries not found])
- fi
-fi
-AM_CONDITIONAL(HAVE_APPARMOR, [test "$have_apparmor" = "yes"])
-
-have_adm_group=no
-AC_ARG_ENABLE(adm-group, AS_HELP_STRING([--disable-adm-group], [disable adm group]))
-AS_IF([test "x$enable_adm_group" != "xno"], [
- AC_DEFINE(ENABLE_ADM_GROUP, 1, [Define if the ACL for adm group should be enabled])
- have_adm_group=yes
- M4_DEFINES="$M4_DEFINES -DENABLE_ADM_GROUP"
-])
-
-have_wheel_group=no
-AC_ARG_ENABLE(wheel-group, AS_HELP_STRING([--disable-wheel-group], [disable wheel group]))
-AS_IF([test "x$enable_wheel_group" != "xno"], [
- AC_DEFINE(ENABLE_WHEEL_GROUP, 1, [Define if the ACL for wheel group should be enabled])
- have_wheel_group=yes
- M4_DEFINES="$M4_DEFINES -DENABLE_WHEEL_GROUP"
-])
-
-
-AC_ARG_WITH(debug-shell,
- AS_HELP_STRING([--with-debug-shell=PATH],
- [path to debug shell binary]),
- [SUSHELL="$withval"],
- [SUSHELL="/bin/sh"])
-
-AC_SUBST(SUSHELL)
-
-AC_ARG_WITH([debug-tty],
- AS_HELP_STRING([--with-debug-tty=PATH],
- [specify the tty device for debug shell]),
- [DEBUGTTY="$withval"],
- [DEBUGTTY=/dev/tty9])
-
-AC_SUBST(DEBUGTTY)
-
-AC_ARG_WITH([certificate-root],
- AS_HELP_STRING([--with-certificate-root=PATH],
- [specify the prefix for TLS certificates [/etc/ssl]]),
- [CERTIFICATEROOT="$withval"],
- [CERTIFICATEROOT="/etc/ssl"])
-
-AC_SUBST(CERTIFICATEROOT)
-
-AC_ARG_WITH([support-url],
- AS_HELP_STRING([--with-support-url=URL],
- [specify the support URL to show in catalog entries included in systemd]),
- [SUPPORT_URL="$withval"],
- [SUPPORT_URL=https://lists.freedesktop.org/mailman/listinfo/systemd-devel])
-
-AC_SUBST(SUPPORT_URL)
-
-AC_ARG_WITH([nobody-user],
- AS_HELP_STRING([--with-nobody-user=NAME],
- [specify the name of the nobody user (the one with UID 65534)]),
- [NOBODY_USER_NAME="$withval"],
- [NOBODY_USER_NAME=nobody])
-
-AC_SUBST(NOBODY_USER_NAME)
-AC_DEFINE_UNQUOTED(NOBODY_USER_NAME, ["$NOBODY_USER_NAME"], [The name of the nobody user (the one with UID 65534)])
-
-AC_ARG_WITH([nobody-group],
- AS_HELP_STRING([--with-nobody-group=NAME],
- [specify the name of the nobody group (the one with GID 65534)]),
- [NOBODY_GROUP_NAME="$withval"],
- [NOBODY_GROUP_NAME=nobody])
-
-AC_SUBST(NOBODY_GROUP_NAME)
-AC_DEFINE_UNQUOTED(NOBODY_GROUP_NAME, ["$NOBODY_GROUP_NAME"], [The name of the nobody group (the one with GID 65534)])
-
-AC_ARG_WITH([fallback-hostname],
- AS_HELP_STRING([--with-fallback-hostname=NAME],
- [specify the hostname used if none configured]),
- [FALLBACK_HOSTNAME="$withval"],
- [FALLBACK_HOSTNAME=localhost])
-
-AC_SUBST(FALLBACK_HOSTNAME)
-AC_DEFINE_UNQUOTED(FALLBACK_HOSTNAME, ["$FALLBACK_HOSTNAME"], [The hostname used if none configured])
-
-# ------------------------------------------------------------------------------
-
-AC_ARG_WITH(default-hierarchy,
- AS_HELP_STRING([--with-default-hierarchy=MODE],
- [default cgroup hierarchy, defaults to "hybrid"]),
- [DEFAULT_HIERARCHY="$withval"],
- [DEFAULT_HIERARCHY="hybrid"])
-
-AS_CASE("$DEFAULT_HIERARCHY",
- [legacy], [mode=CGROUP_UNIFIED_NONE],
- [hybrid], [mode=CGROUP_UNIFIED_SYSTEMD],
- [unified], [mode=CGROUP_UNIFIED_ALL],
- AC_MSG_ERROR(Bad default hierarchy mode ${DEFAULT_HIERARCHY}))
-AC_DEFINE_UNQUOTED(DEFAULT_HIERARCHY, [$mode], [Default cgroup hierarchy])
-AC_DEFINE_UNQUOTED(DEFAULT_HIERARCHY_NAME, ["$DEFAULT_HIERARCHY"],
- [Default cgroup hierarchy as string])
-
-# ------------------------------------------------------------------------------
-have_xz=no
-AC_ARG_ENABLE(xz, AS_HELP_STRING([--disable-xz], [disable optional XZ support]))
-AS_IF([test "x$enable_xz" != "xno"], [
- PKG_CHECK_MODULES(XZ, [ liblzma ],
- [AC_DEFINE(HAVE_XZ, 1, [Define if XZ is available])
- have_xz=yes],
- have_xz=no)
- AS_IF([test "x$have_xz" = xno -a "x$enable_xz" = xyes],
- [AC_MSG_ERROR([*** XZ support requested but libraries not found])])
-])
-AM_CONDITIONAL(HAVE_XZ, [test "$have_xz" = "yes"])
-
-# ------------------------------------------------------------------------------
-have_zlib=no
-AC_ARG_ENABLE(zlib, AS_HELP_STRING([--disable-zlib], [disable optional ZLIB support]))
-AS_IF([test "x$enable_zlib" != "xno"], [
- PKG_CHECK_MODULES(ZLIB, [ zlib ],
- [AC_DEFINE(HAVE_ZLIB, 1, [Define if ZLIB is available])
- have_zlib=yes],
- have_zlib=no)
- AS_IF([test "x$have_zlib" = xno -a "x$enable_zlib" = xyes],
- [AC_MSG_ERROR([*** ZLIB support requested but libraries not found])])
-])
-AM_CONDITIONAL(HAVE_ZLIB, [test "$have_zlib" = "yes"])
-
-# ------------------------------------------------------------------------------
-have_bzip2=no
-AC_ARG_ENABLE(bzip2, AS_HELP_STRING([--disable-bzip2], [disable optional BZIP2 support]))
-AS_IF([test "x$enable_bzip2" != "xno"], [
- AC_CHECK_HEADERS(bzlib.h,
- [AC_DEFINE(HAVE_BZIP2, 1, [Define if BZIP2 is available])
- have_bzip2=yes],
- [AS_IF([test "x$enable_bzip2" = xyes],
- [AC_MSG_ERROR([*** BZIP2 support requested but headers not found])])]
- )
-])
-AM_CONDITIONAL(HAVE_BZIP2, [test "$have_bzip2" = "yes"])
-
-# ------------------------------------------------------------------------------
-have_lz4=no
-AC_ARG_ENABLE(lz4, AS_HELP_STRING([--disable-lz4], [disable optional LZ4 support]))
-AS_IF([test "x$enable_lz4" != "xno"], [
- PKG_CHECK_MODULES(LZ4, [ liblz4 < 10 ],
- [AC_DEFINE(HAVE_LZ4, 1, [Define if LZ4 is available])
- have_lz4=yes],
- [PKG_CHECK_MODULES(LZ4, [ liblz4 >= 125 ],
- [AC_DEFINE(HAVE_LZ4, 1, [Define if LZ4 is available])
- have_lz4=yes],
- have_lz4=no)])
- AS_IF([test "x$have_lz4" = xno -a "x$enable_lz4" = xyes],
- [AC_MSG_ERROR([*** LZ4 support requested but libraries not found])])
-])
-AM_CONDITIONAL(HAVE_LZ4, [test "$have_lz4" = "yes"])
-
-AM_CONDITIONAL(HAVE_COMPRESSION, [test "$have_xz" = "yes" -o "$have_lz4" = "yes"])
-
-# ------------------------------------------------------------------------------
-AC_ARG_ENABLE([pam],
- AS_HELP_STRING([--disable-pam], [disable optional PAM support]),
- [case "${enableval}" in
- yes) have_pam=yes ;;
- no) have_pam=no ;;
- *) AC_MSG_ERROR(bad value ${enableval} for --disable-pam) ;;
- esac],
- [have_pam=auto])
-
-if test "x${have_pam}" != xno ; then
- AC_CHECK_HEADERS(
- [security/pam_modules.h security/pam_modutil.h security/pam_ext.h],
- [have_pam=yes],
- [if test "x$have_pam" = xyes ; then
- AC_MSG_ERROR([*** PAM headers not found.])
- fi])
-
- AC_CHECK_LIB(
- [pam],
- [pam_syslog],
- [have_pam=yes],
- [if test "x$have_pam" = xyes ; then
- AC_MSG_ERROR([*** libpam not found.])
- fi])
-
- if test "x$have_pam" = xyes ; then
- PAM_LIBS="-lpam -lpam_misc"
- AC_DEFINE(HAVE_PAM, 1, [PAM available])
- M4_DEFINES="$M4_DEFINES -DHAVE_PAM"
- else
- have_pam=no
- fi
-else
- PAM_LIBS=
-fi
-AC_SUBST(PAM_LIBS)
-AM_CONDITIONAL([HAVE_PAM], [test "x$have_pam" != xno])
-
-# ------------------------------------------------------------------------------
-AC_ARG_ENABLE([acl],
- AS_HELP_STRING([--disable-acl], [disable optional ACL support]),
- [case "${enableval}" in
- yes) have_acl=yes ;;
- no) have_acl=no ;;
- *) AC_MSG_ERROR(bad value ${enableval} for --disable-acl) ;;
- esac],
- [have_acl=auto])
-
-if test "x${have_acl}" != xno ; then
- AC_CHECK_HEADERS(
- [sys/acl.h acl/libacl.h],
- [have_acl=yes],
- [if test "x$have_acl" = xyes ; then
- AC_MSG_ERROR([*** ACL headers not found.])
- fi])
-
- AC_CHECK_LIB(
- [acl],
- [acl_get_file],
- [have_acl=yes],
- [if test "x$have_acl" = xyes ; then
- AC_MSG_ERROR([*** libacl not found.])
- fi])
-
- if test "x$have_acl" = xyes ; then
- ACL_LIBS="-lacl"
- AC_DEFINE(HAVE_ACL, 1, [ACL available])
- M4_DEFINES="$M4_DEFINES -DHAVE_ACL"
- else
- have_acl=no
- fi
-else
- ACL_LIBS=
-fi
-AC_SUBST(ACL_LIBS)
-AM_CONDITIONAL([HAVE_ACL], [test "x$have_acl" != xno])
-
-# ------------------------------------------------------------------------------
-AC_ARG_ENABLE([smack], AS_HELP_STRING([--disable-smack], [disable optional SMACK support]),
- [case "${enableval}" in
- yes) have_smack=yes ;;
- no) have_smack=no ;;
- *) AC_MSG_ERROR(bad value ${enableval} for --disable-smack) ;;
- esac],
- [have_smack=auto])
-
-if test "x${have_smack}" != xno; then
- AC_DEFINE(HAVE_SMACK, 1, [Define if SMACK is available])
- M4_DEFINES="$M4_DEFINES -DHAVE_SMACK"
- have_smack=yes
-fi
-
-AM_CONDITIONAL([HAVE_SMACK], [test "x$have_smack" = "xyes"])
-
-have_smack_run_label=no
-AC_ARG_WITH(smack-run-label,
-AS_HELP_STRING([--with-smack-run-label=STRING],
- [run systemd --system itself with a specific SMACK label]),
- [AC_DEFINE_UNQUOTED(SMACK_RUN_LABEL, ["$withval"], [Run systemd itself with SMACK label]) have_smack_run_label=yes],
- [])
-
-if test "x${have_smack_run_label}" = xyes; then
- M4_DEFINES="$M4_DEFINES -DHAVE_SMACK_RUN_LABEL"
-fi
-
-AC_ARG_WITH(smack-default-process-label,
-AS_HELP_STRING([--with-smack-default-process-label=STRING],
- [default SMACK label for executed processes]),
- [AC_DEFINE_UNQUOTED(SMACK_DEFAULT_PROCESS_LABEL, ["$withval"], [Default SMACK label for executed processes])],
- [])
-
-# ------------------------------------------------------------------------------
-AC_ARG_ENABLE([gcrypt],
- AS_HELP_STRING([--disable-gcrypt], [disable optional GCRYPT support]),
- [case "${enableval}" in
- yes) have_gcrypt=yes ;;
- no) have_gcrypt=no ;;
- *) AC_MSG_ERROR(bad value ${enableval} for --disable-gcrypt) ;;
- esac],
- [have_gcrypt=auto])
-
-if test "x${have_gcrypt}" != xno ; then
- m4_define([AM_PATH_LIBGCRYPT_FAIL],
- [{ test "x$have_gcrypt" != xyes || AC_MSG_ERROR([*** GCRYPT/GPG-ERROR headers not found.]); }]
- )
- m4_ifdef([AM_PATH_LIBGCRYPT], [AM_PATH_LIBGCRYPT(
- [1.4.5],
- [have_gcrypt=yes],
- dnl If we have the gcrypt m4 macros, but don't have
- dnl gcrypt, throw an error if gcrypt is explicitly
- dnl requested.
- [AM_PATH_LIBGCRYPT_FAIL]
- )],
- dnl If we don't have the gcrypt m4 macros, but build with
- dnl gcrypt explicitly requested, throw an error.
- [AM_PATH_LIBGCRYPT_FAIL]
- )
-
- have_gpg_error=no
- m4_ifdef([AM_PATH_GPG_ERROR], [AM_PATH_GPG_ERROR(
- [1.12],
- [have_gpg_error=yes],
- [AM_PATH_LIBGCRYPT_FAIL]
- )],
- [AM_PATH_LIBGCRYPT_FAIL]
- )
-
- if test "x$have_gcrypt" = xyes -a "x$have_gpg_error" = xyes ; then
- GCRYPT_LIBS="$LIBGCRYPT_LIBS $GPG_ERROR_LIBS"
- GCRYPT_CFLAGS="$LIBGCRYPT_CFLAGS $GPG_ERROR_CFLAGS"
- AC_DEFINE(HAVE_GCRYPT, 1, [GCRYPT available])
- else
- have_gcrypt=no
- have_gpg_error=no
- fi
-else
- GCRYPT_LIBS=
- GCRYPT_CFLAGS=
-fi
-AC_SUBST(GCRYPT_LIBS)
-AC_SUBST(GCRYPT_CFLAGS)
-AM_CONDITIONAL([HAVE_GCRYPT], [test "x$have_gcrypt" != xno])
-
-# ------------------------------------------------------------------------------
-AC_ARG_ENABLE([audit],
- AS_HELP_STRING([--disable-audit], [disable optional AUDIT support]),
- [case "${enableval}" in
- yes) have_audit=yes ;;
- no) have_audit=no ;;
- *) AC_MSG_ERROR(bad value ${enableval} for --disable-audit) ;;
- esac],
- [have_audit=auto])
-
-if test "x${have_audit}" != xno ; then
- AC_CHECK_HEADERS(
- [libaudit.h],
- [have_audit=yes],
- [if test "x$have_audit" = xyes ; then
- AC_MSG_ERROR([*** AUDIT headers not found.])
- fi])
-
- AC_CHECK_LIB(
- [audit],
- [audit_open],
- [have_audit=yes],
- [if test "x$have_audit" = xyes ; then
- AC_MSG_ERROR([*** libaudit not found.])
- fi])
-
- if test "x$have_audit" = xyes ; then
- AUDIT_LIBS="-laudit"
- AC_DEFINE(HAVE_AUDIT, 1, [AUDIT available])
- else
- have_audit=no
- fi
-else
- AUDIT_LIBS=
-fi
-AC_SUBST(AUDIT_LIBS)
-AM_CONDITIONAL([HAVE_AUDIT], [test "x$have_audit" != xno])
-
-# ------------------------------------------------------------------------------
-AC_ARG_ENABLE([elfutils],
- AS_HELP_STRING([--disable-elfutils], [disable optional ELFUTILS support]),
- [case "${enableval}" in
- yes) have_elfutils=yes ;;
- no) have_elfutils=no ;;
- *) AC_MSG_ERROR(bad value ${enableval} for --disable-elfutils) ;;
- esac],
- [have_elfutils=auto])
-
-if test "x${have_elfutils}" != xno ; then
- AC_CHECK_HEADERS(
- [elfutils/libdwfl.h],
- [],
- [if test "x$have_elfutils" = xyes ; then
- AC_MSG_ERROR([*** ELFUTILS headers not found.])
- fi])
-
- AC_CHECK_LIB(
- [dw],
- [dwfl_core_file_attach],
- [have_elfutils=yes],
- [if test "x$have_elfutils" = xyes ; then
- AC_MSG_ERROR([*** ELFUTILS >= 158 is required.])
- fi])
-
- if test "x$have_elfutils" = xyes ; then
- ELFUTILS_LIBS="-lelf -ldw"
- AC_DEFINE(HAVE_ELFUTILS, 1, [ELFUTILS available])
- else
- have_elfutils=no
- fi
-else
- ELFUTILS_LIBS=
-fi
-AC_SUBST(ELFUTILS_LIBS)
-AM_CONDITIONAL(HAVE_ELFUTILS, [test "$have_elfutils" = "yes"])
-
-# ------------------------------------------------------------------------------
-have_libcryptsetup=no
-AC_ARG_ENABLE(libcryptsetup, AS_HELP_STRING([--disable-libcryptsetup], [disable libcryptsetup tools]))
-if test "x$enable_libcryptsetup" != "xno"; then
- PKG_CHECK_MODULES(LIBCRYPTSETUP, [ libcryptsetup >= 1.6.0 ],
- [AC_DEFINE(HAVE_LIBCRYPTSETUP, 1, [Define if libcryptsetup is available]) have_libcryptsetup=yes], have_libcryptsetup=no)
- if test "x$have_libcryptsetup" = xno -a "x$enable_libcryptsetup" = xyes; then
- AC_MSG_ERROR([*** libcryptsetup support requested but libraries not found])
- fi
-fi
-AM_CONDITIONAL(HAVE_LIBCRYPTSETUP, [test "$have_libcryptsetup" = "yes"])
-
-# ------------------------------------------------------------------------------
-have_qrencode=no
-AC_ARG_ENABLE(qrencode, AS_HELP_STRING([--disable-qrencode], [disable qrencode support]))
-if test "x$enable_qrencode" != "xno"; then
- PKG_CHECK_MODULES(QRENCODE, [ libqrencode ],
- [AC_DEFINE(HAVE_QRENCODE, 1, [Define if qrencode is available]) have_qrencode=yes], have_qrencode=no)
- if test "x$have_qrencode" = xno -a "x$enable_qrencode" = xyes; then
- AC_MSG_ERROR([*** qrencode support requested but libraries not found])
- fi
-fi
-AM_CONDITIONAL(HAVE_QRENCODE, [test "$have_qrencode" = "yes"])
-
-# ------------------------------------------------------------------------------
-have_gnutls=no
-AC_ARG_ENABLE(gnutls, AS_HELP_STRING([--disable-gnutls], [disable gnutls support]))
-if test "x$enable_gnutls" != "xno"; then
- PKG_CHECK_MODULES(GNUTLS, [gnutls >= 3.1.4],
- [AC_DEFINE(HAVE_GNUTLS, 1, [Define if gnutls is available]) have_gnutls=yes], have_gnutls=no)
- if test "x$have_gnutls" = xno -a "x$enable_gnutls" = xyes; then
- AC_MSG_ERROR([*** gnutls support requested but libraries not found])
- fi
-fi
-AM_CONDITIONAL(HAVE_GNUTLS, [test "$have_gnutls" = "yes"])
-
-# ------------------------------------------------------------------------------
-have_microhttpd=no
-AC_ARG_ENABLE(microhttpd, AS_HELP_STRING([--disable-microhttpd], [disable microhttpd support]))
-if test "x$enable_microhttpd" != "xno"; then
- PKG_CHECK_MODULES(MICROHTTPD, [libmicrohttpd >= 0.9.33],
- [AC_DEFINE(HAVE_MICROHTTPD, 1, [Define if microhttpd is available])
- have_microhttpd=yes
- M4_DEFINES="$M4_DEFINES -DHAVE_MICROHTTPD"],
- [have_microhttpd=no])
- if test "x$have_microhttpd" = xno -a "x$enable_microhttpd" = xyes; then
- AC_MSG_ERROR([*** microhttpd support requested but libraries not found])
- fi
-fi
-AM_CONDITIONAL(HAVE_MICROHTTPD, [test "$have_microhttpd" = "yes"])
-
-# ------------------------------------------------------------------------------
-have_libcurl=no
-AC_ARG_ENABLE(libcurl, AS_HELP_STRING([--disable-libcurl], [disable libcurl support]))
-if test "x$enable_libcurl" != "xno"; then
- PKG_CHECK_MODULES(LIBCURL, [libcurl >= 7.32.0],
- [AC_DEFINE(HAVE_LIBCURL, 1, [Define if libcurl is available])
- have_libcurl=yes
- M4_DEFINES="$M4_DEFINES -DHAVE_LIBCURL"],
- [have_libcurl=no])
- if test "x$have_libcurl" = xno -a "x$enable_libcurl" = xyes; then
- AC_MSG_ERROR([*** libcurl support requested but libraries not found])
- fi
-fi
-AM_CONDITIONAL(HAVE_LIBCURL, [test "$have_libcurl" = "yes"])
-
-# ------------------------------------------------------------------------------
-AM_CONDITIONAL(HAVE_REMOTE, [test "$have_microhttpd" = "yes" -o "$have_libcurl" = "yes"])
-
-# ------------------------------------------------------------------------------
-have_libidn=no
-AC_ARG_ENABLE(libidn, AS_HELP_STRING([--disable-libidn], [disable optional LIBIDN support]))
-if test "x$enable_libidn" != "xno"; then
- PKG_CHECK_MODULES(LIBIDN, [libidn],
- [AC_DEFINE(HAVE_LIBIDN, 1, [Define if libidn is available])
- have_libidn=yes
- M4_DEFINES="$M4_DEFINES -DHAVE_LIBIDN"],
- [have_libidn=no])
- if test "x$have_libidn" = "xno" -a "x$enable_libidn" = "xyes"; then
- AC_MSG_ERROR([*** libidn support requested but libraries not found])
- fi
-fi
-AM_CONDITIONAL(HAVE_LIBIDN, [test "$have_libidn" = "yes"])
-
-have_libidn2=no
-AC_ARG_ENABLE(libidn2, AS_HELP_STRING([--disable-libidn2], [disable optional LIBIDN2 support]))
-if test "$have_libidn" != "yes"; then
- if test "x$enable_libidn2" != "xno"; then
- PKG_CHECK_MODULES(LIBIDN2, [libidn2 >= 2.0.0],
- [AC_DEFINE(HAVE_LIBIDN2, 1, [Define if libidn2 is available])
- have_libidn2=yes
- M4_DEFINES="$M4_DEFINES -DHAVE_LIBIDN2"],
- [have_libidn2=no])
- if test "x$have_libidn2" = "xno" -a "x$enable_libidn2" = "xyes"; then
- AC_MSG_ERROR([*** libidn2 support requested but libraries not found])
- fi
- fi
-fi
-AM_CONDITIONAL(HAVE_LIBIDN2, [test "$have_libidn2" = "yes"])
-
-# ------------------------------------------------------------------------------
-have_idn=no
-AC_ARG_ENABLE(idn, AS_HELP_STRING([--disable-idn], [disable IDN when printing host names]))
-if test "x$enable_idn" != "xno"; then
- have_idn=yes
- AC_DEFINE(ENABLE_IDN, [1], [IDN is enabled])
-fi
-AM_CONDITIONAL(ENABLE_IDN, [test "$have_idn" = "yes"])
-
-# ------------------------------------------------------------------------------
-have_nss_systemd=no
-AC_ARG_ENABLE(nss-systemd, AS_HELP_STRING([--disable-nss-systemd], [disable nss-systemd support]))
-if test "x$enable_nss_systemd" != "xno"; then
- have_nss_systemd=yes
- AC_DEFINE(ENABLE_NSS_SYSTEMD, [1], [nss-systemd is enabled])
-fi
-AM_CONDITIONAL(ENABLE_NSS_SYSTEMD, [test "$have_nss_systemd" = "yes"])
-
-# ------------------------------------------------------------------------------
-have_libiptc=no
-AC_ARG_ENABLE(libiptc, AS_HELP_STRING([--disable-libiptc], [disable optional LIBIPTC support]))
-if test "x$enable_libiptc" != "xno"; then
- PKG_CHECK_MODULES(LIBIPTC, [libiptc],
- [AC_DEFINE(HAVE_LIBIPTC, 1, [Define if libiptc is available])
- have_libiptc=yes
- M4_DEFINES="$M4_DEFINES -DHAVE_LIBIPTC"],
- [have_libiptc=no])
- if test "x$have_libiptc" = "xno" -a "x$enable_libiptc" = "xyes"; then
- AC_MSG_ERROR([*** libiptc support requested but libraries not found])
- fi
-fi
-AM_CONDITIONAL(HAVE_LIBIPTC, [test "$have_libiptc" = "yes"])
-
-# ------------------------------------------------------------------------------
-have_binfmt=no
-AC_ARG_ENABLE(binfmt, AS_HELP_STRING([--disable-binfmt], [disable binfmt tool]))
-if test "x$enable_binfmt" != "xno"; then
- have_binfmt=yes
-fi
-AM_CONDITIONAL(ENABLE_BINFMT, [test "$have_binfmt" = "yes"])
-
-# ------------------------------------------------------------------------------
-have_vconsole=no
-AC_ARG_ENABLE(vconsole, AS_HELP_STRING([--disable-vconsole], [disable vconsole tool]))
-if test "x$enable_vconsole" != "xno"; then
- have_vconsole=yes
-fi
-AM_CONDITIONAL(ENABLE_VCONSOLE, [test "$have_vconsole" = "yes"])
-
-# ------------------------------------------------------------------------------
-have_quotacheck=no
-AC_ARG_ENABLE(quotacheck, AS_HELP_STRING([--disable-quotacheck], [disable quotacheck tools]))
-if test "x$enable_quotacheck" != "xno"; then
- have_quotacheck=yes
-fi
-AM_CONDITIONAL(ENABLE_QUOTACHECK, [test "$have_quotacheck" = "yes"])
-
-# ------------------------------------------------------------------------------
-have_tmpfiles=no
-AC_ARG_ENABLE(tmpfiles, AS_HELP_STRING([--disable-tmpfiles], [disable tmpfiles support]))
-if test "x$enable_tmpfiles" != "xno"; then
- have_tmpfiles=yes
-fi
-AM_CONDITIONAL(ENABLE_TMPFILES, [test "$have_tmpfiles" = "yes"])
-
-# ------------------------------------------------------------------------------
-have_environment_d=no
-AC_ARG_ENABLE(environment-d, AS_HELP_STRING([--disable-environment-d], [disable environment.d support]))
-if test "x$enable_environment_d" != "xno"; then
- have_environment_d=yes
-fi
-AM_CONDITIONAL(ENABLE_ENVIRONMENT_D, [test "$have_environment_d" = "yes"])
-
-# ------------------------------------------------------------------------------
-have_sysusers=no
-AC_ARG_ENABLE(sysusers, AS_HELP_STRING([--disable-sysusers], [disable sysusers support]))
-if test "x$enable_sysusers" != "xno"; then
- have_sysusers=yes
-fi
-AM_CONDITIONAL(ENABLE_SYSUSERS, [test "$have_sysusers" = "yes"])
-
-AC_ARG_ENABLE(gshadow, AS_HELP_STRING([--disable-gshadow], [disable shadow group support]))
-AS_IF([test "x${enable_gshadow}" != "xno"], [
- AC_DEFINE(ENABLE_GSHADOW, 1, [shadow group support is enabled])
-])
-
-# ------------------------------------------------------------------------------
-have_firstboot=no
-AC_ARG_ENABLE(firstboot, AS_HELP_STRING([--disable-firstboot], [disable firstboot support]))
-if test "x$enable_firstboot" != "xno"; then
- have_firstboot=yes
-fi
-AM_CONDITIONAL(ENABLE_FIRSTBOOT, [test "$have_firstboot" = "yes"])
-
-# ------------------------------------------------------------------------------
-have_randomseed=no
-AC_ARG_ENABLE(randomseed, AS_HELP_STRING([--disable-randomseed], [disable randomseed tools]))
-if test "x$enable_randomseed" != "xno"; then
- have_randomseed=yes
-fi
-AM_CONDITIONAL(ENABLE_RANDOMSEED, [test "$have_randomseed" = "yes"])
-
-# ------------------------------------------------------------------------------
-have_backlight=no
-AC_ARG_ENABLE(backlight, AS_HELP_STRING([--disable-backlight], [disable backlight tools]))
-if test "x$enable_backlight" != "xno"; then
- have_backlight=yes
-fi
-AM_CONDITIONAL(ENABLE_BACKLIGHT, [test "$have_backlight" = "yes"])
-
-# ------------------------------------------------------------------------------
-have_rfkill=no
-AC_ARG_ENABLE(rfkill, AS_HELP_STRING([--disable-rfkill], [disable rfkill tools]))
-if test "x$enable_rfkill" != "xno"; then
- have_rfkill=yes
-fi
-AM_CONDITIONAL(ENABLE_RFKILL, [test "$have_rfkill" = "yes"])
-
-# ------------------------------------------------------------------------------
-have_logind=no
-AC_ARG_ENABLE(logind, AS_HELP_STRING([--disable-logind], [disable login daemon]))
-if test "x$enable_logind" != "xno"; then
- have_logind=yes
-fi
-AM_CONDITIONAL(ENABLE_LOGIND, [test "$have_logind" = "yes"])
-AS_IF([test "$have_logind" = "yes"], [ AC_DEFINE(ENABLE_LOGIND, [1], [Logind support available]) ])
-
-AC_ARG_WITH([kill-user-processes],
- [AS_HELP_STRING([--without-kill-user-processes], [set logind's KillUserProcesses=no by default])])
-AS_IF([test "$with_kill_user_processes" != "no"],
- [kill_user_processes=true
- KILL_USER_PROCESSES=yes],
- [kill_user_processes=false
- KILL_USER_PROCESSES=no])
-AC_DEFINE_UNQUOTED(KILL_USER_PROCESSES, [$kill_user_processes], [Default KillUserProcesses setting])
-AC_SUBST(KILL_USER_PROCESSES)
-
-# ------------------------------------------------------------------------------
-have_machined=no
-AC_ARG_ENABLE(machined, AS_HELP_STRING([--disable-machined], [disable machine daemon]))
-if test "x$enable_machined" != "xno"; then
- have_machined=yes
- AC_DEFINE(HAVE_MACHINED, [1], [systemd-machined is enabled])
-fi
-AM_CONDITIONAL(ENABLE_MACHINED, [test "$have_machined" = "yes"])
-
-# ------------------------------------------------------------------------------
-have_importd=no
-AC_ARG_ENABLE(importd, AS_HELP_STRING([--disable-importd], [disable import daemon]))
-if test "x$enable_importd" != "xno"; then
- have_importd=yes
-fi
-AM_CONDITIONAL(ENABLE_IMPORTD, [test "$have_importd" = "yes"])
-AS_IF([test "$have_importd" = "yes"], [ AC_DEFINE(HAVE_IMPORTD, [1], [Importd support available]) ])
-
-# ------------------------------------------------------------------------------
-have_hostnamed=no
-AC_ARG_ENABLE(hostnamed, AS_HELP_STRING([--disable-hostnamed], [disable hostname daemon]))
-if test "x$enable_hostnamed" != "xno"; then
- have_hostnamed=yes
-fi
-AM_CONDITIONAL(ENABLE_HOSTNAMED, [test "$have_hostnamed" = "yes"])
-
-# ------------------------------------------------------------------------------
-have_timedated=no
-AC_ARG_ENABLE(timedated, AS_HELP_STRING([--disable-timedated], [disable timedate daemon]))
-if test "x$enable_timedated" != "xno"; then
- have_timedated=yes
-fi
-AM_CONDITIONAL(ENABLE_TIMEDATED, [test "$have_timedated" = "yes"])
-
-# ------------------------------------------------------------------------------
-have_timesyncd=no
-AC_ARG_ENABLE(timesyncd, AS_HELP_STRING([--disable-timesyncd], [disable timesync daemon]))
-if test "x$enable_timesyncd" != "xno"; then
- have_timesyncd=yes
- M4_DEFINES="$M4_DEFINES -DENABLE_TIMESYNCD"
-fi
-AM_CONDITIONAL(ENABLE_TIMESYNCD, [test "$have_timesyncd" = "yes"])
-
-AC_ARG_WITH(ntp-servers,
- AS_HELP_STRING([--with-ntp-servers=NTPSERVERS],
- [space-separated list of default NTP servers]),
- [NTP_SERVERS="$withval"],
- [NTP_SERVERS="time1.google.com time2.google.com time3.google.com time4.google.com"])
-
-AC_DEFINE_UNQUOTED(NTP_SERVERS, ["$NTP_SERVERS"], [Default NTP Servers])
-AC_SUBST(NTP_SERVERS)
-
-AC_ARG_WITH(time-epoch,
- AS_HELP_STRING([--with-time-epoch=SECONDS],
- [time epoch for time clients]),
- [TIME_EPOCH="$withval"],
- [TIME_EPOCH="`stat -c %Y ${srcdir}/NEWS 2>/dev/null || echo 0`"])
-
-AC_DEFINE_UNQUOTED(TIME_EPOCH, [$TIME_EPOCH], [Time Epoch])
-
-# ------------------------------------------------------------------------------
-AC_ARG_WITH(system-uid-max,
- AS_HELP_STRING([--with-system-uid-max=UID]
- [maximum UID for system users]),
- [SYSTEM_UID_MAX="$withval"],
- [SYSTEM_UID_MAX="`awk 'BEGIN { uid=999 } /^\s*SYS_UID_MAX\s+/ { uid=$2 } END { print uid }' /etc/login.defs 2>/dev/null || echo 999`"])
-
-AC_DEFINE_UNQUOTED(SYSTEM_UID_MAX, [$SYSTEM_UID_MAX], [Maximum System UID])
-AC_SUBST(SYSTEM_UID_MAX)
-
-# ------------------------------------------------------------------------------
-AC_ARG_WITH(system-gid-max,
- AS_HELP_STRING([--with-system-gid-max=GID]
- [maximum GID for system groups]),
- [SYSTEM_GID_MAX="$withval"],
- [SYSTEM_GID_MAX="`awk 'BEGIN { gid=999 } /^\s*SYS_GID_MAX\s+/ { gid=$2 } END { print gid }' /etc/login.defs 2>/dev/null || echo 999`"])
-
-AC_DEFINE_UNQUOTED(SYSTEM_GID_MAX, [$SYSTEM_GID_MAX], [Maximum System GID])
-AC_SUBST(SYSTEM_GID_MAX)
-
-# ------------------------------------------------------------------------------
-
-AC_ARG_WITH(dev-kvm-mode,
- AS_HELP_STRING([--with-dev-kvm-mode=MODE],
- [/dev/kvm access mode, defaults to "0660"]),
- [DEV_KVM_MODE="$withval"],
- [DEV_KVM_MODE="0660"])
-
-AC_SUBST(DEV_KVM_MODE, [$DEV_KVM_MODE], [/dev/kvm access mode])
-
-# ------------------------------------------------------------------------------
-have_localed=no
-AC_ARG_ENABLE(localed, AS_HELP_STRING([--disable-localed], [disable locale daemon]))
-if test "x$enable_localed" != "xno"; then
- have_localed=yes
-fi
-AM_CONDITIONAL(ENABLE_LOCALED, [test "$have_localed" = "yes"])
-
-# ------------------------------------------------------------------------------
-have_coredump=no
-AC_ARG_ENABLE(coredump, AS_HELP_STRING([--disable-coredump], [disable coredump hook]))
-if test "x$enable_coredump" != "xno"; then
- have_coredump=yes
- M4_DEFINES="$M4_DEFINES -DENABLE_COREDUMP"
-fi
-AM_CONDITIONAL(ENABLE_COREDUMP, [test "$have_coredump" = "yes"])
-
-# ------------------------------------------------------------------------------
-have_polkit=no
-AC_ARG_ENABLE(polkit, AS_HELP_STRING([--disable-polkit], [disable PolicyKit support]))
-if test "x$enable_polkit" != "xno"; then
- AC_DEFINE(ENABLE_POLKIT, 1, [Define if PolicyKit support is to be enabled])
- have_polkit=yes
-
- # also enable support for *.pkla files on old polkit
- PKG_CHECK_MODULES(POLKIT, [ polkit-gobject-1 < 0.106 ],
- [polkit_pkla=yes],
- [polkit_pkla=no])
-fi
-AM_CONDITIONAL(ENABLE_POLKIT, [test "x$have_polkit" = "xyes"])
-AM_CONDITIONAL(ENABLE_POLKIT_PKLA, [test "x$polkit_pkla" = "xyes"])
-
-# ------------------------------------------------------------------------------
-have_resolved=no
-AC_ARG_ENABLE(resolved, AS_HELP_STRING([--disable-resolved], [disable resolve daemon]))
-AS_IF([test "x$enable_resolved" != "xno"], [
- AC_CHECK_LIB([dl], [dlsym], [true], [AC_MSG_ERROR([*** Dynamic linking loader library not found])])
-
- have_resolved=yes
- M4_DEFINES="$M4_DEFINES -DENABLE_RESOLVED"
- AC_DEFINE(HAVE_RESOLVED, [1], [systemd-resolved is enabled])
-])
-AM_CONDITIONAL(ENABLE_RESOLVED, [test "$have_resolved" = "yes"])
-
-AC_ARG_WITH(dns-servers,
- AS_HELP_STRING([--with-dns-servers=DNSSERVERS],
- [space-separated list of default DNS servers]),
- [DNS_SERVERS="$withval"],
- [DNS_SERVERS="8.8.8.8 8.8.4.4 2001:4860:4860::8888 2001:4860:4860::8844"])
-
-AC_DEFINE_UNQUOTED(DNS_SERVERS, ["$DNS_SERVERS"], [Default DNS Servers])
-AC_SUBST(DNS_SERVERS)
-
-AC_ARG_WITH(default-dnssec,
- AS_HELP_STRING([--with-default-dnssec=MODE],
- [default DNSSEC mode, defaults to "allow-downgrade"]),
- [DEFAULT_DNSSEC_MODE="$withval"],
- [DEFAULT_DNSSEC_MODE="allow-downgrade"])
-
-if test "x$have_gcrypt" = xno -a "x${DEFAULT_DNSSEC_MODE}" != xno ; then
- AC_MSG_WARN(default-dnssec cannot be set to yes or allow-downgrade when gcrypt is disabled. Setting default-dnssec to no.)
- DEFAULT_DNSSEC_MODE="no"
-fi
-
-AS_CASE("x${DEFAULT_DNSSEC_MODE}",
- [xno], [mode=DNSSEC_NO],
- [xyes], [mode=DNSSEC_YES],
- [xallow-downgrade], [mode=DNSSEC_ALLOW_DOWNGRADE],
- AC_MSG_ERROR(Bad DNSSEC mode ${DEFAULT_DNSSEC_MODE}))
-AC_DEFINE_UNQUOTED(DEFAULT_DNSSEC_MODE, [$mode], [Default DNSSEC mode])
-AC_SUBST(DEFAULT_DNSSEC_MODE)
-
-# ------------------------------------------------------------------------------
-have_networkd=no
-AC_ARG_ENABLE(networkd, AS_HELP_STRING([--disable-networkd], [disable networkd]))
-AS_IF([test "x$enable_networkd" != "xno"], [
- AC_DEFINE(ENABLE_NETWORKD, 1, [Define if networkd support is to be enabled])
- have_networkd=yes
- M4_DEFINES="$M4_DEFINES -DENABLE_NETWORKD"
-])
-AM_CONDITIONAL(ENABLE_NETWORKD, [test "x$have_networkd" = "xyes"])
-
-# ------------------------------------------------------------------------------
-have_efi=no
-AC_ARG_ENABLE(efi, AS_HELP_STRING([--disable-efi], [disable systemd-boot and bootctl (EFI support)]))
-if test "x$enable_efi" != "xno"; then
- AC_DEFINE(ENABLE_EFI, 1, [Define if systemd-boot and bootctl are to be enabled])
- have_efi=yes
-fi
-AM_CONDITIONAL(ENABLE_EFI, [test "x$have_efi" = "xyes"])
-
-# ------------------------------------------------------------------------------
-AC_CHECK_TOOL(EFI_CC, gcc)
-
-EFI_ARCH=`echo $host | sed "s/\(-\).*$//"`
-
-AM_COND_IF(ARCH_IA32, [
- EFI_ARCH=ia32
- EFI_MACHINE_TYPE_NAME=ia32])
-
-AM_COND_IF(ARCH_X86_64, [
- EFI_MACHINE_TYPE_NAME=x64])
-
-AM_COND_IF(ARCH_ARM, [
- EFI_MACHINE_TYPE_NAME=arm])
-
-AM_COND_IF(ARCH_AARCH64, [
- EFI_MACHINE_TYPE_NAME=aa64])
-
-AC_SUBST([EFI_ARCH])
-AC_SUBST([EFI_MACHINE_TYPE_NAME])
-
-have_gnuefi=no
-AC_ARG_ENABLE(gnuefi, AS_HELP_STRING([--enable-gnuefi], [enable optional gnuefi support]))
-AS_IF([test "x$enable_gnuefi" != "xno"], [
- AC_ARG_WITH(efi-includedir,
- AS_HELP_STRING([--with-efi-includedir=PATH], [path to EFI include directory]),
- [EFI_INC_DIR="$withval"], [EFI_INC_DIR="/usr/include"]
- )
- AC_SUBST([EFI_INC_DIR])
-
- AC_CHECK_HEADERS(${EFI_INC_DIR}/efi/${EFI_ARCH}/efibind.h,
- [AC_DEFINE(HAVE_GNUEFI, 1, [Define if gnuefi is available])
- have_gnuefi=yes],
- [AS_IF([test "x$enable_gnuefi" = xyes],
- [AC_MSG_ERROR([*** gnuefi support requested but headers not found])])
- ])
-
- efiroot=$(echo $(cd /usr/lib/$(${EFI_CC} -print-multi-os-directory); pwd))
-
- EFI_LIB_DIR="$efiroot"
- AC_ARG_WITH(efi-libdir,
- AS_HELP_STRING([--with-efi-libdir=PATH], [path to EFI lib directory]),
- [EFI_LIB_DIR="$withval"], [EFI_LIB_DIR="$efiroot"]
- )
- AC_SUBST([EFI_LIB_DIR])
-
- have_efi_lds=no
- AC_ARG_WITH(efi-ldsdir,
- AS_HELP_STRING([--with-efi-ldsdir=PATH], [path to EFI lds directory]),
- [EFI_LDS_DIR="$withval" && AS_IF([test -f "${EFI_LDS_DIR}/elf_${EFI_ARCH}_efi.lds"],
- [have_efi_lds=yes])],
- [AS_FOR([DIR], [EFI_LDS_DIR], ["${EFI_LIB_DIR}/gnuefi" "${EFI_LIB_DIR}"],
- [AS_IF([test -f "${EFI_LDS_DIR}/elf_${EFI_ARCH}_efi.lds"],
- [have_efi_lds=yes && break])])])
- AS_IF([test "x$have_efi_lds" = xyes],
- [AC_SUBST([EFI_LDS_DIR])],
- [AS_IF([test "x$enable_gnuefi" = xyes],
- [AC_MSG_ERROR([*** gnuefi support requested but files not found])],
- [have_gnuefi=no])])
-])
-AM_CONDITIONAL(HAVE_GNUEFI, [test "x$have_gnuefi" = xyes])
-
-# ------------------------------------------------------------------------------
-have_tpm=no
-AC_ARG_ENABLE([tpm], AS_HELP_STRING([--enable-tpm], [enable optional TPM support]),
- [case "${enableval}" in
- yes) have_tpm=yes ;;
- no) have_tpm=no ;;
- *) AC_MSG_ERROR(bad value ${enableval} for --enable-tpm) ;;
- esac],
- [have_tpm=no])
-
-if test "x${have_tpm}" != xno ; then
- AC_DEFINE(SD_BOOT_LOG_TPM, 1, [Define if TPM should be used to log events and extend the registers])
-fi
-
-AC_ARG_WITH(tpm-pcrindex,
- AS_HELP_STRING([--with-tpm-pcrindex=<NUM>],
- [TPM PCR register number to use]),
- [SD_TPM_PCR="$withval"],
- [SD_TPM_PCR="8"])
-
-AC_DEFINE_UNQUOTED(SD_TPM_PCR, [$SD_TPM_PCR], [TPM PCR register number to use])
-
-# ------------------------------------------------------------------------------
-AC_ARG_WITH(rc-local-script-path-start,
- AS_HELP_STRING([--with-rc-local-script-path-start=PATH],
- [path to /etc/rc.local]),
- [RC_LOCAL_SCRIPT_PATH_START="$withval"],
- [RC_LOCAL_SCRIPT_PATH_START="/etc/rc.local"])
-
-AC_ARG_WITH(rc-local-script-path-stop,
- AS_HELP_STRING([--with-rc-local-script-path-stop=PATH],
- [path to /usr/sbin/halt.local]),
- [RC_LOCAL_SCRIPT_PATH_STOP="$withval"],
- [RC_LOCAL_SCRIPT_PATH_STOP="/usr/sbin/halt.local"])
-
-AC_DEFINE_UNQUOTED(RC_LOCAL_SCRIPT_PATH_START, ["$RC_LOCAL_SCRIPT_PATH_START"], [Path of /etc/rc.local script])
-AC_DEFINE_UNQUOTED(RC_LOCAL_SCRIPT_PATH_STOP, ["$RC_LOCAL_SCRIPT_PATH_STOP"], [Path of /usr/sbin/halt.local script])
-
-AC_SUBST(RC_LOCAL_SCRIPT_PATH_START)
-AC_SUBST(RC_LOCAL_SCRIPT_PATH_STOP)
-
-# ------------------------------------------------------------------------------
-AC_ARG_WITH(kbd-loadkeys,
- AS_HELP_STRING([--with-kbd-loadkeys=PATH],
- [path to loadkeys]),
- [KBD_LOADKEYS="$withval"],
- [KBD_LOADKEYS="/usr/bin/loadkeys"])
-
-AC_ARG_WITH(kbd-setfont,
- AS_HELP_STRING([--with-kbd-setfont=PATH],
- [path to setfont]),
- [KBD_SETFONT="$withval"],
- [KBD_SETFONT="/usr/bin/setfont"])
-
-AC_DEFINE_UNQUOTED(KBD_LOADKEYS, ["$KBD_LOADKEYS"], [Path of loadkeys])
-AC_DEFINE_UNQUOTED(KBD_SETFONT, ["$KBD_SETFONT"], [Path of setfont])
-
-AC_SUBST(KBD_LOADKEYS)
-AC_SUBST(KBD_SETFONT)
-
-AC_ARG_WITH(telinit,
- AS_HELP_STRING([--with-telinit=PATH],
- [path to telinit]),
- [TELINIT="$withval"],
- [TELINIT="/lib/sysvinit/telinit"])
-
-AC_DEFINE_UNQUOTED(TELINIT, ["$TELINIT"], [Path to telinit])
-
-AC_SUBST(TELINIT)
-
-AC_CHECK_HEADERS_ONCE([valgrind/memcheck.h valgrind/valgrind.h])
-
-# ------------------------------------------------------------------------------
-have_myhostname=no
-AC_ARG_ENABLE(myhostname, AS_HELP_STRING([--disable-myhostname], [disable nss-myhostname support]))
-if test "x$enable_myhostname" != "xno"; then
- AC_HEADER_STDC
- AC_CHECK_HEADERS([arpa/inet.h fcntl.h inttypes.h netdb.h netinet/in.h stdlib.h string.h sys/socket.h sys/time.h unistd.h nss.h sys/ioctl.h sys/auxv.h])
-
- AC_C_CONST
- AC_TYPE_SIZE_T
- AC_HEADER_TIME
-
- AC_FUNC_SELECT_ARGTYPES
- AC_CHECK_FUNCS([gethostbyaddr gethostbyname gettimeofday inet_ntoa memset select socket strcspn strdup strerror strncasecmp strcasecmp strspn])
-
- have_myhostname=yes
- AC_DEFINE(HAVE_MYHOSTNAME, [1], [nss-myhostname is enabled])
-fi
-AM_CONDITIONAL(HAVE_MYHOSTNAME, [test "$have_myhostname" = "yes"])
-
-# ------------------------------------------------------------------------------
-AC_ARG_ENABLE(hwdb, [AS_HELP_STRING([--disable-hwdb], [disable hardware database support])],
- enable_hwdb=$enableval, enable_hwdb=yes)
-AM_CONDITIONAL(ENABLE_HWDB, [test x$enable_hwdb = xyes])
-
-# ------------------------------------------------------------------------------
-have_manpages=no
-AC_ARG_ENABLE(manpages, AS_HELP_STRING([--disable-manpages], [disable manpages]))
-AC_PATH_PROG([XSLTPROC], [xsltproc])
-AS_IF([test "x$enable_manpages" != xno], [
- have_manpages=yes
- AS_IF([test -z "$XSLTPROC"],
- AC_MSG_ERROR([*** xsltproc is required for man pages]))
-])
-AM_CONDITIONAL(ENABLE_MANPAGES, [test "x$have_manpages" = "xyes"])
-
-# ------------------------------------------------------------------------------
-AC_ARG_ENABLE(hibernate,
- [AS_HELP_STRING([--disable-hibernate], [disable hibernation support])],
- enable_hibernate=$enableval, enable_hibernate=yes)
-AM_CONDITIONAL(ENABLE_HIBERNATE, [test x$enable_hibernate = xyes])
-
-# ------------------------------------------------------------------------------
-AC_ARG_ENABLE(ldconfig,
- [AS_HELP_STRING([--disable-ldconfig], [disable ldconfig])],
- enable_ldconfig=$enableval, enable_ldconfig=yes)
-AM_CONDITIONAL(ENABLE_LDCONFIG, [test x$enable_ldconfig = xyes])
-
-# ------------------------------------------------------------------------------
-# Location of the init scripts as mandated by LSB
-SYSTEM_SYSVINIT_PATH=/etc/init.d
-SYSTEM_SYSVRCND_PATH=/etc/rc.d
-
-AC_ARG_WITH([sysvinit-path],
- [AS_HELP_STRING([--with-sysvinit-path=PATH],
- [specify the path to where the SysV init scripts are located])],
- [SYSTEM_SYSVINIT_PATH="$withval"],
- [])
-
-AC_ARG_WITH([sysvrcnd-path],
- [AS_HELP_STRING([--with-sysvrcnd-path=PATH],
- [specify the path to the base directory for the SysV rcN.d directories])],
- [SYSTEM_SYSVRCND_PATH="$withval"],
- [])
-
-if test "x${SYSTEM_SYSVINIT_PATH}" != "x" -a "x${SYSTEM_SYSVRCND_PATH}" != "x"; then
- AC_DEFINE(HAVE_SYSV_COMPAT, [], [SysV init scripts and rcN.d links are supported.])
- SYSTEM_SYSV_COMPAT="yes"
- M4_DEFINES="$M4_DEFINES -DHAVE_SYSV_COMPAT"
-elif test "x${SYSTEM_SYSVINIT_PATH}" != "x" -o "x${SYSTEM_SYSVRCND_PATH}" != "x"; then
- AC_MSG_ERROR([*** You need both --with-sysvinit-path=PATH and --with-sysvrcnd-path=PATH to enable SysV compatibility support, or both empty to disable it.])
-else
- SYSTEM_SYSV_COMPAT="no"
-fi
-
-AC_SUBST(SYSTEM_SYSVINIT_PATH)
-AC_SUBST(SYSTEM_SYSVRCND_PATH)
-AC_SUBST(M4_DEFINES)
-
-AM_CONDITIONAL(HAVE_SYSV_COMPAT, test "$SYSTEM_SYSV_COMPAT" = "yes")
-
-AC_ARG_WITH([tty-gid],
- [AS_HELP_STRING([--with-tty-gid=GID],
- [specify the numeric GID of the 'tty' group])],
- [TTY_GID="$withval"],
- [TTY_GID="5"])
-
-AC_DEFINE_UNQUOTED(TTY_GID, [$TTY_GID], [GID of the 'tty' group])
-AC_SUBST(TTY_GID)
-
-AC_ARG_WITH([dbuspolicydir],
- AS_HELP_STRING([--with-dbuspolicydir=DIR], [D-Bus policy directory]),
- [],
- [with_dbuspolicydir=${datadir}/dbus-1/system.d])
-AX_NORMALIZE_PATH([with_dbuspolicydir])
-
-AC_ARG_WITH([dbussessionservicedir],
- AS_HELP_STRING([--with-dbussessionservicedir=DIR], [D-Bus session service directory]),
- [],
- [with_dbussessionservicedir=${datadir}/dbus-1/services])
-AX_NORMALIZE_PATH([with_dbussessionservicedir])
-
-AC_ARG_WITH([dbussystemservicedir],
- AS_HELP_STRING([--with-dbussystemservicedir=DIR], [D-Bus system service directory]),
- [],
- [with_dbussystemservicedir=${datadir}/dbus-1/system-services])
-AX_NORMALIZE_PATH([with_dbussystemservicedir])
-
-AC_ARG_WITH([bashcompletiondir],
- AS_HELP_STRING([--with-bashcompletiondir=DIR], [bash completions directory]),
- [],
- [AS_IF([$($PKG_CONFIG --exists bash-completion)], [
- with_bashcompletiondir=$($PKG_CONFIG --variable=completionsdir bash-completion)
- ] , [
- with_bashcompletiondir=${datadir}/bash-completion/completions
- ])])
-AM_CONDITIONAL(ENABLE_BASH_COMPLETION, [test "$with_bashcompletiondir" != "no"])
-AX_NORMALIZE_PATH([with_bashcompletiondir])
-
-AC_ARG_WITH([zshcompletiondir],
- AS_HELP_STRING([--with-zshcompletiondir=DIR], [zsh completions directory]),
- [], [with_zshcompletiondir=${datadir}/zsh/site-functions])
-AM_CONDITIONAL(ENABLE_ZSH_COMPLETION, [test "$with_zshcompletiondir" != "no"])
-AX_NORMALIZE_PATH([with_zshcompletiondir])
-
-AC_ARG_WITH([rootprefix],
- AS_HELP_STRING([--with-rootprefix=DIR], [rootfs directory prefix for config files and kernel modules]),
- [], [with_rootprefix=${ac_default_prefix}])
-# --with-rootprefix= (empty) should default to "/" but AX_NORMALIZE_PATH
-# defaults those to ".", solve that here for now until we can find a suitable
-# fix for AX_NORMALIZE_PATH upstream at autoconf-archive.
-# See: https://github.com/systemd/systemd/issues/54
-if test "x${with_rootprefix}" = "x"; then
- with_rootprefix="/"
-fi
-AX_NORMALIZE_PATH([with_rootprefix])
-
-AC_ARG_WITH([rootlibdir],
- AS_HELP_STRING([--with-rootlibdir=DIR], [root directory for libraries necessary for boot]),
- [],
- [with_rootlibdir=${libdir}])
-AX_NORMALIZE_PATH([with_rootlibdir])
-
-AC_ARG_WITH([pamlibdir],
- AS_HELP_STRING([--with-pamlibdir=DIR], [directory for PAM modules]),
- [],
- [with_pamlibdir=${with_rootlibdir}/security])
-AX_NORMALIZE_PATH([with_pamlibdir])
-
-AC_ARG_WITH([pamconfdir],
- AS_HELP_STRING([--with-pamconfdir=DIR], [directory for PAM configuration (pass no to disable installing)]),
- [],
- [with_pamconfdir=${sysconfdir}/pam.d])
-AM_CONDITIONAL(ENABLE_PAM_CONFIG, [test "$with_pamconfdir" != "no"])
-AX_NORMALIZE_PATH([with_pamconfdir])
-
-AC_ARG_WITH([rpmmacrosdir],
- AS_HELP_STRING([--with-rpmmacrosdir=DIR], [directory to store macros for RPM]),
- [], [with_rpmmacrosdir=\${prefix}/lib/rpm/macros.d])
-AM_CONDITIONAL(ENABLE_RPM_MACROS, [test "$with_rpmmacrosdir" != "no"])
-AX_NORMALIZE_PATH([with_rpmmacrosdir])
-
-AC_ARG_ENABLE([split-usr],
- AS_HELP_STRING([--enable-split-usr], [assume that /bin, /sbin aren't symlinks into /usr]),
- [],
- [AS_IF([test "x${ac_default_prefix}" != "x${with_rootprefix}"], [
- enable_split_usr=yes
- ], [
- enable_split_usr=no
- ])])
-
-AS_IF([test "x${enable_split_usr}" = "xyes"], [
- AC_DEFINE(HAVE_SPLIT_USR, 1, [Define if /bin, /sbin aren't symlinks into /usr])
-])
-AM_CONDITIONAL(ENABLE_SPLIT_USR, [test "x${enable_split_usr}" = "xyes"])
-
-# work around intltool-update issues during 'make distcheck'
-AS_IF([test "x$0" != "x./configure"], [
- AC_SUBST([INTLTOOL_UPDATE], [/bin/true])
-])
-
-# QEMU and OVMF UEFI firmware
-AS_IF([test x"$cross_compiling" = "xyes"], [], [
- AC_PATH_PROG([QEMU], [qemu-system-x86_64])
- AC_CHECK_FILE([/usr/share/qemu/bios-ovmf.bin], [QEMU_BIOS=/usr/share/qemu/bios-ovmf.bin],
- [AC_CHECK_FILE([/usr/share/qemu-ovmf/bios.bin], [QEMU_BIOS=/usr/share/qemu-ovmf/bios.bin])])
- AC_SUBST([QEMU_BIOS])
-])
-
-AC_ARG_ENABLE(tests,
- [AS_HELP_STRING([--disable-tests], [disable tests, or enable extra tests with =unsafe])],
- enable_tests=$enableval, enable_tests=yes)
-AM_CONDITIONAL(ENABLE_TESTS, [test x$enable_tests = xyes -o x$enable_tests = xunsafe])
-AM_CONDITIONAL(ENABLE_UNSAFE_TESTS, [test x$enable_tests = xunsafe])
-
-AC_ARG_ENABLE(debug,
- [AS_HELP_STRING([--enable-debug@<:@=LIST@:>@], [enable extra debugging (hashmap,mmap-cache)])],
- [if test "x$enableval" = "xyes"; then
- enableval="hashmap,mmap-cache"
- fi
- saved_ifs="$IFS"
- IFS="$IFS$PATH_SEPARATOR,"
- for name in $enableval; do
- case $name in
- hashmap)
- enable_debug_hashmap=yes
- ;;
- mmap-cache)
- enable_debug_mmap_cache=yes
- ;;
- esac
- done
- IFS="$saved_ifs"],[])
-
-enable_debug=""
-AS_IF([test x$enable_debug_hashmap = xyes], [
- AC_DEFINE(ENABLE_DEBUG_HASHMAP, 1, [Define if hashmap debugging is to be enabled])
- enable_debug="hashmap $enable_debug"
-])
-AS_IF([test x$enable_debug_mmap_cache = xyes], [
- AC_DEFINE(ENABLE_DEBUG_MMAP_CACHE, 1, [Define if mmap cache debugging is to be enabled])
- enable_debug="mmap-cache $enable_debug"
-])
-test -z "$enable_debug" && enable_debug="none"
-
-AC_SUBST([dbuspolicydir], [$with_dbuspolicydir])
-AC_SUBST([dbussessionservicedir], [$with_dbussessionservicedir])
-AC_SUBST([dbussystemservicedir], [$with_dbussystemservicedir])
-AC_SUBST([bashcompletiondir], [$with_bashcompletiondir])
-AC_SUBST([zshcompletiondir], [$with_zshcompletiondir])
-AC_SUBST([pamlibdir], [$with_pamlibdir])
-AC_SUBST([pamconfdir], [$with_pamconfdir])
-AC_SUBST([rpmmacrosdir], [$with_rpmmacrosdir])
-AC_SUBST([rootprefix], [$with_rootprefix])
-AC_SUBST([rootlibdir], [$with_rootlibdir])
-
-AC_CONFIG_FILES([
- Makefile
- po/Makefile.in
-])
-
-AC_OUTPUT
-AC_MSG_RESULT([
- $PACKAGE_NAME $PACKAGE_VERSION
-
- libcryptsetup: ${have_libcryptsetup}
- PAM: ${have_pam}
- AUDIT: ${have_audit}
- IMA: ${have_ima}
- AppArmor: ${have_apparmor}
- SELinux: ${have_selinux}
- SECCOMP: ${have_seccomp}
- SMACK: ${have_smack}
- ZLIB: ${have_zlib}
- XZ: ${have_xz}
- LZ4: ${have_lz4}
- BZIP2: ${have_bzip2}
- ACL: ${have_acl}
- GCRYPT: ${have_gcrypt}
- QRENCODE: ${have_qrencode}
- MICROHTTPD: ${have_microhttpd}
- GNUTLS: ${have_gnutls}
- libcurl: ${have_libcurl}
- libidn2: ${have_libidn2}
- libidn: ${have_libidn}
- IDN: ${have_idn}
- libiptc: ${have_libiptc}
- ELFUTILS: ${have_elfutils}
- binfmt: ${have_binfmt}
- vconsole: ${have_vconsole}
- quotacheck: ${have_quotacheck}
- tmpfiles: ${have_tmpfiles}
- environment.d: ${have_environment_d}
- sysusers: ${have_sysusers}
- firstboot: ${have_firstboot}
- randomseed: ${have_randomseed}
- backlight: ${have_backlight}
- rfkill: ${have_rfkill}
- logind: ${have_logind}
- default cgroup hierarchy: ${DEFAULT_HIERARCHY}
- default KillUserProcesses setting: ${KILL_USER_PROCESSES}
- machined: ${have_machined}
- importd: ${have_importd}
- hostnamed: ${have_hostnamed}
- timedated: ${have_timedated}
- timesyncd: ${have_timesyncd}
- default NTP servers: ${NTP_SERVERS}
- time epoch: ${TIME_EPOCH}
- localed: ${have_localed}
- networkd: ${have_networkd}
- resolved: ${have_resolved}
- default DNS servers: ${DNS_SERVERS}
- default DNSSEC mode: ${DEFAULT_DNSSEC_MODE}
- coredump: ${have_coredump}
- polkit: ${have_polkit} (legacy pkla support: ${polkit_pkla})
- efi: ${have_efi}
- gnuefi: ${have_gnuefi}
- efi arch: ${EFI_ARCH}
- EFI machine type: ${EFI_MACHINE_TYPE_NAME}
- EFI CC ${EFI_CC}
- EFI libdir: ${EFI_LIB_DIR}
- EFI ldsdir: ${EFI_LDS_DIR}
- EFI includedir: ${EFI_INC_DIR}
- kmod: ${have_kmod}
- xkbcommon: ${have_xkbcommon}
- blkid: ${have_blkid}
- libmount: ${have_libmount}
- dbus: ${have_dbus}
- glib: ${have_glib}
- nss-myhostname: ${have_myhostname}
- nss-systemd: ${have_nss_systemd}
- hwdb: ${enable_hwdb}
- tpm: ${have_tpm}
- Python: ${have_python}
- man pages: ${have_manpages}
- test coverage: ${have_coverage}
- Split /usr: ${enable_split_usr}
- SysV compatibility: ${SYSTEM_SYSV_COMPAT}
- utmp/wtmp support: ${have_utmp}
- ldconfig support: ${enable_ldconfig}
- hibernate support: ${enable_hibernate}
- extra debugging: ${enable_debug}
- tests: ${enable_tests}
-
- prefix: ${prefix}
- rootprefix: ${with_rootprefix}
- sysconf dir: ${sysconfdir}
- datarootdir: ${datarootdir}
- includedir: ${includedir}
- lib dir: ${libdir}
- rootlib dir: ${with_rootlibdir}
- SysV init scripts: ${SYSTEM_SYSVINIT_PATH}
- SysV rc?.d directories: ${SYSTEM_SYSVRCND_PATH}
- build Python: ${PYTHON}
- PAM modules dir: ${with_pamlibdir}
- PAM configuration dir: ${with_pamconfdir}
- RPM macros dir: ${with_rpmmacrosdir}
- D-Bus policy dir: ${with_dbuspolicydir}
- D-Bus session dir: ${with_dbussessionservicedir}
- D-Bus system dir: ${with_dbussystemservicedir}
- bash completions dir: ${with_bashcompletiondir}
- zsh completions dir: ${with_zshcompletiondir}
- extra start script: ${RC_LOCAL_SCRIPT_PATH_START}
- extra stop script: ${RC_LOCAL_SCRIPT_PATH_STOP}
- adm group: ${have_adm_group}
- wheel group: ${have_wheel_group}
- debug shell: ${SUSHELL} @ ${DEBUGTTY}
- TTY GID: ${TTY_GID}
- maximum system UID: ${SYSTEM_UID_MAX}
- maximum system GID: ${SYSTEM_GID_MAX}
- /dev/kvm access mode: ${DEV_KVM_MODE}
- certificate root: ${CERTIFICATEROOT}
- support URL: ${SUPPORT_URL}
- nobody user name: ${NOBODY_USER_NAME}
- nobody group name: ${NOBODY_GROUP_NAME}
- fallback hostname: ${FALLBACK_HOSTNAME}
-
- CFLAGS: ${OUR_CFLAGS} ${CFLAGS}
- CPPFLAGS: ${OUR_CPPFLAGS} ${CPPFLAGS}
- LDFLAGS: ${OUR_LDFLAGS} ${LDFLAGS}
-])
diff --git a/docs/.gitignore b/docs/.gitignore
deleted file mode 100644
index 35b5e99aee..0000000000
--- a/docs/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-/html
diff --git a/docs/Makefile b/docs/Makefile
deleted file mode 120000
index bd1047548b..0000000000
--- a/docs/Makefile
+++ /dev/null
@@ -1 +0,0 @@
-../src/Makefile \ No newline at end of file
diff --git a/docs/sysvinit/.gitignore b/docs/sysvinit/.gitignore
deleted file mode 100644
index c3fea7424f..0000000000
--- a/docs/sysvinit/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-/README
diff --git a/docs/sysvinit/Makefile b/docs/sysvinit/Makefile
deleted file mode 120000
index 50be21181f..0000000000
--- a/docs/sysvinit/Makefile
+++ /dev/null
@@ -1 +0,0 @@
-../../src/Makefile \ No newline at end of file
diff --git a/docs/var-log/.gitignore b/docs/var-log/.gitignore
deleted file mode 100644
index c3fea7424f..0000000000
--- a/docs/var-log/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-/README
diff --git a/docs/var-log/Makefile b/docs/var-log/Makefile
deleted file mode 120000
index 50be21181f..0000000000
--- a/docs/var-log/Makefile
+++ /dev/null
@@ -1 +0,0 @@
-../../src/Makefile \ No newline at end of file
diff --git a/hwdb/60-evdev.hwdb b/hwdb/60-evdev.hwdb
index 4f01d88c35..9088f524cf 100644
--- a/hwdb/60-evdev.hwdb
+++ b/hwdb/60-evdev.hwdb
@@ -383,6 +383,17 @@ evdev:name:ETPS/2 Elantech Touchpad:dmi:*svnSAMSUNGELECTRONICSCO.,LTD.:pn870Z5E/
EVDEV_ABS_36=::29
#########################################
+# System76
+#########################################
+
+# GalagoPro 2 (galp2)
+evdev:name:SynPS/2 Synaptics TouchPad:dmi:*svnSystem76:pnGalagoPro:pvrgalp2:*
+ EVDEV_ABS_00=1238:5747:50
+ EVDEV_ABS_01=901:4900:83
+ EVDEV_ABS_35=1238:5747:50
+ EVDEV_ABS_36=901:4900:83
+
+#########################################
# Toshiba
#########################################
diff --git a/hwdb/60-keyboard.hwdb b/hwdb/60-keyboard.hwdb
index 881a531b67..33895ed75e 100644
--- a/hwdb/60-keyboard.hwdb
+++ b/hwdb/60-keyboard.hwdb
@@ -709,6 +709,8 @@ evdev:atkbd:dmi:bvn*:bvr*:bd*:svnIBM*:pn18666TU:pvr*
# IdeaPad
evdev:name:Ideapad extra buttons:dmi:bvn*:bvr*:bd*:svnLENOVO*:pn*
+ KEYBOARD_KEY_0d=rfkill # airplane mode switch (toggle all wireless devices)
+ KEYBOARD_KEY_08=f20 # micmute
KEYBOARD_KEY_42=f23
KEYBOARD_KEY_43=f22
diff --git a/hwdb/60-sensor.hwdb b/hwdb/60-sensor.hwdb
index dab22dc643..ee94de9a85 100644
--- a/hwdb/60-sensor.hwdb
+++ b/hwdb/60-sensor.hwdb
@@ -42,8 +42,20 @@
# Sort by brand, model
#########################################
+# Acer
+#########################################
+sensor:modalias:acpi:BMA250E*:dmi:*:svnAcer:pnIconiaW1-810:*
+ ACCEL_MOUNT_MATRIX=1, 0, 0; 0, -1, 0; 0, 0, 1
+
+#########################################
# AsusTek
#########################################
+sensor:modalias:acpi:INVN6500*:dmi:*svnASUSTeK*:*pnT100CHI*
+ ACCEL_MOUNT_MATRIX=-1, 0, 0; 0, 1, 0; 0, 0, 1
+
+sensor:modalias:acpi:INVN6500*:dmi:*svnASUSTeK*:*pnT100TA*
+ ACCEL_MOUNT_MATRIX=1, 0, 0; 0, -1, 0; 0, 0, 1
+
sensor:modalias:acpi:SMO8500*:dmi:*svn*ASUSTeK*:*pn*TP500LB*
ACCEL_MOUNT_MATRIX=0, 1, 0; 1, 0, 0; 0, 0, 0
@@ -51,18 +63,101 @@ sensor:modalias:acpi:SMO8500*:dmi:*svn*ASUSTeK*:*pn*TP300LJ*
ACCEL_MOUNT_MATRIX=0, -1, 0; -1, 0, 0; 0, 0, 1
#########################################
+# Chuwi
+#########################################
+
+# Chuwi Vi8 Plus
+sensor:modalias:acpi:BOSC0200*:dmi:*:svnHampoo:pnD2D3_Vi8A1:*
+ ACCEL_MOUNT_MATRIX=0, -1, 0; -1, 0, 0; 0, 0, 1
+
+#########################################
+# Cube
+#########################################
+
+# Cube iWork8 Air
+sensor:modalias:acpi:KIOX000A*:dmi:*:svncube:pni1-TF:*
+ ACCEL_MOUNT_MATRIX=1, 0, 0; 0, -1, 0; 0, 0, 1
+
+#########################################
# Endless
#########################################
sensor:modalias:acpi:ACCE0001*:dmi:*svnEndless*:*pnELT-NL3*
ACCEL_MOUNT_MATRIX=0, 1, 0; 0, 0, -1; -1, 0, 0
#########################################
+# GP-electronic
+#########################################
+sensor:modalias:acpi:KIOX000A*:dmi:bvnINSYDECorp.:bvrBYT70A.YNCHENG.WIN.007:*:svnInsyde:pnT701:*
+ ACCEL_MOUNT_MATRIX=0, 1, 0; 1, 0, 0; 0, 0, 1
+
+#########################################
# HP
#########################################
sensor:modalias:platform:lis3lv02d:dmi:*svn*Hewlett-Packard*:*pn*HPEliteBook8540w*
sensor:modalias:platform:lis3lv02d:dmi:*svn*Hewlett-Packard*:*pn*HPEliteBook8560w*
ACCEL_MOUNT_MATRIX=1, 0, 0; 0, 0, -1; 0, 1, 0
+sensor:modalias:acpi:SMO8500*:dmi:*:svnHewlett-Packard:pnHPStream7Tablet:*
+ ACCEL_MOUNT_MATRIX=0, 1, 0; 1, 0, 0; 0, 0, 1
+
+#########################################
+# I.T.Works
+#########################################
+
+# The I.T.Works TW891 2-in-1's DMI has the product-name field set, but not
+# the sys-vendor field. This makes the DMI data a bit generic, so we match
+# the whole dmi modalias, except for the BIOS version/date
+sensor:modalias:acpi:KIOX000A*:dmi:bvnAmericanMegatrendsInc.:*:svnTobefilledbyO.E.M.:pnTW891:pvrTobefilledbyO.E.M.:rvnTobefilledbyO.E.M.:rnTW891:rvr1.0:cvnToBeFilledByO.E.M.:ct3:cvrToBeFilledByO.E.M.:
+ ACCEL_MOUNT_MATRIX=0, 1, 0; 1, 0, 0; 0, 0, 1
+
+#########################################
+# Jumper
+#########################################
+
+# EZpad mini 3
+sensor:modalias:acpi:BOSC0200*:dmi:bvnINSYDECorp.:bvrjumperx.T87.KFBNEE*
+ ACCEL_MOUNT_MATRIX=0, -1, 0; -1, 0, 0; 0, 0, 1
+
+#########################################
+# Lamina
+#########################################
+sensor:modalias:acpi:SMO8500*:dmi:*svnLamina*:*pnT701BR.SE*
+ ACCEL_MOUNT_MATRIX=-1, 0, 0; 0, 1, 0; 0, 0, 1
+
+#########################################
+# Peaq
+#########################################
+sensor:modalias:acpi:SMO8500*:dmi:*:svnPEAQ:pnPEAQPMMC1010MD99187:*
+ ACCEL_MOUNT_MATRIX=-1, 0, 0; 0, 1, 0; 0, 0, 1
+
+#########################################
+# Pipo
+#########################################
+sensor:modalias:acpi:KIOX000A*:dmi:*:svnPIPO:pnW2S:*
+ ACCEL_MOUNT_MATRIX=1, 0, 0; 0, -1, 0; 0, 0, 1
+
+#########################################
+# Ployer
+#########################################
+sensor:modalias:acpi:BMA250E*:dmi:*:svnShenzhenPLOYER*:pnMOMO7W:*
+ ACCEL_MOUNT_MATRIX=0, 1, 0; 1, 0, 0; 0, 0, 1
+
+#########################################
+# Point of View
+#########################################
+
+# The Point of View TAB-P800W does not have its product name filled, so we
+# match the entire dmi-alias, assuming that the use of a BMA250E +
+# bios-version + bios-date combo is unique
+sensor:modalias:acpi:BMA250E*:dmi:bvnAmericanMegatrendsInc.:bvr3BAIR1013:bd08/22/2014:svnTobefilledbyO.E.M.:pnTobefilledbyO.E.M.:pvrTobefilledbyO.E.M.:rvnAMICorporation:rnAptioCRB:rvrTobefilledbyO.E.M.:cvnToBeFilledByO.E.M.:ct3:cvrToBeFilledByO.E.M.:
+ ACCEL_MOUNT_MATRIX=0, 1, 0; 1, 0, 0; 0, 0, 1
+
+#########################################
+# Trekstor
+#########################################
+sensor:modalias:acpi:BMA250*:dmi:*:bvrTREK.G.WI71C.JGBMRBA*:*:svnInsyde:pnST70416-6:*
+ ACCEL_MOUNT_MATRIX=0, 1, 0; 1, 0, 0; 0, 0, 1
+
#########################################
# Winbook
#########################################
diff --git a/hwdb/Makefile b/hwdb/Makefile
deleted file mode 120000
index bd1047548b..0000000000
--- a/hwdb/Makefile
+++ /dev/null
@@ -1 +0,0 @@
-../src/Makefile \ No newline at end of file
diff --git a/hwdb/meson.build b/hwdb/meson.build
index 74a93f9ccb..6fceff2b3b 100644
--- a/hwdb/meson.build
+++ b/hwdb/meson.build
@@ -12,6 +12,7 @@ hwdb_files = files('''
60-evdev.hwdb
60-keyboard.hwdb
60-sensor.hwdb
+ 70-joystick.hwdb
70-mouse.hwdb
70-pointingstick.hwdb
70-touchpad.hwdb
diff --git a/m4/.gitignore b/m4/.gitignore
deleted file mode 100644
index 55eaa803a1..0000000000
--- a/m4/.gitignore
+++ /dev/null
@@ -1,6 +0,0 @@
-intltool.m4
-libtool.m4
-ltoptions.m4
-ltsugar.m4
-ltversion.m4
-lt~obsolete.m4
diff --git a/m4/arch.m4 b/m4/arch.m4
deleted file mode 100644
index f17b4278eb..0000000000
--- a/m4/arch.m4
+++ /dev/null
@@ -1,13 +0,0 @@
-
-dnl SET_ARCH(ARCHNAME, PATTERN)
-dnl
-dnl Define ARCH_<archname> condition if the pattern match with the current
-dnl architecture
-dnl
-AC_DEFUN([SET_ARCH], [
- cpu_$1=false
- case "$host" in
- $2) cpu_$1=true ;;
- esac
- AM_CONDITIONAL(AS_TR_CPP(ARCH_$1), [test "x$cpu_$1" = xtrue])
-])
diff --git a/m4/attributes.m4 b/m4/attributes.m4
deleted file mode 100644
index 51ac88be61..0000000000
--- a/m4/attributes.m4
+++ /dev/null
@@ -1,292 +0,0 @@
-dnl Macros to check the presence of generic (non-typed) symbols.
-dnl Copyright (c) 2006-2008 Diego Pettenò <flameeyes@gmail.com>
-dnl Copyright (c) 2006-2008 xine project
-dnl Copyright (c) 2012 Lucas De Marchi <lucas.de.marchi@gmail.com>
-dnl
-dnl This program is free software; you can redistribute it and/or modify
-dnl it under the terms of the GNU General Public License as published by
-dnl the Free Software Foundation; either version 2, or (at your option)
-dnl any later version.
-dnl
-dnl This program is distributed in the hope that it will be useful,
-dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
-dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-dnl GNU General Public License for more details.
-dnl
-dnl You should have received a copy of the GNU General Public License
-dnl along with this program; if not, write to the Free Software
-dnl Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-dnl 02110-1301, USA.
-dnl
-dnl As a special exception, the copyright owners of the
-dnl macro gives unlimited permission to copy, distribute and modify the
-dnl configure scripts that are the output of Autoconf when processing the
-dnl Macro. You need not follow the terms of the GNU General Public
-dnl License when using or distributing such scripts, even though portions
-dnl of the text of the Macro appear in them. The GNU General Public
-dnl License (GPL) does govern all other use of the material that
-dnl constitutes the Autoconf Macro.
-dnl
-dnl This special exception to the GPL applies to versions of the
-dnl Autoconf Macro released by this project. When you make and
-dnl distribute a modified version of the Autoconf Macro, you may extend
-dnl this special exception to the GPL to apply to your modified version as
-dnl well.
-
-dnl Check if FLAG in ENV-VAR is supported by compiler and append it
-dnl to WHERE-TO-APPEND variable. Note that we invert -Wno-* checks to
-dnl -W* as gcc cannot test for negated warnings. If a C snippet is passed,
-dnl use it, otherwise use a simple main() definition that just returns 0.
-dnl CC_CHECK_FLAG_APPEND([WHERE-TO-APPEND], [ENV-VAR], [FLAG], [C-SNIPPET])
-
-AC_DEFUN([CC_CHECK_FLAG_APPEND], [
- AC_CACHE_CHECK([if $CC supports flag $3 in envvar $2],
- AS_TR_SH([cc_cv_$2_$3]),
- [eval "AS_TR_SH([cc_save_$2])='${$2}'"
- eval "AS_TR_SH([$2])='${cc_save_$2} -Werror `echo "$3" | sed 's/^-Wno-/-W/'`'"
- AC_LINK_IFELSE([AC_LANG_SOURCE(ifelse([$4], [],
- [int main(void) { return 0; } ],
- [$4]))],
- [eval "AS_TR_SH([cc_cv_$2_$3])='yes'"],
- [eval "AS_TR_SH([cc_cv_$2_$3])='no'"])
- eval "AS_TR_SH([$2])='$cc_save_$2'"])
-
- AS_IF([eval test x$]AS_TR_SH([cc_cv_$2_$3])[ = xyes],
- [eval "$1='${$1} $3'"])
-])
-
-dnl CC_CHECK_FLAGS_APPEND([WHERE-TO-APPEND], [ENV-VAR], [FLAG1 FLAG2], [C-SNIPPET])
-AC_DEFUN([CC_CHECK_FLAGS_APPEND], [
- for flag in [$3]; do
- CC_CHECK_FLAG_APPEND([$1], [$2], $flag, [$4])
- done
-])
-
-dnl Check if the flag is supported by linker (cacheable)
-dnl CC_CHECK_LDFLAGS([FLAG], [ACTION-IF-FOUND],[ACTION-IF-NOT-FOUND])
-
-AC_DEFUN([CC_CHECK_LDFLAGS], [
- AC_CACHE_CHECK([if $CC supports $1 flag],
- AS_TR_SH([cc_cv_ldflags_$1]),
- [ac_save_LDFLAGS="$LDFLAGS"
- LDFLAGS="$LDFLAGS $1"
- AC_LINK_IFELSE([int main() { return 1; }],
- [eval "AS_TR_SH([cc_cv_ldflags_$1])='yes'"],
- [eval "AS_TR_SH([cc_cv_ldflags_$1])="])
- LDFLAGS="$ac_save_LDFLAGS"
- ])
-
- AS_IF([eval test x$]AS_TR_SH([cc_cv_ldflags_$1])[ = xyes],
- [$2], [$3])
-])
-
-dnl define the LDFLAGS_NOUNDEFINED variable with the correct value for
-dnl the current linker to avoid undefined references in a shared object.
-AC_DEFUN([CC_NOUNDEFINED], [
- dnl We check $host for which systems to enable this for.
- AC_REQUIRE([AC_CANONICAL_HOST])
-
- case $host in
- dnl FreeBSD (et al.) does not complete linking for shared objects when pthreads
- dnl are requested, as different implementations are present; to avoid problems
- dnl use -Wl,-z,defs only for those platform not behaving this way.
- *-freebsd* | *-openbsd*) ;;
- *)
- dnl First of all check for the --no-undefined variant of GNU ld. This allows
- dnl for a much more readable command line, so that people can understand what
- dnl it does without going to look for what the heck -z defs does.
- for possible_flags in "-Wl,--no-undefined" "-Wl,-z,defs"; do
- CC_CHECK_LDFLAGS([$possible_flags], [LDFLAGS_NOUNDEFINED="$possible_flags"])
- break
- done
- ;;
- esac
-
- AC_SUBST([LDFLAGS_NOUNDEFINED])
-])
-
-dnl Check for a -Werror flag or equivalent. -Werror is the GCC
-dnl and ICC flag that tells the compiler to treat all the warnings
-dnl as fatal. We usually need this option to make sure that some
-dnl constructs (like attributes) are not simply ignored.
-dnl
-dnl Other compilers don't support -Werror per se, but they support
-dnl an equivalent flag:
-dnl - Sun Studio compiler supports -errwarn=%all
-AC_DEFUN([CC_CHECK_WERROR], [
- AC_CACHE_CHECK(
- [for $CC way to treat warnings as errors],
- [cc_cv_werror],
- [CC_CHECK_CFLAGS_SILENT([-Werror], [cc_cv_werror=-Werror],
- [CC_CHECK_CFLAGS_SILENT([-errwarn=%all], [cc_cv_werror=-errwarn=%all])])
- ])
-])
-
-AC_DEFUN([CC_CHECK_ATTRIBUTE], [
- AC_REQUIRE([CC_CHECK_WERROR])
- AC_CACHE_CHECK([if $CC supports __attribute__(( ifelse([$2], , [$1], [$2]) ))],
- AS_TR_SH([cc_cv_attribute_$1]),
- [ac_save_CFLAGS="$CFLAGS"
- CFLAGS="$CFLAGS $cc_cv_werror"
- AC_COMPILE_IFELSE([AC_LANG_SOURCE([$3])],
- [eval "AS_TR_SH([cc_cv_attribute_$1])='yes'"],
- [eval "AS_TR_SH([cc_cv_attribute_$1])='no'"])
- CFLAGS="$ac_save_CFLAGS"
- ])
-
- AS_IF([eval test x$]AS_TR_SH([cc_cv_attribute_$1])[ = xyes],
- [AC_DEFINE(
- AS_TR_CPP([SUPPORT_ATTRIBUTE_$1]), 1,
- [Define this if the compiler supports __attribute__(( ifelse([$2], , [$1], [$2]) ))]
- )
- $4],
- [$5])
-])
-
-AC_DEFUN([CC_ATTRIBUTE_CONSTRUCTOR], [
- CC_CHECK_ATTRIBUTE(
- [constructor],,
- [void __attribute__((constructor)) ctor() { int a; }],
- [$1], [$2])
-])
-
-AC_DEFUN([CC_ATTRIBUTE_FORMAT], [
- CC_CHECK_ATTRIBUTE(
- [format], [format(printf, n, n)],
- [void __attribute__((format(printf, 1, 2))) printflike(const char *fmt, ...) { fmt = (void *)0; }],
- [$1], [$2])
-])
-
-AC_DEFUN([CC_ATTRIBUTE_FORMAT_ARG], [
- CC_CHECK_ATTRIBUTE(
- [format_arg], [format_arg(printf)],
- [char *__attribute__((format_arg(1))) gettextlike(const char *fmt) { fmt = (void *)0; }],
- [$1], [$2])
-])
-
-AC_DEFUN([CC_ATTRIBUTE_VISIBILITY], [
- CC_CHECK_ATTRIBUTE(
- [visibility_$1], [visibility("$1")],
- [void __attribute__((visibility("$1"))) $1_function() { }],
- [$2], [$3])
-])
-
-AC_DEFUN([CC_ATTRIBUTE_NONNULL], [
- CC_CHECK_ATTRIBUTE(
- [nonnull], [nonnull()],
- [void __attribute__((nonnull())) some_function(void *foo, void *bar) { foo = (void*)0; bar = (void*)0; }],
- [$1], [$2])
-])
-
-AC_DEFUN([CC_ATTRIBUTE_UNUSED], [
- CC_CHECK_ATTRIBUTE(
- [unused], ,
- [void some_function(void *foo, __attribute__((unused)) void *bar);],
- [$1], [$2])
-])
-
-AC_DEFUN([CC_ATTRIBUTE_SENTINEL], [
- CC_CHECK_ATTRIBUTE(
- [sentinel], ,
- [void some_function(void *foo, ...) __attribute__((sentinel));],
- [$1], [$2])
-])
-
-AC_DEFUN([CC_ATTRIBUTE_DEPRECATED], [
- CC_CHECK_ATTRIBUTE(
- [deprecated], ,
- [void some_function(void *foo, ...) __attribute__((deprecated));],
- [$1], [$2])
-])
-
-AC_DEFUN([CC_ATTRIBUTE_ALIAS], [
- CC_CHECK_ATTRIBUTE(
- [alias], [weak, alias],
- [void other_function(void *foo) { }
- void some_function(void *foo) __attribute__((weak, alias("other_function")));],
- [$1], [$2])
-])
-
-AC_DEFUN([CC_ATTRIBUTE_MALLOC], [
- CC_CHECK_ATTRIBUTE(
- [malloc], ,
- [void * __attribute__((malloc)) my_alloc(int n);],
- [$1], [$2])
-])
-
-AC_DEFUN([CC_ATTRIBUTE_PACKED], [
- CC_CHECK_ATTRIBUTE(
- [packed], ,
- [struct astructure { char a; int b; long c; void *d; } __attribute__((packed));],
- [$1], [$2])
-])
-
-AC_DEFUN([CC_ATTRIBUTE_CONST], [
- CC_CHECK_ATTRIBUTE(
- [const], ,
- [int __attribute__((const)) twopow(int n) { return 1 << n; } ],
- [$1], [$2])
-])
-
-AC_DEFUN([CC_FLAG_VISIBILITY], [
- AC_REQUIRE([CC_CHECK_WERROR])
- AC_CACHE_CHECK([if $CC supports -fvisibility=hidden],
- [cc_cv_flag_visibility],
- [cc_flag_visibility_save_CFLAGS="$CFLAGS"
- CFLAGS="$CFLAGS $cc_cv_werror"
- CC_CHECK_CFLAGS_SILENT([-fvisibility=hidden],
- cc_cv_flag_visibility='yes',
- cc_cv_flag_visibility='no')
- CFLAGS="$cc_flag_visibility_save_CFLAGS"])
-
- AS_IF([test "x$cc_cv_flag_visibility" = "xyes"],
- [AC_DEFINE([SUPPORT_FLAG_VISIBILITY], 1,
- [Define this if the compiler supports the -fvisibility flag])
- $1],
- [$2])
-])
-
-AC_DEFUN([CC_FUNC_EXPECT], [
- AC_REQUIRE([CC_CHECK_WERROR])
- AC_CACHE_CHECK([if compiler has __builtin_expect function],
- [cc_cv_func_expect],
- [ac_save_CFLAGS="$CFLAGS"
- CFLAGS="$CFLAGS $cc_cv_werror"
- AC_COMPILE_IFELSE([AC_LANG_SOURCE(
- [int some_function() {
- int a = 3;
- return (int)__builtin_expect(a, 3);
- }])],
- [cc_cv_func_expect=yes],
- [cc_cv_func_expect=no])
- CFLAGS="$ac_save_CFLAGS"
- ])
-
- AS_IF([test "x$cc_cv_func_expect" = "xyes"],
- [AC_DEFINE([SUPPORT__BUILTIN_EXPECT], 1,
- [Define this if the compiler supports __builtin_expect() function])
- $1],
- [$2])
-])
-
-AC_DEFUN([CC_ATTRIBUTE_ALIGNED], [
- AC_REQUIRE([CC_CHECK_WERROR])
- AC_CACHE_CHECK([highest __attribute__ ((aligned ())) supported],
- [cc_cv_attribute_aligned],
- [ac_save_CFLAGS="$CFLAGS"
- CFLAGS="$CFLAGS $cc_cv_werror"
- for cc_attribute_align_try in 64 32 16 8 4 2; do
- AC_COMPILE_IFELSE([AC_LANG_SOURCE([
- int main() {
- static char c __attribute__ ((aligned($cc_attribute_align_try))) = 0;
- return c;
- }])], [cc_cv_attribute_aligned=$cc_attribute_align_try; break])
- done
- CFLAGS="$ac_save_CFLAGS"
- ])
-
- if test "x$cc_cv_attribute_aligned" != "x"; then
- AC_DEFINE_UNQUOTED([ATTRIBUTE_ALIGNED_MAX], [$cc_cv_attribute_aligned],
- [Define the highest alignment supported])
- fi
-])
diff --git a/m4/ax_compiler_vendor.m4 b/m4/ax_compiler_vendor.m4
deleted file mode 100644
index 39ca3c0f33..0000000000
--- a/m4/ax_compiler_vendor.m4
+++ /dev/null
@@ -1,87 +0,0 @@
-# ===========================================================================
-# http://www.gnu.org/software/autoconf-archive/ax_compiler_vendor.html
-# ===========================================================================
-#
-# SYNOPSIS
-#
-# AX_COMPILER_VENDOR
-#
-# DESCRIPTION
-#
-# Determine the vendor of the C/C++ compiler, e.g., gnu, intel, ibm, sun,
-# hp, borland, comeau, dec, cray, kai, lcc, metrowerks, sgi, microsoft,
-# watcom, etc. The vendor is returned in the cache variable
-# $ax_cv_c_compiler_vendor for C and $ax_cv_cxx_compiler_vendor for C++.
-#
-# LICENSE
-#
-# Copyright (c) 2008 Steven G. Johnson <stevenj@alum.mit.edu>
-# Copyright (c) 2008 Matteo Frigo
-#
-# This program is free software: you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the
-# Free Software Foundation, either version 3 of the License, or (at your
-# option) any later version.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
-# Public License for more details.
-#
-# You should have received a copy of the GNU General Public License along
-# with this program. If not, see <http://www.gnu.org/licenses/>.
-#
-# As a special exception, the respective Autoconf Macro's copyright owner
-# gives unlimited permission to copy, distribute and modify the configure
-# scripts that are the output of Autoconf when processing the Macro. You
-# need not follow the terms of the GNU General Public License when using
-# or distributing such scripts, even though portions of the text of the
-# Macro appear in them. The GNU General Public License (GPL) does govern
-# all other use of the material that constitutes the Autoconf Macro.
-#
-# This special exception to the GPL applies to versions of the Autoconf
-# Macro released by the Autoconf Archive. When you make and distribute a
-# modified version of the Autoconf Macro, you may extend this special
-# exception to the GPL to apply to your modified version as well.
-
-#serial 15
-
-AC_DEFUN([AX_COMPILER_VENDOR],
-[AC_CACHE_CHECK([for _AC_LANG compiler vendor], ax_cv_[]_AC_LANG_ABBREV[]_compiler_vendor,
- dnl Please add if possible support to ax_compiler_version.m4
- [# note: don't check for gcc first since some other compilers define __GNUC__
- vendors="intel: __ICC,__ECC,__INTEL_COMPILER
- ibm: __xlc__,__xlC__,__IBMC__,__IBMCPP__
- pathscale: __PATHCC__,__PATHSCALE__
- clang: __clang__
- cray: _CRAYC
- fujitsu: __FUJITSU
- gnu: __GNUC__
- sun: __SUNPRO_C,__SUNPRO_CC
- hp: __HP_cc,__HP_aCC
- dec: __DECC,__DECCXX,__DECC_VER,__DECCXX_VER
- borland: __BORLANDC__,__CODEGEARC__,__TURBOC__
- comeau: __COMO__
- kai: __KCC
- lcc: __LCC__
- sgi: __sgi,sgi
- microsoft: _MSC_VER
- metrowerks: __MWERKS__
- watcom: __WATCOMC__
- portland: __PGI
- tcc: __TINYC__
- unknown: UNKNOWN"
- for ventest in $vendors; do
- case $ventest in
- *:) vendor=$ventest; continue ;;
- *) vencpp="defined("`echo $ventest | sed 's/,/) || defined(/g'`")" ;;
- esac
- AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[
- #if !($vencpp)
- thisisanerror;
- #endif
- ])], [break])
- done
- ax_cv_[]_AC_LANG_ABBREV[]_compiler_vendor=`echo $vendor | cut -d: -f1`
- ])
-])
diff --git a/m4/ax_normalize_path.m4 b/m4/ax_normalize_path.m4
deleted file mode 100644
index e8f9973e35..0000000000
--- a/m4/ax_normalize_path.m4
+++ /dev/null
@@ -1,115 +0,0 @@
-# ===========================================================================
-# http://www.gnu.org/software/autoconf-archive/ax_normalize_path.html
-# ===========================================================================
-#
-# SYNOPSIS
-#
-# AX_NORMALIZE_PATH(VARNAME, [REFERENCE_STRING])
-#
-# DESCRIPTION
-#
-# Perform some cleanups on the value of $VARNAME (interpreted as a path):
-#
-# - empty paths are changed to '.'
-# - trailing slashes are removed
-# - repeated slashes are squeezed except a leading doubled slash '//'
-# (which might indicate a networked disk on some OS).
-#
-# REFERENCE_STRING is used to turn '/' into '\' and vice-versa: if
-# REFERENCE_STRING contains some backslashes, all slashes and backslashes
-# are turned into backslashes, otherwise they are all turned into slashes.
-#
-# This makes processing of DOS filenames quite easier, because you can
-# turn a filename to the Unix notation, make your processing, and turn it
-# back to original notation.
-#
-# filename='A:\FOO\\BAR\'
-# old_filename="$filename"
-# # Switch to the unix notation
-# AX_NORMALIZE_PATH([filename], ["/"])
-# # now we have $filename = 'A:/FOO/BAR' and we can process it as if
-# # it was a Unix path. For instance let's say that you want
-# # to append '/subpath':
-# filename="$filename/subpath"
-# # finally switch back to the original notation
-# AX_NORMALIZE_PATH([filename], ["$old_filename"])
-# # now $filename equals to 'A:\FOO\BAR\subpath'
-#
-# One good reason to make all path processing with the unix convention is
-# that backslashes have a special meaning in many cases. For instance
-#
-# expr 'A:\FOO' : 'A:\Foo'
-#
-# will return 0 because the second argument is a regex in which
-# backslashes have to be backslashed. In other words, to have the two
-# strings to match you should write this instead:
-#
-# expr 'A:\Foo' : 'A:\\Foo'
-#
-# Such behavior makes DOS filenames extremely unpleasant to work with. So
-# temporary turn your paths to the Unix notation, and revert them to the
-# original notation after the processing. See the macro
-# AX_COMPUTE_RELATIVE_PATHS for a concrete example of this.
-#
-# REFERENCE_STRING defaults to $VARIABLE, this means that slashes will be
-# converted to backslashes if $VARIABLE already contains some backslashes
-# (see $thirddir below).
-#
-# firstdir='/usr/local//share'
-# seconddir='C:\Program Files\\'
-# thirddir='C:\home/usr/'
-# AX_NORMALIZE_PATH([firstdir])
-# AX_NORMALIZE_PATH([seconddir])
-# AX_NORMALIZE_PATH([thirddir])
-# # $firstdir = '/usr/local/share'
-# # $seconddir = 'C:\Program Files'
-# # $thirddir = 'C:\home\usr'
-#
-# LICENSE
-#
-# Copyright (c) 2008 Alexandre Duret-Lutz <adl@gnu.org>
-#
-# This program is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the
-# Free Software Foundation; either version 2 of the License, or (at your
-# option) any later version.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
-# Public License for more details.
-#
-# You should have received a copy of the GNU General Public License along
-# with this program. If not, see <http://www.gnu.org/licenses/>.
-#
-# As a special exception, the respective Autoconf Macro's copyright owner
-# gives unlimited permission to copy, distribute and modify the configure
-# scripts that are the output of Autoconf when processing the Macro. You
-# need not follow the terms of the GNU General Public License when using
-# or distributing such scripts, even though portions of the text of the
-# Macro appear in them. The GNU General Public License (GPL) does govern
-# all other use of the material that constitutes the Autoconf Macro.
-#
-# This special exception to the GPL applies to versions of the Autoconf
-# Macro released by the Autoconf Archive. When you make and distribute a
-# modified version of the Autoconf Macro, you may extend this special
-# exception to the GPL to apply to your modified version as well.
-
-#serial 5
-
-AU_ALIAS([ADL_NORMALIZE_PATH], [AX_NORMALIZE_PATH])
-AC_DEFUN([AX_NORMALIZE_PATH],
-[case ":[$]$1:" in
-# change empty paths to '.'
- ::) $1='.' ;;
-# strip trailing slashes
- :*[[\\/]]:) $1=`echo "[$]$1" | sed 's,[[\\/]]*[$],,'` ;;
- :*:) ;;
-esac
-# squeze repeated slashes
-case ifelse($2,,"[$]$1",$2) in
-# if the path contains any backslashes, turn slashes into backslashes
- *\\*) $1=`echo "[$]$1" | sed 's,\(.\)[[\\/]][[\\/]]*,\1\\\\,g'` ;;
-# if the path contains slashes, also turn backslashes into slashes
- *) $1=`echo "[$]$1" | sed 's,\(.\)[[\\/]][[\\/]]*,\1/,g'` ;;
-esac])
diff --git a/man/.gitignore b/man/.gitignore
deleted file mode 100644
index d928e5a83f..0000000000
--- a/man/.gitignore
+++ /dev/null
@@ -1,5 +0,0 @@
-/systemd.directives.xml
-/systemd.index.xml
-/*.[13578]
-/*.html
-/custom-entities.ent
diff --git a/man/Makefile b/man/Makefile
deleted file mode 120000
index bd1047548b..0000000000
--- a/man/Makefile
+++ /dev/null
@@ -1 +0,0 @@
-../src/Makefile \ No newline at end of file
diff --git a/man/crypttab.xml b/man/crypttab.xml
index 17976f3704..49896a45ba 100644
--- a/man/crypttab.xml
+++ b/man/crypttab.xml
@@ -70,7 +70,10 @@
<para>Empty lines and lines starting with the <literal>#</literal>
character are ignored. Each of the remaining lines describes one
encrypted block device, fields on the line are delimited by white
- space. The first two fields are mandatory, the remaining two are
+ space.</para>
+
+ <para>Each line is in the form<programlisting><replaceable>name</replaceable> <replaceable>encrypted-device</replaceable> <replaceable>password</replaceable> <replaceable>options</replaceable></programlisting>
+ The first two fields are mandatory, the remaining two are
optional.</para>
<para>Setting up encrypted block devices using this file supports
diff --git a/man/journald.conf.xml b/man/journald.conf.xml
index 209d857234..e4dc5862d9 100644
--- a/man/journald.conf.xml
+++ b/man/journald.conf.xml
@@ -358,6 +358,14 @@
</varlistentry>
<varlistentry>
+ <term><varname>ReadKMsg=</varname></term>
+
+ <listitem><para>Takes a boolean value. If enabled (the
+ default), journal reads <filename>/dev/kmsg</filename>
+ messages generated by the kernel.</para></listitem>
+ </varlistentry>
+
+ <varlistentry>
<term><varname>TTYPath=</varname></term>
<listitem><para>Change the console TTY to use if
diff --git a/man/meson.build b/man/meson.build
index 4f2ddad31a..a93693c43c 100644
--- a/man/meson.build
+++ b/man/meson.build
@@ -198,7 +198,7 @@ if git.found()
# and https://github.com/mesonbuild/meson/issues/1512
command : ['sh', '-c',
'cd @0@ && '.format(meson.build_root()) +
- 'python3 @0@/tools/make-man-rules.py --meson `git ls-files ":/man/*.xml"` >t && '.format(meson.source_root()) +
+ 'python3 @0@/tools/make-man-rules.py `git ls-files ":/man/*.xml"` >t && '.format(meson.source_root()) +
'mv t @0@/rules/meson.build'.format(meson.current_source_dir())],
depend_files : custom_entities_ent)
endif
diff --git a/man/sd_bus_negotiate_fds.xml b/man/sd_bus_negotiate_fds.xml
index 1501e1427d..e91269ba31 100644
--- a/man/sd_bus_negotiate_fds.xml
+++ b/man/sd_bus_negotiate_fds.xml
@@ -93,12 +93,6 @@
default, file descriptor passing is negotiated for all
connections.</para>
- <para>Note that when bus activation is used, it is highly
- recommended to set the <option>AcceptFileDescriptors=</option>
- setting in the <filename>.busname</filename> unit file to the same
- setting as negotiated by the program ultimately activated. By
- default, file descriptor passing is enabled for both.</para>
-
<para><function>sd_bus_negotiate_timestamp()</function> controls whether implicit sender
timestamps shall be attached automatically to all incoming messages. Takes a bus object and a
boolean, which, when true, enables timestamping, and, when false, disables it. Use
@@ -178,8 +172,7 @@
<citerefentry><refentrytitle>sd_bus_message_get_monotonic_usec</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_bus_message_get_realtime_usec</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_bus_message_get_seqnum</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
- <citerefentry><refentrytitle>sd_bus_message_get_creds</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
- <citerefentry><refentrytitle>systemd.busname</refentrytitle><manvolnum>5</manvolnum></citerefentry>
+ <citerefentry><refentrytitle>sd_bus_message_get_creds</refentrytitle><manvolnum>3</manvolnum></citerefentry>
</para>
</refsect1>
diff --git a/man/systemd-resolved.service.xml b/man/systemd-resolved.service.xml
index f6831848c7..f452806dd3 100644
--- a/man/systemd-resolved.service.xml
+++ b/man/systemd-resolved.service.xml
@@ -138,7 +138,7 @@
LLMNR.</para></listitem>
<listitem><para>Multi-label names are routed to all local
- interfaces that have a DNS sever configured, plus the globally
+ interfaces that have a DNS server configured, plus the globally
configured DNS server if there is one. Address lookups from the
link-local address range are never routed to
DNS.</para></listitem>
diff --git a/man/systemd.exec.xml b/man/systemd.exec.xml
index d28de2d0f2..b074331dd5 100644
--- a/man/systemd.exec.xml
+++ b/man/systemd.exec.xml
@@ -1619,7 +1619,7 @@
any combination of: <constant>cgroup</constant>, <constant>ipc</constant>, <constant>net</constant>,
<constant>mnt</constant>, <constant>pid</constant>, <constant>user</constant> and <constant>uts</constant>. Any
namespace type listed is made accessible to the unit's processes, access to namespace types not listed is
- prohibited (whitelisting). By prepending the list with a single tilda character (<literal>~</literal>) the
+ prohibited (whitelisting). By prepending the list with a single tilde character (<literal>~</literal>) the
effect may be inverted: only the listed namespace types will be made inaccessible, all unlisted ones are
permitted (blacklisting). If the empty string is assigned, the default namespace restrictions are applied,
which is equivalent to false. Internally, this setting limits access to the
@@ -1654,35 +1654,77 @@
<varlistentry>
<term><varname>RuntimeDirectory=</varname></term>
- <listitem><para>Takes a list of directory names. If set, one
- or more directories by the specified names will be created
- below <filename>/run</filename> (for system services) or below
- <varname>$XDG_RUNTIME_DIR</varname> (for user services) when
- the unit is started, and removed when the unit is stopped. The
- directories will have the access mode specified in
- <varname>RuntimeDirectoryMode=</varname>, and will be owned by
- the user and group specified in <varname>User=</varname> and
- <varname>Group=</varname>. Use this to manage one or more
- runtime directories of the unit and bind their lifetime to the
- daemon runtime. The specified directory names must be
- relative, and may not include a <literal>/</literal>, i.e.
- must refer to simple directories to create or remove. This is
- particularly useful for unprivileged daemons that cannot
- create runtime directories in <filename>/run</filename> due to
- lack of privileges, and to make sure the runtime directory is
- cleaned up automatically after use. For runtime directories
- that require more complex or different configuration or
- lifetime guarantees, please consider using
- <citerefentry><refentrytitle>tmpfiles.d</refentrytitle><manvolnum>5</manvolnum></citerefentry>.</para></listitem>
+ <listitem><para>Takes a whitespace-separated list of directory names. The specified directory names must be
+ relative, and may not include <literal>.</literal> or <literal>..</literal>. If set, one or more directories
+ including their parents by the specified names will be created below <filename>/run</filename> (for system
+ services) or below <varname>$XDG_RUNTIME_DIR</varname> (for user services) when the unit is started. The
+ lowest subdirectories are removed when the unit is stopped. It is possible to preserve the directories if
+ <varname>RuntimeDirectoryPreserve=</varname> is configured to <option>restart</option> or <option>yes</option>.
+ The lowest subdirectories will have the access mode specified in <varname>RuntimeDirectoryMode=</varname>,
+ and be owned by the user and group specified in <varname>User=</varname> and <varname>Group=</varname>.
+ This implies <varname>ReadWritePaths=</varname>, that is, the directories specified
+ in this option are accessible with the access mode specified in <varname>RuntimeDirectoryMode=</varname>
+ even if <varname>ProtectSystem=</varname> is set to <option>strict</option>.
+ Use this to manage one or more runtime directories of the unit and bind their
+ lifetime to the daemon runtime. This is particularly useful for unprivileged daemons that cannot create
+ runtime directories in <filename>/run</filename> due to lack of privileges, and to make sure the runtime
+ directory is cleaned up automatically after use. For runtime directories that require more complex or
+ different configuration or lifetime guarantees, please consider using
+ <citerefentry><refentrytitle>tmpfiles.d</refentrytitle><manvolnum>5</manvolnum></citerefentry>.</para>
+
+ <para>Example: if a system service unit has the following,
+ <programlisting>RuntimeDirectory=foo/bar baz</programlisting>
+ the service manager creates <filename>/run/foo</filename> (if it does not exist), <filename>/run/foo/bar</filename>,
+ and <filename>/run/baz</filename>. The directories <filename>/run/foo/bar</filename> and <filename>/run/baz</filename>
+ except <filename>/run/foo</filename> are owned by the user and group specified in <varname>User=</varname> and
+ <varname>Group=</varname>, and removed when the service is stopped.
+ </para></listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><varname>StateDirectory=</varname></term>
+ <term><varname>CacheDirectory=</varname></term>
+ <term><varname>LogsDirectory=</varname></term>
+ <term><varname>ConfigurationDirectory=</varname></term>
+
+ <listitem><para>Takes a whitespace-separated list of directory names. If set, as similar to
+ <varname>RuntimeDirectory=</varname>, one or more directories including their parents by the specified names
+ will be created below <filename>/var/lib</filename>, <filename>/var/cache</filename>, <filename>/var/log</filename>,
+ or <filename>/etc</filename>, respectively, when the unit is started.
+ Unlike <varname>RuntimeDirectory=</varname>, the directories are not removed when the unit is stopped.
+ The lowest subdirectories will be owned by the user and group specified in <varname>User=</varname>
+ and <varname>Group=</varname>. The options imply <varname>ReadWritePaths=</varname>.
+ </para></listitem>
</varlistentry>
<varlistentry>
<term><varname>RuntimeDirectoryMode=</varname></term>
+ <term><varname>StateDirectoryMode=</varname></term>
+ <term><varname>CacheDirectoryMode=</varname></term>
+ <term><varname>LogsDirectoryMode=</varname></term>
+ <term><varname>ConfigurationDirectoryMode=</varname></term>
<listitem><para>Specifies the access mode of the directories specified in
- <varname>RuntimeDirectory=</varname> as an octal number. Defaults to
- <constant>0755</constant>. See "Permissions" in
- <citerefentry project='man-pages'><refentrytitle>path_resolution</refentrytitle><manvolnum>7</manvolnum></citerefentry> for a discussion of the meaning of permission bits.
+ <varname>RuntimeDirectory=</varname>, <varname>StateDirectory=</varname>, <varname>CacheDirectory=</varname>,
+ <varname>LogsDirectory=</varname>, or <varname>ConfigurationDirectory=</varname>, respectively, as an octal number.
+ Defaults to <constant>0755</constant>. See "Permissions" in
+ <citerefentry project='man-pages'><refentrytitle>path_resolution</refentrytitle><manvolnum>7</manvolnum></citerefentry>
+ for a discussion of the meaning of permission bits.
+ </para></listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><varname>RuntimeDirectoryPreserve=</varname></term>
+
+ <listitem><para>Takes a boolean argument or <option>restart</option>.
+ If set to <option>no</option> (the default), the directories specified in <varname>RuntimeDirectory=</varname>
+ are always removed when the service stops. If set to <option>restart</option> the directories are preserved
+ when the service is both automatically and manually restarted. Here, the automatic restart means the operation
+ specified in <varname>Restart=</varname>, and manual restart means the one triggered by
+ <command>systemctl restart foo.service</command>. If set to <option>yes</option>, then the directories are not
+ removed when the service is stopped. Note that since the runtime directory <filename>/run</filename> is a mount
+ point of <literal>tmpfs</literal>, then for system services the directories specified in
+ <varname>RuntimeDirectory=</varname> are removed when the system is rebooted.
</para></listitem>
</varlistentry>
@@ -1706,7 +1748,7 @@
services, so that they cannot be used to circumvent the restrictions of this option. Specifically, it is
recommended to combine this option with <varname>SystemCallArchitectures=native</varname> or similar. If
running in user mode, or in system mode, but without the <constant>CAP_SYS_ADMIN</constant> capability
- (e.g. setting <varname>User=</varname>), <varname>NoNewPrivileges=yes</varname> is implied. </para></listitem>
+ (e.g. setting <varname>User=</varname>), <varname>NoNewPrivileges=yes</varname> is implied.</para></listitem>
</varlistentry>
<varlistentry>
diff --git a/man/systemd.network.xml b/man/systemd.network.xml
index 6b83a5b851..49d97cb604 100644
--- a/man/systemd.network.xml
+++ b/man/systemd.network.xml
@@ -271,7 +271,8 @@
<listitem>
<para>Enables DHCPv4 and/or DHCPv6 client support. Accepts
<literal>yes</literal>, <literal>no</literal>,
- <literal>ipv4</literal>, or <literal>ipv6</literal>.</para>
+ <literal>ipv4</literal>, or <literal>ipv6</literal>. Defaults
+ to <literal>no</literal>.</para>
<para>Note that DHCPv6 will by default be triggered by Router
Advertisement, if that is enabled, regardless of this parameter.
diff --git a/meson.build b/meson.build
index 61b9e76f90..5cc2e35570 100644
--- a/meson.build
+++ b/meson.build
@@ -26,6 +26,14 @@ m4_defines = []
#####################################################################
+# Try to install the git pre-commit hook
+git_hook = run_command(join_paths(meson.source_root(), 'tools/add-git-hook.sh'))
+if git_hook.returncode() == 0
+ message(git_hook.stdout().strip())
+endif
+
+#####################################################################
+
rootprefixdir = get_option('rootprefix')
if get_option('split-usr')
conf.set('HAVE_SPLIT_USR', true)
@@ -837,6 +845,23 @@ else
libqrencode = []
endif
+want_gcrypt = get_option('gcrypt')
+if want_gcrypt != 'false'
+ libgcrypt = cc.find_library('gcrypt', required : want_gcrypt == 'true')
+ libgpg_error = cc.find_library('gpg-error', required : want_gcrypt == 'true')
+
+ have_deps = libgcrypt.found() and libgpg_error.found()
+ conf.set('HAVE_GCRYPT', have_deps)
+ if not have_deps
+ # link to neither of the libs if one is not found
+ libgcrypt = []
+ libgpg_error = []
+ endif
+else
+ libgcrypt = []
+ libgpg_error = []
+endif
+
want_gnutls = get_option('gnutls')
if want_gnutls != 'false'
libgnutls = dependency('gnutls',
@@ -892,6 +917,16 @@ else
liblz4 = []
endif
+want_xkbcommon = get_option('xkbcommon')
+if want_xkbcommon != 'false'
+ libxkbcommon = dependency('xkbcommon',
+ version : '>= 0.3.0',
+ required : want_xkbcommon == 'true')
+ conf.set('HAVE_XKBCOMMON', libxkbcommon.found())
+else
+ libxkbcommon = []
+endif
+
want_glib = get_option('glib')
if want_glib != 'false'
libglib = dependency('glib-2.0',
@@ -910,16 +945,6 @@ else
libgio = []
endif
-want_xkbcommon = get_option('xkbcommon')
-if want_xkbcommon != 'false'
- libxkbcommon = dependency('xkbcommon',
- version : '>= 0.3.0',
- required : want_xkbcommon == 'true')
- conf.set('HAVE_XKBCOMMON', libxkbcommon.found())
-else
- libxkbcommon = []
-endif
-
want_dbus = get_option('dbus')
if want_dbus != 'false'
libdbus = dependency('dbus-1',
@@ -930,23 +955,6 @@ else
libdbus = []
endif
-want_gcrypt = get_option('gcrypt')
-if want_gcrypt != 'false'
- libgcrypt = cc.find_library('gcrypt', required : want_gcrypt == 'true')
- libgpg_error = cc.find_library('gpg-error', required : want_gcrypt == 'true')
-
- have_deps = libgcrypt.found() and libgpg_error.found()
- conf.set('HAVE_GCRYPT', have_deps)
- if not have_deps
- # link to neither of the libs if one is not found
- libgcrypt = []
- libgpg_error = []
- endif
-else
- libgcrypt = []
- libgpg_error = []
-endif
-
default_dnssec = get_option('default-dnssec')
if default_dnssec != 'no' and not conf.get('HAVE_GCRYPT', false)
message('default-dnssec cannot be set to yes or allow-downgrade when gcrypt is disabled. Setting default-dnssec to no.')
@@ -1008,7 +1016,7 @@ foreach pair : [['utmp', 'HAVE_UTMP'],
['rfkill', 'ENABLE_RFKILL'],
['ldconfig', 'ENABLE_LDCONFIG'],
['efi', 'ENABLE_EFI'],
- ['tpm', 'SD_BOOT_LOG_TPM'],
+ ['tpm', 'ENABLE_TPM'],
['ima', 'HAVE_IMA'],
['smack', 'HAVE_SMACK'],
['gshadow', 'ENABLE_GSHADOW'],
@@ -2525,6 +2533,9 @@ foreach tuple : [
endforeach
status += [
+ '',
'enabled features: @0@'.format(', '.join(found)),
- 'disabled features: @0@'.format(', '.join(missing))]
+ '',
+ 'disabled features: @0@'.format(', '.join(missing)),
+ '']
message('\n '.join(status))
diff --git a/meson_options.txt b/meson_options.txt
index 71e357f15b..a37e8176a0 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -47,7 +47,7 @@ option('resolve', type : 'boolean',
description : 'systemd-resolved stack')
option('efi', type : 'boolean',
description : 'enable systemd-boot and bootctl')
-option('tpm', type : 'boolean', value : false,
+option('tpm', type : 'boolean',
description : 'TPM should be used to log events and extend the registers')
option('environment-d', type : 'boolean',
description : 'support for environment.d')
@@ -69,7 +69,7 @@ option('timedated', type : 'boolean',
description : 'install the systemd-timedated daemon')
option('timesyncd', type : 'boolean',
description : 'install the systemd-timesyncd daemon')
-option('remote', type : 'boolean',
+option('remote', type : 'combo', choices : ['auto', 'true', 'false'],
description : 'support for "journal over the network"')
option('myhostname', type : 'boolean',
description : 'nss-myhostname support')
@@ -87,7 +87,7 @@ option('sysusers', type : 'boolean',
description : 'support for the sysusers configuration')
option('tmpfiles', type : 'boolean',
description : 'support for tmpfiles.d')
-option('importd', type : 'boolean',
+option('importd', type : 'combo', choices : ['auto', 'true', 'false'],
description : 'install the systemd-importd daemon')
option('hwdb', type : 'boolean',
description : 'support for the hardware database')
diff --git a/mkosi.build b/mkosi.build
index 2231118da5..12e88b909c 100755
--- a/mkosi.build
+++ b/mkosi.build
@@ -20,15 +20,20 @@
# This is a build script for OS image generation using mkosi (https://github.com/systemd/mkosi).
# Simply invoke "mkosi" in the project directory to build an OS image.
+# If mkosi.builddir/ exists mkosi will set $BUILDDIR to it, let's then use it
+# as out-of-tree build dir. Otherwise, let's make up our own builddir.
+[ -z "$BUILDDIR" ] && BUILDDIR=build
+
export LC_CTYPE=C.UTF-8
-meson build
-ninja -C build all
-ninja -C build test
-ninja -C build install
-mkdir -p $DESTDIR/etc
+[ -f "$BUILDDIR"/build.ninja ] || meson "$BUILDDIR"
+ninja -C "$BUILDDIR" all
+[ "$WITH_TESTS" = 0 ] || ninja -C "$BUILDDIR" test
+ninja -C "$BUILDDIR" install
+
+mkdir -p "$DESTDIR"/etc
-cat > $DESTDIR/etc/issue <<EOF
+cat > "$DESTDIR"/etc/issue <<EOF
\S (built from systemd tree)
Kernel \r on an \m (\l)
diff --git a/network/Makefile b/network/Makefile
deleted file mode 120000
index bd1047548b..0000000000
--- a/network/Makefile
+++ /dev/null
@@ -1 +0,0 @@
-../src/Makefile \ No newline at end of file
diff --git a/po/.gitignore b/po/.gitignore
deleted file mode 100644
index 0d1d4b0f9a..0000000000
--- a/po/.gitignore
+++ /dev/null
@@ -1,6 +0,0 @@
-POTFILES
-Makefile.in.in
-.intltool-merge-cache
-Makefile
-systemd.pot
-/*.gmo
diff --git a/rules/.gitignore b/rules/.gitignore
deleted file mode 100644
index ea6e216bad..0000000000
--- a/rules/.gitignore
+++ /dev/null
@@ -1,2 +0,0 @@
-/50-udev-default.rules
-/99-systemd.rules
diff --git a/rules/Makefile b/rules/Makefile
deleted file mode 120000
index bd1047548b..0000000000
--- a/rules/Makefile
+++ /dev/null
@@ -1 +0,0 @@
-../src/Makefile \ No newline at end of file
diff --git a/rules/meson.build b/rules/meson.build
index 0f818a506f..7f4725ad65 100644
--- a/rules/meson.build
+++ b/rules/meson.build
@@ -12,6 +12,7 @@ rules = files('''
60-sensor.rules
60-serial.rules
64-btrfs.rules
+ 70-joystick.rules
70-mouse.rules
70-touchpad.rules
75-net-description.rules
diff --git a/shell-completion/Makefile b/shell-completion/Makefile
deleted file mode 120000
index bd1047548b..0000000000
--- a/shell-completion/Makefile
+++ /dev/null
@@ -1 +0,0 @@
-../src/Makefile \ No newline at end of file
diff --git a/shell-completion/bash/.gitignore b/shell-completion/bash/.gitignore
deleted file mode 100644
index 016e09d1e7..0000000000
--- a/shell-completion/bash/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-/systemctl
diff --git a/shell-completion/bash/Makefile b/shell-completion/bash/Makefile
deleted file mode 120000
index d0b0e8e008..0000000000
--- a/shell-completion/bash/Makefile
+++ /dev/null
@@ -1 +0,0 @@
-../Makefile \ No newline at end of file
diff --git a/shell-completion/bash/systemctl.in b/shell-completion/bash/systemctl.in
index 0398d09d18..bde28efc3e 100644
--- a/shell-completion/bash/systemctl.in
+++ b/shell-completion/bash/systemctl.in
@@ -68,7 +68,7 @@ __filter_units_by_properties () {
done
for ((i=0; i < ${#units[*]}; i++)); do
for ((j=0; j < ${#conditions[*]}; j++)); do
- if [[ "${props[ i * ${#conditions[*]} + j]}" != "${conditions[j]}" ]]; then
+ if [[ "${props[i * ${#conditions[*]} + j]}" != "${conditions[j]}" ]]; then
break
fi
done
@@ -87,19 +87,19 @@ __get_active_units () { __systemctl $1 list-units \
| { while read -r a b; do echo " $a"; done; }; }
__get_startable_units () {
# find startable inactive units
- __filter_units_by_properties $mode ActiveState,CanStart inactive,yes $(
- { __systemctl $mode list-unit-files --state enabled,enabled-runtime,linked,linked-runtime,static,indirect,disabled,generated,transient | \
+ __filter_units_by_properties $1 ActiveState,CanStart inactive,yes $(
+ { __systemctl $1 list-unit-files --state enabled,enabled-runtime,linked,linked-runtime,static,indirect,disabled,generated,transient | \
{ while read -r a b; do [[ $a =~ @\. ]] || echo " $a"; done; }
- __systemctl $mode list-units --state inactive,failed | \
+ __systemctl $1 list-units --state inactive,failed | \
{ while read -r a b c; do [[ $b == "loaded" ]] && echo " $a"; done; }
} | sort -u )
}
__get_restartable_units () {
# filter out masked and not-found
- __filter_units_by_property $mode CanStart yes $(
- __systemctl $mode list-unit-files --state enabled,disabled,static | \
+ __filter_units_by_property $1 CanStart yes $(
+ __systemctl $1 list-unit-files --state enabled,disabled,static | \
{ while read -r a b; do [[ $a =~ @\. ]] || echo " $a"; done; }
- __systemctl $mode list-units | \
+ __systemctl $1 list-units | \
{ while read -r a b; do echo " $a"; done; } )
}
__get_failed_units () { __systemctl $1 list-units \
diff --git a/shell-completion/zsh/.gitignore b/shell-completion/zsh/.gitignore
deleted file mode 100644
index 75f13ad6d1..0000000000
--- a/shell-completion/zsh/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-/_systemctl
diff --git a/shell-completion/zsh/Makefile b/shell-completion/zsh/Makefile
deleted file mode 120000
index d0b0e8e008..0000000000
--- a/shell-completion/zsh/Makefile
+++ /dev/null
@@ -1 +0,0 @@
-../Makefile \ No newline at end of file
diff --git a/shell-completion/zsh/_sd_unit_files b/shell-completion/zsh/_sd_unit_files
index 3e7a4ee803..5e90ea23c5 100644
--- a/shell-completion/zsh/_sd_unit_files
+++ b/shell-completion/zsh/_sd_unit_files
@@ -5,5 +5,5 @@ _sd_unit_files() {
files=( '*:files:->files' )
_description files expl 'unit file'
- _files "$expl[@]" -g '*.(automount|busname|device|mount|path|service|socket|swap|target|timer)'
+ _files "$expl[@]" -g '*.(automount|device|mount|path|service|socket|swap|target|timer)'
}
diff --git a/src/.gitignore b/src/.gitignore
deleted file mode 100644
index e6ac2d7b8a..0000000000
--- a/src/.gitignore
+++ /dev/null
@@ -1,8 +0,0 @@
-load-fragment-gperf-nulstr.c
-load-fragment-gperf.c
-load-fragment-gperf.gperf
-org.freedesktop.systemd1.policy.in
-org.freedesktop.systemd1.policy
-99-systemd.rules
-*.gcno
-*.gcda
diff --git a/src/Makefile b/src/Makefile
deleted file mode 100644
index 9d07505194..0000000000
--- a/src/Makefile
+++ /dev/null
@@ -1,28 +0,0 @@
-# This file is part of systemd.
-#
-# Copyright 2010 Lennart Poettering
-#
-# systemd is free software; you can redistribute it and/or modify it
-# under the terms of the GNU Lesser General Public License as published by
-# the Free Software Foundation; either version 2.1 of the License, or
-# (at your option) any later version.
-#
-# systemd is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public License
-# along with systemd; If not, see <http://www.gnu.org/licenses/>.
-
-# This file is a dirty trick to simplify compilation from within
-# emacs. This file is not intended to be distributed. So, don't touch
-# it, even better ignore it!
-
-all:
- $(MAKE) -C ..
-
-clean:
- $(MAKE) -C .. clean
-
-.PHONY: all clean
diff --git a/src/ac-power/Makefile b/src/ac-power/Makefile
deleted file mode 120000
index d0b0e8e008..0000000000
--- a/src/ac-power/Makefile
+++ /dev/null
@@ -1 +0,0 @@
-../Makefile \ No newline at end of file
diff --git a/src/activate/Makefile b/src/activate/Makefile
deleted file mode 120000
index d0b0e8e008..0000000000
--- a/src/activate/Makefile
+++ /dev/null
@@ -1 +0,0 @@
-../Makefile \ No newline at end of file
diff --git a/src/activate/activate.c b/src/activate/activate.c
index 6ebd820410..4b82dca491 100644
--- a/src/activate/activate.c
+++ b/src/activate/activate.c
@@ -31,6 +31,7 @@
#include "fd-util.h"
#include "log.h"
#include "macro.h"
+#include "process-util.h"
#include "signal-util.h"
#include "socket-util.h"
#include "string-util.h"
@@ -221,7 +222,7 @@ static int exec_process(const char* name, char **argv, char **env, int start_fd,
if (asprintf((char**)(envp + n_env++), "LISTEN_FDS=%i", n_fds) < 0)
return log_oom();
- if (asprintf((char**)(envp + n_env++), "LISTEN_PID=" PID_FMT, getpid()) < 0)
+ if (asprintf((char**)(envp + n_env++), "LISTEN_PID=" PID_FMT, getpid_cached()) < 0)
return log_oom();
if (arg_fdnames) {
@@ -271,7 +272,7 @@ static int fork_and_exec_process(const char* child, char** argv, char **env, int
if (!joined)
return log_oom();
- parent_pid = getpid();
+ parent_pid = getpid_cached();
child_pid = fork();
if (child_pid < 0)
diff --git a/src/analyze/.gitignore b/src/analyze/.gitignore
deleted file mode 100644
index 752ea236c8..0000000000
--- a/src/analyze/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-/systemd-analyze
diff --git a/src/analyze/Makefile b/src/analyze/Makefile
deleted file mode 120000
index d0b0e8e008..0000000000
--- a/src/analyze/Makefile
+++ /dev/null
@@ -1 +0,0 @@
-../Makefile \ No newline at end of file
diff --git a/src/ask-password/Makefile b/src/ask-password/Makefile
deleted file mode 120000
index d0b0e8e008..0000000000
--- a/src/ask-password/Makefile
+++ /dev/null
@@ -1 +0,0 @@
-../Makefile \ No newline at end of file
diff --git a/src/backlight/Makefile b/src/backlight/Makefile
deleted file mode 120000
index d0b0e8e008..0000000000
--- a/src/backlight/Makefile
+++ /dev/null
@@ -1 +0,0 @@
-../Makefile \ No newline at end of file
diff --git a/src/basic/.gitignore b/src/basic/.gitignore
deleted file mode 100644
index e22411e484..0000000000
--- a/src/basic/.gitignore
+++ /dev/null
@@ -1,16 +0,0 @@
-/cap-from-name.gperf
-/cap-from-name.h
-/cap-list.txt
-/cap-to-name.h
-/errno-from-name.gperf
-/errno-from-name.h
-/errno-list.txt
-/errno-to-name.h
-/af-from-name.gperf
-/af-from-name.h
-/af-list.txt
-/af-to-name.h
-/arphrd-from-name.gperf
-/arphrd-from-name.h
-/arphrd-list.txt
-/arphrd-to-name.h
diff --git a/src/basic/Makefile b/src/basic/Makefile
deleted file mode 120000
index d0b0e8e008..0000000000
--- a/src/basic/Makefile
+++ /dev/null
@@ -1 +0,0 @@
-../Makefile \ No newline at end of file
diff --git a/src/basic/calendarspec.c b/src/basic/calendarspec.c
index 204120ee0e..b0712a4bad 100644
--- a/src/basic/calendarspec.c
+++ b/src/basic/calendarspec.c
@@ -257,19 +257,19 @@ static void format_weekdays(FILE *f, const CalendarSpec *c) {
if (l < 0) {
if (need_comma)
- fputc(',', f);
+ fputc_unlocked(',', f);
else
need_comma = true;
- fputs(days[x], f);
+ fputs_unlocked(days[x], f);
l = x;
}
} else if (l >= 0) {
if (x > l + 1) {
- fputs(x > l + 2 ? ".." : ",", f);
- fputs(days[x-1], f);
+ fputs_unlocked(x > l + 2 ? ".." : ",", f);
+ fputs_unlocked(days[x-1], f);
}
l = -1;
@@ -277,8 +277,8 @@ static void format_weekdays(FILE *f, const CalendarSpec *c) {
}
if (l >= 0 && x > l + 1) {
- fputs(x > l + 2 ? ".." : ",", f);
- fputs(days[x-1], f);
+ fputs_unlocked(x > l + 2 ? ".." : ",", f);
+ fputs_unlocked(days[x-1], f);
}
}
@@ -288,12 +288,12 @@ static void format_chain(FILE *f, int space, const CalendarComponent *c, bool us
assert(f);
if (!c) {
- fputc('*', f);
+ fputc_unlocked('*', f);
return;
}
if (usec && c->start == 0 && c->repeat == USEC_PER_SEC && !c->next) {
- fputc('*', f);
+ fputc_unlocked('*', f);
return;
}
@@ -314,7 +314,7 @@ static void format_chain(FILE *f, int space, const CalendarComponent *c, bool us
fprintf(f, ".%06i", c->repeat % d);
if (c->next) {
- fputc(',', f);
+ fputc_unlocked(',', f);
format_chain(f, space, c->next, usec);
}
}
@@ -334,23 +334,23 @@ int calendar_spec_to_string(const CalendarSpec *c, char **p) {
if (c->weekdays_bits > 0 && c->weekdays_bits <= BITS_WEEKDAYS) {
format_weekdays(f, c);
- fputc(' ', f);
+ fputc_unlocked(' ', f);
}
format_chain(f, 4, c->year, false);
- fputc('-', f);
+ fputc_unlocked('-', f);
format_chain(f, 2, c->month, false);
- fputc(c->end_of_month ? '~' : '-', f);
+ fputc_unlocked(c->end_of_month ? '~' : '-', f);
format_chain(f, 2, c->day, false);
- fputc(' ', f);
+ fputc_unlocked(' ', f);
format_chain(f, 2, c->hour, false);
- fputc(':', f);
+ fputc_unlocked(':', f);
format_chain(f, 2, c->minute, false);
- fputc(':', f);
+ fputc_unlocked(':', f);
format_chain(f, 2, c->microsecond, true);
if (c->utc)
- fputs(" UTC", f);
+ fputs_unlocked(" UTC", f);
else if (IN_SET(c->dst, 0, 1)) {
/* If daylight saving is explicitly on or off, let's show the used timezone. */
@@ -358,8 +358,8 @@ int calendar_spec_to_string(const CalendarSpec *c, char **p) {
tzset();
if (!isempty(tzname[c->dst])) {
- fputc(' ', f);
- fputs(tzname[c->dst], f);
+ fputc_unlocked(' ', f);
+ fputs_unlocked(tzname[c->dst], f);
}
}
diff --git a/src/basic/cgroup-util.c b/src/basic/cgroup-util.c
index 6344372610..5dea078978 100644
--- a/src/basic/cgroup-util.c
+++ b/src/basic/cgroup-util.c
@@ -255,7 +255,7 @@ int cg_kill(
return -ENOMEM;
}
- my_pid = getpid();
+ my_pid = getpid_cached();
do {
_cleanup_fclose_ FILE *f = NULL;
@@ -399,7 +399,7 @@ int cg_migrate(
if (!s)
return -ENOMEM;
- my_pid = getpid();
+ my_pid = getpid_cached();
do {
_cleanup_fclose_ FILE *f = NULL;
@@ -825,7 +825,7 @@ int cg_attach(const char *controller, const char *path, pid_t pid) {
return r;
if (pid == 0)
- pid = getpid();
+ pid = getpid_cached();
xsprintf(c, PID_FMT "\n", pid);
diff --git a/src/basic/def.h b/src/basic/def.h
index b1a3bc190b..7ce052c7ef 100644
--- a/src/basic/def.h
+++ b/src/basic/def.h
@@ -57,10 +57,8 @@
#endif
#define UNIX_SYSTEM_BUS_ADDRESS "unix:path=/var/run/dbus/system_bus_socket"
-#define KERNEL_SYSTEM_BUS_ADDRESS "kernel:path=/sys/fs/kdbus/0-system/bus"
-#define DEFAULT_SYSTEM_BUS_ADDRESS KERNEL_SYSTEM_BUS_ADDRESS ";" UNIX_SYSTEM_BUS_ADDRESS
+#define DEFAULT_SYSTEM_BUS_ADDRESS UNIX_SYSTEM_BUS_ADDRESS
#define UNIX_USER_BUS_ADDRESS_FMT "unix:path=%s/bus"
-#define KERNEL_USER_BUS_ADDRESS_FMT "kernel:path=/sys/fs/kdbus/"UID_FMT"-user/bus"
#define PLYMOUTH_SOCKET { \
.un.sun_family = AF_UNIX, \
diff --git a/src/basic/exit-status.c b/src/basic/exit-status.c
index 1e23c32c3f..fba012601d 100644
--- a/src/basic/exit-status.c
+++ b/src/basic/exit-status.c
@@ -151,6 +151,18 @@ const char* exit_status_to_string(int status, ExitStatusLevel level) {
case EXIT_KEYRING:
return "KEYRING";
+
+ case EXIT_STATE_DIRECTORY:
+ return "STATE_DIRECTORY";
+
+ case EXIT_CACHE_DIRECTORY:
+ return "CACHE_DIRECTORY";
+
+ case EXIT_LOGS_DIRECTORY:
+ return "LOGS_DIRECTORY";
+
+ case EXIT_CONFIGURATION_DIRECTORY:
+ return "CONFIGURATION_DIRECTORY";
}
}
diff --git a/src/basic/exit-status.h b/src/basic/exit-status.h
index d22b2c00e4..e2c76f84f8 100644
--- a/src/basic/exit-status.h
+++ b/src/basic/exit-status.h
@@ -83,6 +83,10 @@ enum {
EXIT_CHOWN,
EXIT_SMACK_PROCESS_LABEL,
EXIT_KEYRING,
+ EXIT_STATE_DIRECTORY,
+ EXIT_CACHE_DIRECTORY,
+ EXIT_LOGS_DIRECTORY, /* 240 */
+ EXIT_CONFIGURATION_DIRECTORY,
};
typedef enum ExitStatusLevel {
diff --git a/src/basic/fd-util.c b/src/basic/fd-util.c
index 19ad20789b..9d61044c89 100644
--- a/src/basic/fd-util.c
+++ b/src/basic/fd-util.c
@@ -31,6 +31,7 @@
#include "missing.h"
#include "parse-util.h"
#include "path-util.h"
+#include "process-util.h"
#include "socket-util.h"
#include "stdio-util.h"
#include "util.h"
@@ -282,7 +283,7 @@ int same_fd(int a, int b) {
return true;
/* Try to use kcmp() if we have it. */
- pid = getpid();
+ pid = getpid_cached();
r = kcmp(pid, pid, KCMP_FILE, a, b);
if (r == 0)
return true;
diff --git a/src/basic/fileio.c b/src/basic/fileio.c
index 9a185e3e60..a025038588 100644
--- a/src/basic/fileio.c
+++ b/src/basic/fileio.c
@@ -41,6 +41,7 @@
#include "missing.h"
#include "parse-util.h"
#include "path-util.h"
+#include "process-util.h"
#include "random-util.h"
#include "stdio-util.h"
#include "string-util.h"
@@ -823,29 +824,29 @@ static void write_env_var(FILE *f, const char *v) {
p = strchr(v, '=');
if (!p) {
/* Fallback */
- fputs(v, f);
- fputc('\n', f);
+ fputs_unlocked(v, f);
+ fputc_unlocked('\n', f);
return;
}
p++;
- fwrite(v, 1, p-v, f);
+ fwrite_unlocked(v, 1, p-v, f);
if (string_has_cc(p, NULL) || chars_intersect(p, WHITESPACE SHELL_NEED_QUOTES)) {
- fputc('\"', f);
+ fputc_unlocked('\"', f);
for (; *p; p++) {
if (strchr(SHELL_NEED_ESCAPE, *p))
- fputc('\\', f);
+ fputc_unlocked('\\', f);
- fputc(*p, f);
+ fputc_unlocked(*p, f);
}
- fputc('\"', f);
+ fputc_unlocked('\"', f);
} else
- fputs(p, f);
+ fputs_unlocked(p, f);
- fputc('\n', f);
+ fputc_unlocked('\n', f);
}
int write_env_file(const char *fname, char **l) {
@@ -1399,7 +1400,7 @@ int open_serialization_fd(const char *ident) {
if (fd < 0) {
const char *path;
- path = getpid() == 1 ? "/run/systemd" : "/tmp";
+ path = getpid_cached() == 1 ? "/run/systemd" : "/tmp";
fd = open_tmpfile_unlinkable(path, O_RDWR|O_CLOEXEC);
if (fd < 0)
return fd;
diff --git a/src/basic/fs-util.c b/src/basic/fs-util.c
index 8fe19ee4e4..5e1163c6a7 100644
--- a/src/basic/fs-util.c
+++ b/src/basic/fs-util.c
@@ -307,7 +307,7 @@ int fd_warn_permissions(const char *path, int fd) {
if (st.st_mode & 0002)
log_warning("Configuration file %s is marked world-writable. Please remove world writability permission bits. Proceeding anyway.", path);
- if (getpid() == 1 && (st.st_mode & 0044) != 0044)
+ if (getpid_cached() == 1 && (st.st_mode & 0044) != 0044)
log_warning("Configuration file %s is marked world-inaccessible. This has no effect as configuration data is accessible via APIs without restrictions. Proceeding anyway.", path);
return 0;
diff --git a/src/basic/log.c b/src/basic/log.c
index 3fd53800a0..d0caeb5ca3 100644
--- a/src/basic/log.c
+++ b/src/basic/log.c
@@ -84,7 +84,7 @@ void log_close_console(void) {
if (console_fd < 0)
return;
- if (getpid() == 1) {
+ if (getpid_cached() == 1) {
if (console_fd >= 3)
safe_close(console_fd);
@@ -140,7 +140,7 @@ static int create_log_socket(int type) {
/* We need a blocking fd here since we'd otherwise lose
messages way too early. However, let's not hang forever in the
unlikely case of a deadlock. */
- if (getpid() == 1)
+ if (getpid_cached() == 1)
timeval_store(&tv, 10 * USEC_PER_MSEC);
else
timeval_store(&tv, 10 * USEC_PER_SEC);
@@ -248,7 +248,7 @@ int log_open(void) {
}
if (!IN_SET(log_target, LOG_TARGET_AUTO, LOG_TARGET_SAFE) ||
- getpid() == 1 ||
+ getpid_cached() == 1 ||
isatty(STDERR_FILENO) <= 0) {
if (IN_SET(log_target, LOG_TARGET_AUTO,
@@ -370,7 +370,7 @@ static int write_to_console(
if (writev(console_fd, iovec, n) < 0) {
- if (errno == EIO && getpid() == 1) {
+ if (errno == EIO && getpid_cached() == 1) {
/* If somebody tried to kick us from our
* console tty (via vhangup() or suchlike),
@@ -423,7 +423,7 @@ static int write_to_syslog(
if (strftime(header_time, sizeof(header_time), "%h %e %T ", tm) <= 0)
return -EINVAL;
- xsprintf(header_pid, "["PID_FMT"]: ", getpid());
+ xsprintf(header_pid, "["PID_FMT"]: ", getpid_cached());
IOVEC_SET_STRING(iovec[0], header_priority);
IOVEC_SET_STRING(iovec[1], header_time);
@@ -468,7 +468,7 @@ static int write_to_kmsg(
return 0;
xsprintf(header_priority, "<%i>", level);
- xsprintf(header_pid, "["PID_FMT"]: ", getpid());
+ xsprintf(header_pid, "["PID_FMT"]: ", getpid_cached());
IOVEC_SET_STRING(iovec[0], header_priority);
IOVEC_SET_STRING(iovec[1], program_invocation_short_name);
@@ -1189,7 +1189,7 @@ int log_syntax_internal(
va_end(ap);
if (unit)
- unit_fmt = getpid() == 1 ? "UNIT=%s" : "USER_UNIT=%s";
+ unit_fmt = getpid_cached() == 1 ? "UNIT=%s" : "USER_UNIT=%s";
return log_struct_internal(
LOG_REALM_PLUS_LEVEL(LOG_REALM_SYSTEMD, level),
diff --git a/src/basic/log.h b/src/basic/log.h
index ff5d776b1d..186747ff8e 100644
--- a/src/basic/log.h
+++ b/src/basic/log.h
@@ -30,6 +30,7 @@
#include "sd-id128.h"
#include "macro.h"
+#include "process-util.h"
typedef enum LogRealm {
LOG_REALM_SYSTEMD,
@@ -247,7 +248,7 @@ void log_assert_failed_return_realm(
#define log_notice(...) log_full(LOG_NOTICE, __VA_ARGS__)
#define log_warning(...) log_full(LOG_WARNING, __VA_ARGS__)
#define log_error(...) log_full(LOG_ERR, __VA_ARGS__)
-#define log_emergency(...) log_full(getpid() == 1 ? LOG_EMERG : LOG_ERR, __VA_ARGS__)
+#define log_emergency(...) log_full(getpid_cached() == 1 ? LOG_EMERG : LOG_ERR, __VA_ARGS__)
/* Logging triggered by an errno-like error */
#define log_debug_errno(error, ...) log_full_errno(LOG_DEBUG, error, __VA_ARGS__)
@@ -255,7 +256,7 @@ void log_assert_failed_return_realm(
#define log_notice_errno(error, ...) log_full_errno(LOG_NOTICE, error, __VA_ARGS__)
#define log_warning_errno(error, ...) log_full_errno(LOG_WARNING, error, __VA_ARGS__)
#define log_error_errno(error, ...) log_full_errno(LOG_ERR, error, __VA_ARGS__)
-#define log_emergency_errno(error, ...) log_full_errno(getpid() == 1 ? LOG_EMERG : LOG_ERR, error, __VA_ARGS__)
+#define log_emergency_errno(error, ...) log_full_errno(getpid_cached() == 1 ? LOG_EMERG : LOG_ERR, error, __VA_ARGS__)
#ifdef LOG_TRACE
# define log_trace(...) log_debug(__VA_ARGS__)
diff --git a/src/basic/process-util.c b/src/basic/process-util.c
index b80cacaa42..ce6a59c8a4 100644
--- a/src/basic/process-util.c
+++ b/src/basic/process-util.c
@@ -814,7 +814,7 @@ bool is_main_thread(void) {
static thread_local int cached = 0;
if (_unlikely_(cached == 0))
- cached = getpid() == gettid() ? 1 : -1;
+ cached = getpid_cached() == gettid() ? 1 : -1;
return cached > 0;
}
@@ -878,7 +878,7 @@ const char* personality_to_string(unsigned long p) {
void valgrind_summary_hack(void) {
#ifdef HAVE_VALGRIND_VALGRIND_H
- if (getpid() == 1 && RUNNING_ON_VALGRIND) {
+ if (getpid_cached() == 1 && RUNNING_ON_VALGRIND) {
pid_t pid;
pid = raw_clone(SIGCHLD);
if (pid < 0)
@@ -922,6 +922,68 @@ int ioprio_parse_priority(const char *s, int *ret) {
return 0;
}
+/* The cached PID, possible values:
+ *
+ * == UNSET [0] → cache not initialized yet
+ * == BUSY [-1] → some thread is initializing it at the moment
+ * any other → the cached PID
+ */
+
+#define CACHED_PID_UNSET ((pid_t) 0)
+#define CACHED_PID_BUSY ((pid_t) -1)
+
+static pid_t cached_pid = CACHED_PID_UNSET;
+
+static void reset_cached_pid(void) {
+ /* Invoked in the child after a fork(), i.e. at the first moment the PID changed */
+ cached_pid = CACHED_PID_UNSET;
+}
+
+/* We use glibc __register_atfork() + __dso_handle directly here, as they are not included in the glibc
+ * headers. __register_atfork() is mostly equivalent to pthread_atfork(), but doesn't require us to link against
+ * libpthread, as it is part of glibc anyway. */
+extern int __register_atfork(void (*prepare) (void), void (*parent) (void), void (*child) (void), void * __dso_handle);
+extern void* __dso_handle __attribute__ ((__weak__));
+
+pid_t getpid_cached(void) {
+ pid_t current_value;
+
+ /* getpid_cached() is much like getpid(), but caches the value in local memory, to avoid having to invoke a
+ * system call each time. This restores glibc behaviour from before 2.24, when getpid() was unconditionally
+ * cached. Starting with 2.24 getpid() started to become prohibitively expensive when used for detecting when
+ * objects were used across fork()s. With this caching the old behaviour is somewhat restored.
+ *
+ * https://bugzilla.redhat.com/show_bug.cgi?id=1443976
+ * https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=1d2bc2eae969543b89850e35e532f3144122d80a
+ */
+
+ current_value = __sync_val_compare_and_swap(&cached_pid, CACHED_PID_UNSET, CACHED_PID_BUSY);
+
+ switch (current_value) {
+
+ case CACHED_PID_UNSET: { /* Not initialized yet, then do so now */
+ pid_t new_pid;
+
+ new_pid = getpid();
+
+ if (__register_atfork(NULL, NULL, reset_cached_pid, __dso_handle) != 0) {
+ /* OOM? Let's try again later */
+ cached_pid = CACHED_PID_UNSET;
+ return new_pid;
+ }
+
+ cached_pid = new_pid;
+ return new_pid;
+ }
+
+ case CACHED_PID_BUSY: /* Somebody else is currently initializing */
+ return getpid();
+
+ default: /* Properly initialized */
+ return current_value;
+ }
+}
+
static const char *const ioprio_class_table[] = {
[IOPRIO_CLASS_NONE] = "none",
[IOPRIO_CLASS_RT] = "realtime",
diff --git a/src/basic/process-util.h b/src/basic/process-util.h
index 28d8d7499a..17746b4ebf 100644
--- a/src/basic/process-util.h
+++ b/src/basic/process-util.h
@@ -119,3 +119,5 @@ static inline bool ioprio_priority_is_valid(int i) {
}
int ioprio_parse_priority(const char *s, int *ret);
+
+pid_t getpid_cached(void);
diff --git a/src/basic/replace-var.c b/src/basic/replace-var.c
index 0d21423a9c..d2642812e7 100644
--- a/src/basic/replace-var.c
+++ b/src/basic/replace-var.c
@@ -54,7 +54,7 @@ static int get_variable(const char *b, char **r) {
return 1;
}
-char *replace_var(const char *text, char *(*lookup)(const char *variable, void*userdata), void *userdata) {
+char *replace_var(const char *text, char *(*lookup)(const char *variable, void *userdata), void *userdata) {
char *r, *t;
const char *f;
size_t l;
diff --git a/src/basic/replace-var.h b/src/basic/replace-var.h
index 78412910b2..31eb057803 100644
--- a/src/basic/replace-var.h
+++ b/src/basic/replace-var.h
@@ -19,4 +19,4 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-char *replace_var(const char *text, char *(*lookup)(const char *variable, void*userdata), void *userdata);
+char *replace_var(const char *text, char *(*lookup)(const char *variable, void *userdata), void *userdata);
diff --git a/src/basic/special.h b/src/basic/special.h
index feb8e5fe21..ddd4e84019 100644
--- a/src/basic/special.h
+++ b/src/basic/special.h
@@ -46,7 +46,6 @@
/* Early boot targets */
#define SPECIAL_SYSINIT_TARGET "sysinit.target"
#define SPECIAL_SOCKETS_TARGET "sockets.target"
-#define SPECIAL_BUSNAMES_TARGET "busnames.target"
#define SPECIAL_TIMERS_TARGET "timers.target"
#define SPECIAL_PATHS_TARGET "paths.target"
#define SPECIAL_LOCAL_FS_TARGET "local-fs.target"
diff --git a/src/basic/string-util.c b/src/basic/string-util.c
index 9d2f4bc8f9..cd58ef97ef 100644
--- a/src/basic/string-util.c
+++ b/src/basic/string-util.c
@@ -542,7 +542,7 @@ char *ellipsize(const char *s, size_t length, unsigned percent) {
return ellipsize_mem(s, strlen(s), length, percent);
}
-bool nulstr_contains(const char*nulstr, const char *needle) {
+bool nulstr_contains(const char *nulstr, const char *needle) {
const char *i;
if (!nulstr)
@@ -635,6 +635,11 @@ char *strip_tab_ansi(char **ibuf, size_t *_isz) {
if (!f)
return NULL;
+ /* Note we use the _unlocked() stdio variants on f for performance
+ * reasons. It's safe to do so since we created f here and it
+ * doesn't leave our scope.
+ */
+
for (i = *ibuf; i < *ibuf + isz + 1; i++) {
switch (state) {
@@ -645,21 +650,21 @@ char *strip_tab_ansi(char **ibuf, size_t *_isz) {
else if (*i == '\x1B')
state = STATE_ESCAPE;
else if (*i == '\t')
- fputs(" ", f);
+ fputs_unlocked(" ", f);
else
- fputc(*i, f);
+ fputc_unlocked(*i, f);
break;
case STATE_ESCAPE:
if (i >= *ibuf + isz) { /* EOT */
- fputc('\x1B', f);
+ fputc_unlocked('\x1B', f);
break;
} else if (*i == '[') {
state = STATE_BRACKET;
begin = i + 1;
} else {
- fputc('\x1B', f);
- fputc(*i, f);
+ fputc_unlocked('\x1B', f);
+ fputc_unlocked(*i, f);
state = STATE_OTHER;
}
@@ -669,8 +674,8 @@ char *strip_tab_ansi(char **ibuf, size_t *_isz) {
if (i >= *ibuf + isz || /* EOT */
(!(*i >= '0' && *i <= '9') && *i != ';' && *i != 'm')) {
- fputc('\x1B', f);
- fputc('[', f);
+ fputc_unlocked('\x1B', f);
+ fputc_unlocked('[', f);
state = STATE_OTHER;
i = begin-1;
} else if (*i == 'm')
diff --git a/src/basic/string-util.h b/src/basic/string-util.h
index be44dedff4..e8a0836538 100644
--- a/src/basic/string-util.h
+++ b/src/basic/string-util.h
@@ -158,7 +158,7 @@ bool string_has_cc(const char *p, const char *ok) _pure_;
char *ellipsize_mem(const char *s, size_t old_length_bytes, size_t new_length_columns, unsigned percent);
char *ellipsize(const char *s, size_t length, unsigned percent);
-bool nulstr_contains(const char*nulstr, const char *needle);
+bool nulstr_contains(const char *nulstr, const char *needle);
char* strshorten(char *s, size_t l);
diff --git a/src/basic/terminal-util.c b/src/basic/terminal-util.c
index 9a8ef825c5..8a0419df75 100644
--- a/src/basic/terminal-util.c
+++ b/src/basic/terminal-util.c
@@ -1220,7 +1220,7 @@ bool colors_enabled(void) {
val = getenv_bool("SYSTEMD_COLORS");
if (val >= 0)
enabled = val;
- else if (getpid() == 1)
+ else if (getpid_cached() == 1)
/* PID1 outputs to the console without holding it open all the time */
enabled = !getenv_terminal_is_dumb();
else
diff --git a/src/basic/unit-name.c b/src/basic/unit-name.c
index 920ca0d9f5..08db164aa9 100644
--- a/src/basic/unit-name.c
+++ b/src/basic/unit-name.c
@@ -608,7 +608,6 @@ const char* unit_dbus_interface_from_type(UnitType t) {
static const char *const table[_UNIT_TYPE_MAX] = {
[UNIT_SERVICE] = "org.freedesktop.systemd1.Service",
[UNIT_SOCKET] = "org.freedesktop.systemd1.Socket",
- [UNIT_BUSNAME] = "org.freedesktop.systemd1.BusName",
[UNIT_TARGET] = "org.freedesktop.systemd1.Target",
[UNIT_DEVICE] = "org.freedesktop.systemd1.Device",
[UNIT_MOUNT] = "org.freedesktop.systemd1.Mount",
@@ -839,7 +838,6 @@ bool slice_name_is_valid(const char *name) {
static const char* const unit_type_table[_UNIT_TYPE_MAX] = {
[UNIT_SERVICE] = "service",
[UNIT_SOCKET] = "socket",
- [UNIT_BUSNAME] = "busname",
[UNIT_TARGET] = "target",
[UNIT_DEVICE] = "device",
[UNIT_MOUNT] = "mount",
@@ -884,19 +882,6 @@ static const char* const automount_state_table[_AUTOMOUNT_STATE_MAX] = {
DEFINE_STRING_TABLE_LOOKUP(automount_state, AutomountState);
-static const char* const busname_state_table[_BUSNAME_STATE_MAX] = {
- [BUSNAME_DEAD] = "dead",
- [BUSNAME_MAKING] = "making",
- [BUSNAME_REGISTERED] = "registered",
- [BUSNAME_LISTENING] = "listening",
- [BUSNAME_RUNNING] = "running",
- [BUSNAME_SIGTERM] = "sigterm",
- [BUSNAME_SIGKILL] = "sigkill",
- [BUSNAME_FAILED] = "failed",
-};
-
-DEFINE_STRING_TABLE_LOOKUP(busname_state, BusNameState);
-
static const char* const device_state_table[_DEVICE_STATE_MAX] = {
[DEVICE_DEAD] = "dead",
[DEVICE_TENTATIVE] = "tentative",
diff --git a/src/basic/unit-name.h b/src/basic/unit-name.h
index 0f164a6aa9..f40fff3fe1 100644
--- a/src/basic/unit-name.h
+++ b/src/basic/unit-name.h
@@ -28,7 +28,6 @@
typedef enum UnitType {
UNIT_SERVICE = 0,
UNIT_SOCKET,
- UNIT_BUSNAME,
UNIT_TARGET,
UNIT_DEVICE,
UNIT_MOUNT,
@@ -73,19 +72,6 @@ typedef enum AutomountState {
_AUTOMOUNT_STATE_INVALID = -1
} AutomountState;
-typedef enum BusNameState {
- BUSNAME_DEAD,
- BUSNAME_MAKING,
- BUSNAME_REGISTERED,
- BUSNAME_LISTENING,
- BUSNAME_RUNNING,
- BUSNAME_SIGTERM,
- BUSNAME_SIGKILL,
- BUSNAME_FAILED,
- _BUSNAME_STATE_MAX,
- _BUSNAME_STATE_INVALID = -1
-} BusNameState;
-
/* We simply watch devices, we cannot plug/unplug them. That
* simplifies the state engine greatly */
typedef enum DeviceState {
@@ -339,9 +325,6 @@ UnitActiveState unit_active_state_from_string(const char *s) _pure_;
const char* automount_state_to_string(AutomountState i) _const_;
AutomountState automount_state_from_string(const char *s) _pure_;
-const char* busname_state_to_string(BusNameState i) _const_;
-BusNameState busname_state_from_string(const char *s) _pure_;
-
const char* device_state_to_string(DeviceState i) _const_;
DeviceState device_state_from_string(const char *s) _pure_;
diff --git a/src/basic/util.c b/src/basic/util.c
index b52a5db31b..2f45128ed4 100644
--- a/src/basic/util.c
+++ b/src/basic/util.c
@@ -219,7 +219,7 @@ int fork_agent(pid_t *pid, const int except[], unsigned n_except, const char *pa
/* Spawns a temporary TTY agent, making sure it goes away when
* we go away */
- parent_pid = getpid();
+ parent_pid = getpid_cached();
/* First we temporarily block all signals, so that the new
* child has them blocked initially. This way, we can be sure
diff --git a/src/basic/virt.c b/src/basic/virt.c
index 6011744523..d8eeb54dbf 100644
--- a/src/basic/virt.c
+++ b/src/basic/virt.c
@@ -46,6 +46,7 @@ static int detect_vm_cpuid(void) {
} cpuid_vendor_table[] = {
{ "XenVMMXenVMM", VIRTUALIZATION_XEN },
{ "KVMKVMKVM", VIRTUALIZATION_KVM },
+ { "TCGTCGTCGTCG", VIRTUALIZATION_QEMU },
/* http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=1009458 */
{ "VMwareVMware", VIRTUALIZATION_VMWARE },
/* https://docs.microsoft.com/en-us/virtualization/hyper-v-on-windows/reference/tlfs */
@@ -421,7 +422,7 @@ int detect_container(void) {
goto finish;
}
- if (getpid() == 1) {
+ if (getpid_cached() == 1) {
/* If we are PID 1 we can just check our own environment variable, and that's authoritative. */
e = getenv("container");
diff --git a/src/binfmt/Makefile b/src/binfmt/Makefile
deleted file mode 120000
index d0b0e8e008..0000000000
--- a/src/binfmt/Makefile
+++ /dev/null
@@ -1 +0,0 @@
-../Makefile \ No newline at end of file
diff --git a/src/boot/Makefile b/src/boot/Makefile
deleted file mode 120000
index d0b0e8e008..0000000000
--- a/src/boot/Makefile
+++ /dev/null
@@ -1 +0,0 @@
-../Makefile \ No newline at end of file
diff --git a/src/boot/efi/.gitignore b/src/boot/efi/.gitignore
deleted file mode 100644
index e193acbe12..0000000000
--- a/src/boot/efi/.gitignore
+++ /dev/null
@@ -1,2 +0,0 @@
-/systemd_boot.so
-/stub.so
diff --git a/src/boot/efi/boot.c b/src/boot/efi/boot.c
index 1e990b3825..21898837e0 100644
--- a/src/boot/efi/boot.c
+++ b/src/boot/efi/boot.c
@@ -1650,15 +1650,14 @@ static EFI_STATUS image_start(EFI_HANDLE parent_image, const Config *config, con
loaded_image->LoadOptions = options;
loaded_image->LoadOptionsSize = (StrLen(loaded_image->LoadOptions)+1) * sizeof(CHAR16);
-#ifdef SD_BOOT_LOG_TPM
+#ifdef ENABLE_TPM
/* Try to log any options to the TPM, especially to catch manually edited options */
err = tpm_log_event(SD_TPM_PCR,
(EFI_PHYSICAL_ADDRESS) loaded_image->LoadOptions,
loaded_image->LoadOptionsSize, loaded_image->LoadOptions);
if (EFI_ERROR(err)) {
Print(L"Unable to add image options measurement: %r", err);
- uefi_call_wrapper(BS->Stall, 1, 3 * 1000 * 1000);
- return err;
+ uefi_call_wrapper(BS->Stall, 1, 200 * 1000);
}
#endif
}
diff --git a/src/boot/efi/measure.c b/src/boot/efi/measure.c
index b22d37b62d..8627c09077 100644
--- a/src/boot/efi/measure.c
+++ b/src/boot/efi/measure.c
@@ -11,7 +11,7 @@
*
*/
-#ifdef SD_BOOT_LOG_TPM
+#ifdef ENABLE_TPM
#include <efi.h>
#include <efilib.h>
diff --git a/src/boot/efi/meson.build b/src/boot/efi/meson.build
index 5ef5b2d20b..b111aad852 100644
--- a/src/boot/efi/meson.build
+++ b/src/boot/efi/meson.build
@@ -64,7 +64,7 @@ if have_gnu_efi
efi_conf = configuration_data()
efi_conf.set_quoted('PACKAGE_VERSION', meson.project_version())
efi_conf.set_quoted('EFI_MACHINE_TYPE_NAME', EFI_MACHINE_TYPE_NAME)
- efi_conf.set('SD_BOOT_LOG_TPM', get_option('tpm'))
+ efi_conf.set('ENABLE_TPM', get_option('tpm'))
efi_conf.set('SD_TPM_PCR', get_option('tpm-pcrindex'))
efi_config_h = configure_file(
diff --git a/src/boot/efi/stub.c b/src/boot/efi/stub.c
index bab5d46de9..7d03370cbd 100644
--- a/src/boot/efi/stub.c
+++ b/src/boot/efi/stub.c
@@ -87,15 +87,14 @@ EFI_STATUS efi_main(EFI_HANDLE image, EFI_SYSTEM_TABLE *sys_table) {
line[i] = options[i];
cmdline = line;
-#ifdef SD_BOOT_LOG_TPM
+#ifdef ENABLE_TPM
/* Try to log any options to the TPM, especially manually edited options */
err = tpm_log_event(SD_TPM_PCR,
(EFI_PHYSICAL_ADDRESS) loaded_image->LoadOptions,
loaded_image->LoadOptionsSize, loaded_image->LoadOptions);
if (EFI_ERROR(err)) {
Print(L"Unable to add image options measurement: %r", err);
- uefi_call_wrapper(BS->Stall, 1, 3 * 1000 * 1000);
- return err;
+ uefi_call_wrapper(BS->Stall, 1, 200 * 1000);
}
#endif
}
diff --git a/src/cgls/Makefile b/src/cgls/Makefile
deleted file mode 120000
index d0b0e8e008..0000000000
--- a/src/cgls/Makefile
+++ /dev/null
@@ -1 +0,0 @@
-../Makefile \ No newline at end of file
diff --git a/src/cgroups-agent/Makefile b/src/cgroups-agent/Makefile
deleted file mode 120000
index d0b0e8e008..0000000000
--- a/src/cgroups-agent/Makefile
+++ /dev/null
@@ -1 +0,0 @@
-../Makefile \ No newline at end of file
diff --git a/src/cgtop/Makefile b/src/cgtop/Makefile
deleted file mode 120000
index d0b0e8e008..0000000000
--- a/src/cgtop/Makefile
+++ /dev/null
@@ -1 +0,0 @@
-../Makefile \ No newline at end of file
diff --git a/src/core/.gitignore b/src/core/.gitignore
deleted file mode 100644
index 465b4fcc20..0000000000
--- a/src/core/.gitignore
+++ /dev/null
@@ -1,3 +0,0 @@
-/macros.systemd
-/triggers.systemd
-/systemd.pc
diff --git a/src/core/Makefile b/src/core/Makefile
deleted file mode 120000
index d0b0e8e008..0000000000
--- a/src/core/Makefile
+++ /dev/null
@@ -1 +0,0 @@
-../Makefile \ No newline at end of file
diff --git a/src/core/automount.c b/src/core/automount.c
index 0f72854ceb..96de933e23 100644
--- a/src/core/automount.c
+++ b/src/core/automount.c
@@ -590,7 +590,7 @@ static void automount_enter_waiting(Automount *a) {
}
xsprintf(options, "fd=%i,pgrp="PID_FMT",minproto=5,maxproto=5,direct", p[1], getpgrp());
- xsprintf(name, "systemd-"PID_FMT, getpid());
+ xsprintf(name, "systemd-"PID_FMT, getpid_cached());
if (mount(name, a->where, "autofs", 0, options) < 0) {
r = -errno;
goto fail;
diff --git a/src/core/bus-policy.c b/src/core/bus-policy.c
deleted file mode 100644
index 4907c268e8..0000000000
--- a/src/core/bus-policy.c
+++ /dev/null
@@ -1,180 +0,0 @@
-/***
- This file is part of systemd.
-
- Copyright 2014 Daniel Mack
-
- systemd is free software; you can redistribute it and/or modify it
- under the terms of the GNU Lesser General Public License as published by
- the Free Software Foundation; either version 2.1 of the License, or
- (at your option) any later version.
-
- systemd is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public License
- along with systemd; If not, see <http://www.gnu.org/licenses/>.
-***/
-
-#include <stdlib.h>
-
-#include "alloc-util.h"
-#include "bus-kernel.h"
-#include "bus-policy.h"
-#include "kdbus.h"
-#include "string-table.h"
-#include "user-util.h"
-#include "util.h"
-
-int bus_kernel_translate_access(BusPolicyAccess access) {
- assert(access >= 0);
- assert(access < _BUS_POLICY_ACCESS_MAX);
-
- switch (access) {
-
- case BUS_POLICY_ACCESS_SEE:
- return KDBUS_POLICY_SEE;
-
- case BUS_POLICY_ACCESS_TALK:
- return KDBUS_POLICY_TALK;
-
- case BUS_POLICY_ACCESS_OWN:
- return KDBUS_POLICY_OWN;
-
- default:
- assert_not_reached("Unknown policy access");
- }
-}
-
-int bus_kernel_translate_policy(const BusNamePolicy *policy, struct kdbus_item *item) {
- int r;
-
- assert(policy);
- assert(item);
-
- switch (policy->type) {
-
- case BUSNAME_POLICY_TYPE_USER: {
- const char *user = policy->name;
- uid_t uid;
-
- r = get_user_creds(&user, &uid, NULL, NULL, NULL);
- if (r < 0)
- return r;
-
- item->policy_access.type = KDBUS_POLICY_ACCESS_USER;
- item->policy_access.id = uid;
- break;
- }
-
- case BUSNAME_POLICY_TYPE_GROUP: {
- const char *group = policy->name;
- gid_t gid;
-
- r = get_group_creds(&group, &gid);
- if (r < 0)
- return r;
-
- item->policy_access.type = KDBUS_POLICY_ACCESS_GROUP;
- item->policy_access.id = gid;
- break;
- }
-
- default:
- assert_not_reached("Unknown policy type");
- }
-
- item->policy_access.access = bus_kernel_translate_access(policy->access);
-
- return 0;
-}
-
-int bus_kernel_make_starter(
- int fd,
- const char *name,
- bool activating,
- bool accept_fd,
- BusNamePolicy *policy,
- BusPolicyAccess world_policy) {
-
- struct kdbus_cmd_free cmd_free = { .size = sizeof(cmd_free) };
- struct kdbus_cmd_hello *hello;
- struct kdbus_item *n;
- size_t policy_cnt = 0;
- BusNamePolicy *po;
- size_t size;
- int r;
-
- assert(fd >= 0);
- assert(name);
-
- LIST_FOREACH(policy, po, policy)
- policy_cnt++;
-
- if (world_policy >= 0)
- policy_cnt++;
-
- size = offsetof(struct kdbus_cmd_hello, items) +
- ALIGN8(offsetof(struct kdbus_item, str) + strlen(name) + 1) +
- policy_cnt * ALIGN8(offsetof(struct kdbus_item, policy_access) + sizeof(struct kdbus_policy_access));
-
- hello = alloca0_align(size, 8);
-
- n = hello->items;
- strcpy(n->str, name);
- n->size = offsetof(struct kdbus_item, str) + strlen(n->str) + 1;
- n->type = KDBUS_ITEM_NAME;
- n = KDBUS_ITEM_NEXT(n);
-
- LIST_FOREACH(policy, po, policy) {
- n->type = KDBUS_ITEM_POLICY_ACCESS;
- n->size = offsetof(struct kdbus_item, policy_access) + sizeof(struct kdbus_policy_access);
-
- r = bus_kernel_translate_policy(po, n);
- if (r < 0)
- return r;
-
- n = KDBUS_ITEM_NEXT(n);
- }
-
- if (world_policy >= 0) {
- n->type = KDBUS_ITEM_POLICY_ACCESS;
- n->size = offsetof(struct kdbus_item, policy_access) + sizeof(struct kdbus_policy_access);
- n->policy_access.type = KDBUS_POLICY_ACCESS_WORLD;
- n->policy_access.access = bus_kernel_translate_access(world_policy);
- }
-
- hello->size = size;
- hello->flags =
- (activating ? KDBUS_HELLO_ACTIVATOR : KDBUS_HELLO_POLICY_HOLDER) |
- (accept_fd ? KDBUS_HELLO_ACCEPT_FD : 0);
- hello->pool_size = KDBUS_POOL_SIZE;
- hello->attach_flags_send = _KDBUS_ATTACH_ANY;
- hello->attach_flags_recv = _KDBUS_ATTACH_ANY;
-
- if (ioctl(fd, KDBUS_CMD_HELLO, hello) < 0) {
- if (errno == ENOTTY) /* Major API change */
- return -ESOCKTNOSUPPORT;
- return -errno;
- }
-
- /* not interested in any output values */
- cmd_free.offset = hello->offset;
- (void) ioctl(fd, KDBUS_CMD_FREE, &cmd_free);
-
- /* The higher 32bit of the bus_flags fields are considered
- * 'incompatible flags'. Refuse them all for now. */
- if (hello->bus_flags > 0xFFFFFFFFULL)
- return -ESOCKTNOSUPPORT;
-
- return fd;
-}
-
-static const char* const bus_policy_access_table[_BUS_POLICY_ACCESS_MAX] = {
- [BUS_POLICY_ACCESS_SEE] = "see",
- [BUS_POLICY_ACCESS_TALK] = "talk",
- [BUS_POLICY_ACCESS_OWN] = "own",
-};
-
-DEFINE_STRING_TABLE_LOOKUP(bus_policy_access, BusPolicyAccess);
diff --git a/src/core/bus-policy.h b/src/core/bus-policy.h
deleted file mode 100644
index 5b2c4d5953..0000000000
--- a/src/core/bus-policy.h
+++ /dev/null
@@ -1,64 +0,0 @@
-#pragma once
-
-/***
- This file is part of systemd.
-
- Copyright 2014 Daniel Mack
-
- systemd is free software; you can redistribute it and/or modify it
- under the terms of the GNU Lesser General Public License as published by
- the Free Software Foundation; either version 2.1 of the License, or
- (at your option) any later version.
-
- systemd is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public License
- along with systemd; If not, see <http://www.gnu.org/licenses/>.
-***/
-
-#include "kdbus.h"
-#include "list.h"
-#include "macro.h"
-
-typedef struct BusNamePolicy BusNamePolicy;
-
-typedef enum BusPolicyAccess {
- BUS_POLICY_ACCESS_SEE,
- BUS_POLICY_ACCESS_TALK,
- BUS_POLICY_ACCESS_OWN,
- _BUS_POLICY_ACCESS_MAX,
- _BUS_POLICY_ACCESS_INVALID = -1
-} BusPolicyAccess;
-
-typedef enum BusNamePolicyType {
- BUSNAME_POLICY_TYPE_USER,
- BUSNAME_POLICY_TYPE_GROUP,
- _BUSNAME_POLICY_TYPE_MAX,
- _BUSNAME_POLICY_TYPE_INVALID = -1
-} BusNamePolicyType;
-
-struct BusNamePolicy {
- BusNamePolicyType type;
- BusPolicyAccess access;
-
- char *name;
-
- LIST_FIELDS(BusNamePolicy, policy);
-};
-
-int bus_kernel_translate_access(BusPolicyAccess access);
-int bus_kernel_translate_policy(const BusNamePolicy *policy, struct kdbus_item *item);
-
-const char* bus_policy_access_to_string(BusPolicyAccess i) _const_;
-BusPolicyAccess bus_policy_access_from_string(const char *s) _pure_;
-
-int bus_kernel_make_starter(
- int fd,
- const char *name,
- bool activating,
- bool accept_fd,
- BusNamePolicy *policy,
- BusPolicyAccess world_policy);
diff --git a/src/core/busname.c b/src/core/busname.c
deleted file mode 100644
index 955f6f88d8..0000000000
--- a/src/core/busname.c
+++ /dev/null
@@ -1,1081 +0,0 @@
-/***
- This file is part of systemd.
-
- Copyright 2013 Lennart Poettering
-
- systemd is free software; you can redistribute it and/or modify it
- under the terms of the GNU Lesser General Public License as published by
- the Free Software Foundation; either version 2.1 of the License, or
- (at your option) any later version.
-
- systemd is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public License
- along with systemd; If not, see <http://www.gnu.org/licenses/>.
-***/
-
-#include <sys/mman.h>
-
-#include "alloc-util.h"
-#include "bus-internal.h"
-#include "bus-kernel.h"
-#include "bus-policy.h"
-#include "bus-util.h"
-#include "busname.h"
-#include "dbus-busname.h"
-#include "fd-util.h"
-#include "format-util.h"
-#include "kdbus.h"
-#include "parse-util.h"
-#include "process-util.h"
-#include "service.h"
-#include "signal-util.h"
-#include "special.h"
-#include "string-table.h"
-#include "string-util.h"
-
-static const UnitActiveState state_translation_table[_BUSNAME_STATE_MAX] = {
- [BUSNAME_DEAD] = UNIT_INACTIVE,
- [BUSNAME_MAKING] = UNIT_ACTIVATING,
- [BUSNAME_REGISTERED] = UNIT_ACTIVE,
- [BUSNAME_LISTENING] = UNIT_ACTIVE,
- [BUSNAME_RUNNING] = UNIT_ACTIVE,
- [BUSNAME_SIGTERM] = UNIT_DEACTIVATING,
- [BUSNAME_SIGKILL] = UNIT_DEACTIVATING,
- [BUSNAME_FAILED] = UNIT_FAILED
-};
-
-static int busname_dispatch_io(sd_event_source *source, int fd, uint32_t revents, void *userdata);
-static int busname_dispatch_timer(sd_event_source *source, usec_t usec, void *userdata);
-
-static void busname_init(Unit *u) {
- BusName *n = BUSNAME(u);
-
- assert(u);
- assert(u->load_state == UNIT_STUB);
-
- n->starter_fd = -1;
- n->accept_fd = true;
- n->activating = true;
-
- n->timeout_usec = u->manager->default_timeout_start_usec;
-}
-
-static void busname_unwatch_control_pid(BusName *n) {
- assert(n);
-
- if (n->control_pid <= 0)
- return;
-
- unit_unwatch_pid(UNIT(n), n->control_pid);
- n->control_pid = 0;
-}
-
-static void busname_free_policy(BusName *n) {
- BusNamePolicy *p;
-
- assert(n);
-
- while ((p = n->policy)) {
- LIST_REMOVE(policy, n->policy, p);
-
- free(p->name);
- free(p);
- }
-}
-
-static void busname_close_fd(BusName *n) {
- assert(n);
-
- n->starter_event_source = sd_event_source_unref(n->starter_event_source);
- n->starter_fd = safe_close(n->starter_fd);
-}
-
-static void busname_done(Unit *u) {
- BusName *n = BUSNAME(u);
-
- assert(n);
-
- n->name = mfree(n->name);
-
- busname_free_policy(n);
- busname_unwatch_control_pid(n);
- busname_close_fd(n);
-
- unit_ref_unset(&n->service);
-
- n->timer_event_source = sd_event_source_unref(n->timer_event_source);
-}
-
-static int busname_arm_timer(BusName *n, usec_t usec) {
- int r;
-
- assert(n);
-
- if (n->timer_event_source) {
- r = sd_event_source_set_time(n->timer_event_source, usec);
- if (r < 0)
- return r;
-
- return sd_event_source_set_enabled(n->timer_event_source, SD_EVENT_ONESHOT);
- }
-
- if (usec == USEC_INFINITY)
- return 0;
-
- r = sd_event_add_time(
- UNIT(n)->manager->event,
- &n->timer_event_source,
- CLOCK_MONOTONIC,
- usec, 0,
- busname_dispatch_timer, n);
- if (r < 0)
- return r;
-
- (void) sd_event_source_set_description(n->timer_event_source, "busname-timer");
-
- return 0;
-}
-
-static int busname_add_default_default_dependencies(BusName *n) {
- int r;
-
- assert(n);
-
- r = unit_add_dependency_by_name(UNIT(n), UNIT_BEFORE, SPECIAL_BUSNAMES_TARGET, NULL, true);
- if (r < 0)
- return r;
-
- if (MANAGER_IS_SYSTEM(UNIT(n)->manager)) {
- r = unit_add_two_dependencies_by_name(UNIT(n), UNIT_AFTER, UNIT_REQUIRES, SPECIAL_SYSINIT_TARGET, NULL, true);
- if (r < 0)
- return r;
- }
-
- return unit_add_two_dependencies_by_name(UNIT(n), UNIT_BEFORE, UNIT_CONFLICTS, SPECIAL_SHUTDOWN_TARGET, NULL, true);
-}
-
-static int busname_add_extras(BusName *n) {
- Unit *u = UNIT(n);
- int r;
-
- assert(n);
-
- if (!n->name) {
- r = unit_name_to_prefix(u->id, &n->name);
- if (r < 0)
- return r;
- }
-
- if (!u->description) {
- r = unit_set_description(u, n->name);
- if (r < 0)
- return r;
- }
-
- if (n->activating) {
- if (!UNIT_DEREF(n->service)) {
- Unit *x;
-
- r = unit_load_related_unit(u, ".service", &x);
- if (r < 0)
- return r;
-
- unit_ref_set(&n->service, x);
- }
-
- r = unit_add_two_dependencies(u, UNIT_BEFORE, UNIT_TRIGGERS, UNIT_DEREF(n->service), true);
- if (r < 0)
- return r;
- }
-
- if (u->default_dependencies) {
- r = busname_add_default_default_dependencies(n);
- if (r < 0)
- return r;
- }
-
- return 0;
-}
-
-static int busname_verify(BusName *n) {
- char *e;
-
- assert(n);
-
- if (UNIT(n)->load_state != UNIT_LOADED)
- return 0;
-
- if (!service_name_is_valid(n->name)) {
- log_unit_error(UNIT(n), "Name= setting is not a valid service name Refusing.");
- return -EINVAL;
- }
-
- e = strjoina(n->name, ".busname");
- if (!unit_has_name(UNIT(n), e)) {
- log_unit_error(UNIT(n), "Name= setting doesn't match unit name. Refusing.");
- return -EINVAL;
- }
-
- return 0;
-}
-
-static int busname_load(Unit *u) {
- BusName *n = BUSNAME(u);
- int r;
-
- assert(u);
- assert(u->load_state == UNIT_STUB);
-
- r = unit_load_fragment_and_dropin(u);
- if (r < 0)
- return r;
-
- if (u->load_state == UNIT_LOADED) {
- /* This is a new unit? Then let's add in some extras */
- r = busname_add_extras(n);
- if (r < 0)
- return r;
- }
-
- return busname_verify(n);
-}
-
-static void busname_dump(Unit *u, FILE *f, const char *prefix) {
- BusName *n = BUSNAME(u);
-
- assert(n);
- assert(f);
-
- fprintf(f,
- "%sBus Name State: %s\n"
- "%sResult: %s\n"
- "%sName: %s\n"
- "%sActivating: %s\n"
- "%sAccept FD: %s\n",
- prefix, busname_state_to_string(n->state),
- prefix, busname_result_to_string(n->result),
- prefix, n->name,
- prefix, yes_no(n->activating),
- prefix, yes_no(n->accept_fd));
-
- if (n->control_pid > 0)
- fprintf(f,
- "%sControl PID: "PID_FMT"\n",
- prefix, n->control_pid);
-}
-
-static void busname_unwatch_fd(BusName *n) {
- int r;
-
- assert(n);
-
- if (!n->starter_event_source)
- return;
-
- r = sd_event_source_set_enabled(n->starter_event_source, SD_EVENT_OFF);
- if (r < 0)
- log_unit_debug_errno(UNIT(n), r, "Failed to disable event source: %m");
-}
-
-static int busname_watch_fd(BusName *n) {
- int r;
-
- assert(n);
-
- if (n->starter_fd < 0)
- return 0;
-
- if (n->starter_event_source) {
- r = sd_event_source_set_enabled(n->starter_event_source, SD_EVENT_ON);
- if (r < 0)
- goto fail;
- } else {
- r = sd_event_add_io(UNIT(n)->manager->event, &n->starter_event_source, n->starter_fd, EPOLLIN, busname_dispatch_io, n);
- if (r < 0)
- goto fail;
-
- (void) sd_event_source_set_description(n->starter_event_source, "busname-starter");
- }
-
- return 0;
-
-fail:
- log_unit_warning_errno(UNIT(n), r, "Failed to watch starter fd: %m");
- busname_unwatch_fd(n);
- return r;
-}
-
-static int busname_open_fd(BusName *n) {
- _cleanup_free_ char *path = NULL;
- const char *mode;
-
- assert(n);
-
- if (n->starter_fd >= 0)
- return 0;
-
- mode = MANAGER_IS_SYSTEM(UNIT(n)->manager) ? "system" : "user";
- n->starter_fd = bus_kernel_open_bus_fd(mode, &path);
- if (n->starter_fd < 0)
- return log_unit_warning_errno(UNIT(n), n->starter_fd, "Failed to open %s: %m", path ?: "kdbus");
-
- return 0;
-}
-
-static void busname_set_state(BusName *n, BusNameState state) {
- BusNameState old_state;
- assert(n);
-
- old_state = n->state;
- n->state = state;
-
- if (!IN_SET(state, BUSNAME_MAKING, BUSNAME_SIGTERM, BUSNAME_SIGKILL)) {
- n->timer_event_source = sd_event_source_unref(n->timer_event_source);
- busname_unwatch_control_pid(n);
- }
-
- if (state != BUSNAME_LISTENING)
- busname_unwatch_fd(n);
-
- if (!IN_SET(state, BUSNAME_LISTENING, BUSNAME_MAKING, BUSNAME_REGISTERED, BUSNAME_RUNNING))
- busname_close_fd(n);
-
- if (state != old_state)
- log_unit_debug(UNIT(n), "Changed %s -> %s", busname_state_to_string(old_state), busname_state_to_string(state));
-
- unit_notify(UNIT(n), state_translation_table[old_state], state_translation_table[state], true);
-}
-
-static int busname_coldplug(Unit *u) {
- BusName *n = BUSNAME(u);
- int r;
-
- assert(n);
- assert(n->state == BUSNAME_DEAD);
-
- if (n->deserialized_state == n->state)
- return 0;
-
- if (n->control_pid > 0 &&
- pid_is_unwaited(n->control_pid) &&
- IN_SET(n->deserialized_state, BUSNAME_MAKING, BUSNAME_SIGTERM, BUSNAME_SIGKILL)) {
-
- r = unit_watch_pid(UNIT(n), n->control_pid);
- if (r < 0)
- return r;
-
- r = busname_arm_timer(n, usec_add(u->state_change_timestamp.monotonic, n->timeout_usec));
- if (r < 0)
- return r;
- }
-
- if (IN_SET(n->deserialized_state, BUSNAME_MAKING, BUSNAME_LISTENING, BUSNAME_REGISTERED, BUSNAME_RUNNING)) {
- r = busname_open_fd(n);
- if (r < 0)
- return r;
- }
-
- if (n->deserialized_state == BUSNAME_LISTENING) {
- r = busname_watch_fd(n);
- if (r < 0)
- return r;
- }
-
- busname_set_state(n, n->deserialized_state);
- return 0;
-}
-
-static int busname_make_starter(BusName *n, pid_t *_pid) {
- pid_t pid;
- int r;
-
- r = busname_arm_timer(n, usec_add(now(CLOCK_MONOTONIC), n->timeout_usec));
- if (r < 0)
- goto fail;
-
- /* We have to resolve the user/group names out-of-process,
- * hence let's fork here. It's messy, but well, what can we
- * do? */
-
- pid = fork();
- if (pid < 0)
- return -errno;
-
- if (pid == 0) {
- int ret;
-
- (void) default_signals(SIGNALS_CRASH_HANDLER, SIGNALS_IGNORE, -1);
- (void) ignore_signals(SIGPIPE, -1);
- log_forget_fds();
-
- r = bus_kernel_make_starter(n->starter_fd, n->name, n->activating, n->accept_fd, n->policy, n->policy_world);
- if (r < 0) {
- ret = EXIT_MAKE_STARTER;
- goto fail_child;
- }
-
- _exit(0);
-
- fail_child:
- log_open();
- log_error_errno(r, "Failed to create starter connection at step %s: %m", exit_status_to_string(ret, EXIT_STATUS_SYSTEMD));
-
- _exit(ret);
- }
-
- r = unit_watch_pid(UNIT(n), pid);
- if (r < 0)
- goto fail;
-
- *_pid = pid;
- return 0;
-
-fail:
- n->timer_event_source = sd_event_source_unref(n->timer_event_source);
- return r;
-}
-
-static void busname_enter_dead(BusName *n, BusNameResult f) {
- assert(n);
-
- if (n->result == BUSNAME_SUCCESS)
- n->result = f;
-
- busname_set_state(n, n->result != BUSNAME_SUCCESS ? BUSNAME_FAILED : BUSNAME_DEAD);
-}
-
-static void busname_enter_signal(BusName *n, BusNameState state, BusNameResult f) {
- KillContext kill_context = {};
- int r;
-
- assert(n);
-
- if (n->result == BUSNAME_SUCCESS)
- n->result = f;
-
- kill_context_init(&kill_context);
-
- r = unit_kill_context(UNIT(n),
- &kill_context,
- state != BUSNAME_SIGTERM ? KILL_KILL : KILL_TERMINATE,
- -1,
- n->control_pid,
- false);
- if (r < 0) {
- log_unit_warning_errno(UNIT(n), r, "Failed to kill control process: %m");
- goto fail;
- }
-
- if (r > 0) {
- r = busname_arm_timer(n, usec_add(now(CLOCK_MONOTONIC), n->timeout_usec));
- if (r < 0) {
- log_unit_warning_errno(UNIT(n), r, "Failed to arm timer: %m");
- goto fail;
- }
-
- busname_set_state(n, state);
- } else if (state == BUSNAME_SIGTERM)
- busname_enter_signal(n, BUSNAME_SIGKILL, BUSNAME_SUCCESS);
- else
- busname_enter_dead(n, BUSNAME_SUCCESS);
-
- return;
-
-fail:
- busname_enter_dead(n, BUSNAME_FAILURE_RESOURCES);
-}
-
-static void busname_enter_listening(BusName *n) {
- int r;
-
- assert(n);
-
- if (n->activating) {
- r = busname_watch_fd(n);
- if (r < 0) {
- log_unit_warning_errno(UNIT(n), r, "Failed to watch names: %m");
- goto fail;
- }
-
- busname_set_state(n, BUSNAME_LISTENING);
- } else
- busname_set_state(n, BUSNAME_REGISTERED);
-
- return;
-
-fail:
- busname_enter_signal(n, BUSNAME_SIGTERM, BUSNAME_FAILURE_RESOURCES);
-}
-
-static void busname_enter_making(BusName *n) {
- int r;
-
- assert(n);
-
- r = busname_open_fd(n);
- if (r < 0)
- goto fail;
-
- if (n->policy) {
- /* If there is a policy, we need to resolve user/group
- * names, which we can't do from PID1, hence let's
- * fork. */
- busname_unwatch_control_pid(n);
-
- r = busname_make_starter(n, &n->control_pid);
- if (r < 0) {
- log_unit_warning_errno(UNIT(n), r, "Failed to fork 'making' task: %m");
- goto fail;
- }
-
- busname_set_state(n, BUSNAME_MAKING);
- } else {
- /* If there is no policy, we can do everything
- * directly from PID 1, hence do so. */
-
- r = bus_kernel_make_starter(n->starter_fd, n->name, n->activating, n->accept_fd, NULL, n->policy_world);
- if (r < 0) {
- log_unit_warning_errno(UNIT(n), r, "Failed to make starter: %m");
- goto fail;
- }
-
- busname_enter_listening(n);
- }
-
- return;
-
-fail:
- busname_enter_dead(n, BUSNAME_FAILURE_RESOURCES);
-}
-
-static void busname_enter_running(BusName *n) {
- _cleanup_(sd_bus_error_free) sd_bus_error error = SD_BUS_ERROR_NULL;
- bool pending = false;
- Unit *other;
- Iterator i;
- int r;
-
- assert(n);
-
- if (!n->activating)
- return;
-
- /* We don't take connections anymore if we are supposed to
- * shut down anyway */
-
- if (unit_stop_pending(UNIT(n))) {
- log_unit_debug(UNIT(n), "Suppressing activation request since unit stop is scheduled.");
-
- /* Flush all queued activation reqeuest by closing and reopening the connection */
- bus_kernel_drop_one(n->starter_fd);
-
- busname_enter_listening(n);
- return;
- }
-
- /* If there's already a start pending don't bother to do
- * anything */
- SET_FOREACH(other, UNIT(n)->dependencies[UNIT_TRIGGERS], i)
- if (unit_active_or_pending(other)) {
- pending = true;
- break;
- }
-
- if (!pending) {
- if (!UNIT_ISSET(n->service)) {
- log_unit_error(UNIT(n), "Service to activate vanished, refusing activation.");
- r = -ENOENT;
- goto fail;
- }
-
- r = manager_add_job(UNIT(n)->manager, JOB_START, UNIT_DEREF(n->service), JOB_REPLACE, &error, NULL);
- if (r < 0)
- goto fail;
- }
-
- busname_set_state(n, BUSNAME_RUNNING);
- return;
-
-fail:
- log_unit_warning(UNIT(n), "Failed to queue service startup job: %s", bus_error_message(&error, r));
- busname_enter_dead(n, BUSNAME_FAILURE_RESOURCES);
-}
-
-static int busname_start(Unit *u) {
- BusName *n = BUSNAME(u);
- int r;
-
- assert(n);
-
- /* We cannot fulfill this request right now, try again later
- * please! */
- if (IN_SET(n->state, BUSNAME_SIGTERM, BUSNAME_SIGKILL))
- return -EAGAIN;
-
- /* Already on it! */
- if (n->state == BUSNAME_MAKING)
- return 0;
-
- if (n->activating && UNIT_ISSET(n->service)) {
- Service *service;
-
- service = SERVICE(UNIT_DEREF(n->service));
-
- if (UNIT(service)->load_state != UNIT_LOADED) {
- log_unit_error(u, "Bus service %s not loaded, refusing.", UNIT(service)->id);
- return -ENOENT;
- }
- }
-
- assert(IN_SET(n->state, BUSNAME_DEAD, BUSNAME_FAILED));
-
- r = unit_start_limit_test(u);
- if (r < 0) {
- busname_enter_dead(n, BUSNAME_FAILURE_START_LIMIT_HIT);
- return r;
- }
-
- r = unit_acquire_invocation_id(u);
- if (r < 0)
- return r;
-
- n->result = BUSNAME_SUCCESS;
- busname_enter_making(n);
-
- return 1;
-}
-
-static int busname_stop(Unit *u) {
- BusName *n = BUSNAME(u);
-
- assert(n);
-
- /* Already on it */
- if (IN_SET(n->state, BUSNAME_SIGTERM, BUSNAME_SIGKILL))
- return 0;
-
- /* If there's already something running, we go directly into
- * kill mode. */
-
- if (n->state == BUSNAME_MAKING) {
- busname_enter_signal(n, BUSNAME_SIGTERM, BUSNAME_SUCCESS);
- return -EAGAIN;
- }
-
- assert(IN_SET(n->state, BUSNAME_REGISTERED, BUSNAME_LISTENING, BUSNAME_RUNNING));
-
- busname_enter_dead(n, BUSNAME_SUCCESS);
- return 1;
-}
-
-static int busname_serialize(Unit *u, FILE *f, FDSet *fds) {
- BusName *n = BUSNAME(u);
- int r;
-
- assert(n);
- assert(f);
- assert(fds);
-
- unit_serialize_item(u, f, "state", busname_state_to_string(n->state));
- unit_serialize_item(u, f, "result", busname_result_to_string(n->result));
-
- if (n->control_pid > 0)
- unit_serialize_item_format(u, f, "control-pid", PID_FMT, n->control_pid);
-
- r = unit_serialize_item_fd(u, f, fds, "starter-fd", n->starter_fd);
- if (r < 0)
- return r;
-
- return 0;
-}
-
-static int busname_deserialize_item(Unit *u, const char *key, const char *value, FDSet *fds) {
- BusName *n = BUSNAME(u);
-
- assert(n);
- assert(key);
- assert(value);
-
- if (streq(key, "state")) {
- BusNameState state;
-
- state = busname_state_from_string(value);
- if (state < 0)
- log_unit_debug(u, "Failed to parse state value: %s", value);
- else
- n->deserialized_state = state;
-
- } else if (streq(key, "result")) {
- BusNameResult f;
-
- f = busname_result_from_string(value);
- if (f < 0)
- log_unit_debug(u, "Failed to parse result value: %s", value);
- else if (f != BUSNAME_SUCCESS)
- n->result = f;
-
- } else if (streq(key, "control-pid")) {
- pid_t pid;
-
- if (parse_pid(value, &pid) < 0)
- log_unit_debug(u, "Failed to parse control-pid value: %s", value);
- else
- n->control_pid = pid;
- } else if (streq(key, "starter-fd")) {
- int fd;
-
- if (safe_atoi(value, &fd) < 0 || fd < 0 || !fdset_contains(fds, fd))
- log_unit_debug(u, "Failed to parse starter fd value: %s", value);
- else {
- safe_close(n->starter_fd);
- n->starter_fd = fdset_remove(fds, fd);
- }
- } else
- log_unit_debug(u, "Unknown serialization key: %s", key);
-
- return 0;
-}
-
-_pure_ static UnitActiveState busname_active_state(Unit *u) {
- assert(u);
-
- return state_translation_table[BUSNAME(u)->state];
-}
-
-_pure_ static const char *busname_sub_state_to_string(Unit *u) {
- assert(u);
-
- return busname_state_to_string(BUSNAME(u)->state);
-}
-
-static int busname_peek_message(BusName *n) {
- struct kdbus_cmd_recv cmd_recv = {
- .size = sizeof(cmd_recv),
- .flags = KDBUS_RECV_PEEK,
- };
- struct kdbus_cmd_free cmd_free = {
- .size = sizeof(cmd_free),
- };
- const char *comm = NULL;
- struct kdbus_item *d;
- struct kdbus_msg *k;
- size_t start, ps, sz, delta;
- void *p = MAP_FAILED;
- pid_t pid = 0;
- int r;
-
- /* Generate a friendly debug log message about which process
- * caused triggering of this bus name. This simply peeks the
- * metadata of the first queued message and logs it. */
-
- assert(n);
-
- /* Let's shortcut things a bit, if debug logging is turned off
- * anyway. */
-
- if (log_get_max_level() < LOG_DEBUG)
- return 0;
-
- r = ioctl(n->starter_fd, KDBUS_CMD_RECV, &cmd_recv);
- if (r < 0) {
- if (errno == EINTR || errno == EAGAIN)
- return 0;
-
- return log_unit_error_errno(UNIT(n), errno, "Failed to query activation message: %m");
- }
-
- /* We map as late as possible, and unmap imemdiately after
- * use. On 32bit address space is scarce and we want to be
- * able to handle a lot of activator connections at the same
- * time, and hence shouldn't keep the mmap()s around for
- * longer than necessary. */
-
- ps = page_size();
- start = (cmd_recv.msg.offset / ps) * ps;
- delta = cmd_recv.msg.offset - start;
- sz = PAGE_ALIGN(delta + cmd_recv.msg.msg_size);
-
- p = mmap(NULL, sz, PROT_READ, MAP_SHARED, n->starter_fd, start);
- if (p == MAP_FAILED) {
- r = log_unit_error_errno(UNIT(n), errno, "Failed to map activation message: %m");
- goto finish;
- }
-
- k = (struct kdbus_msg *) ((uint8_t *) p + delta);
- KDBUS_ITEM_FOREACH(d, k, items) {
- switch (d->type) {
-
- case KDBUS_ITEM_PIDS:
- pid = d->pids.pid;
- break;
-
- case KDBUS_ITEM_PID_COMM:
- comm = d->str;
- break;
- }
- }
-
- if (pid > 0)
- log_unit_debug(UNIT(n), "Activation triggered by process " PID_FMT " (%s)", pid, strna(comm));
-
- r = 0;
-
-finish:
- if (p != MAP_FAILED)
- (void) munmap(p, sz);
-
- cmd_free.offset = cmd_recv.msg.offset;
- if (ioctl(n->starter_fd, KDBUS_CMD_FREE, &cmd_free) < 0)
- log_unit_warning(UNIT(n), "Failed to free peeked message, ignoring: %m");
-
- return r;
-}
-
-static int busname_dispatch_io(sd_event_source *source, int fd, uint32_t revents, void *userdata) {
- BusName *n = userdata;
-
- assert(n);
- assert(fd >= 0);
-
- if (n->state != BUSNAME_LISTENING)
- return 0;
-
- log_unit_debug(UNIT(n), "Activation request");
-
- if (revents != EPOLLIN) {
- log_unit_error(UNIT(n), "Got unexpected poll event (0x%x) on starter fd.", revents);
- goto fail;
- }
-
- busname_peek_message(n);
- busname_enter_running(n);
- return 0;
-fail:
-
- busname_enter_dead(n, BUSNAME_FAILURE_RESOURCES);
- return 0;
-}
-
-static void busname_sigchld_event(Unit *u, pid_t pid, int code, int status) {
- BusName *n = BUSNAME(u);
- BusNameResult f;
-
- assert(n);
- assert(pid >= 0);
-
- if (pid != n->control_pid)
- return;
-
- n->control_pid = 0;
-
- if (is_clean_exit(code, status, EXIT_CLEAN_COMMAND, NULL))
- f = BUSNAME_SUCCESS;
- else if (code == CLD_EXITED)
- f = BUSNAME_FAILURE_EXIT_CODE;
- else if (code == CLD_KILLED)
- f = BUSNAME_FAILURE_SIGNAL;
- else if (code == CLD_DUMPED)
- f = BUSNAME_FAILURE_CORE_DUMP;
- else
- assert_not_reached("Unknown sigchld code");
-
- log_unit_full(u, f == BUSNAME_SUCCESS ? LOG_DEBUG : LOG_NOTICE, 0,
- "Control process exited, code=%s status=%i", sigchld_code_to_string(code), status);
-
- if (n->result == BUSNAME_SUCCESS)
- n->result = f;
-
- switch (n->state) {
-
- case BUSNAME_MAKING:
- if (f == BUSNAME_SUCCESS)
- busname_enter_listening(n);
- else
- busname_enter_signal(n, BUSNAME_SIGTERM, f);
- break;
-
- case BUSNAME_SIGTERM:
- case BUSNAME_SIGKILL:
- busname_enter_dead(n, f);
- break;
-
- default:
- assert_not_reached("Uh, control process died at wrong time.");
- }
-
- /* Notify clients about changed exit status */
- unit_add_to_dbus_queue(u);
-}
-
-static int busname_dispatch_timer(sd_event_source *source, usec_t usec, void *userdata) {
- BusName *n = BUSNAME(userdata);
-
- assert(n);
- assert(n->timer_event_source == source);
-
- switch (n->state) {
-
- case BUSNAME_MAKING:
- log_unit_warning(UNIT(n), "Making timed out. Terminating.");
- busname_enter_signal(n, BUSNAME_SIGTERM, BUSNAME_FAILURE_TIMEOUT);
- break;
-
- case BUSNAME_SIGTERM:
- log_unit_warning(UNIT(n), "Stopping timed out. Killing.");
- busname_enter_signal(n, BUSNAME_SIGKILL, BUSNAME_FAILURE_TIMEOUT);
- break;
-
- case BUSNAME_SIGKILL:
- log_unit_warning(UNIT(n), "Processes still around after SIGKILL. Ignoring.");
- busname_enter_dead(n, BUSNAME_FAILURE_TIMEOUT);
- break;
-
- default:
- assert_not_reached("Timeout at wrong time.");
- }
-
- return 0;
-}
-
-static void busname_reset_failed(Unit *u) {
- BusName *n = BUSNAME(u);
-
- assert(n);
-
- if (n->state == BUSNAME_FAILED)
- busname_set_state(n, BUSNAME_DEAD);
-
- n->result = BUSNAME_SUCCESS;
-}
-
-static void busname_trigger_notify(Unit *u, Unit *other) {
- BusName *n = BUSNAME(u);
-
- assert(n);
- assert(other);
-
- if (!IN_SET(n->state, BUSNAME_RUNNING, BUSNAME_LISTENING))
- return;
-
- if (other->start_limit_hit) {
- busname_enter_dead(n, BUSNAME_FAILURE_SERVICE_START_LIMIT_HIT);
- return;
- }
-
- if (other->load_state != UNIT_LOADED || other->type != UNIT_SERVICE)
- return;
-
- if (IN_SET(SERVICE(other)->state,
- SERVICE_DEAD, SERVICE_FAILED,
- SERVICE_FINAL_SIGTERM, SERVICE_FINAL_SIGKILL,
- SERVICE_AUTO_RESTART))
- busname_enter_listening(n);
-
- if (SERVICE(other)->state == SERVICE_RUNNING)
- busname_set_state(n, BUSNAME_RUNNING);
-}
-
-static int busname_kill(Unit *u, KillWho who, int signo, sd_bus_error *error) {
- return unit_kill_common(u, who, signo, -1, BUSNAME(u)->control_pid, error);
-}
-
-static int busname_get_timeout(Unit *u, usec_t *timeout) {
- BusName *n = BUSNAME(u);
- usec_t t;
- int r;
-
- if (!n->timer_event_source)
- return 0;
-
- r = sd_event_source_get_time(n->timer_event_source, &t);
- if (r < 0)
- return r;
- if (t == USEC_INFINITY)
- return 0;
-
- *timeout = t;
- return 1;
-}
-
-static bool busname_supported(void) {
- return false;
-}
-
-static int busname_control_pid(Unit *u) {
- BusName *n = BUSNAME(u);
-
- assert(n);
-
- return n->control_pid;
-}
-
-static const char* const busname_result_table[_BUSNAME_RESULT_MAX] = {
- [BUSNAME_SUCCESS] = "success",
- [BUSNAME_FAILURE_RESOURCES] = "resources",
- [BUSNAME_FAILURE_TIMEOUT] = "timeout",
- [BUSNAME_FAILURE_EXIT_CODE] = "exit-code",
- [BUSNAME_FAILURE_SIGNAL] = "signal",
- [BUSNAME_FAILURE_CORE_DUMP] = "core-dump",
- [BUSNAME_FAILURE_START_LIMIT_HIT] = "start-limit-hit",
- [BUSNAME_FAILURE_SERVICE_START_LIMIT_HIT] = "service-start-limit-hit",
-};
-
-DEFINE_STRING_TABLE_LOOKUP(busname_result, BusNameResult);
-
-const UnitVTable busname_vtable = {
- .object_size = sizeof(BusName),
-
- .sections =
- "Unit\0"
- "BusName\0"
- "Install\0",
- .private_section = "BusName",
-
- .init = busname_init,
- .done = busname_done,
- .load = busname_load,
-
- .coldplug = busname_coldplug,
-
- .dump = busname_dump,
-
- .start = busname_start,
- .stop = busname_stop,
-
- .kill = busname_kill,
-
- .get_timeout = busname_get_timeout,
-
- .serialize = busname_serialize,
- .deserialize_item = busname_deserialize_item,
-
- .active_state = busname_active_state,
- .sub_state_to_string = busname_sub_state_to_string,
-
- .sigchld_event = busname_sigchld_event,
-
- .trigger_notify = busname_trigger_notify,
-
- .reset_failed = busname_reset_failed,
-
- .supported = busname_supported,
-
- .control_pid = busname_control_pid,
-
- .bus_vtable = bus_busname_vtable,
-
- .status_message_formats = {
- .finished_start_job = {
- [JOB_DONE] = "Listening on %s.",
- [JOB_FAILED] = "Failed to listen on %s.",
- },
- .finished_stop_job = {
- [JOB_DONE] = "Closed %s.",
- [JOB_FAILED] = "Failed stopping %s.",
- },
- },
-};
diff --git a/src/core/busname.h b/src/core/busname.h
deleted file mode 100644
index a8562db458..0000000000
--- a/src/core/busname.h
+++ /dev/null
@@ -1,69 +0,0 @@
-#pragma once
-
-/***
- This file is part of systemd.
-
- Copyright 2013 Lennart Poettering
-
- systemd is free software; you can redistribute it and/or modify it
- under the terms of the GNU Lesser General Public License as published by
- the Free Software Foundation; either version 2.1 of the License, or
- (at your option) any later version.
-
- systemd is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public License
- along with systemd; If not, see <http://www.gnu.org/licenses/>.
-***/
-
-typedef struct BusName BusName;
-typedef struct BusNamePolicy BusNamePolicy;
-
-#include "unit.h"
-#include "bus-policy.h"
-
-typedef enum BusNameResult {
- BUSNAME_SUCCESS,
- BUSNAME_FAILURE_RESOURCES,
- BUSNAME_FAILURE_TIMEOUT,
- BUSNAME_FAILURE_EXIT_CODE,
- BUSNAME_FAILURE_SIGNAL,
- BUSNAME_FAILURE_CORE_DUMP,
- BUSNAME_FAILURE_START_LIMIT_HIT,
- BUSNAME_FAILURE_SERVICE_START_LIMIT_HIT,
- _BUSNAME_RESULT_MAX,
- _BUSNAME_RESULT_INVALID = -1
-} BusNameResult;
-
-struct BusName {
- Unit meta;
-
- char *name;
- int starter_fd;
-
- bool activating;
- bool accept_fd;
-
- UnitRef service;
-
- BusNameState state, deserialized_state;
- BusNameResult result;
-
- usec_t timeout_usec;
-
- sd_event_source *starter_event_source;
- sd_event_source *timer_event_source;
-
- pid_t control_pid;
-
- LIST_HEAD(BusNamePolicy, policy);
- BusPolicyAccess policy_world;
-};
-
-extern const UnitVTable busname_vtable;
-
-const char* busname_result_to_string(BusNameResult i) _const_;
-BusNameResult busname_result_from_string(const char *s) _pure_;
diff --git a/src/core/cgroup.c b/src/core/cgroup.c
index 71f307fb6c..82d86a0ad4 100644
--- a/src/core/cgroup.c
+++ b/src/core/cgroup.c
@@ -931,8 +931,6 @@ static void cgroup_context_apply(Unit *u, CGroupMask mask, ManagerState state) {
whitelist_device(path, x, y);
whitelist_major(path, "pts", 'c', "rw");
- whitelist_major(path, "kdbus", 'c', "rw");
- whitelist_major(path, "kdbus/*", 'c', "rw");
}
LIST_FOREACH(device_allow, a, c->device_allow) {
@@ -1593,7 +1591,7 @@ int unit_search_main_pid(Unit *u, pid_t *ret) {
if (r < 0)
return r;
- mypid = getpid();
+ mypid = getpid_cached();
while (cg_read_pid(f, &npid) > 0) {
pid_t ppid;
diff --git a/src/core/dbus-busname.c b/src/core/dbus-busname.c
deleted file mode 100644
index cf816ba15b..0000000000
--- a/src/core/dbus-busname.c
+++ /dev/null
@@ -1,37 +0,0 @@
-/***
- This file is part of systemd.
-
- Copyright 2013 Lennart Poettering
-
- systemd is free software; you can redistribute it and/or modify it
- under the terms of the GNU Lesser General Public License as published by
- the Free Software Foundation; either version 2.1 of the License, or
- (at your option) any later version.
-
- systemd is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public License
- along with systemd; If not, see <http://www.gnu.org/licenses/>.
-***/
-
-#include "bus-util.h"
-#include "busname.h"
-#include "dbus-busname.h"
-#include "string-util.h"
-#include "unit.h"
-
-static BUS_DEFINE_PROPERTY_GET_ENUM(property_get_result, busname_result, BusNameResult);
-
-const sd_bus_vtable bus_busname_vtable[] = {
- SD_BUS_VTABLE_START(0),
- SD_BUS_PROPERTY("Name", "s", NULL, offsetof(BusName, name), SD_BUS_VTABLE_PROPERTY_CONST),
- SD_BUS_PROPERTY("TimeoutUSec", "t", bus_property_get_usec, offsetof(BusName, timeout_usec), SD_BUS_VTABLE_PROPERTY_CONST),
- SD_BUS_PROPERTY("ControlPID", "u", bus_property_get_pid, offsetof(BusName, control_pid), SD_BUS_VTABLE_PROPERTY_EMITS_CHANGE),
- SD_BUS_PROPERTY("Result", "s", property_get_result, offsetof(BusName, result), SD_BUS_VTABLE_PROPERTY_EMITS_CHANGE),
- SD_BUS_PROPERTY("Activating", "b", bus_property_get_bool, offsetof(BusName, activating), SD_BUS_VTABLE_PROPERTY_CONST),
- SD_BUS_PROPERTY("AcceptFileDescriptors", "b", bus_property_get_bool, offsetof(BusName, accept_fd), SD_BUS_VTABLE_PROPERTY_CONST),
- SD_BUS_VTABLE_END
-};
diff --git a/src/core/dbus-busname.h b/src/core/dbus-busname.h
deleted file mode 100644
index 8643d1a404..0000000000
--- a/src/core/dbus-busname.h
+++ /dev/null
@@ -1,23 +0,0 @@
-#pragma once
-
-/***
- This file is part of systemd.
-
- Copyright 2013 Lennart Poettering
-
- systemd is free software; you can redistribute it and/or modify it
- under the terms of the GNU Lesser General Public License as published by
- the Free Software Foundation; either version 2.1 of the License, or
- (at your option) any later version.
-
- systemd is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public License
- along with systemd; If not, see <http://www.gnu.org/licenses/>.
-***/
-
-
-extern const sd_bus_vtable bus_busname_vtable[];
diff --git a/src/core/dbus-cgroup.c b/src/core/dbus-cgroup.c
index 12d3ca076b..4e6d1effaa 100644
--- a/src/core/dbus-cgroup.c
+++ b/src/core/dbus-cgroup.c
@@ -625,7 +625,7 @@ int bus_cgroup_set_property(
if (!f)
return -ENOMEM;
- fputs("IODeviceWeight=\n", f);
+ fputs_unlocked("IODeviceWeight=\n", f);
LIST_FOREACH(device_weights, a, c->io_device_weights)
fprintf(f, "IODeviceWeight=%s %" PRIu64 "\n", a->path, a->weight);
@@ -774,12 +774,12 @@ int bus_cgroup_set_property(
return -ENOMEM;
if (read) {
- fputs("BlockIOReadBandwidth=\n", f);
+ fputs_unlocked("BlockIOReadBandwidth=\n", f);
LIST_FOREACH(device_bandwidths, a, c->blockio_device_bandwidths)
if (a->rbps != CGROUP_LIMIT_MAX)
fprintf(f, "BlockIOReadBandwidth=%s %" PRIu64 "\n", a->path, a->rbps);
} else {
- fputs("BlockIOWriteBandwidth=\n", f);
+ fputs_unlocked("BlockIOWriteBandwidth=\n", f);
LIST_FOREACH(device_bandwidths, a, c->blockio_device_bandwidths)
if (a->wbps != CGROUP_LIMIT_MAX)
fprintf(f, "BlockIOWriteBandwidth=%s %" PRIu64 "\n", a->path, a->wbps);
@@ -857,7 +857,7 @@ int bus_cgroup_set_property(
if (!f)
return -ENOMEM;
- fputs("BlockIODeviceWeight=\n", f);
+ fputs_unlocked("BlockIODeviceWeight=\n", f);
LIST_FOREACH(device_weights, a, c->blockio_device_weights)
fprintf(f, "BlockIODeviceWeight=%s %" PRIu64 "\n", a->path, a->weight);
@@ -1086,7 +1086,7 @@ int bus_cgroup_set_property(
if (!f)
return -ENOMEM;
- fputs("DeviceAllow=\n", f);
+ fputs_unlocked("DeviceAllow=\n", f);
LIST_FOREACH(device_allow, a, c->device_allow)
fprintf(f, "DeviceAllow=%s %s%s%s\n", a->path, a->r ? "r" : "", a->w ? "w" : "", a->m ? "m" : "");
diff --git a/src/core/dbus-execute.c b/src/core/dbus-execute.c
index c041a7d94c..01f2d11342 100644
--- a/src/core/dbus-execute.c
+++ b/src/core/dbus-execute.c
@@ -55,6 +55,8 @@ static BUS_DEFINE_PROPERTY_GET_ENUM(property_get_exec_input, exec_input, ExecInp
static BUS_DEFINE_PROPERTY_GET_ENUM(property_get_exec_utmp_mode, exec_utmp_mode, ExecUtmpMode);
+static BUS_DEFINE_PROPERTY_GET_ENUM(property_get_exec_preserve_mode, exec_preserve_mode, ExecPreserveMode);
+
static BUS_DEFINE_PROPERTY_GET_ENUM(bus_property_get_protect_home, protect_home, ProtectHome);
static BUS_DEFINE_PROPERTY_GET_ENUM(bus_property_get_protect_system, protect_system, ProtectSystem);
@@ -849,8 +851,17 @@ const sd_bus_vtable bus_exec_vtable[] = {
SD_BUS_PROPERTY("SystemCallErrorNumber", "i", property_get_syscall_errno, 0, SD_BUS_VTABLE_PROPERTY_CONST),
SD_BUS_PROPERTY("Personality", "s", property_get_personality, 0, SD_BUS_VTABLE_PROPERTY_CONST),
SD_BUS_PROPERTY("RestrictAddressFamilies", "(bas)", property_get_address_families, 0, SD_BUS_VTABLE_PROPERTY_CONST),
- SD_BUS_PROPERTY("RuntimeDirectoryMode", "u", bus_property_get_mode, offsetof(ExecContext, runtime_directory_mode), SD_BUS_VTABLE_PROPERTY_CONST),
- SD_BUS_PROPERTY("RuntimeDirectory", "as", NULL, offsetof(ExecContext, runtime_directory), SD_BUS_VTABLE_PROPERTY_CONST),
+ SD_BUS_PROPERTY("RuntimeDirectoryPreserve", "s", property_get_exec_preserve_mode, offsetof(ExecContext, runtime_directory_preserve_mode), SD_BUS_VTABLE_PROPERTY_CONST),
+ SD_BUS_PROPERTY("RuntimeDirectoryMode", "u", bus_property_get_mode, offsetof(ExecContext, directories[EXEC_DIRECTORY_RUNTIME].mode), SD_BUS_VTABLE_PROPERTY_CONST),
+ SD_BUS_PROPERTY("RuntimeDirectory", "as", NULL, offsetof(ExecContext, directories[EXEC_DIRECTORY_RUNTIME].paths), SD_BUS_VTABLE_PROPERTY_CONST),
+ SD_BUS_PROPERTY("DataDirectoryMode", "u", bus_property_get_mode, offsetof(ExecContext, directories[EXEC_DIRECTORY_STATE].mode), SD_BUS_VTABLE_PROPERTY_CONST),
+ SD_BUS_PROPERTY("DataDirectory", "as", NULL, offsetof(ExecContext, directories[EXEC_DIRECTORY_STATE].paths), SD_BUS_VTABLE_PROPERTY_CONST),
+ SD_BUS_PROPERTY("CacheDirectoryMode", "u", bus_property_get_mode, offsetof(ExecContext, directories[EXEC_DIRECTORY_CACHE].mode), SD_BUS_VTABLE_PROPERTY_CONST),
+ SD_BUS_PROPERTY("CacheDirectory", "as", NULL, offsetof(ExecContext, directories[EXEC_DIRECTORY_CACHE].paths), SD_BUS_VTABLE_PROPERTY_CONST),
+ SD_BUS_PROPERTY("LogsDirectoryMode", "u", bus_property_get_mode, offsetof(ExecContext, directories[EXEC_DIRECTORY_LOGS].mode), SD_BUS_VTABLE_PROPERTY_CONST),
+ SD_BUS_PROPERTY("LogsDirectory", "as", NULL, offsetof(ExecContext, directories[EXEC_DIRECTORY_LOGS].paths), SD_BUS_VTABLE_PROPERTY_CONST),
+ SD_BUS_PROPERTY("ConfigurationDirectoryMode", "u", bus_property_get_mode, offsetof(ExecContext, directories[EXEC_DIRECTORY_CONFIGURATION].mode), SD_BUS_VTABLE_PROPERTY_CONST),
+ SD_BUS_PROPERTY("ConfigurationDirectory", "as", NULL, offsetof(ExecContext, directories[EXEC_DIRECTORY_CONFIGURATION].paths), SD_BUS_VTABLE_PROPERTY_CONST),
SD_BUS_PROPERTY("MemoryDenyWriteExecute", "b", bus_property_get_bool, offsetof(ExecContext, memory_deny_write_execute), SD_BUS_VTABLE_PROPERTY_CONST),
SD_BUS_PROPERTY("RestrictRealtime", "b", bus_property_get_bool, offsetof(ExecContext, restrict_realtime), SD_BUS_VTABLE_PROPERTY_CONST),
SD_BUS_PROPERTY("RestrictNamespaces", "t", bus_property_get_ulong, offsetof(ExecContext, restrict_namespaces), SD_BUS_VTABLE_PROPERTY_CONST),
@@ -1678,7 +1689,48 @@ int bus_exec_context_set_transient_property(
return 1;
- } else if (streq(name, "RuntimeDirectory")) {
+ } else if (streq(name, "RuntimeDirectoryPreserve")) {
+ const char *s;
+ ExecPreserveMode m;
+
+ r = sd_bus_message_read(message, "s", &s);
+ if (r < 0)
+ return r;
+
+ m = exec_preserve_mode_from_string(s);
+ if (m < 0)
+ return sd_bus_error_setf(error, SD_BUS_ERROR_INVALID_ARGS, "Invalid preserve mode");
+
+ if (mode != UNIT_CHECK) {
+ c->runtime_directory_preserve_mode = m;
+
+ unit_write_drop_in_private_format(u, mode, name, "RuntimeDirectoryPreserve=%s", exec_preserve_mode_to_string(m));
+ }
+
+ return 1;
+
+ } else if (STR_IN_SET(name, "RuntimeDirectoryMode", "StateDirectoryMode", "CacheDirectoryMode", "LogsDirectoryMode", "ConfigurationDirectoryMode")) {
+ mode_t m;
+
+ r = sd_bus_message_read(message, "u", &m);
+ if (r < 0)
+ return r;
+
+ if (mode != UNIT_CHECK) {
+ ExecDirectoryType i;
+
+ for (i = 0; i < _EXEC_DIRECTORY_MAX; i++)
+ if (startswith(name, exec_directory_type_to_string(i))) {
+ c->directories[i].mode = m;
+ break;
+ }
+
+ unit_write_drop_in_private_format(u, mode, name, "%s=%040o", name, m);
+ }
+
+ return 1;
+
+ } else if (STR_IN_SET(name, "RuntimeDirectory", "StateDirectory", "CacheDirectory", "LogsDirectory", "ConfigurationDirectory")) {
_cleanup_strv_free_ char **l = NULL;
char **p;
@@ -1688,22 +1740,32 @@ int bus_exec_context_set_transient_property(
STRV_FOREACH(p, l) {
if (!filename_is_valid(*p))
- return sd_bus_error_setf(error, SD_BUS_ERROR_INVALID_ARGS, "Runtime directory is not valid %s", *p);
+ return sd_bus_error_setf(error, SD_BUS_ERROR_INVALID_ARGS, "%s is not valid %s", name, *p);
}
if (mode != UNIT_CHECK) {
_cleanup_free_ char *joined = NULL;
+ char ***dirs = NULL;
+ ExecDirectoryType i;
+
+ for (i = 0; i < _EXEC_DIRECTORY_MAX; i++)
+ if (streq(name, exec_directory_type_to_string(i))) {
+ dirs = &c->directories[i].paths;
+ break;
+ }
+
+ assert(dirs);
if (strv_isempty(l)) {
- c->runtime_directory = strv_free(c->runtime_directory);
+ *dirs = strv_free(*dirs);
unit_write_drop_in_private_format(u, mode, name, "%s=", name);
} else {
- r = strv_extend_strv(&c->runtime_directory, l, true);
+ r = strv_extend_strv(dirs, l, true);
if (r < 0)
return -ENOMEM;
- joined = strv_join_quoted(c->runtime_directory);
+ joined = strv_join_quoted(*dirs);
if (!joined)
return -ENOMEM;
diff --git a/src/core/dbus-service.c b/src/core/dbus-service.c
index 6458ee5c12..a20d4b3b99 100644
--- a/src/core/dbus-service.c
+++ b/src/core/dbus-service.c
@@ -308,7 +308,7 @@ static int bus_service_set_transient_property(
if (!f)
return -ENOMEM;
- fputs("ExecStart=\n", f);
+ fputs_unlocked("ExecStart=\n", f);
LIST_FOREACH(command, c, s->exec_command[SERVICE_EXEC_START]) {
_cleanup_free_ char *a;
diff --git a/src/core/dbus.c b/src/core/dbus.c
index cfc045d282..96bf975f88 100644
--- a/src/core/dbus.c
+++ b/src/core/dbus.c
@@ -967,7 +967,7 @@ static int bus_init_private(Manager *m) {
if (MANAGER_IS_SYSTEM(m)) {
/* We want the private bus only when running as init */
- if (getpid() != 1)
+ if (getpid_cached() != 1)
return 0;
strcpy(sa.un.sun_path, "/run/systemd/private");
diff --git a/src/core/execute.c b/src/core/execute.c
index d72e5bf08c..48b84815ca 100644
--- a/src/core/execute.c
+++ b/src/core/execute.c
@@ -1099,7 +1099,7 @@ static int setup_pam(
assert_se(sigprocmask_many(SIG_BLOCK, &old_ss, SIGTERM, -1) >= 0);
- parent_pid = getpid();
+ parent_pid = getpid_cached();
pam_pid = fork();
if (pam_pid < 0) {
@@ -1506,7 +1506,7 @@ static int build_environment(
if (n_fds > 0) {
_cleanup_free_ char *joined = NULL;
- if (asprintf(&x, "LISTEN_PID="PID_FMT, getpid()) < 0)
+ if (asprintf(&x, "LISTEN_PID="PID_FMT, getpid_cached()) < 0)
return -ENOMEM;
our_env[n_env++] = x;
@@ -1525,7 +1525,7 @@ static int build_environment(
}
if ((p->flags & EXEC_SET_WATCHDOG) && p->watchdog_usec > 0) {
- if (asprintf(&x, "WATCHDOG_PID="PID_FMT, getpid()) < 0)
+ if (asprintf(&x, "WATCHDOG_PID="PID_FMT, getpid_cached()) < 0)
return -ENOMEM;
our_env[n_env++] = x;
@@ -1839,35 +1839,68 @@ static int setup_private_users(uid_t uid, gid_t gid) {
return 0;
}
-static int setup_runtime_directory(
+static int setup_exec_directory(
const ExecContext *context,
const ExecParameters *params,
uid_t uid,
- gid_t gid) {
+ gid_t gid,
+ bool manager_is_system,
+ ExecDirectoryType type,
+ int *exit_status) {
+ static const int exit_status_table[_EXEC_DIRECTORY_MAX] = {
+ [EXEC_DIRECTORY_RUNTIME] = EXIT_RUNTIME_DIRECTORY,
+ [EXEC_DIRECTORY_STATE] = EXIT_STATE_DIRECTORY,
+ [EXEC_DIRECTORY_CACHE] = EXIT_CACHE_DIRECTORY,
+ [EXEC_DIRECTORY_LOGS] = EXIT_LOGS_DIRECTORY,
+ [EXEC_DIRECTORY_CONFIGURATION] = EXIT_CONFIGURATION_DIRECTORY,
+ };
char **rt;
int r;
assert(context);
assert(params);
+ assert(type >= 0 && type < _EXEC_DIRECTORY_MAX);
+ assert(exit_status);
+
+ if (!params->prefix[type])
+ return 0;
- STRV_FOREACH(rt, context->runtime_directory) {
+ if (manager_is_system) {
+ if (!uid_is_valid(uid))
+ uid = 0;
+ if (!gid_is_valid(gid))
+ gid = 0;
+ }
+
+ STRV_FOREACH(rt, context->directories[type].paths) {
_cleanup_free_ char *p;
- p = strjoin(params->runtime_prefix, "/", *rt);
- if (!p)
- return -ENOMEM;
+ p = strjoin(params->prefix[type], "/", *rt);
+ if (!p) {
+ r = -ENOMEM;
+ goto fail;
+ }
- r = mkdir_p_label(p, context->runtime_directory_mode);
+ r = mkdir_parents_label(p, 0755);
if (r < 0)
- return r;
+ goto fail;
- r = chmod_and_chown(p, context->runtime_directory_mode, uid, gid);
+ r = mkdir_p_label(p, context->directories[type].mode);
if (r < 0)
- return r;
+ goto fail;
+
+ r = chmod_and_chown(p, context->directories[type].mode, uid, gid);
+ if (r < 0)
+ goto fail;
}
return 0;
+
+fail:
+ *exit_status = exit_status_table[type];
+
+ return r;
}
static int setup_smack(
@@ -1913,29 +1946,40 @@ static int compile_read_write_paths(
_cleanup_strv_free_ char **l = NULL;
char **rt;
+ ExecDirectoryType i;
/* Compile the list of writable paths. This is the combination of
* the explicitly configured paths, plus all runtime directories. */
- if (strv_isempty(context->read_write_paths) &&
- strv_isempty(context->runtime_directory)) {
- *ret = NULL; /* NOP if neither is set */
- return 0;
+ if (strv_isempty(context->read_write_paths)) {
+ for (i = 0; i < _EXEC_DIRECTORY_MAX; i++)
+ if (!strv_isempty(context->directories[i].paths))
+ break;
+
+ if (i == _EXEC_DIRECTORY_MAX) {
+ *ret = NULL; /* NOP if neither is set */
+ return 0;
+ }
}
l = strv_copy(context->read_write_paths);
if (!l)
return -ENOMEM;
- STRV_FOREACH(rt, context->runtime_directory) {
- char *s;
+ for (i = 0; i < _EXEC_DIRECTORY_MAX; i++) {
+ if (!params->prefix[i])
+ continue;
- s = strjoin(params->runtime_prefix, "/", *rt);
- if (!s)
- return -ENOMEM;
+ STRV_FOREACH(rt, context->directories[i].paths) {
+ char *s;
- if (strv_consume(&l, s) < 0)
- return -ENOMEM;
+ s = strjoin(params->prefix[i], "/", *rt);
+ if (!s)
+ return -ENOMEM;
+
+ if (strv_consume(&l, s) < 0)
+ return -ENOMEM;
+ }
}
*ret = l;
@@ -2265,6 +2309,7 @@ static int exec_child(
gid_t gid = GID_INVALID;
int i, r, ngids = 0;
unsigned n_fds;
+ ExecDirectoryType dt;
assert(unit);
assert(command);
@@ -2519,7 +2564,7 @@ static int exec_child(
}
if (context->utmp_id)
- utmp_put_init_process(context->utmp_id, getpid(), getsid(0),
+ utmp_put_init_process(context->utmp_id, getpid_cached(), getsid(0),
context->tty_path,
context->utmp_mode == EXEC_UTMP_INIT ? INIT_PROCESS :
context->utmp_mode == EXEC_UTMP_LOGIN ? LOGIN_PROCESS :
@@ -2552,12 +2597,10 @@ static int exec_child(
}
}
- if (!strv_isempty(context->runtime_directory) && params->runtime_prefix) {
- r = setup_runtime_directory(context, params, uid, gid);
- if (r < 0) {
- *exit_status = EXIT_RUNTIME_DIRECTORY;
+ for (dt = 0; dt < _EXEC_DIRECTORY_MAX; dt++) {
+ r = setup_exec_directory(context, params, uid, gid, MANAGER_IS_SYSTEM(unit->manager), dt, exit_status);
+ if (r < 0)
return r;
- }
}
r = build_environment(
@@ -3045,6 +3088,8 @@ int exec_spawn(Unit *unit,
}
void exec_context_init(ExecContext *c) {
+ ExecDirectoryType i;
+
assert(c);
c->umask = 0022;
@@ -3055,13 +3100,15 @@ void exec_context_init(ExecContext *c) {
c->ignore_sigpipe = true;
c->timer_slack_nsec = NSEC_INFINITY;
c->personality = PERSONALITY_INVALID;
- c->runtime_directory_mode = 0755;
+ for (i = 0; i < _EXEC_DIRECTORY_MAX; i++)
+ c->directories[i].mode = 0755;
c->capability_bounding_set = CAP_ALL;
c->restrict_namespaces = NAMESPACE_FLAGS_ALL;
}
void exec_context_done(ExecContext *c) {
unsigned l;
+ ExecDirectoryType i;
assert(c);
@@ -3099,12 +3146,14 @@ void exec_context_done(ExecContext *c) {
c->utmp_id = mfree(c->utmp_id);
c->selinux_context = mfree(c->selinux_context);
c->apparmor_profile = mfree(c->apparmor_profile);
+ c->smack_process_label = mfree(c->smack_process_label);
c->syscall_filter = set_free(c->syscall_filter);
c->syscall_archs = set_free(c->syscall_archs);
c->address_families = set_free(c->address_families);
- c->runtime_directory = strv_free(c->runtime_directory);
+ for (i = 0; i < _EXEC_DIRECTORY_MAX; i++)
+ c->directories[i].paths = strv_free(c->directories[i].paths);
}
int exec_context_destroy_runtime_directory(ExecContext *c, const char *runtime_prefix) {
@@ -3115,7 +3164,7 @@ int exec_context_destroy_runtime_directory(ExecContext *c, const char *runtime_p
if (!runtime_prefix)
return 0;
- STRV_FOREACH(i, c->runtime_directory) {
+ STRV_FOREACH(i, c->directories[EXEC_DIRECTORY_RUNTIME].paths) {
_cleanup_free_ char *p;
p = strjoin(runtime_prefix, "/", *i);
@@ -3371,6 +3420,7 @@ static void strv_fprintf(FILE *f, char **l) {
void exec_context_dump(ExecContext *c, FILE* f, const char *prefix) {
char **e, **d;
unsigned i;
+ ExecDirectoryType dt;
int r;
assert(c);
@@ -3426,10 +3476,14 @@ void exec_context_dump(ExecContext *c, FILE* f, const char *prefix) {
STRV_FOREACH(e, c->pass_environment)
fprintf(f, "%sPassEnvironment: %s\n", prefix, *e);
- fprintf(f, "%sRuntimeDirectoryMode: %04o\n", prefix, c->runtime_directory_mode);
+ fprintf(f, "%sRuntimeDirectoryPreserve: %s\n", prefix, exec_preserve_mode_to_string(c->runtime_directory_preserve_mode));
+
+ for (dt = 0; dt < _EXEC_DIRECTORY_MAX; dt++) {
+ fprintf(f, "%s%sMode: %04o\n", prefix, exec_directory_type_to_string(dt), c->directories[dt].mode);
- STRV_FOREACH(d, c->runtime_directory)
- fprintf(f, "%sRuntimeDirectory: %s\n", prefix, *d);
+ STRV_FOREACH(d, c->directories[dt].paths)
+ fprintf(f, "%s%s: %s\n", prefix, exec_directory_type_to_string(dt), *d);
+ }
if (c->nice_set)
fprintf(f,
@@ -3613,6 +3667,16 @@ void exec_context_dump(ExecContext *c, FILE* f, const char *prefix) {
"%sSELinuxContext: %s%s\n",
prefix, c->selinux_context_ignore ? "-" : "", c->selinux_context);
+ if (c->apparmor_profile)
+ fprintf(f,
+ "%sAppArmorProfile: %s%s\n",
+ prefix, c->apparmor_profile_ignore ? "-" : "", c->apparmor_profile);
+
+ if (c->smack_process_label)
+ fprintf(f,
+ "%sSmackProcessLabel: %s%s\n",
+ prefix, c->smack_process_label_ignore ? "-" : "", c->smack_process_label);
+
if (c->personality != PERSONALITY_INVALID)
fprintf(f,
"%sPersonality: %s\n",
@@ -4160,3 +4224,21 @@ static const char* const exec_utmp_mode_table[_EXEC_UTMP_MODE_MAX] = {
};
DEFINE_STRING_TABLE_LOOKUP(exec_utmp_mode, ExecUtmpMode);
+
+static const char* const exec_preserve_mode_table[_EXEC_PRESERVE_MODE_MAX] = {
+ [EXEC_PRESERVE_NO] = "no",
+ [EXEC_PRESERVE_YES] = "yes",
+ [EXEC_PRESERVE_RESTART] = "restart",
+};
+
+DEFINE_STRING_TABLE_LOOKUP_WITH_BOOLEAN(exec_preserve_mode, ExecPreserveMode, EXEC_PRESERVE_YES);
+
+static const char* const exec_directory_type_table[_EXEC_DIRECTORY_MAX] = {
+ [EXEC_DIRECTORY_RUNTIME] = "RuntimeDirectory",
+ [EXEC_DIRECTORY_STATE] = "StateDirectory",
+ [EXEC_DIRECTORY_CACHE] = "CacheDirectory",
+ [EXEC_DIRECTORY_LOGS] = "LogsDirectory",
+ [EXEC_DIRECTORY_CONFIGURATION] = "ConfigurationDirectory",
+};
+
+DEFINE_STRING_TABLE_LOOKUP(exec_directory_type, ExecDirectoryType);
diff --git a/src/core/execute.h b/src/core/execute.h
index 9f07aa4aef..f7fa3176b1 100644
--- a/src/core/execute.h
+++ b/src/core/execute.h
@@ -72,6 +72,14 @@ typedef enum ExecOutput {
_EXEC_OUTPUT_INVALID = -1
} ExecOutput;
+typedef enum ExecPreserveMode {
+ EXEC_PRESERVE_NO,
+ EXEC_PRESERVE_YES,
+ EXEC_PRESERVE_RESTART,
+ _EXEC_PRESERVE_MODE_MAX,
+ _EXEC_PRESERVE_MODE_INVALID = -1
+} ExecPreserveMode;
+
struct ExecStatus {
dual_timestamp start_timestamp;
dual_timestamp exit_timestamp;
@@ -100,6 +108,21 @@ struct ExecRuntime {
int netns_storage_socket[2];
};
+typedef enum ExecDirectoryType {
+ EXEC_DIRECTORY_RUNTIME = 0,
+ EXEC_DIRECTORY_STATE,
+ EXEC_DIRECTORY_CACHE,
+ EXEC_DIRECTORY_LOGS,
+ EXEC_DIRECTORY_CONFIGURATION,
+ _EXEC_DIRECTORY_MAX,
+ _EXEC_DIRECTORY_INVALID = -1,
+} ExecDirectoryType;
+
+typedef struct ExecDirectory {
+ char **paths;
+ mode_t mode;
+} ExecDirectory;
+
struct ExecContext {
char **environment;
char **environment_files;
@@ -209,8 +232,8 @@ struct ExecContext {
Set *address_families;
bool address_families_whitelist:1;
- char **runtime_directory;
- mode_t runtime_directory_mode;
+ ExecPreserveMode runtime_directory_preserve_mode;
+ ExecDirectory directories[_EXEC_DIRECTORY_MAX];
bool memory_deny_write_execute;
bool restrict_realtime;
@@ -256,7 +279,7 @@ struct ExecParameters {
CGroupMask cgroup_supported;
const char *cgroup_path;
- const char *runtime_prefix;
+ char **prefix;
const char *confirm_spawn;
@@ -330,3 +353,9 @@ ExecInput exec_input_from_string(const char *s) _pure_;
const char* exec_utmp_mode_to_string(ExecUtmpMode i) _const_;
ExecUtmpMode exec_utmp_mode_from_string(const char *s) _pure_;
+
+const char* exec_preserve_mode_to_string(ExecPreserveMode i) _const_;
+ExecPreserveMode exec_preserve_mode_from_string(const char *s) _pure_;
+
+const char* exec_directory_type_to_string(ExecDirectoryType i) _const_;
+ExecDirectoryType exec_directory_type_from_string(const char *s) _pure_;
diff --git a/src/core/load-fragment-gperf.gperf.m4 b/src/core/load-fragment-gperf.gperf.m4
index 5b5a86250e..9a87f0acd3 100644
--- a/src/core/load-fragment-gperf.gperf.m4
+++ b/src/core/load-fragment-gperf.gperf.m4
@@ -104,8 +104,17 @@ $1.ProtectHome, config_parse_protect_home, 0,
$1.MountFlags, config_parse_exec_mount_flags, 0, offsetof($1, exec_context)
$1.MountAPIVFS, config_parse_bool, 0, offsetof($1, exec_context.mount_apivfs)
$1.Personality, config_parse_personality, 0, offsetof($1, exec_context.personality)
-$1.RuntimeDirectoryMode, config_parse_mode, 0, offsetof($1, exec_context.runtime_directory_mode)
-$1.RuntimeDirectory, config_parse_runtime_directory, 0, offsetof($1, exec_context.runtime_directory)
+$1.RuntimeDirectoryPreserve, config_parse_runtime_preserve_mode, 0, offsetof($1, exec_context.runtime_directory_preserve_mode)
+$1.RuntimeDirectoryMode, config_parse_mode, 0, offsetof($1, exec_context.directories[EXEC_DIRECTORY_RUNTIME].mode)
+$1.RuntimeDirectory, config_parse_exec_directories, 0, offsetof($1, exec_context.directories[EXEC_DIRECTORY_RUNTIME].paths)
+$1.StateDirectoryMode, config_parse_mode, 0, offsetof($1, exec_context.directories[EXEC_DIRECTORY_STATE].mode)
+$1.StateDirectory, config_parse_exec_directories, 0, offsetof($1, exec_context.directories[EXEC_DIRECTORY_STATE].paths)
+$1.CacheDirectoryMode, config_parse_mode, 0, offsetof($1, exec_context.directories[EXEC_DIRECTORY_CACHE].mode)
+$1.CacheDirectory, config_parse_exec_directories, 0, offsetof($1, exec_context.directories[EXEC_DIRECTORY_CACHE].paths)
+$1.LogsDirectoryMode, config_parse_mode, 0, offsetof($1, exec_context.directories[EXEC_DIRECTORY_LOGS].mode)
+$1.LogsDirectory, config_parse_exec_directories, 0, offsetof($1, exec_context.directories[EXEC_DIRECTORY_LOGS].paths)
+$1.ConfigurationDirectoryMode, config_parse_mode, 0, offsetof($1, exec_context.directories[EXEC_DIRECTORY_CONFIGURATION].mode)
+$1.ConfigurationDirectory, config_parse_exec_directories, 0, offsetof($1, exec_context.directories[EXEC_DIRECTORY_CONFIGURATION].paths)
m4_ifdef(`HAVE_PAM',
`$1.PAMName, config_parse_unit_string_printf, 0, offsetof($1, exec_context.pam_name)',
`$1.PAMName, config_parse_warn_compat, DISABLED_CONFIGURATION, 0')
@@ -194,7 +203,7 @@ Unit.OnFailureIsolate, config_parse_job_mode_isolate, 0,
Unit.IgnoreOnIsolate, config_parse_bool, 0, offsetof(Unit, ignore_on_isolate)
Unit.IgnoreOnSnapshot, config_parse_warn_compat, DISABLED_LEGACY, 0
Unit.JobTimeoutSec, config_parse_sec_fix_0, 0, offsetof(Unit, job_timeout)
-Unit.JobRunningTimeoutSec, config_parse_sec, 0, offsetof(Unit, job_running_timeout)
+Unit.JobRunningTimeoutSec, config_parse_sec_fix_0, 0, offsetof(Unit, job_running_timeout)
Unit.JobTimeoutAction, config_parse_emergency_action, 0, offsetof(Unit, job_timeout_action)
Unit.JobTimeoutRebootArgument, config_parse_unit_string_printf, 0, offsetof(Unit, job_timeout_reboot_arg)
Unit.StartLimitIntervalSec, config_parse_sec, 0, offsetof(Unit, start_limit.interval)
@@ -354,15 +363,6 @@ EXEC_CONTEXT_CONFIG_ITEMS(Socket)m4_dnl
CGROUP_CONTEXT_CONFIG_ITEMS(Socket)m4_dnl
KILL_CONTEXT_CONFIG_ITEMS(Socket)m4_dnl
m4_dnl
-BusName.Name, config_parse_string, 0, offsetof(BusName, name)
-BusName.Activating, config_parse_bool, 0, offsetof(BusName, activating)
-BusName.Service, config_parse_busname_service, 0, 0
-BusName.AllowUser, config_parse_bus_policy, 0, 0
-BusName.AllowGroup, config_parse_bus_policy, 0, 0
-BusName.AllowWorld, config_parse_bus_policy_world, 0, offsetof(BusName, policy_world)
-BusName.SELinuxContext, config_parse_exec_selinux_context, 0, 0
-BusName.AcceptFileDescriptors, config_parse_bool, 0, offsetof(BusName, accept_fd)
-m4_dnl
Mount.What, config_parse_unit_string_printf, 0, offsetof(Mount, parameters_fragment.what)
Mount.Where, config_parse_path, 0, offsetof(Mount, where)
Mount.Options, config_parse_unit_string_printf, 0, offsetof(Mount, parameters_fragment.options)
diff --git a/src/core/load-fragment.c b/src/core/load-fragment.c
index 9d5c39b3dd..95742dd8c7 100644
--- a/src/core/load-fragment.c
+++ b/src/core/load-fragment.c
@@ -2019,115 +2019,6 @@ int config_parse_user_group_strv(
return 0;
}
-int config_parse_busname_service(
- const char *unit,
- const char *filename,
- unsigned line,
- const char *section,
- unsigned section_line,
- const char *lvalue,
- int ltype,
- const char *rvalue,
- void *data,
- void *userdata) {
-
- _cleanup_(sd_bus_error_free) sd_bus_error error = SD_BUS_ERROR_NULL;
- BusName *n = data;
- int r;
- Unit *x;
- _cleanup_free_ char *p = NULL;
-
- assert(filename);
- assert(lvalue);
- assert(rvalue);
- assert(data);
-
- r = unit_name_printf(UNIT(n), rvalue, &p);
- if (r < 0) {
- log_syntax(unit, LOG_ERR, filename, line, r, "Failed to resolve specifiers, ignoring: %s", rvalue);
- return 0;
- }
-
- if (!endswith(p, ".service")) {
- log_syntax(unit, LOG_ERR, filename, line, 0, "Unit must be of type service, ignoring: %s", rvalue);
- return 0;
- }
-
- r = manager_load_unit(UNIT(n)->manager, p, NULL, &error, &x);
- if (r < 0) {
- log_syntax(unit, LOG_ERR, filename, line, r, "Failed to load unit %s, ignoring: %s", rvalue, bus_error_message(&error, r));
- return 0;
- }
-
- unit_ref_set(&n->service, x);
-
- return 0;
-}
-
-DEFINE_CONFIG_PARSE_ENUM(config_parse_bus_policy_world, bus_policy_access, BusPolicyAccess, "Failed to parse bus name policy access");
-
-int config_parse_bus_policy(
- const char *unit,
- const char *filename,
- unsigned line,
- const char *section,
- unsigned section_line,
- const char *lvalue,
- int ltype,
- const char *rvalue,
- void *data,
- void *userdata) {
-
- _cleanup_free_ BusNamePolicy *p = NULL;
- _cleanup_free_ char *id_str = NULL;
- BusName *busname = data;
- char *access_str;
-
- assert(filename);
- assert(lvalue);
- assert(rvalue);
- assert(data);
-
- p = new0(BusNamePolicy, 1);
- if (!p)
- return log_oom();
-
- if (streq(lvalue, "AllowUser"))
- p->type = BUSNAME_POLICY_TYPE_USER;
- else if (streq(lvalue, "AllowGroup"))
- p->type = BUSNAME_POLICY_TYPE_GROUP;
- else
- assert_not_reached("Unknown lvalue");
-
- id_str = strdup(rvalue);
- if (!id_str)
- return log_oom();
-
- access_str = strpbrk(id_str, WHITESPACE);
- if (!access_str) {
- log_syntax(unit, LOG_ERR, filename, line, 0, "Invalid busname policy value '%s'", rvalue);
- return 0;
- }
-
- *access_str = '\0';
- access_str++;
- access_str += strspn(access_str, WHITESPACE);
-
- p->access = bus_policy_access_from_string(access_str);
- if (p->access < 0) {
- log_syntax(unit, LOG_ERR, filename, line, 0, "Invalid busname policy access type '%s'", access_str);
- return 0;
- }
-
- p->name = id_str;
- id_str = NULL;
-
- LIST_PREPEND(policy, busname->policy, p);
- p = NULL;
-
- return 0;
-}
-
int config_parse_working_directory(
const char *unit,
const char *filename,
@@ -3701,7 +3592,9 @@ int config_parse_job_mode_isolate(
return 0;
}
-int config_parse_runtime_directory(
+DEFINE_CONFIG_PARSE_ENUM(config_parse_runtime_preserve_mode, exec_preserve_mode, ExecPreserveMode, "Failed to parse runtime directory preserve mode");
+
+int config_parse_exec_directories(
const char *unit,
const char *filename,
unsigned line,
@@ -3750,9 +3643,9 @@ int config_parse_runtime_directory(
continue;
}
- if (!filename_is_valid(k)) {
+ if (!path_is_safe(k) || path_is_absolute(k)) {
log_syntax(unit, LOG_ERR, filename, line, 0,
- "Runtime directory is not valid, ignoring assignment: %s", rvalue);
+ "%s is not valid, ignoring assignment: %s", lvalue, rvalue);
continue;
}
diff --git a/src/core/load-fragment.h b/src/core/load-fragment.h
index fc27a07955..ec338ccb9a 100644
--- a/src/core/load-fragment.h
+++ b/src/core/load-fragment.h
@@ -65,9 +65,6 @@ int config_parse_trigger_unit(const char *unit, const char *filename, unsigned l
int config_parse_path_spec(const char *unit, const char *filename, unsigned line, const char *section, unsigned section_line, const char *lvalue, int ltype, const char *rvalue, void *data, void *userdata);
int config_parse_socket_service(const char *unit, const char *filename, unsigned line, const char *section, unsigned section_line, const char *lvalue, int ltype, const char *rvalue, void *data, void *userdata);
int config_parse_service_sockets(const char *unit, const char *filename, unsigned line, const char *section, unsigned section_line, const char *lvalue, int ltype, const char *rvalue, void *data, void *userdata);
-int config_parse_busname_service(const char *unit, const char *filename, unsigned line, const char *section, unsigned section_line, const char *lvalue, int ltype, const char *rvalue, void *data, void *userdata);
-int config_parse_bus_policy(const char *unit, const char *filename, unsigned line, const char *section, unsigned section_line, const char *lvalue, int ltype, const char *rvalue, void *data, void *userdata);
-int config_parse_bus_policy_world(const char *unit, const char *filename, unsigned line, const char *section, unsigned section_line, const char *lvalue, int ltype, const char *rvalue, void *data, void *userdata);
int config_parse_unit_env_file(const char *unit, const char *filename, unsigned line, const char *section, unsigned section_line, const char *lvalue, int ltype, const char *rvalue, void *data, void *userdata);
int config_parse_ip_tos(const char *unit, const char *filename, unsigned line, const char *section, unsigned section_line, const char *lvalue, int ltype, const char *rvalue, void *data, void *userdata);
int config_parse_unit_condition_path(const char *unit, const char *filename, unsigned line, const char *section, unsigned section_line, const char *lvalue, int ltype, const char *rvalue, void *data, void *userdata);
@@ -102,7 +99,8 @@ int config_parse_exec_selinux_context(const char *unit, const char *filename, un
int config_parse_exec_apparmor_profile(const char *unit, const char *filename, unsigned line, const char *section, unsigned section_line, const char *lvalue, int ltype, const char *rvalue, void *data, void *userdata);
int config_parse_exec_smack_process_label(const char *unit, const char *filename, unsigned line, const char *section, unsigned section_line, const char *lvalue, int ltype, const char *rvalue, void *data, void *userdata);
int config_parse_address_families(const char *unit, const char *filename, unsigned line, const char *section, unsigned section_line, const char *lvalue, int ltype, const char *rvalue, void *data, void *userdata);
-int config_parse_runtime_directory(const char *unit, const char *filename, unsigned line, const char *section, unsigned section_line, const char *lvalue, int ltype, const char *rvalue, void *data, void *userdata);
+int config_parse_runtime_preserve_mode(const char *unit, const char *filename, unsigned line, const char *section, unsigned section_line, const char *lvalue, int ltype, const char *rvalue, void *data, void *userdata);
+int config_parse_exec_directories(const char *unit, const char *filename, unsigned line, const char *section, unsigned section_line, const char *lvalue, int ltype, const char *rvalue, void *data, void *userdata);
int config_parse_set_status(const char *unit, const char *filename, unsigned line, const char *section, unsigned section_line, const char *lvalue, int ltype, const char *rvalue, void *data, void *userdata);
int config_parse_namespace_path_strv(const char *unit, const char *filename, unsigned line, const char *section, unsigned section_line, const char *lvalue, int ltype, const char *rvalue, void *data, void *userdata);
int config_parse_no_new_privileges(const char *unit, const char *filename, unsigned line, const char *section, unsigned section_line, const char *lvalue, int ltype, const char *rvalue, void *data, void *userdata);
diff --git a/src/core/main.c b/src/core/main.c
index 88e2c92504..dfedc3dac4 100644
--- a/src/core/main.c
+++ b/src/core/main.c
@@ -154,7 +154,7 @@ noreturn static void crash(int sig) {
struct sigaction sa;
pid_t pid;
- if (getpid() != 1)
+ if (getpid_cached() != 1)
/* Pass this on immediately, if this is not PID 1 */
(void) raise(sig);
else if (!arg_dump_core)
@@ -860,7 +860,7 @@ static int parse_argv(int argc, char *argv[]) {
assert(argc >= 1);
assert(argv);
- if (getpid() == 1)
+ if (getpid_cached() == 1)
opterr = 0;
while ((c = getopt_long(argc, argv, "hDbsz:", options, NULL)) >= 0)
@@ -1066,7 +1066,7 @@ static int parse_argv(int argc, char *argv[]) {
* parse_proc_cmdline_word() or ignore. */
case '?':
- if (getpid() != 1)
+ if (getpid_cached() != 1)
return -EINVAL;
else
return 0;
@@ -1075,7 +1075,7 @@ static int parse_argv(int argc, char *argv[]) {
assert_not_reached("Unhandled option code.");
}
- if (optind < argc && getpid() != 1) {
+ if (optind < argc && getpid_cached() != 1) {
/* Hmm, when we aren't run as init system
* let's complain about excess arguments */
@@ -1091,6 +1091,7 @@ static int help(void) {
printf("%s [OPTIONS...]\n\n"
"Starts up and maintains the system or user services.\n\n"
" -h --help Show this help\n"
+ " --version Show version\n"
" --test Determine startup sequence, dump it and exit\n"
" --no-pager Do not pipe output into a pager\n"
" --dump-configuration-items Dump understood unit configuration items\n"
@@ -1388,7 +1389,7 @@ int main(int argc, char *argv[]) {
const char *error_message = NULL;
#ifdef HAVE_SYSV_COMPAT
- if (getpid() != 1 && strstr(program_invocation_short_name, "init")) {
+ if (getpid_cached() != 1 && strstr(program_invocation_short_name, "init")) {
/* This is compatibility support for SysV, where
* calling init as a user is identical to telinit. */
@@ -1424,7 +1425,7 @@ int main(int argc, char *argv[]) {
log_set_upgrade_syslog_to_journal(true);
- if (getpid() == 1) {
+ if (getpid_cached() == 1) {
/* Disable the umask logic */
umask(0);
@@ -1435,7 +1436,7 @@ int main(int argc, char *argv[]) {
log_set_always_reopen_console(true);
}
- if (getpid() == 1 && detect_container() <= 0) {
+ if (getpid_cached() == 1 && detect_container() <= 0) {
/* Running outside of a container as PID 1 */
arg_system = true;
@@ -1520,7 +1521,7 @@ int main(int argc, char *argv[]) {
* might redirect output elsewhere. */
log_set_target(LOG_TARGET_JOURNAL_OR_KMSG);
- } else if (getpid() == 1) {
+ } else if (getpid_cached() == 1) {
/* Running inside a container, as PID 1 */
arg_system = true;
log_set_target(LOG_TARGET_CONSOLE);
@@ -1544,7 +1545,7 @@ int main(int argc, char *argv[]) {
kernel_timestamp = DUAL_TIMESTAMP_NULL;
}
- if (getpid() == 1) {
+ if (getpid_cached() == 1) {
/* Don't limit the core dump size, so that coredump handlers such as systemd-coredump (which honour the limit)
* will process core dumps for system services by default. */
if (setrlimit(RLIMIT_CORE, &RLIMIT_MAKE_CONST(RLIM_INFINITY)) < 0)
@@ -1579,9 +1580,9 @@ int main(int argc, char *argv[]) {
/* Mount /proc, /sys and friends, so that /proc/cmdline and
* /proc/$PID/fd is available. */
- if (getpid() == 1) {
+ if (getpid_cached() == 1) {
- /* Load the kernel modules early, so that we kdbus.ko is loaded before kdbusfs shall be mounted */
+ /* Load the kernel modules early. */
if (!skip_setup)
kmod_setup();
@@ -1705,7 +1706,7 @@ int main(int argc, char *argv[]) {
* tty. */
release_terminal();
- if (getpid() == 1 && !skip_setup)
+ if (getpid_cached() == 1 && !skip_setup)
console_setup();
}
@@ -1717,7 +1718,7 @@ int main(int argc, char *argv[]) {
/* Make sure we leave a core dump without panicing the
* kernel. */
- if (getpid() == 1) {
+ if (getpid_cached() == 1) {
install_crash_handler();
r = mount_cgroup_controllers(arg_join_controllers);
@@ -2151,7 +2152,7 @@ finish:
* here explicitly. valgrind will only generate nice output on
* exit(), not on exec(), hence let's do the former not the
* latter here. */
- if (getpid() == 1 && RUNNING_ON_VALGRIND)
+ if (getpid_cached() == 1 && RUNNING_ON_VALGRIND)
return 0;
#endif
@@ -2227,10 +2228,10 @@ finish:
execve(SYSTEMD_SHUTDOWN_BINARY_PATH, (char **) command_line, env_block);
log_error_errno(errno, "Failed to execute shutdown binary, %s: %m",
- getpid() == 1 ? "freezing" : "quitting");
+ getpid_cached() == 1 ? "freezing" : "quitting");
}
- if (getpid() == 1) {
+ if (getpid_cached() == 1) {
if (error_message)
manager_status_printf(NULL, STATUS_TYPE_EMERGENCY,
ANSI_HIGHLIGHT_RED "!!!!!!" ANSI_NORMAL,
diff --git a/src/core/manager.c b/src/core/manager.c
index 283720750f..d29acf500f 100644
--- a/src/core/manager.c
+++ b/src/core/manager.c
@@ -36,6 +36,7 @@
#include "sd-daemon.h"
#include "sd-messages.h"
+#include "sd-path.h"
#include "alloc-util.h"
#include "audit-fd.h"
@@ -52,6 +53,7 @@
#include "dirent-util.h"
#include "env-util.h"
#include "escape.h"
+#include "execute.h"
#include "exec-util.h"
#include "exit-status.h"
#include "fd-util.h"
@@ -556,6 +558,48 @@ static int manager_default_environment(Manager *m) {
return 0;
}
+static int manager_setup_prefix(Manager *m) {
+ struct table_entry {
+ uint64_t type;
+ const char *suffix;
+ };
+
+ static const struct table_entry paths_system[_EXEC_DIRECTORY_MAX] = {
+ [EXEC_DIRECTORY_RUNTIME] = { SD_PATH_SYSTEM_RUNTIME, NULL },
+ [EXEC_DIRECTORY_STATE] = { SD_PATH_SYSTEM_STATE_PRIVATE, NULL },
+ [EXEC_DIRECTORY_CACHE] = { SD_PATH_SYSTEM_STATE_CACHE, NULL },
+ [EXEC_DIRECTORY_LOGS] = { SD_PATH_SYSTEM_STATE_LOGS, NULL },
+ [EXEC_DIRECTORY_CONFIGURATION] = { SD_PATH_SYSTEM_CONFIGURATION, NULL },
+ };
+
+ static const struct table_entry paths_user[_EXEC_DIRECTORY_MAX] = {
+ [EXEC_DIRECTORY_RUNTIME] = { SD_PATH_USER_RUNTIME, NULL },
+ [EXEC_DIRECTORY_STATE] = { SD_PATH_USER_CONFIGURATION, NULL },
+ [EXEC_DIRECTORY_CACHE] = { SD_PATH_SYSTEM_STATE_CACHE, NULL },
+ [EXEC_DIRECTORY_LOGS] = { SD_PATH_SYSTEM_CONFIGURATION, "log" },
+ [EXEC_DIRECTORY_CONFIGURATION] = { SD_PATH_SYSTEM_CONFIGURATION, NULL },
+ };
+
+ const struct table_entry *p;
+ ExecDirectoryType i;
+ int r;
+
+ assert(m);
+
+ if (MANAGER_IS_SYSTEM(m))
+ p = paths_system;
+ else
+ p = paths_user;
+
+ for (i = 0; i < _EXEC_DIRECTORY_MAX; i++) {
+ r = sd_path_home(p[i].type, p[i].suffix, &m->prefix[i]);
+ if (r < 0)
+ return r;
+ }
+
+ return 0;
+}
+
int manager_new(UnitFileScope scope, bool test_run, Manager **_m) {
Manager *m;
int r;
@@ -672,6 +716,10 @@ int manager_new(UnitFileScope scope, bool test_run, Manager **_m) {
m->taint_usr = dir_is_empty("/usr") > 0;
+ r = manager_setup_prefix(m);
+ if (r < 0)
+ goto fail;
+
*_m = m;
return 0;
@@ -692,7 +740,6 @@ static int manager_setup_notify(Manager *m) {
.sa.sa_family = AF_UNIX,
};
static const int one = 1;
- const char *e;
/* First free all secondary fields */
m->notify_socket = mfree(m->notify_socket);
@@ -704,13 +751,7 @@ static int manager_setup_notify(Manager *m) {
fd_inc_rcvbuf(fd, NOTIFY_RCVBUF_SIZE);
- e = manager_get_runtime_prefix(m);
- if (!e) {
- log_error("Failed to determine runtime prefix.");
- return -EINVAL;
- }
-
- m->notify_socket = strappend(e, "/systemd/notify");
+ m->notify_socket = strappend(m->prefix[EXEC_DIRECTORY_RUNTIME], "/systemd/notify");
if (!m->notify_socket)
return log_oom();
@@ -1071,6 +1112,7 @@ static void manager_clear_jobs_and_units(Manager *m) {
Manager* manager_free(Manager *m) {
UnitType c;
int i;
+ ExecDirectoryType dt;
if (!m)
return NULL;
@@ -1143,6 +1185,9 @@ Manager* manager_free(Manager *m) {
hashmap_free(m->uid_refs);
hashmap_free(m->gid_refs);
+ for (dt = 0; dt < _EXEC_DIRECTORY_MAX; dt++)
+ m->prefix[dt] = mfree(m->prefix[dt]);
+
return mfree(m);
}
@@ -2547,15 +2592,15 @@ int manager_serialize(Manager *m, FILE *f, FDSet *fds, bool switching_root) {
manager_serialize_uid_refs(m, f);
manager_serialize_gid_refs(m, f);
- fputc('\n', f);
+ fputc_unlocked('\n', f);
HASHMAP_FOREACH_KEY(u, t, m->units, i) {
if (u->id != t)
continue;
/* Start marker */
- fputs(u->id, f);
- fputc('\n', f);
+ fputs_unlocked(u->id, f);
+ fputc_unlocked('\n', f);
r = unit_serialize(u, f, fds, !switching_root);
if (r < 0) {
@@ -3309,12 +3354,16 @@ Set *manager_get_units_requiring_mounts_for(Manager *m, const char *path) {
return hashmap_get(m->units_requiring_mounts_for, streq(p, "/") ? "" : p);
}
-const char *manager_get_runtime_prefix(Manager *m) {
+int manager_set_exec_params(Manager *m, ExecParameters *p) {
assert(m);
+ assert(p);
+
+ p->environment = m->environment;
+ p->confirm_spawn = manager_get_confirm_spawn(m);
+ p->cgroup_supported = m->cgroup_supported;
+ p->prefix = m->prefix;
- return MANAGER_IS_SYSTEM(m) ?
- "/run" :
- getenv("XDG_RUNTIME_DIR");
+ return 0;
}
int manager_update_failed_units(Manager *m, Unit *u, bool failed) {
diff --git a/src/core/manager.h b/src/core/manager.h
index 4a9a37caff..6aceed281a 100644
--- a/src/core/manager.h
+++ b/src/core/manager.h
@@ -316,6 +316,9 @@ struct Manager {
const char *invocation_log_format_string;
int first_boot; /* tri-state */
+
+ /* prefixes of e.g. RuntimeDirectory= */
+ char *prefix[_EXEC_DIRECTORY_MAX];
};
#define MANAGER_IS_SYSTEM(m) ((m)->unit_file_scope == UNIT_FILE_SYSTEM)
@@ -380,7 +383,7 @@ void manager_flip_auto_status(Manager *m, bool enable);
Set *manager_get_units_requiring_mounts_for(Manager *m, const char *path);
-const char *manager_get_runtime_prefix(Manager *m);
+int manager_set_exec_params(Manager *m, ExecParameters *p);
ManagerState manager_state(Manager *m);
diff --git a/src/core/meson.build b/src/core/meson.build
index fb8f9dc36b..569eed9cad 100644
--- a/src/core/meson.build
+++ b/src/core/meson.build
@@ -15,10 +15,6 @@ libcore_la_sources = '''
service.h
socket.c
socket.h
- busname.c
- busname.h
- bus-policy.c
- bus-policy.h
target.c
target.h
device.c
@@ -57,8 +53,6 @@ libcore_la_sources = '''
dbus-service.h
dbus-socket.c
dbus-socket.h
- dbus-busname.c
- dbus-busname.h
dbus-target.c
dbus-target.h
dbus-device.c
diff --git a/src/core/mount-setup.c b/src/core/mount-setup.c
index 7295efbf31..b343bb7e09 100644
--- a/src/core/mount-setup.c
+++ b/src/core/mount-setup.c
@@ -95,10 +95,14 @@ static const MountPoint mount_table[] = {
#endif
{ "tmpfs", "/run", "tmpfs", "mode=755", MS_NOSUID|MS_NODEV|MS_STRICTATIME,
NULL, MNT_FATAL|MNT_IN_CONTAINER },
+ { "cgroup", "/sys/fs/cgroup", "cgroup2", "nsdelegate", MS_NOSUID|MS_NOEXEC|MS_NODEV,
+ cg_is_unified_wanted, MNT_IN_CONTAINER },
{ "cgroup", "/sys/fs/cgroup", "cgroup2", NULL, MS_NOSUID|MS_NOEXEC|MS_NODEV,
cg_is_unified_wanted, MNT_IN_CONTAINER },
{ "tmpfs", "/sys/fs/cgroup", "tmpfs", "mode=755", MS_NOSUID|MS_NOEXEC|MS_NODEV|MS_STRICTATIME,
cg_is_legacy_wanted, MNT_FATAL|MNT_IN_CONTAINER },
+ { "cgroup", "/sys/fs/cgroup/unified", "cgroup2", "nsdelegate", MS_NOSUID|MS_NOEXEC|MS_NODEV,
+ cg_is_hybrid_wanted, MNT_IN_CONTAINER },
{ "cgroup", "/sys/fs/cgroup/unified", "cgroup2", NULL, MS_NOSUID|MS_NOEXEC|MS_NODEV,
cg_is_hybrid_wanted, MNT_IN_CONTAINER },
{ "cgroup", "/sys/fs/cgroup/systemd", "cgroup", "none,name=systemd,xattr", MS_NOSUID|MS_NOEXEC|MS_NODEV,
diff --git a/src/core/mount.c b/src/core/mount.c
index 214364d87d..0e66ffb3b6 100644
--- a/src/core/mount.c
+++ b/src/core/mount.c
@@ -770,12 +770,12 @@ static int mount_spawn(Mount *m, ExecCommand *c, pid_t *_pid) {
if (r < 0)
return r;
- exec_params.environment = UNIT(m)->manager->environment;
- exec_params.confirm_spawn = manager_get_confirm_spawn(UNIT(m)->manager);
- exec_params.cgroup_supported = UNIT(m)->manager->cgroup_supported;
+ r = manager_set_exec_params(UNIT(m)->manager, &exec_params);
+ if (r < 0)
+ return r;
+
exec_params.cgroup_path = UNIT(m)->cgroup_path;
exec_params.cgroup_delegate = m->cgroup_context.delegate;
- exec_params.runtime_prefix = manager_get_runtime_prefix(UNIT(m)->manager);
r = exec_spawn(UNIT(m),
c,
@@ -808,7 +808,7 @@ static void mount_enter_dead(Mount *m, MountResult f) {
exec_runtime_destroy(m->exec_runtime);
m->exec_runtime = exec_runtime_unref(m->exec_runtime);
- exec_context_destroy_runtime_directory(&m->exec_context, manager_get_runtime_prefix(UNIT(m)->manager));
+ exec_context_destroy_runtime_directory(&m->exec_context, UNIT(m)->manager->prefix[EXEC_DIRECTORY_RUNTIME]);
unit_unref_uid_gid(UNIT(m), true);
diff --git a/src/core/service.c b/src/core/service.c
index 4c577db8d7..baeed70554 100644
--- a/src/core/service.c
+++ b/src/core/service.c
@@ -157,7 +157,7 @@ static int service_set_main_pid(Service *s, pid_t pid) {
if (pid <= 1)
return -EINVAL;
- if (pid == getpid())
+ if (pid == getpid_cached())
return -EINVAL;
if (s->main_pid == pid && s->main_pid_known)
@@ -171,7 +171,7 @@ static int service_set_main_pid(Service *s, pid_t pid) {
s->main_pid = pid;
s->main_pid_known = true;
- if (get_process_ppid(pid, &ppid) >= 0 && ppid != getpid()) {
+ if (get_process_ppid(pid, &ppid) >= 0 && ppid != getpid_cached()) {
log_unit_warning(UNIT(s), "Supervising process "PID_FMT" which is not our child. We'll most likely not notice when it exits.", pid);
s->main_pid_alien = true;
} else
@@ -614,7 +614,7 @@ static int service_setup_bus_name(Service *s) {
if (r < 0)
return log_unit_error_errno(UNIT(s), r, "Failed to add dependency on " SPECIAL_DBUS_SOCKET ": %m");
- /* Regardless if kdbus is used or not, we always want to be ordered against dbus.socket if both are in the transaction. */
+ /* We always want to be ordered against dbus.socket if both are in the transaction. */
r = unit_add_dependency_by_name(UNIT(s), UNIT_AFTER, SPECIAL_DBUS_SOCKET, NULL, true);
if (r < 0)
return log_unit_error_errno(UNIT(s), r, "Failed to add dependency on " SPECIAL_DBUS_SOCKET ": %m");
@@ -1283,7 +1283,7 @@ static int service_spawn(
return -ENOMEM;
if (MANAGER_IS_USER(UNIT(s)->manager))
- if (asprintf(our_env + n_env++, "MANAGERPID="PID_FMT, getpid()) < 0)
+ if (asprintf(our_env + n_env++, "MANAGERPID="PID_FMT, getpid_cached()) < 0)
return -ENOMEM;
if (s->socket_fd >= 0) {
@@ -1342,7 +1342,11 @@ static int service_spawn(
}
}
- final_env = strv_env_merge(2, UNIT(s)->manager->environment, our_env, NULL);
+ r = manager_set_exec_params(UNIT(s)->manager, &exec_params);
+ if (r < 0)
+ return r;
+
+ final_env = strv_env_merge(2, exec_params.environment, our_env, NULL);
if (!final_env)
return -ENOMEM;
@@ -1359,11 +1363,8 @@ static int service_spawn(
exec_params.fd_names = fd_names;
exec_params.n_storage_fds = n_storage_fds;
exec_params.n_socket_fds = n_socket_fds;
- exec_params.confirm_spawn = manager_get_confirm_spawn(UNIT(s)->manager);
- exec_params.cgroup_supported = UNIT(s)->manager->cgroup_supported;
exec_params.cgroup_path = path;
exec_params.cgroup_delegate = s->cgroup_context.delegate;
- exec_params.runtime_prefix = manager_get_runtime_prefix(UNIT(s)->manager);
exec_params.watchdog_usec = s->watchdog_usec;
exec_params.selinux_context_net = s->socket_fd_selinux_context_net;
if (s->type == SERVICE_IDLE)
@@ -1480,6 +1481,18 @@ static bool service_shall_restart(Service *s) {
}
}
+static bool service_will_restart(Service *s) {
+ assert(s);
+
+ if (s->state == SERVICE_AUTO_RESTART)
+ return true;
+ if (!UNIT(s)->job)
+ return false;
+ if (UNIT(s)->job->type == JOB_START)
+ return true;
+ return false;
+}
+
static void service_enter_dead(Service *s, ServiceResult f, bool allow_restart) {
int r;
assert(s);
@@ -1510,8 +1523,10 @@ static void service_enter_dead(Service *s, ServiceResult f, bool allow_restart)
exec_runtime_destroy(s->exec_runtime);
s->exec_runtime = exec_runtime_unref(s->exec_runtime);
- /* Also, remove the runtime directory */
- exec_context_destroy_runtime_directory(&s->exec_context, manager_get_runtime_prefix(UNIT(s)->manager));
+ if (s->exec_context.runtime_directory_preserve_mode == EXEC_PRESERVE_NO ||
+ (s->exec_context.runtime_directory_preserve_mode == EXEC_PRESERVE_RESTART && !service_will_restart(s)))
+ /* Also, remove the runtime directory */
+ exec_context_destroy_runtime_directory(&s->exec_context, UNIT(s)->manager->prefix[EXEC_DIRECTORY_RUNTIME]);
/* Get rid of the IPC bits of the user */
unit_unref_uid_gid(UNIT(s), true);
@@ -3269,7 +3284,7 @@ static void service_notify_message(Unit *u, pid_t pid, char **tags, FDSet *fds)
log_unit_warning(u, "Failed to parse MAINPID= field in notification message: %s", e);
else if (pid == s->control_pid)
log_unit_warning(u, "A control process cannot also be the main process");
- else if (pid == getpid() || pid == 1)
+ else if (pid == getpid_cached() || pid == 1)
log_unit_warning(u, "Service manager can't be main process, ignoring sd_notify() MAINPID= field");
else {
service_set_main_pid(s, pid);
diff --git a/src/core/shutdown.c b/src/core/shutdown.c
index a7d5e57936..6d1cc3120a 100644
--- a/src/core/shutdown.c
+++ b/src/core/shutdown.c
@@ -180,7 +180,7 @@ int main(int argc, char *argv[]) {
umask(0022);
- if (getpid() != 1) {
+ if (getpid_cached() != 1) {
log_error("Not executed by init (PID 1).");
r = -EPERM;
goto error;
diff --git a/src/core/smack-setup.c b/src/core/smack-setup.c
index adf2293142..9f25364335 100644
--- a/src/core/smack-setup.c
+++ b/src/core/smack-setup.c
@@ -246,7 +246,7 @@ static int write_netlabel_rules(const char* srcdir) {
FOREACH_LINE(buf, policy,
log_error_errno(errno, "Failed to read line from %s: %m",
entry->d_name)) {
- if (!fputs(buf, dst)) {
+ if (!fputs_unlocked(buf, dst)) {
if (r == 0)
r = -EINVAL;
log_error_errno(errno, "Failed to write line to /sys/fs/smackfs/netlabel");
diff --git a/src/core/socket.c b/src/core/socket.c
index 8750643d92..ca59a13b66 100644
--- a/src/core/socket.c
+++ b/src/core/socket.c
@@ -1790,13 +1790,13 @@ static int socket_spawn(Socket *s, ExecCommand *c, pid_t *_pid) {
if (r < 0)
return r;
+ r = manager_set_exec_params(UNIT(s)->manager, &exec_params);
+ if (r < 0)
+ return r;
+
exec_params.argv = c->argv;
- exec_params.environment = UNIT(s)->manager->environment;
- exec_params.confirm_spawn = manager_get_confirm_spawn(UNIT(s)->manager);
- exec_params.cgroup_supported = UNIT(s)->manager->cgroup_supported;
exec_params.cgroup_path = UNIT(s)->cgroup_path;
exec_params.cgroup_delegate = s->cgroup_context.delegate;
- exec_params.runtime_prefix = manager_get_runtime_prefix(UNIT(s)->manager);
r = exec_spawn(UNIT(s),
c,
@@ -1814,6 +1814,7 @@ static int socket_spawn(Socket *s, ExecCommand *c, pid_t *_pid) {
return r;
*_pid = pid;
+
return 0;
}
@@ -1912,7 +1913,7 @@ static void socket_enter_dead(Socket *s, SocketResult f) {
exec_runtime_destroy(s->exec_runtime);
s->exec_runtime = exec_runtime_unref(s->exec_runtime);
- exec_context_destroy_runtime_directory(&s->exec_context, manager_get_runtime_prefix(UNIT(s)->manager));
+ exec_context_destroy_runtime_directory(&s->exec_context, UNIT(s)->manager->prefix[EXEC_DIRECTORY_RUNTIME]);
unit_unref_uid_gid(UNIT(s), true);
diff --git a/src/core/swap.c b/src/core/swap.c
index 4c3a74ce00..e839c26141 100644
--- a/src/core/swap.c
+++ b/src/core/swap.c
@@ -630,18 +630,18 @@ static int swap_spawn(Swap *s, ExecCommand *c, pid_t *_pid) {
r = unit_setup_dynamic_creds(UNIT(s));
if (r < 0)
- return r;
+ goto fail;
r = swap_arm_timer(s, usec_add(now(CLOCK_MONOTONIC), s->timeout_usec));
if (r < 0)
goto fail;
- exec_params.environment = UNIT(s)->manager->environment;
- exec_params.confirm_spawn = manager_get_confirm_spawn(UNIT(s)->manager);
- exec_params.cgroup_supported = UNIT(s)->manager->cgroup_supported;
+ r = manager_set_exec_params(UNIT(s)->manager, &exec_params);
+ if (r < 0)
+ goto fail;
+
exec_params.cgroup_path = UNIT(s)->cgroup_path;
exec_params.cgroup_delegate = s->cgroup_context.delegate;
- exec_params.runtime_prefix = manager_get_runtime_prefix(UNIT(s)->manager);
r = exec_spawn(UNIT(s),
c,
@@ -664,6 +664,7 @@ static int swap_spawn(Swap *s, ExecCommand *c, pid_t *_pid) {
fail:
s->timer_event_source = sd_event_source_unref(s->timer_event_source);
+
return r;
}
@@ -678,7 +679,7 @@ static void swap_enter_dead(Swap *s, SwapResult f) {
exec_runtime_destroy(s->exec_runtime);
s->exec_runtime = exec_runtime_unref(s->exec_runtime);
- exec_context_destroy_runtime_directory(&s->exec_context, manager_get_runtime_prefix(UNIT(s)->manager));
+ exec_context_destroy_runtime_directory(&s->exec_context, UNIT(s)->manager->prefix[EXEC_DIRECTORY_RUNTIME]);
unit_unref_uid_gid(UNIT(s), true);
diff --git a/src/core/transaction.c b/src/core/transaction.c
index a2dfd8ae90..710a6a3948 100644
--- a/src/core/transaction.c
+++ b/src/core/transaction.c
@@ -338,6 +338,26 @@ _pure_ static bool unit_matters_to_anchor(Unit *u, Job *j) {
return false;
}
+static char* merge_unit_ids(const char* unit_log_field, char **pairs) {
+ char **unit_id, **job_type, *ans = NULL;
+ size_t alloc = 0, size = 0, next;
+
+ STRV_FOREACH_PAIR(unit_id, job_type, pairs) {
+ next = strlen(unit_log_field) + strlen(*unit_id);
+ if (!GREEDY_REALLOC(ans, alloc, size + next + 1)) {
+ free(ans);
+ return NULL;
+ }
+
+ sprintf(ans + size, "%s%s", unit_log_field, *unit_id);
+ if (*(unit_id+1))
+ ans[size + next] = '\n';
+ size += next + 1;
+ }
+
+ return ans;
+}
+
static int transaction_verify_order_one(Transaction *tr, Job *j, Job *from, unsigned generation, sd_bus_error *e) {
Iterator i;
Unit *u;
@@ -352,7 +372,9 @@ static int transaction_verify_order_one(Transaction *tr, Job *j, Job *from, unsi
/* Have we seen this before? */
if (j->generation == generation) {
- Job *k, *delete;
+ Job *k, *delete = NULL;
+ _cleanup_free_ char **array = NULL, *unit_ids = NULL;
+ char **unit_id, **job_type;
/* If the marker is NULL we have been here already and
* decided the job was loop-free from here. Hence
@@ -360,46 +382,46 @@ static int transaction_verify_order_one(Transaction *tr, Job *j, Job *from, unsi
if (!j->marker)
return 0;
- /* So, the marker is not NULL and we already have been
- * here. We have a cycle. Let's try to break it. We go
- * backwards in our path and try to find a suitable
- * job to remove. We use the marker to find our way
- * back, since smart how we are we stored our way back
- * in there. */
- log_unit_warning(j->unit,
- "Found ordering cycle on %s/%s",
- j->unit->id, job_type_to_string(j->type));
-
- delete = NULL;
+ /* So, the marker is not NULL and we already have been here. We have
+ * a cycle. Let's try to break it. We go backwards in our path and
+ * try to find a suitable job to remove. We use the marker to find
+ * our way back, since smart how we are we stored our way back in
+ * there. */
+
for (k = from; k; k = ((k->generation == generation && k->marker != k) ? k->marker : NULL)) {
- /* logging for j not k here to provide consistent narrative */
- log_unit_warning(j->unit,
- "Found dependency on %s/%s",
- k->unit->id, job_type_to_string(k->type));
+ /* For logging below */
+ if (strv_push_pair(&array, k->unit->id, (char*) job_type_to_string(k->type)) < 0)
+ log_oom();
if (!delete && hashmap_get(tr->jobs, k->unit) && !unit_matters_to_anchor(k->unit, k))
- /* Ok, we can drop this one, so let's
- * do so. */
+ /* Ok, we can drop this one, so let's do so. */
delete = k;
- /* Check if this in fact was the beginning of
- * the cycle */
+ /* Check if this in fact was the beginning of the cycle */
if (k == j)
break;
}
+ unit_ids = merge_unit_ids(j->manager->unit_log_field, array); /* ignore error */
+
+ STRV_FOREACH_PAIR(unit_id, job_type, array)
+ /* logging for j not k here to provide a consistent narrative */
+ log_struct(LOG_WARNING,
+ "MESSAGE=%s: Found %s on %s/%s",
+ j->unit->id,
+ unit_id == array ? "ordering cycle" : "dependency",
+ *unit_id, *job_type,
+ unit_ids, NULL);
if (delete) {
const char *status;
- /* logging for j not k here to provide consistent narrative */
- log_unit_warning(j->unit,
- "Breaking ordering cycle by deleting job %s/%s",
- delete->unit->id, job_type_to_string(delete->type));
- log_unit_error(delete->unit,
- "Job %s/%s deleted to break ordering cycle starting with %s/%s",
- delete->unit->id, job_type_to_string(delete->type),
- j->unit->id, job_type_to_string(j->type));
+ /* logging for j not k here to provide a consistent narrative */
+ log_struct(LOG_ERR,
+ "MESSAGE=%s: Job %s/%s deleted to break ordering cycle starting with %s/%s",
+ j->unit->id, delete->unit->id, job_type_to_string(delete->type),
+ j->unit->id, job_type_to_string(j->type),
+ unit_ids, NULL);
if (log_get_show_color())
status = ANSI_HIGHLIGHT_RED " SKIP " ANSI_NORMAL;
@@ -412,7 +434,10 @@ static int transaction_verify_order_one(Transaction *tr, Job *j, Job *from, unsi
return -EAGAIN;
}
- log_error("Unable to break cycle");
+ log_struct(LOG_ERR,
+ "MESSAGE=%s: Unable to break cycle starting with %s/%s",
+ j->unit->id, j->unit->id, job_type_to_string(j->type),
+ unit_ids, NULL);
return sd_bus_error_setf(e, BUS_ERROR_TRANSACTION_ORDER_IS_CYCLIC,
"Transaction order is cyclic. See system logs for details.");
diff --git a/src/core/unit-printf.c b/src/core/unit-printf.c
index 746e1a46ef..0480ec6526 100644
--- a/src/core/unit-printf.c
+++ b/src/core/unit-printf.c
@@ -145,15 +145,11 @@ static int specifier_cgroup_slice(char specifier, void *data, void *userdata, ch
static int specifier_runtime(char specifier, void *data, void *userdata, char **ret) {
Unit *u = userdata;
- const char *e;
char *n = NULL;
assert(u);
- e = manager_get_runtime_prefix(u->manager);
- if (!e)
- return -EOPNOTSUPP;
- n = strdup(e);
+ n = strdup(u->manager->prefix[EXEC_DIRECTORY_RUNTIME]);
if (!n)
return -ENOMEM;
diff --git a/src/core/unit.c b/src/core/unit.c
index b28eeb2262..394832e8ba 100644
--- a/src/core/unit.c
+++ b/src/core/unit.c
@@ -63,7 +63,6 @@
const UnitVTable * const unit_vtable[_UNIT_TYPE_MAX] = {
[UNIT_SERVICE] = &service_vtable,
[UNIT_SOCKET] = &socket_vtable,
- [UNIT_BUSNAME] = &busname_vtable,
[UNIT_TARGET] = &target_vtable,
[UNIT_DEVICE] = &device_vtable,
[UNIT_MOUNT] = &mount_vtable,
@@ -1098,7 +1097,6 @@ void unit_dump(Unit *u, FILE *f, const char *prefix) {
/* Common implementation for multiple backends */
int unit_load_fragment_and_dropin(Unit *u) {
- Unit *t;
int r;
assert(u);
@@ -1111,18 +1109,15 @@ int unit_load_fragment_and_dropin(Unit *u) {
if (u->load_state == UNIT_STUB)
return -ENOENT;
- /* If the unit is an alias and the final unit has already been
- * loaded, there's no point in reloading the dropins one more time. */
- t = unit_follow_merge(u);
- if (t != u && t->load_state != UNIT_STUB)
- return 0;
-
- return unit_load_dropin(t);
+ /* Load drop-in directory data. If u is an alias, we might be reloading the
+ * target unit needlessly. But we cannot be sure which drops-ins have already
+ * been loaded and which not, at least without doing complicated book-keeping,
+ * so let's always reread all drop-ins. */
+ return unit_load_dropin(unit_follow_merge(u));
}
/* Common implementation for multiple backends */
int unit_load_fragment_and_dropin_optional(Unit *u) {
- Unit *t;
int r;
assert(u);
@@ -1138,13 +1133,8 @@ int unit_load_fragment_and_dropin_optional(Unit *u) {
if (u->load_state == UNIT_STUB)
u->load_state = UNIT_LOADED;
- /* If the unit is an alias and the final unit has already been
- * loaded, there's no point in reloading the dropins one more time. */
- t = unit_follow_merge(u);
- if (t != u && t->load_state != UNIT_STUB)
- return 0;
-
- return unit_load_dropin(t);
+ /* Load drop-in directory data */
+ return unit_load_dropin(unit_follow_merge(u));
}
int unit_add_default_target_dependency(Unit *u, Unit *target) {
diff --git a/src/core/unit.h b/src/core/unit.h
index cf21b37e22..5ecaba11e9 100644
--- a/src/core/unit.h
+++ b/src/core/unit.h
@@ -276,7 +276,6 @@ typedef enum UnitSetPropertiesMode {
} UnitSetPropertiesMode;
#include "automount.h"
-#include "busname.h"
#include "device.h"
#include "path.h"
#include "scope.h"
@@ -471,7 +470,6 @@ extern const UnitVTable * const unit_vtable[_UNIT_TYPE_MAX];
DEFINE_CAST(SERVICE, Service);
DEFINE_CAST(SOCKET, Socket);
-DEFINE_CAST(BUSNAME, BusName);
DEFINE_CAST(TARGET, Target);
DEFINE_CAST(DEVICE, Device);
DEFINE_CAST(MOUNT, Mount);
diff --git a/src/coredump/Makefile b/src/coredump/Makefile
deleted file mode 120000
index d0b0e8e008..0000000000
--- a/src/coredump/Makefile
+++ /dev/null
@@ -1 +0,0 @@
-../Makefile \ No newline at end of file
diff --git a/src/coredump/coredump.c b/src/coredump/coredump.c
index a2c62e55a5..57d1af454a 100644
--- a/src/coredump/coredump.c
+++ b/src/coredump/coredump.c
@@ -564,7 +564,7 @@ static int compose_open_fds(pid_t pid, char **open_fds) {
}
FOREACH_LINE(line, fdinfo, break) {
- fputs(line, stream);
+ fputs_unlocked(line, stream);
if (!endswith(line, "\n"))
fputc('\n', stream);
}
diff --git a/src/coredump/stacktrace.c b/src/coredump/stacktrace.c
index 778bee9b12..1726613623 100644
--- a/src/coredump/stacktrace.c
+++ b/src/coredump/stacktrace.c
@@ -107,7 +107,7 @@ static int thread_callback(Dwfl_Thread *thread, void *userdata) {
return DWARF_CB_ABORT;
if (c->n_thread != 0)
- fputc('\n', c->f);
+ fputc_unlocked('\n', c->f);
c->n_frame = 0;
diff --git a/src/cryptsetup/Makefile b/src/cryptsetup/Makefile
deleted file mode 120000
index d0b0e8e008..0000000000
--- a/src/cryptsetup/Makefile
+++ /dev/null
@@ -1 +0,0 @@
-../Makefile \ No newline at end of file
diff --git a/src/cryptsetup/cryptsetup-generator.c b/src/cryptsetup/cryptsetup-generator.c
index b58b6db7c9..cd07f2abd9 100644
--- a/src/cryptsetup/cryptsetup-generator.c
+++ b/src/cryptsetup/cryptsetup-generator.c
@@ -58,11 +58,11 @@ static int create_disk(
const char *password,
const char *options) {
- _cleanup_free_ char *p = NULL, *n = NULL, *d = NULL, *u = NULL, *to = NULL, *e = NULL,
+ _cleanup_free_ char *p = NULL, *n = NULL, *d = NULL, *u = NULL, *e = NULL,
*filtered = NULL;
_cleanup_fclose_ FILE *f = NULL;
+ const char *dmname;
bool noauto, nofail, tmp, swap;
- char *from;
int r;
assert(name);
@@ -102,17 +102,17 @@ static int create_disk(
if (!f)
return log_error_errno(errno, "Failed to create unit file %s: %m", p);
- fputs("# Automatically generated by systemd-cryptsetup-generator\n\n"
- "[Unit]\n"
- "Description=Cryptography Setup for %I\n"
- "Documentation=man:crypttab(5) man:systemd-cryptsetup-generator(8) man:systemd-cryptsetup@.service(8)\n"
- "SourcePath=/etc/crypttab\n"
- "DefaultDependencies=no\n"
- "Conflicts=umount.target\n"
- "BindsTo=dev-mapper-%i.device\n"
- "IgnoreOnIsolate=true\n"
- "After=cryptsetup-pre.target\n",
- f);
+ fputs_unlocked("# Automatically generated by systemd-cryptsetup-generator\n\n"
+ "[Unit]\n"
+ "Description=Cryptography Setup for %I\n"
+ "Documentation=man:crypttab(5) man:systemd-cryptsetup-generator(8) man:systemd-cryptsetup@.service(8)\n"
+ "SourcePath=/etc/crypttab\n"
+ "DefaultDependencies=no\n"
+ "Conflicts=umount.target\n"
+ "BindsTo=dev-mapper-%i.device\n"
+ "IgnoreOnIsolate=true\n"
+ "After=cryptsetup-pre.target\n",
+ f);
if (!nofail)
fprintf(f,
@@ -120,8 +120,8 @@ static int create_disk(
if (password) {
if (STR_IN_SET(password, "/dev/urandom", "/dev/random", "/dev/hw_random"))
- fputs("After=systemd-random-seed.service\n", f);
- else if (!streq(password, "-") && !streq(password, "none")) {
+ fputs_unlocked("After=systemd-random-seed.service\n", f);
+ else if (!STR_IN_SET(password, "-", "none")) {
_cleanup_free_ char *uu;
uu = fstab_node_to_udev_node(password);
@@ -152,8 +152,8 @@ static int create_disk(
d, d);
if (swap)
- fputs("Before=dev-mapper-%i.swap\n",
- f);
+ fputs_unlocked("Before=dev-mapper-%i.swap\n",
+ f);
} else
fprintf(f,
"RequiresMountsFor=%s\n",
@@ -187,46 +187,23 @@ static int create_disk(
if (r < 0)
return log_error_errno(r, "Failed to write file %s: %m", p);
- from = strjoina("../", n);
-
if (!noauto) {
+ r = generator_add_symlink(arg_dest, d, "wants", n);
+ if (r < 0)
+ return r;
- to = strjoin(arg_dest, "/", d, ".wants/", n);
- if (!to)
- return log_oom();
-
- mkdir_parents_label(to, 0755);
- if (symlink(from, to) < 0)
- return log_error_errno(errno, "Failed to create symlink %s: %m", to);
-
- free(to);
- if (!nofail)
- to = strjoin(arg_dest, "/cryptsetup.target.requires/", n);
- else
- to = strjoin(arg_dest, "/cryptsetup.target.wants/", n);
- if (!to)
- return log_oom();
-
- mkdir_parents_label(to, 0755);
- if (symlink(from, to) < 0)
- return log_error_errno(errno, "Failed to create symlink %s: %m", to);
+ r = generator_add_symlink(arg_dest, "cryptsetup.target",
+ nofail ? "wants" : "requires", n);
+ if (r < 0)
+ return r;
}
- free(to);
- to = strjoin(arg_dest, "/dev-mapper-", e, ".device.requires/", n);
- if (!to)
- return log_oom();
-
- mkdir_parents_label(to, 0755);
- if (symlink(from, to) < 0)
- return log_error_errno(errno, "Failed to create symlink %s: %m", to);
+ dmname = strjoina("dev-mapper-", e, ".device");
+ r = generator_add_symlink(arg_dest, dmname, "requires", n);
+ if (r < 0)
+ return r;
if (!noauto && !nofail) {
- _cleanup_free_ char *dmname;
- dmname = strjoin("dev-mapper-", e, ".device");
- if (!dmname)
- return log_oom();
-
r = write_drop_in(arg_dest, dmname, 90, "device-timeout",
"# Automatically generated by systemd-cryptsetup-generator \n\n"
"[Unit]\nJobTimeoutSec=0");
diff --git a/src/dbus1-generator/Makefile b/src/dbus1-generator/Makefile
deleted file mode 120000
index d0b0e8e008..0000000000
--- a/src/dbus1-generator/Makefile
+++ /dev/null
@@ -1 +0,0 @@
-../Makefile \ No newline at end of file
diff --git a/src/debug-generator/Makefile b/src/debug-generator/Makefile
deleted file mode 120000
index d0b0e8e008..0000000000
--- a/src/debug-generator/Makefile
+++ /dev/null
@@ -1 +0,0 @@
-../Makefile \ No newline at end of file
diff --git a/src/delta/Makefile b/src/delta/Makefile
deleted file mode 120000
index d0b0e8e008..0000000000
--- a/src/delta/Makefile
+++ /dev/null
@@ -1 +0,0 @@
-../Makefile \ No newline at end of file
diff --git a/src/detect-virt/Makefile b/src/detect-virt/Makefile
deleted file mode 120000
index d0b0e8e008..0000000000
--- a/src/detect-virt/Makefile
+++ /dev/null
@@ -1 +0,0 @@
-../Makefile \ No newline at end of file
diff --git a/src/dissect/Makefile b/src/dissect/Makefile
deleted file mode 120000
index d0b0e8e008..0000000000
--- a/src/dissect/Makefile
+++ /dev/null
@@ -1 +0,0 @@
-../Makefile \ No newline at end of file
diff --git a/src/environment-d-generator/Makefile b/src/environment-d-generator/Makefile
deleted file mode 120000
index d0b0e8e008..0000000000
--- a/src/environment-d-generator/Makefile
+++ /dev/null
@@ -1 +0,0 @@
-../Makefile \ No newline at end of file
diff --git a/src/escape/Makefile b/src/escape/Makefile
deleted file mode 120000
index d0b0e8e008..0000000000
--- a/src/escape/Makefile
+++ /dev/null
@@ -1 +0,0 @@
-../Makefile \ No newline at end of file
diff --git a/src/escape/escape.c b/src/escape/escape.c
index af98c98e40..89e885d47c 100644
--- a/src/escape/escape.c
+++ b/src/escape/escape.c
@@ -38,7 +38,7 @@ static bool arg_path = false;
static void help(void) {
printf("%s [OPTIONS...] [NAME...]\n\n"
- "Show system and user paths.\n\n"
+ "Escape strings for usage in system unit names.\n\n"
" -h --help Show this help\n"
" --version Show package version\n"
" --suffix=SUFFIX Unit suffix to append to escaped strings\n"
diff --git a/src/firstboot/Makefile b/src/firstboot/Makefile
deleted file mode 120000
index d0b0e8e008..0000000000
--- a/src/firstboot/Makefile
+++ /dev/null
@@ -1 +0,0 @@
-../Makefile \ No newline at end of file
diff --git a/src/fsck/Makefile b/src/fsck/Makefile
deleted file mode 120000
index d0b0e8e008..0000000000
--- a/src/fsck/Makefile
+++ /dev/null
@@ -1 +0,0 @@
-../Makefile \ No newline at end of file
diff --git a/src/fstab-generator/Makefile b/src/fstab-generator/Makefile
deleted file mode 120000
index d0b0e8e008..0000000000
--- a/src/fstab-generator/Makefile
+++ /dev/null
@@ -1 +0,0 @@
-../Makefile \ No newline at end of file
diff --git a/src/fstab-generator/fstab-generator.c b/src/fstab-generator/fstab-generator.c
index 7f23b9fd74..ec70a349fc 100644
--- a/src/fstab-generator/fstab-generator.c
+++ b/src/fstab-generator/fstab-generator.c
@@ -92,7 +92,7 @@ static int add_swap(
bool noauto,
bool nofail) {
- _cleanup_free_ char *name = NULL, *unit = NULL, *lnk = NULL;
+ _cleanup_free_ char *name = NULL, *unit = NULL;
_cleanup_fclose_ FILE *f = NULL;
int r;
@@ -125,11 +125,11 @@ static int add_swap(
"Failed to create unit file %s: %m",
unit);
- fputs("# Automatically generated by systemd-fstab-generator\n\n"
- "[Unit]\n"
- "SourcePath=/etc/fstab\n"
- "Documentation=man:fstab(5) man:systemd-fstab-generator(8)\n\n"
- "[Swap]\n", f);
+ fputs_unlocked("# Automatically generated by systemd-fstab-generator\n\n"
+ "[Unit]\n"
+ "SourcePath=/etc/fstab\n"
+ "Documentation=man:fstab(5) man:systemd-fstab-generator(8)\n\n"
+ "[Swap]\n", f);
r = write_what(f, what);
if (r < 0)
@@ -149,14 +149,10 @@ static int add_swap(
return r;
if (!noauto) {
- lnk = strjoin(arg_dest, "/" SPECIAL_SWAP_TARGET,
- nofail ? ".wants/" : ".requires/", name, NULL);
- if (!lnk)
- return log_oom();
-
- mkdir_parents_label(lnk, 0755);
- if (symlink(unit, lnk) < 0)
- return log_error_errno(errno, "Failed to create symlink %s: %m", lnk);
+ r = generator_add_symlink(arg_dest, SPECIAL_SWAP_TARGET,
+ nofail ? "wants" : "requires", name);
+ if (r < 0)
+ return r;
}
return 0;
@@ -302,7 +298,7 @@ static int add_mount(
const char *source) {
_cleanup_free_ char
- *name = NULL, *unit = NULL, *lnk = NULL,
+ *name = NULL, *unit = NULL,
*automount_name = NULL, *automount_unit = NULL,
*filtered = NULL;
_cleanup_fclose_ FILE *f = NULL;
@@ -431,13 +427,10 @@ static int add_mount(
return log_error_errno(r, "Failed to write unit file %s: %m", unit);
if (!noauto && !automount) {
- lnk = strjoin(dest, "/", post, nofail ? ".wants/" : ".requires/", name);
- if (!lnk)
- return log_oom();
-
- mkdir_parents_label(lnk, 0755);
- if (symlink(unit, lnk) < 0)
- return log_error_errno(errno, "Failed to create symlink %s: %m", lnk);
+ r = generator_add_symlink(dest, post,
+ nofail ? "wants" : "requires", name);
+ if (r < 0)
+ return r;
}
if (automount) {
@@ -492,14 +485,10 @@ static int add_mount(
if (r < 0)
return log_error_errno(r, "Failed to write unit file %s: %m", automount_unit);
- free(lnk);
- lnk = strjoin(dest, "/", post, nofail ? ".wants/" : ".requires/", automount_name);
- if (!lnk)
- return log_oom();
-
- mkdir_parents_label(lnk, 0755);
- if (symlink(automount_unit, lnk) < 0)
- return log_error_errno(errno, "Failed to create symlink %s: %m", lnk);
+ r = generator_add_symlink(dest, post,
+ nofail ? "wants" : "requires", automount_name);
+ if (r < 0)
+ return r;
}
return 0;
@@ -537,7 +526,7 @@ static int parse_fstab(bool initrd) {
continue;
}
- where = initrd ? strappend("/sysroot/", me->mnt_dir) : strdup(me->mnt_dir);
+ where = strdup(me->mnt_dir);
if (!where)
return log_oom();
diff --git a/src/getty-generator/Makefile b/src/getty-generator/Makefile
deleted file mode 120000
index d0b0e8e008..0000000000
--- a/src/getty-generator/Makefile
+++ /dev/null
@@ -1 +0,0 @@
-../Makefile \ No newline at end of file
diff --git a/src/gpt-auto-generator/Makefile b/src/gpt-auto-generator/Makefile
deleted file mode 120000
index d0b0e8e008..0000000000
--- a/src/gpt-auto-generator/Makefile
+++ /dev/null
@@ -1 +0,0 @@
-../Makefile \ No newline at end of file
diff --git a/src/gpt-auto-generator/gpt-auto-generator.c b/src/gpt-auto-generator/gpt-auto-generator.c
index a072242430..a6c0b33fbb 100644
--- a/src/gpt-auto-generator/gpt-auto-generator.c
+++ b/src/gpt-auto-generator/gpt-auto-generator.c
@@ -58,7 +58,7 @@ static bool arg_root_rw = false;
static int add_cryptsetup(const char *id, const char *what, bool rw, bool require, char **device) {
_cleanup_free_ char *e = NULL, *n = NULL, *p = NULL, *d = NULL, *to = NULL;
_cleanup_fclose_ FILE *f = NULL;
- char *from, *ret;
+ char *ret;
int r;
assert(id);
@@ -109,35 +109,21 @@ static int add_cryptsetup(const char *id, const char *what, bool rw, bool requir
if (r < 0)
return log_error_errno(r, "Failed to write file %s: %m", p);
- from = strjoina("../", n);
-
- to = strjoin(arg_dest, "/", d, ".wants/", n);
- if (!to)
- return log_oom();
-
- mkdir_parents_label(to, 0755);
- if (symlink(from, to) < 0)
- return log_error_errno(errno, "Failed to create symlink %s: %m", to);
+ r = generator_add_symlink(arg_dest, d, "wants", n);
+ if (r < 0)
+ return r;
if (require) {
- free(to);
-
- to = strjoin(arg_dest, "/cryptsetup.target.requires/", n);
- if (!to)
- return log_oom();
+ const char *dmname;
- mkdir_parents_label(to, 0755);
- if (symlink(from, to) < 0)
- return log_error_errno(errno, "Failed to create symlink %s: %m", to);
-
- free(to);
- to = strjoin(arg_dest, "/dev-mapper-", e, ".device.requires/", n);
- if (!to)
- return log_oom();
+ r = generator_add_symlink(arg_dest, "cryptsetup.target", "requires", n);
+ if (r < 0)
+ return r;
- mkdir_parents_label(to, 0755);
- if (symlink(from, to) < 0)
- return log_error_errno(errno, "Failed to create symlink %s: %m", to);
+ dmname = strjoina("dev-mapper-", e, ".device");
+ r = generator_add_symlink(arg_dest, dmname, "requires", n);
+ if (r < 0)
+ return r;
}
free(p);
@@ -173,7 +159,7 @@ static int add_mount(
const char *description,
const char *post) {
- _cleanup_free_ char *unit = NULL, *lnk = NULL, *crypto_what = NULL, *p = NULL;
+ _cleanup_free_ char *unit = NULL, *crypto_what = NULL, *p = NULL;
_cleanup_fclose_ FILE *f = NULL;
int r;
@@ -239,16 +225,8 @@ static int add_mount(
if (r < 0)
return log_error_errno(r, "Failed to write unit file %s: %m", p);
- if (post) {
- lnk = strjoin(arg_dest, "/", post, ".requires/", unit);
- if (!lnk)
- return log_oom();
-
- mkdir_parents_label(lnk, 0755);
- if (symlink(p, lnk) < 0)
- return log_error_errno(errno, "Failed to create symlink %s: %m", lnk);
- }
-
+ if (post)
+ return generator_add_symlink(arg_dest, post, "requires", unit);
return 0;
}
@@ -299,7 +277,7 @@ static int add_partition_mount(
}
static int add_swap(const char *path) {
- _cleanup_free_ char *name = NULL, *unit = NULL, *lnk = NULL;
+ _cleanup_free_ char *name = NULL, *unit = NULL;
_cleanup_fclose_ FILE *f = NULL;
int r;
@@ -341,15 +319,7 @@ static int add_swap(const char *path) {
if (r < 0)
return log_error_errno(r, "Failed to write unit file %s: %m", unit);
- lnk = strjoin(arg_dest, "/" SPECIAL_SWAP_TARGET ".wants/", name);
- if (!lnk)
- return log_oom();
-
- mkdir_parents_label(lnk, 0755);
- if (symlink(unit, lnk) < 0)
- return log_error_errno(errno, "Failed to create symlink %s: %m", lnk);
-
- return 0;
+ return generator_add_symlink(arg_dest, SPECIAL_SWAP_TARGET, "wants", name);
}
#ifdef ENABLE_EFI
@@ -363,7 +333,7 @@ static int add_automount(
const char *description,
usec_t timeout) {
- _cleanup_free_ char *unit = NULL, *lnk = NULL;
+ _cleanup_free_ char *unit = NULL;
_cleanup_free_ char *opt, *p = NULL;
_cleanup_fclose_ FILE *f = NULL;
int r;
@@ -418,15 +388,7 @@ static int add_automount(
if (r < 0)
return log_error_errno(r, "Failed to write unit file %s: %m", p);
- lnk = strjoin(arg_dest, "/" SPECIAL_LOCAL_FS_TARGET ".wants/", unit);
- if (!lnk)
- return log_oom();
- mkdir_parents_label(lnk, 0755);
-
- if (symlink(p, lnk) < 0)
- return log_error_errno(errno, "Failed to create symlink %s: %m", lnk);
-
- return 0;
+ return generator_add_symlink(arg_dest, SPECIAL_LOCAL_FS_TARGET, "wants", unit);
}
static int add_esp(DissectedPartition *p) {
diff --git a/src/hibernate-resume/Makefile b/src/hibernate-resume/Makefile
deleted file mode 120000
index d0b0e8e008..0000000000
--- a/src/hibernate-resume/Makefile
+++ /dev/null
@@ -1 +0,0 @@
-../Makefile \ No newline at end of file
diff --git a/src/hostname/.gitignore b/src/hostname/.gitignore
deleted file mode 100644
index 1ff281b231..0000000000
--- a/src/hostname/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-org.freedesktop.hostname1.policy
diff --git a/src/hostname/Makefile b/src/hostname/Makefile
deleted file mode 120000
index d0b0e8e008..0000000000
--- a/src/hostname/Makefile
+++ /dev/null
@@ -1 +0,0 @@
-../Makefile \ No newline at end of file
diff --git a/src/hwdb/Makefile b/src/hwdb/Makefile
deleted file mode 120000
index d0b0e8e008..0000000000
--- a/src/hwdb/Makefile
+++ /dev/null
@@ -1 +0,0 @@
-../Makefile \ No newline at end of file
diff --git a/src/import/.gitignore b/src/import/.gitignore
deleted file mode 100644
index 01106e2e68..0000000000
--- a/src/import/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-/org.freedesktop.import1.policy
diff --git a/src/import/Makefile b/src/import/Makefile
deleted file mode 120000
index d0b0e8e008..0000000000
--- a/src/import/Makefile
+++ /dev/null
@@ -1 +0,0 @@
-../Makefile \ No newline at end of file
diff --git a/src/initctl/Makefile b/src/initctl/Makefile
deleted file mode 120000
index d0b0e8e008..0000000000
--- a/src/initctl/Makefile
+++ /dev/null
@@ -1 +0,0 @@
-../Makefile \ No newline at end of file
diff --git a/src/initctl/initctl.c b/src/initctl/initctl.c
index 6aeb5ad614..deb3f1b2a8 100644
--- a/src/initctl/initctl.c
+++ b/src/initctl/initctl.c
@@ -388,7 +388,7 @@ int main(int argc, char *argv[]) {
if (server_init(&server, (unsigned) n) < 0)
return EXIT_FAILURE;
- log_debug("systemd-initctl running as pid "PID_FMT, getpid());
+ log_debug("systemd-initctl running as pid "PID_FMT, getpid_cached());
sd_notify(false,
"READY=1\n"
@@ -415,7 +415,7 @@ int main(int argc, char *argv[]) {
r = EXIT_SUCCESS;
- log_debug("systemd-initctl stopped as pid "PID_FMT, getpid());
+ log_debug("systemd-initctl stopped as pid "PID_FMT, getpid_cached());
fail:
sd_notify(false,
diff --git a/src/journal-remote/.gitignore b/src/journal-remote/.gitignore
deleted file mode 100644
index 06847b65d4..0000000000
--- a/src/journal-remote/.gitignore
+++ /dev/null
@@ -1,2 +0,0 @@
-/journal-remote.conf
-/journal-upload.conf
diff --git a/src/journal-remote/Makefile b/src/journal-remote/Makefile
deleted file mode 120000
index d0b0e8e008..0000000000
--- a/src/journal-remote/Makefile
+++ /dev/null
@@ -1 +0,0 @@
-../Makefile \ No newline at end of file
diff --git a/src/journal-remote/journal-remote.c b/src/journal-remote/journal-remote.c
index 36c1a32dcd..810206c621 100644
--- a/src/journal-remote/journal-remote.c
+++ b/src/journal-remote/journal-remote.c
@@ -86,7 +86,7 @@ static int spawn_child(const char* child, char** argv) {
if (pipe(fd) < 0)
return log_error_errno(errno, "Failed to create pager pipe: %m");
- parent_pid = getpid();
+ parent_pid = getpid_cached();
child_pid = fork();
if (child_pid < 0) {
@@ -1564,7 +1564,7 @@ int main(int argc, char **argv) {
log_debug("Watchdog is %sd.", enable_disable(r > 0));
log_debug("%s running as pid "PID_FMT,
- program_invocation_short_name, getpid());
+ program_invocation_short_name, getpid_cached());
sd_notify(false,
"READY=1\n"
"STATUS=Processing requests...");
diff --git a/src/journal-remote/journal-upload.c b/src/journal-remote/journal-upload.c
index e0858dda7b..ea264989ab 100644
--- a/src/journal-remote/journal-upload.c
+++ b/src/journal-remote/journal-upload.c
@@ -811,7 +811,7 @@ int main(int argc, char **argv) {
goto cleanup;
log_debug("%s running as pid "PID_FMT,
- program_invocation_short_name, getpid());
+ program_invocation_short_name, getpid_cached());
use_journal = optind >= argc;
if (use_journal) {
diff --git a/src/journal/.gitignore b/src/journal/.gitignore
deleted file mode 100644
index b93a9462fa..0000000000
--- a/src/journal/.gitignore
+++ /dev/null
@@ -1,3 +0,0 @@
-/journald-gperf.c
-/audit_type-list.txt
-/audit_type-*-name.*
diff --git a/src/journal/Makefile b/src/journal/Makefile
deleted file mode 120000
index d0b0e8e008..0000000000
--- a/src/journal/Makefile
+++ /dev/null
@@ -1 +0,0 @@
-../Makefile \ No newline at end of file
diff --git a/src/journal/journal-file.c b/src/journal/journal-file.c
index 4ff38de2e6..84e64aef6c 100644
--- a/src/journal/journal-file.c
+++ b/src/journal/journal-file.c
@@ -727,7 +727,7 @@ static unsigned type_to_context(ObjectType type) {
return type > OBJECT_UNUSED && type < _OBJECT_TYPE_MAX ? type : 0;
}
-static int journal_file_move_to(JournalFile *f, ObjectType type, bool keep_always, uint64_t offset, uint64_t size, void **ret) {
+static int journal_file_move_to(JournalFile *f, ObjectType type, bool keep_always, uint64_t offset, uint64_t size, void **ret, size_t *ret_size) {
int r;
assert(f);
@@ -749,7 +749,7 @@ static int journal_file_move_to(JournalFile *f, ObjectType type, bool keep_alway
return -EADDRNOTAVAIL;
}
- return mmap_cache_get(f->mmap, f->cache_fd, f->prot, type_to_context(type), keep_always, offset, size, &f->last_stat, ret);
+ return mmap_cache_get(f->mmap, f->cache_fd, f->prot, type_to_context(type), keep_always, offset, size, &f->last_stat, ret, ret_size);
}
static uint64_t minimum_header_size(Object *o) {
@@ -773,6 +773,7 @@ static uint64_t minimum_header_size(Object *o) {
int journal_file_move_to_object(JournalFile *f, ObjectType type, uint64_t offset, Object **ret) {
int r;
void *t;
+ size_t tsize;
Object *o;
uint64_t s;
@@ -791,7 +792,7 @@ int journal_file_move_to_object(JournalFile *f, ObjectType type, uint64_t offset
return -EBADMSG;
}
- r = journal_file_move_to(f, type, false, offset, sizeof(ObjectHeader), &t);
+ r = journal_file_move_to(f, type, false, offset, sizeof(ObjectHeader), &t, &tsize);
if (r < 0)
return r;
@@ -822,8 +823,8 @@ int journal_file_move_to_object(JournalFile *f, ObjectType type, uint64_t offset
return -EBADMSG;
}
- if (s > sizeof(ObjectHeader)) {
- r = journal_file_move_to(f, type, false, offset, s, &t);
+ if (s > tsize) {
+ r = journal_file_move_to(f, type, false, offset, s, &t, NULL);
if (r < 0)
return r;
@@ -893,7 +894,7 @@ int journal_file_append_object(JournalFile *f, ObjectType type, uint64_t size, O
if (r < 0)
return r;
- r = journal_file_move_to(f, type, false, p, size, &t);
+ r = journal_file_move_to(f, type, false, p, size, &t, NULL);
if (r < 0)
return r;
@@ -991,7 +992,7 @@ int journal_file_map_data_hash_table(JournalFile *f) {
OBJECT_DATA_HASH_TABLE,
true,
p, s,
- &t);
+ &t, NULL);
if (r < 0)
return r;
@@ -1017,7 +1018,7 @@ int journal_file_map_field_hash_table(JournalFile *f) {
OBJECT_FIELD_HASH_TABLE,
true,
p, s,
- &t);
+ &t, NULL);
if (r < 0)
return r;
@@ -3196,7 +3197,7 @@ int journal_file_open(
goto fail;
}
- r = mmap_cache_get(f->mmap, f->cache_fd, f->prot, CONTEXT_HEADER, true, 0, PAGE_ALIGN(sizeof(Header)), &f->last_stat, &h);
+ r = mmap_cache_get(f->mmap, f->cache_fd, f->prot, CONTEXT_HEADER, true, 0, PAGE_ALIGN(sizeof(Header)), &f->last_stat, &h, NULL);
if (r < 0)
goto fail;
diff --git a/src/journal/journal-qrcode.c b/src/journal/journal-qrcode.c
index 5ee10498d1..4e194bd809 100644
--- a/src/journal/journal-qrcode.c
+++ b/src/journal/journal-qrcode.c
@@ -65,11 +65,11 @@ int print_qr_code(
if (!f)
return -ENOMEM;
- fputs("fss://", f);
+ fputs_unlocked("fss://", f);
for (i = 0; i < seed_size; i++) {
if (i > 0 && i % 3 == 0)
- fputc('-', f);
+ fputc_unlocked('-', f);
fprintf(f, "%02x", ((uint8_t*) seed)[i]);
}
diff --git a/src/journal/journal-verify.c b/src/journal/journal-verify.c
index 9feb5b5ae6..3f4c38ccde 100644
--- a/src/journal/journal-verify.c
+++ b/src/journal/journal-verify.c
@@ -392,7 +392,7 @@ static int contains_uint64(MMapCache *m, MMapFileDescriptor *f, uint64_t n, uint
c = (a + b) / 2;
- r = mmap_cache_get(m, f, PROT_READ|PROT_WRITE, 0, false, c * sizeof(uint64_t), sizeof(uint64_t), NULL, (void **) &z);
+ r = mmap_cache_get(m, f, PROT_READ|PROT_WRITE, 0, false, c * sizeof(uint64_t), sizeof(uint64_t), NULL, (void **) &z, NULL);
if (r < 0)
return r;
diff --git a/src/journal/journald-gperf.gperf b/src/journal/journald-gperf.gperf
index 654fd76a4b..522ad30cf3 100644
--- a/src/journal/journald-gperf.gperf
+++ b/src/journal/journald-gperf.gperf
@@ -18,6 +18,7 @@ struct ConfigPerfItem;
Journal.Storage, config_parse_storage, 0, offsetof(Server, storage)
Journal.Compress, config_parse_bool, 0, offsetof(Server, compress)
Journal.Seal, config_parse_bool, 0, offsetof(Server, seal)
+Journal.ReadKMsg, config_parse_bool, 0, offsetof(Server, read_kmsg)
Journal.SyncIntervalSec, config_parse_sec, 0, offsetof(Server, sync_interval_usec)
# The following is a legacy name for compatibility
Journal.RateLimitInterval, config_parse_sec, 0, offsetof(Server, rate_limit_interval)
diff --git a/src/journal/journald-kmsg.c b/src/journal/journald-kmsg.c
index 8afaec0ced..7fea85a5d8 100644
--- a/src/journal/journald-kmsg.c
+++ b/src/journal/journald-kmsg.c
@@ -106,7 +106,7 @@ static bool is_us(const char *pid) {
if (parse_pid(pid, &t) < 0)
return false;
- return t == getpid();
+ return t == getpid_cached();
}
static void dev_kmsg_record(Server *s, const char *p, size_t l) {
@@ -397,17 +397,26 @@ static int dispatch_dev_kmsg(sd_event_source *es, int fd, uint32_t revents, void
}
int server_open_dev_kmsg(Server *s) {
+ mode_t mode;
int r;
assert(s);
- s->dev_kmsg_fd = open("/dev/kmsg", O_RDWR|O_CLOEXEC|O_NONBLOCK|O_NOCTTY);
+ if (s->read_kmsg)
+ mode = O_RDWR|O_CLOEXEC|O_NONBLOCK|O_NOCTTY;
+ else
+ mode = O_WRONLY|O_CLOEXEC|O_NONBLOCK|O_NOCTTY;
+
+ s->dev_kmsg_fd = open("/dev/kmsg", mode);
if (s->dev_kmsg_fd < 0) {
log_full(errno == ENOENT ? LOG_DEBUG : LOG_WARNING,
"Failed to open /dev/kmsg, ignoring: %m");
return 0;
}
+ if (!s->read_kmsg)
+ return 0;
+
r = sd_event_add_io(s->event, &s->dev_kmsg_event_source, s->dev_kmsg_fd, EPOLLIN, dispatch_dev_kmsg, s);
if (r < 0) {
diff --git a/src/journal/journald-server.c b/src/journal/journald-server.c
index 05a1254d4a..f391845ba9 100644
--- a/src/journal/journald-server.c
+++ b/src/journal/journald-server.c
@@ -1095,7 +1095,7 @@ void server_driver_message(Server *s, const char *message_id, const char *format
/* Error handling below */
va_end(ap);
- ucred.pid = getpid();
+ ucred.pid = getpid_cached();
ucred.uid = getuid();
ucred.gid = getgid();
@@ -1915,6 +1915,7 @@ int server_init(Server *s) {
s->syslog_fd = s->native_fd = s->stdout_fd = s->dev_kmsg_fd = s->audit_fd = s->hostname_fd = s->notify_fd = -1;
s->compress = true;
s->seal = true;
+ s->read_kmsg = true;
s->watchdog_usec = USEC_INFINITY;
@@ -2051,7 +2052,7 @@ int server_init(Server *s) {
if (r < 0)
return r;
- /* /dev/ksmg */
+ /* /dev/kmsg */
r = server_open_dev_kmsg(s);
if (r < 0)
return r;
diff --git a/src/journal/journald-server.h b/src/journal/journald-server.h
index 203460c50a..882bcead8d 100644
--- a/src/journal/journald-server.h
+++ b/src/journal/journald-server.h
@@ -112,6 +112,7 @@ struct Server {
bool compress;
bool seal;
+ bool read_kmsg;
bool forward_to_kmsg;
bool forward_to_syslog;
diff --git a/src/journal/journald-syslog.c b/src/journal/journald-syslog.c
index 8e034c8fa9..17f855e967 100644
--- a/src/journal/journald-syslog.c
+++ b/src/journal/journald-syslog.c
@@ -99,7 +99,7 @@ static void forward_syslog_iovec(Server *s, const struct iovec *iovec, unsigned
* let's fix it as good as we can, and retry */
u = *ucred;
- u.pid = getpid();
+ u.pid = getpid_cached();
memcpy(CMSG_DATA(cmsg), &u, sizeof(struct ucred));
if (sendmsg(s->syslog_fd, &msghdr, MSG_NOSIGNAL) >= 0)
diff --git a/src/journal/journald.c b/src/journal/journald.c
index 1aaef387b4..4dee764fdd 100644
--- a/src/journal/journald.c
+++ b/src/journal/journald.c
@@ -55,7 +55,7 @@ int main(int argc, char *argv[]) {
server_flush_to_var(&server, true);
server_flush_dev_kmsg(&server);
- log_debug("systemd-journald running as pid "PID_FMT, getpid());
+ log_debug("systemd-journald running as pid "PID_FMT, getpid_cached());
server_driver_message(&server,
"MESSAGE_ID=" SD_MESSAGE_JOURNAL_START_STR,
LOG_MESSAGE("Journal started"),
@@ -114,7 +114,7 @@ int main(int argc, char *argv[]) {
server_maybe_warn_forward_syslog_missed(&server);
}
- log_debug("systemd-journald stopped as pid "PID_FMT, getpid());
+ log_debug("systemd-journald stopped as pid "PID_FMT, getpid_cached());
server_driver_message(&server,
"MESSAGE_ID=" SD_MESSAGE_JOURNAL_STOP_STR,
LOG_MESSAGE("Journal stopped"),
diff --git a/src/journal/mmap-cache.c b/src/journal/mmap-cache.c
index 5dfda73c56..6e60d24dcf 100644
--- a/src/journal/mmap-cache.c
+++ b/src/journal/mmap-cache.c
@@ -157,19 +157,26 @@ static void window_free(Window *w) {
free(w);
}
-_pure_ static bool window_matches(Window *w, MMapFileDescriptor *f, int prot, uint64_t offset, size_t size) {
+_pure_ static inline bool window_matches(Window *w, int prot, uint64_t offset, size_t size) {
assert(w);
- assert(f);
assert(size > 0);
return
- w->fd &&
- f->fd == w->fd->fd &&
prot == w->prot &&
offset >= w->offset &&
offset + size <= w->offset + w->size;
}
+_pure_ static bool window_matches_fd(Window *w, MMapFileDescriptor *f, int prot, uint64_t offset, size_t size) {
+ assert(w);
+ assert(f);
+
+ return
+ w->fd &&
+ f->fd == w->fd->fd &&
+ window_matches(w, prot, offset, size);
+}
+
static Window *window_add(MMapCache *m, MMapFileDescriptor *f, int prot, bool keep_always, uint64_t offset, size_t size, void *ptr) {
Window *w;
@@ -338,7 +345,8 @@ static int try_context(
bool keep_always,
uint64_t offset,
size_t size,
- void **ret) {
+ void **ret,
+ size_t *ret_size) {
Context *c;
@@ -357,7 +365,7 @@ static int try_context(
if (!c->window)
return 0;
- if (!window_matches(c->window, f, prot, offset, size)) {
+ if (!window_matches_fd(c->window, f, prot, offset, size)) {
/* Drop the reference to the window, since it's unnecessary now */
context_detach_window(c);
@@ -370,6 +378,9 @@ static int try_context(
c->window->keep_always = c->window->keep_always || keep_always;
*ret = (uint8_t*) c->window->ptr + (offset - c->window->offset);
+ if (ret_size)
+ *ret_size = c->window->size - (offset - c->window->offset);
+
return 1;
}
@@ -381,7 +392,8 @@ static int find_mmap(
bool keep_always,
uint64_t offset,
size_t size,
- void **ret) {
+ void **ret,
+ size_t *ret_size) {
Window *w;
Context *c;
@@ -395,7 +407,7 @@ static int find_mmap(
return -EIO;
LIST_FOREACH(by_fd, w, f->windows)
- if (window_matches(w, f, prot, offset, size))
+ if (window_matches(w, prot, offset, size))
break;
if (!w)
@@ -409,6 +421,9 @@ static int find_mmap(
w->keep_always = w->keep_always || keep_always;
*ret = (uint8_t*) w->ptr + (offset - w->offset);
+ if (ret_size)
+ *ret_size = w->size - (offset - w->offset);
+
return 1;
}
@@ -448,7 +463,8 @@ static int add_mmap(
uint64_t offset,
size_t size,
struct stat *st,
- void **ret) {
+ void **ret,
+ size_t *ret_size) {
uint64_t woffset, wsize;
Context *c;
@@ -503,11 +519,12 @@ static int add_mmap(
if (!w)
goto outofmem;
- context_detach_window(c);
- c->window = w;
- LIST_PREPEND(by_window, w->contexts, c);
+ context_attach_window(c, w);
*ret = (uint8_t*) w->ptr + (offset - w->offset);
+ if (ret_size)
+ *ret_size = w->size - (offset - w->offset);
+
return 1;
outofmem:
@@ -524,7 +541,8 @@ int mmap_cache_get(
uint64_t offset,
size_t size,
struct stat *st,
- void **ret) {
+ void **ret,
+ size_t *ret_size) {
int r;
@@ -536,14 +554,14 @@ int mmap_cache_get(
assert(context < MMAP_CACHE_MAX_CONTEXTS);
/* Check whether the current context is the right one already */
- r = try_context(m, f, prot, context, keep_always, offset, size, ret);
+ r = try_context(m, f, prot, context, keep_always, offset, size, ret, ret_size);
if (r != 0) {
m->n_hit++;
return r;
}
/* Search for a matching mmap */
- r = find_mmap(m, f, prot, context, keep_always, offset, size, ret);
+ r = find_mmap(m, f, prot, context, keep_always, offset, size, ret, ret_size);
if (r != 0) {
m->n_hit++;
return r;
@@ -552,7 +570,7 @@ int mmap_cache_get(
m->n_missed++;
/* Create a new mmap */
- return add_mmap(m, f, prot, context, keep_always, offset, size, st, ret);
+ return add_mmap(m, f, prot, context, keep_always, offset, size, st, ret, ret_size);
}
unsigned mmap_cache_get_hit(MMapCache *m) {
diff --git a/src/journal/mmap-cache.h b/src/journal/mmap-cache.h
index 7b33218563..cf6af1906a 100644
--- a/src/journal/mmap-cache.h
+++ b/src/journal/mmap-cache.h
@@ -41,7 +41,8 @@ int mmap_cache_get(
uint64_t offset,
size_t size,
struct stat *st,
- void **ret);
+ void **ret,
+ size_t *ret_size);
MMapFileDescriptor * mmap_cache_add_fd(MMapCache *m, int fd);
void mmap_cache_free_fd(MMapCache *m, MMapFileDescriptor *f);
diff --git a/src/journal/sd-journal.c b/src/journal/sd-journal.c
index cd56470a33..22054835ba 100644
--- a/src/journal/sd-journal.c
+++ b/src/journal/sd-journal.c
@@ -69,7 +69,7 @@ static bool journal_pid_changed(sd_journal *j) {
/* We don't support people creating a journal object and
* keeping it around over a fork(). Let's complain. */
- return j->original_pid != getpid();
+ return j->original_pid != getpid_cached();
}
static int journal_put_error(sd_journal *j, int r, const char *path) {
@@ -1715,7 +1715,7 @@ static sd_journal *journal_new(int flags, const char *path) {
if (!j)
return NULL;
- j->original_pid = getpid();
+ j->original_pid = getpid_cached();
j->toplevel_fd = -1;
j->inotify_fd = -1;
j->flags = flags;
diff --git a/src/journal/test-compress-benchmark.c b/src/journal/test-compress-benchmark.c
index 2a0ef634a5..7bddd178c4 100644
--- a/src/journal/test-compress-benchmark.c
+++ b/src/journal/test-compress-benchmark.c
@@ -180,7 +180,7 @@ int main(int argc, char *argv[]) {
if (argc == 3)
(void) safe_atozu(argv[2], &arg_start);
else
- arg_start = getpid();
+ arg_start = getpid_cached();
NULSTR_FOREACH(i, "zeros\0simple\0random\0") {
#ifdef HAVE_XZ
diff --git a/src/journal/test-mmap-cache.c b/src/journal/test-mmap-cache.c
index c51b069f8b..702434efd2 100644
--- a/src/journal/test-mmap-cache.c
+++ b/src/journal/test-mmap-cache.c
@@ -51,23 +51,23 @@ int main(int argc, char *argv[]) {
assert_se(z >= 0);
unlink(pz);
- r = mmap_cache_get(m, fx, PROT_READ, 0, false, 1, 2, NULL, &p);
+ r = mmap_cache_get(m, fx, PROT_READ, 0, false, 1, 2, NULL, &p, NULL);
assert_se(r >= 0);
- r = mmap_cache_get(m, fx, PROT_READ, 0, false, 2, 2, NULL, &q);
+ r = mmap_cache_get(m, fx, PROT_READ, 0, false, 2, 2, NULL, &q, NULL);
assert_se(r >= 0);
assert_se((uint8_t*) p + 1 == (uint8_t*) q);
- r = mmap_cache_get(m, fx, PROT_READ, 1, false, 3, 2, NULL, &q);
+ r = mmap_cache_get(m, fx, PROT_READ, 1, false, 3, 2, NULL, &q, NULL);
assert_se(r >= 0);
assert_se((uint8_t*) p + 2 == (uint8_t*) q);
- r = mmap_cache_get(m, fx, PROT_READ, 0, false, 16ULL*1024ULL*1024ULL, 2, NULL, &p);
+ r = mmap_cache_get(m, fx, PROT_READ, 0, false, 16ULL*1024ULL*1024ULL, 2, NULL, &p, NULL);
assert_se(r >= 0);
- r = mmap_cache_get(m, fx, PROT_READ, 1, false, 16ULL*1024ULL*1024ULL+1, 2, NULL, &q);
+ r = mmap_cache_get(m, fx, PROT_READ, 1, false, 16ULL*1024ULL*1024ULL+1, 2, NULL, &q, NULL);
assert_se(r >= 0);
assert_se((uint8_t*) p + 1 == (uint8_t*) q);
diff --git a/src/kernel-install/Makefile b/src/kernel-install/Makefile
deleted file mode 120000
index d0b0e8e008..0000000000
--- a/src/kernel-install/Makefile
+++ /dev/null
@@ -1 +0,0 @@
-../Makefile \ No newline at end of file
diff --git a/src/libsystemd-network/Makefile b/src/libsystemd-network/Makefile
deleted file mode 120000
index d0b0e8e008..0000000000
--- a/src/libsystemd-network/Makefile
+++ /dev/null
@@ -1 +0,0 @@
-../Makefile \ No newline at end of file
diff --git a/src/libsystemd-network/sd-dhcp-lease.c b/src/libsystemd-network/sd-dhcp-lease.c
index 1661874a55..6f0e51720a 100644
--- a/src/libsystemd-network/sd-dhcp-lease.c
+++ b/src/libsystemd-network/sd-dhcp-lease.c
@@ -926,16 +926,16 @@ int dhcp_lease_save(sd_dhcp_lease *lease, const char *lease_file) {
r = sd_dhcp_lease_get_dns(lease, &addresses);
if (r > 0) {
- fputs("DNS=", f);
+ fputs_unlocked("DNS=", f);
serialize_in_addrs(f, addresses, r);
- fputs("\n", f);
+ fputs_unlocked("\n", f);
}
r = sd_dhcp_lease_get_ntp(lease, &addresses);
if (r > 0) {
- fputs("NTP=", f);
+ fputs_unlocked("NTP=", f);
serialize_in_addrs(f, addresses, r);
- fputs("\n", f);
+ fputs_unlocked("\n", f);
}
r = sd_dhcp_lease_get_domainname(lease, &string);
@@ -944,9 +944,9 @@ int dhcp_lease_save(sd_dhcp_lease *lease, const char *lease_file) {
r = sd_dhcp_lease_get_search_domains(lease, &search_domains);
if (r > 0) {
- fputs("DOMAIN_SEARCH_LIST=", f);
+ fputs_unlocked("DOMAIN_SEARCH_LIST=", f);
fputstrv(f, search_domains, NULL, NULL);
- fputs("\n", f);
+ fputs_unlocked("\n", f);
}
r = sd_dhcp_lease_get_hostname(lease, &string);
diff --git a/src/libsystemd/.gitignore b/src/libsystemd/.gitignore
deleted file mode 100644
index 50a1692374..0000000000
--- a/src/libsystemd/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-/libsystemd.pc
diff --git a/src/libsystemd/Makefile b/src/libsystemd/Makefile
deleted file mode 120000
index d0b0e8e008..0000000000
--- a/src/libsystemd/Makefile
+++ /dev/null
@@ -1 +0,0 @@
-../Makefile \ No newline at end of file
diff --git a/src/libsystemd/meson.build b/src/libsystemd/meson.build
index ab69afee42..8807517a1a 100644
--- a/src/libsystemd/meson.build
+++ b/src/libsystemd/meson.build
@@ -41,7 +41,6 @@ libsystemd_internal_sources = files('''
sd-bus/bus-track.h
sd-bus/bus-type.c
sd-bus/bus-type.h
- sd-bus/kdbus.h
sd-bus/sd-bus.c
sd-daemon/sd-daemon.c
sd-device/device-enumerator-private.h
diff --git a/src/libsystemd/sd-bus/Makefile b/src/libsystemd/sd-bus/Makefile
deleted file mode 120000
index 94aaae2c4d..0000000000
--- a/src/libsystemd/sd-bus/Makefile
+++ /dev/null
@@ -1 +0,0 @@
-../../Makefile \ No newline at end of file
diff --git a/src/libsystemd/sd-bus/bus-container.c b/src/libsystemd/sd-bus/bus-container.c
index 3191d27ded..9827a42267 100644
--- a/src/libsystemd/sd-bus/bus-container.c
+++ b/src/libsystemd/sd-bus/bus-container.c
@@ -140,138 +140,3 @@ int bus_container_connect_socket(sd_bus *b) {
return bus_socket_start_auth(b);
}
-
-int bus_container_connect_kernel(sd_bus *b) {
- _cleanup_close_pair_ int pair[2] = { -1, -1 };
- _cleanup_close_ int pidnsfd = -1, mntnsfd = -1, usernsfd = -1, rootfd = -1;
- union {
- struct cmsghdr cmsghdr;
- uint8_t buf[CMSG_SPACE(sizeof(int))];
- } control = {};
- int error_buf = 0;
- struct iovec iov = {
- .iov_base = &error_buf,
- .iov_len = sizeof(error_buf),
- };
- struct msghdr mh = {
- .msg_control = &control,
- .msg_controllen = sizeof(control),
- .msg_iov = &iov,
- .msg_iovlen = 1,
- };
- struct cmsghdr *cmsg;
- pid_t child;
- siginfo_t si;
- int r, fd = -1;
- ssize_t n;
-
- assert(b);
- assert(b->input_fd < 0);
- assert(b->output_fd < 0);
- assert(b->nspid > 0 || b->machine);
-
- if (b->nspid <= 0) {
- r = container_get_leader(b->machine, &b->nspid);
- if (r < 0)
- return r;
- }
-
- r = namespace_open(b->nspid, &pidnsfd, &mntnsfd, NULL, &usernsfd, &rootfd);
- if (r < 0)
- return r;
-
- if (socketpair(AF_UNIX, SOCK_SEQPACKET, 0, pair) < 0)
- return -errno;
-
- child = fork();
- if (child < 0)
- return -errno;
-
- if (child == 0) {
- pid_t grandchild;
-
- pair[0] = safe_close(pair[0]);
-
- r = namespace_enter(pidnsfd, mntnsfd, -1, usernsfd, rootfd);
- if (r < 0)
- _exit(EXIT_FAILURE);
-
- /* We just changed PID namespace, however it will only
- * take effect on the children we now fork. Hence,
- * let's fork another time, and connect from this
- * grandchild, so that kdbus only sees the credentials
- * of this process which comes from within the
- * container, and not outside of it */
-
- grandchild = fork();
- if (grandchild < 0)
- _exit(EXIT_FAILURE);
-
- if (grandchild == 0) {
- fd = open(b->kernel, O_RDWR|O_NOCTTY|O_CLOEXEC);
- if (fd < 0) {
- /* Try to send error up */
- error_buf = errno;
- (void) write(pair[1], &error_buf, sizeof(error_buf));
- _exit(EXIT_FAILURE);
- }
-
- r = send_one_fd(pair[1], fd, 0);
- if (r < 0)
- _exit(EXIT_FAILURE);
-
- _exit(EXIT_SUCCESS);
- }
-
- r = wait_for_terminate(grandchild, &si);
- if (r < 0)
- _exit(EXIT_FAILURE);
-
- if (si.si_code != CLD_EXITED)
- _exit(EXIT_FAILURE);
-
- _exit(si.si_status);
- }
-
- pair[1] = safe_close(pair[1]);
-
- r = wait_for_terminate(child, &si);
- if (r < 0)
- return r;
-
- n = recvmsg(pair[0], &mh, MSG_NOSIGNAL|MSG_CMSG_CLOEXEC);
- if (n < 0)
- return -errno;
-
- CMSG_FOREACH(cmsg, &mh) {
- if (cmsg->cmsg_level == SOL_SOCKET && cmsg->cmsg_type == SCM_RIGHTS) {
- int *fds;
- unsigned n_fds;
-
- assert(fd < 0);
-
- fds = (int*) CMSG_DATA(cmsg);
- n_fds = (cmsg->cmsg_len - CMSG_LEN(0)) / sizeof(int);
-
- if (n_fds != 1) {
- close_many(fds, n_fds);
- return -EIO;
- }
-
- fd = fds[0];
- }
- }
-
- /* If there's an fd passed, we are good. */
- if (fd >= 0) {
- b->input_fd = b->output_fd = fd;
- return bus_kernel_take_fd(b);
- }
-
- /* If there's an error passed, use it */
- if (n == sizeof(error_buf) && error_buf > 0)
- return -error_buf;
-
- /* Otherwise, we have no clue */
- return -EIO;
-}
diff --git a/src/libsystemd/sd-bus/bus-container.h b/src/libsystemd/sd-bus/bus-container.h
index 509ef45624..35952d9256 100644
--- a/src/libsystemd/sd-bus/bus-container.h
+++ b/src/libsystemd/sd-bus/bus-container.h
@@ -22,4 +22,3 @@
#include "sd-bus.h"
int bus_container_connect_socket(sd_bus *b);
-int bus_container_connect_kernel(sd_bus *b);
diff --git a/src/libsystemd/sd-bus/bus-control.c b/src/libsystemd/sd-bus/bus-control.c
index b56bb07713..1a87d3a0ee 100644
--- a/src/libsystemd/sd-bus/bus-control.c
+++ b/src/libsystemd/sd-bus/bus-control.c
@@ -56,38 +56,6 @@ _public_ int sd_bus_get_unique_name(sd_bus *bus, const char **unique) {
return 0;
}
-static int bus_request_name_kernel(sd_bus *bus, const char *name, uint64_t flags) {
- struct kdbus_cmd *n;
- size_t size, l;
- int r;
-
- assert(bus);
- assert(name);
-
- l = strlen(name) + 1;
- size = offsetof(struct kdbus_cmd, items) + KDBUS_ITEM_SIZE(l);
- n = alloca0_align(size, 8);
- n->size = size;
- n->flags = request_name_flags_to_kdbus(flags);
-
- n->items[0].size = KDBUS_ITEM_HEADER_SIZE + l;
- n->items[0].type = KDBUS_ITEM_NAME;
- memcpy(n->items[0].str, name, l);
-
-#ifdef HAVE_VALGRIND_MEMCHECK_H
- VALGRIND_MAKE_MEM_DEFINED(n, n->size);
-#endif
-
- r = ioctl(bus->input_fd, KDBUS_CMD_NAME_ACQUIRE, n);
- if (r < 0)
- return -errno;
-
- if (n->return_flags & KDBUS_NAME_IN_QUEUE)
- return 0;
-
- return 1;
-}
-
static int bus_request_name_dbus1(sd_bus *bus, const char *name, uint64_t flags) {
_cleanup_(sd_bus_message_unrefp) sd_bus_message *reply = NULL;
uint32_t ret, param = 0;
@@ -151,37 +119,7 @@ _public_ int sd_bus_request_name(sd_bus *bus, const char *name, uint64_t flags)
if (!BUS_IS_OPEN(bus->state))
return -ENOTCONN;
- if (bus->is_kernel)
- return bus_request_name_kernel(bus, name, flags);
- else
- return bus_request_name_dbus1(bus, name, flags);
-}
-
-static int bus_release_name_kernel(sd_bus *bus, const char *name) {
- struct kdbus_cmd *n;
- size_t size, l;
- int r;
-
- assert(bus);
- assert(name);
-
- l = strlen(name) + 1;
- size = offsetof(struct kdbus_cmd, items) + KDBUS_ITEM_SIZE(l);
- n = alloca0_align(size, 8);
- n->size = size;
-
- n->items[0].size = KDBUS_ITEM_HEADER_SIZE + l;
- n->items[0].type = KDBUS_ITEM_NAME;
- memcpy(n->items[0].str, name, l);
-
-#ifdef HAVE_VALGRIND_MEMCHECK_H
- VALGRIND_MAKE_MEM_DEFINED(n, n->size);
-#endif
- r = ioctl(bus->input_fd, KDBUS_CMD_NAME_RELEASE, n);
- if (r < 0)
- return -errno;
-
- return 0;
+ return bus_request_name_dbus1(bus, name, flags);
}
static int bus_release_name_dbus1(sd_bus *bus, const char *name) {
@@ -235,95 +173,7 @@ _public_ int sd_bus_release_name(sd_bus *bus, const char *name) {
if (!BUS_IS_OPEN(bus->state))
return -ENOTCONN;
- if (bus->is_kernel)
- return bus_release_name_kernel(bus, name);
- else
- return bus_release_name_dbus1(bus, name);
-}
-
-static int kernel_get_list(sd_bus *bus, uint64_t flags, char ***x) {
- struct kdbus_cmd_list cmd = {
- .size = sizeof(cmd),
- .flags = flags,
- };
- struct kdbus_info *name_list, *name;
- uint64_t previous_id = 0;
- int r;
-
- /* Caller will free half-constructed list on failure... */
-
- r = ioctl(bus->input_fd, KDBUS_CMD_LIST, &cmd);
- if (r < 0)
- return -errno;
-
- name_list = (struct kdbus_info *) ((uint8_t *) bus->kdbus_buffer + cmd.offset);
-
- KDBUS_FOREACH(name, name_list, cmd.list_size) {
- struct kdbus_item *item;
-
- if ((flags & KDBUS_LIST_UNIQUE) && name->id != previous_id && !(name->flags & KDBUS_HELLO_ACTIVATOR)) {
- char *n;
-
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wformat"
- if (asprintf(&n, ":1.%llu", name->id) < 0) {
- r = -ENOMEM;
- goto fail;
- }
-#pragma GCC diagnostic pop
-
- r = strv_consume(x, n);
- if (r < 0)
- goto fail;
-
- previous_id = name->id;
- }
-
- KDBUS_ITEM_FOREACH(item, name, items) {
- if (item->type == KDBUS_ITEM_OWNED_NAME) {
- if (service_name_is_valid(item->name.name)) {
- r = strv_extend(x, item->name.name);
- if (r < 0) {
- r = -ENOMEM;
- goto fail;
- }
- }
- }
- }
- }
-
- r = 0;
-
-fail:
- bus_kernel_cmd_free(bus, cmd.offset);
- return r;
-}
-
-static int bus_list_names_kernel(sd_bus *bus, char ***acquired, char ***activatable) {
- _cleanup_strv_free_ char **x = NULL, **y = NULL;
- int r;
-
- if (acquired) {
- r = kernel_get_list(bus, KDBUS_LIST_UNIQUE | KDBUS_LIST_NAMES, &x);
- if (r < 0)
- return r;
- }
-
- if (activatable) {
- r = kernel_get_list(bus, KDBUS_LIST_ACTIVATORS, &y);
- if (r < 0)
- return r;
-
- *activatable = y;
- y = NULL;
- }
-
- if (acquired) {
- *acquired = x;
- x = NULL;
- }
-
- return 0;
+ return bus_release_name_dbus1(bus, name);
}
static int bus_list_names_dbus1(sd_bus *bus, char ***acquired, char ***activatable) {
@@ -391,365 +241,7 @@ _public_ int sd_bus_list_names(sd_bus *bus, char ***acquired, char ***activatabl
if (!BUS_IS_OPEN(bus->state))
return -ENOTCONN;
- if (bus->is_kernel)
- return bus_list_names_kernel(bus, acquired, activatable);
- else
- return bus_list_names_dbus1(bus, acquired, activatable);
-}
-
-static int bus_populate_creds_from_items(
- sd_bus *bus,
- struct kdbus_info *info,
- uint64_t mask,
- sd_bus_creds *c) {
-
- struct kdbus_item *item;
- uint64_t m;
- int r;
-
- assert(bus);
- assert(info);
- assert(c);
-
- KDBUS_ITEM_FOREACH(item, info, items) {
-
- switch (item->type) {
-
- case KDBUS_ITEM_PIDS:
-
- if (mask & SD_BUS_CREDS_PID && item->pids.pid > 0) {
- c->pid = (pid_t) item->pids.pid;
- c->mask |= SD_BUS_CREDS_PID;
- }
-
- if (mask & SD_BUS_CREDS_TID && item->pids.tid > 0) {
- c->tid = (pid_t) item->pids.tid;
- c->mask |= SD_BUS_CREDS_TID;
- }
-
- if (mask & SD_BUS_CREDS_PPID) {
- if (item->pids.ppid > 0) {
- c->ppid = (pid_t) item->pids.ppid;
- c->mask |= SD_BUS_CREDS_PPID;
- } else if (item->pids.pid == 1) {
- /* The structure doesn't
- * really distinguish the case
- * where a process has no
- * parent and where we don't
- * know it because it could
- * not be translated due to
- * namespaces. However, we
- * know that PID 1 has no
- * parent process, hence let's
- * patch that in, manually. */
- c->ppid = 0;
- c->mask |= SD_BUS_CREDS_PPID;
- }
- }
-
- break;
-
- case KDBUS_ITEM_CREDS:
-
- if (mask & SD_BUS_CREDS_UID && (uid_t) item->creds.uid != UID_INVALID) {
- c->uid = (uid_t) item->creds.uid;
- c->mask |= SD_BUS_CREDS_UID;
- }
-
- if (mask & SD_BUS_CREDS_EUID && (uid_t) item->creds.euid != UID_INVALID) {
- c->euid = (uid_t) item->creds.euid;
- c->mask |= SD_BUS_CREDS_EUID;
- }
-
- if (mask & SD_BUS_CREDS_SUID && (uid_t) item->creds.suid != UID_INVALID) {
- c->suid = (uid_t) item->creds.suid;
- c->mask |= SD_BUS_CREDS_SUID;
- }
-
- if (mask & SD_BUS_CREDS_FSUID && (uid_t) item->creds.fsuid != UID_INVALID) {
- c->fsuid = (uid_t) item->creds.fsuid;
- c->mask |= SD_BUS_CREDS_FSUID;
- }
-
- if (mask & SD_BUS_CREDS_GID && (gid_t) item->creds.gid != GID_INVALID) {
- c->gid = (gid_t) item->creds.gid;
- c->mask |= SD_BUS_CREDS_GID;
- }
-
- if (mask & SD_BUS_CREDS_EGID && (gid_t) item->creds.egid != GID_INVALID) {
- c->egid = (gid_t) item->creds.egid;
- c->mask |= SD_BUS_CREDS_EGID;
- }
-
- if (mask & SD_BUS_CREDS_SGID && (gid_t) item->creds.sgid != GID_INVALID) {
- c->sgid = (gid_t) item->creds.sgid;
- c->mask |= SD_BUS_CREDS_SGID;
- }
-
- if (mask & SD_BUS_CREDS_FSGID && (gid_t) item->creds.fsgid != GID_INVALID) {
- c->fsgid = (gid_t) item->creds.fsgid;
- c->mask |= SD_BUS_CREDS_FSGID;
- }
-
- break;
-
- case KDBUS_ITEM_PID_COMM:
- if (mask & SD_BUS_CREDS_COMM) {
- r = free_and_strdup(&c->comm, item->str);
- if (r < 0)
- return r;
-
- c->mask |= SD_BUS_CREDS_COMM;
- }
- break;
-
- case KDBUS_ITEM_TID_COMM:
- if (mask & SD_BUS_CREDS_TID_COMM) {
- r = free_and_strdup(&c->tid_comm, item->str);
- if (r < 0)
- return r;
-
- c->mask |= SD_BUS_CREDS_TID_COMM;
- }
- break;
-
- case KDBUS_ITEM_EXE:
- if (mask & SD_BUS_CREDS_EXE) {
- r = free_and_strdup(&c->exe, item->str);
- if (r < 0)
- return r;
-
- c->mask |= SD_BUS_CREDS_EXE;
- }
- break;
-
- case KDBUS_ITEM_CMDLINE:
- if (mask & SD_BUS_CREDS_CMDLINE) {
- c->cmdline_size = item->size - offsetof(struct kdbus_item, data);
- c->cmdline = memdup(item->data, c->cmdline_size);
- if (!c->cmdline)
- return -ENOMEM;
-
- c->mask |= SD_BUS_CREDS_CMDLINE;
- }
- break;
-
- case KDBUS_ITEM_CGROUP:
- m = (SD_BUS_CREDS_CGROUP | SD_BUS_CREDS_UNIT |
- SD_BUS_CREDS_USER_UNIT | SD_BUS_CREDS_SLICE |
- SD_BUS_CREDS_SESSION | SD_BUS_CREDS_OWNER_UID) & mask;
-
- if (m) {
- r = free_and_strdup(&c->cgroup, item->str);
- if (r < 0)
- return r;
-
- r = bus_get_root_path(bus);
- if (r < 0)
- return r;
-
- r = free_and_strdup(&c->cgroup_root, bus->cgroup_root);
- if (r < 0)
- return r;
-
- c->mask |= m;
- }
- break;
-
- case KDBUS_ITEM_CAPS:
- m = (SD_BUS_CREDS_EFFECTIVE_CAPS | SD_BUS_CREDS_PERMITTED_CAPS |
- SD_BUS_CREDS_INHERITABLE_CAPS | SD_BUS_CREDS_BOUNDING_CAPS) & mask;
-
- if (m) {
- if (item->caps.last_cap != cap_last_cap() ||
- item->size - offsetof(struct kdbus_item, caps.caps) < DIV_ROUND_UP(item->caps.last_cap, 32U) * 4 * 4)
- return -EBADMSG;
-
- c->capability = memdup(item->caps.caps, item->size - offsetof(struct kdbus_item, caps.caps));
- if (!c->capability)
- return -ENOMEM;
-
- c->mask |= m;
- }
- break;
-
- case KDBUS_ITEM_SECLABEL:
- if (mask & SD_BUS_CREDS_SELINUX_CONTEXT) {
- r = free_and_strdup(&c->label, item->str);
- if (r < 0)
- return r;
-
- c->mask |= SD_BUS_CREDS_SELINUX_CONTEXT;
- }
- break;
-
- case KDBUS_ITEM_AUDIT:
- if (mask & SD_BUS_CREDS_AUDIT_SESSION_ID) {
- c->audit_session_id = (uint32_t) item->audit.sessionid;
- c->mask |= SD_BUS_CREDS_AUDIT_SESSION_ID;
- }
-
- if (mask & SD_BUS_CREDS_AUDIT_LOGIN_UID) {
- c->audit_login_uid = (uid_t) item->audit.loginuid;
- c->mask |= SD_BUS_CREDS_AUDIT_LOGIN_UID;
- }
- break;
-
- case KDBUS_ITEM_OWNED_NAME:
- if ((mask & SD_BUS_CREDS_WELL_KNOWN_NAMES) && service_name_is_valid(item->name.name)) {
- r = strv_extend(&c->well_known_names, item->name.name);
- if (r < 0)
- return r;
-
- c->mask |= SD_BUS_CREDS_WELL_KNOWN_NAMES;
- }
- break;
-
- case KDBUS_ITEM_CONN_DESCRIPTION:
- if (mask & SD_BUS_CREDS_DESCRIPTION) {
- r = free_and_strdup(&c->description, item->str);
- if (r < 0)
- return r;
-
- c->mask |= SD_BUS_CREDS_DESCRIPTION;
- }
- break;
-
- case KDBUS_ITEM_AUXGROUPS:
- if (mask & SD_BUS_CREDS_SUPPLEMENTARY_GIDS) {
- size_t i, n;
- uid_t *g;
-
- n = (item->size - offsetof(struct kdbus_item, data64)) / sizeof(uint64_t);
- g = new(gid_t, n);
- if (!g)
- return -ENOMEM;
-
- for (i = 0; i < n; i++)
- g[i] = item->data64[i];
-
- free(c->supplementary_gids);
- c->supplementary_gids = g;
- c->n_supplementary_gids = n;
-
- c->mask |= SD_BUS_CREDS_SUPPLEMENTARY_GIDS;
- }
- break;
- }
- }
-
- return 0;
-}
-
-int bus_get_name_creds_kdbus(
- sd_bus *bus,
- const char *name,
- uint64_t mask,
- bool allow_activator,
- sd_bus_creds **creds) {
-
- _cleanup_(sd_bus_creds_unrefp) sd_bus_creds *c = NULL;
- struct kdbus_cmd_info *cmd;
- struct kdbus_info *conn_info;
- size_t size, l;
- uint64_t id;
- int r;
-
- if (streq(name, "org.freedesktop.DBus"))
- return -EOPNOTSUPP;
-
- r = bus_kernel_parse_unique_name(name, &id);
- if (r < 0)
- return r;
- if (r > 0) {
- size = offsetof(struct kdbus_cmd_info, items);
- cmd = alloca0_align(size, 8);
- cmd->id = id;
- } else {
- l = strlen(name) + 1;
- size = offsetof(struct kdbus_cmd_info, items) + KDBUS_ITEM_SIZE(l);
- cmd = alloca0_align(size, 8);
- cmd->items[0].size = KDBUS_ITEM_HEADER_SIZE + l;
- cmd->items[0].type = KDBUS_ITEM_NAME;
- memcpy(cmd->items[0].str, name, l);
- }
-
- /* If augmentation is on, and the bus didn't provide us
- * the bits we want, then ask for the PID/TID so that we
- * can read the rest from /proc. */
- if ((mask & SD_BUS_CREDS_AUGMENT) &&
- (mask & (SD_BUS_CREDS_PPID|
- SD_BUS_CREDS_UID|SD_BUS_CREDS_EUID|SD_BUS_CREDS_SUID|SD_BUS_CREDS_FSUID|
- SD_BUS_CREDS_GID|SD_BUS_CREDS_EGID|SD_BUS_CREDS_SGID|SD_BUS_CREDS_FSGID|
- SD_BUS_CREDS_SUPPLEMENTARY_GIDS|
- SD_BUS_CREDS_COMM|SD_BUS_CREDS_TID_COMM|SD_BUS_CREDS_EXE|SD_BUS_CREDS_CMDLINE|
- SD_BUS_CREDS_CGROUP|SD_BUS_CREDS_UNIT|SD_BUS_CREDS_USER_UNIT|SD_BUS_CREDS_SLICE|SD_BUS_CREDS_SESSION|SD_BUS_CREDS_OWNER_UID|
- SD_BUS_CREDS_EFFECTIVE_CAPS|SD_BUS_CREDS_PERMITTED_CAPS|SD_BUS_CREDS_INHERITABLE_CAPS|SD_BUS_CREDS_BOUNDING_CAPS|
- SD_BUS_CREDS_SELINUX_CONTEXT|
- SD_BUS_CREDS_AUDIT_SESSION_ID|SD_BUS_CREDS_AUDIT_LOGIN_UID)))
- mask |= SD_BUS_CREDS_PID;
-
- cmd->size = size;
- cmd->attach_flags = attach_flags_to_kdbus(mask);
-
- r = ioctl(bus->input_fd, KDBUS_CMD_CONN_INFO, cmd);
- if (r < 0)
- return -errno;
-
- conn_info = (struct kdbus_info *) ((uint8_t *) bus->kdbus_buffer + cmd->offset);
-
- /* Non-activated names are considered not available */
- if (!allow_activator && (conn_info->flags & KDBUS_HELLO_ACTIVATOR)) {
- if (name[0] == ':')
- r = -ENXIO;
- else
- r = -ESRCH;
- goto fail;
- }
-
- c = bus_creds_new();
- if (!c) {
- r = -ENOMEM;
- goto fail;
- }
-
- if (mask & SD_BUS_CREDS_UNIQUE_NAME) {
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wformat"
- if (asprintf(&c->unique_name, ":1.%llu", conn_info->id) < 0) {
- r = -ENOMEM;
- goto fail;
- }
-#pragma GCC diagnostic pop
-
- c->mask |= SD_BUS_CREDS_UNIQUE_NAME;
- }
-
- /* If KDBUS_ITEM_OWNED_NAME is requested then we'll get 0 of
- them in case the service has no names. This does not mean
- however that the list of owned names could not be
- acquired. Hence, let's explicitly clarify that the data is
- complete. */
- c->mask |= mask & SD_BUS_CREDS_WELL_KNOWN_NAMES;
-
- r = bus_populate_creds_from_items(bus, conn_info, mask, c);
- if (r < 0)
- goto fail;
-
- r = bus_creds_add_more(c, mask, 0, 0);
- if (r < 0)
- goto fail;
-
- if (creds) {
- *creds = c;
- c = NULL;
- }
-
- r = 0;
-
-fail:
- bus_kernel_cmd_free(bus, cmd->offset);
- return r;
+ return bus_list_names_dbus1(bus, acquired, activatable);
}
static int bus_get_name_creds_dbus1(
@@ -1056,60 +548,7 @@ _public_ int sd_bus_get_name_creds(
if (!BUS_IS_OPEN(bus->state))
return -ENOTCONN;
- if (bus->is_kernel)
- return bus_get_name_creds_kdbus(bus, name, mask, false, creds);
- else
- return bus_get_name_creds_dbus1(bus, name, mask, creds);
-}
-
-static int bus_get_owner_creds_kdbus(sd_bus *bus, uint64_t mask, sd_bus_creds **ret) {
- _cleanup_(sd_bus_creds_unrefp) sd_bus_creds *c = NULL;
- struct kdbus_cmd_info cmd = {
- .size = sizeof(struct kdbus_cmd_info),
- };
- struct kdbus_info *creator_info;
- pid_t pid = 0;
- int r;
-
- c = bus_creds_new();
- if (!c)
- return -ENOMEM;
-
- /* If augmentation is on, and the bus doesn't didn't allow us
- * to get the bits we want, then ask for the PID/TID so that we
- * can read the rest from /proc. */
- if ((mask & SD_BUS_CREDS_AUGMENT) &&
- (mask & (SD_BUS_CREDS_PPID|
- SD_BUS_CREDS_UID|SD_BUS_CREDS_EUID|SD_BUS_CREDS_SUID|SD_BUS_CREDS_FSUID|
- SD_BUS_CREDS_GID|SD_BUS_CREDS_EGID|SD_BUS_CREDS_SGID|SD_BUS_CREDS_FSGID|
- SD_BUS_CREDS_SUPPLEMENTARY_GIDS|
- SD_BUS_CREDS_COMM|SD_BUS_CREDS_TID_COMM|SD_BUS_CREDS_EXE|SD_BUS_CREDS_CMDLINE|
- SD_BUS_CREDS_CGROUP|SD_BUS_CREDS_UNIT|SD_BUS_CREDS_USER_UNIT|SD_BUS_CREDS_SLICE|SD_BUS_CREDS_SESSION|SD_BUS_CREDS_OWNER_UID|
- SD_BUS_CREDS_EFFECTIVE_CAPS|SD_BUS_CREDS_PERMITTED_CAPS|SD_BUS_CREDS_INHERITABLE_CAPS|SD_BUS_CREDS_BOUNDING_CAPS|
- SD_BUS_CREDS_SELINUX_CONTEXT|
- SD_BUS_CREDS_AUDIT_SESSION_ID|SD_BUS_CREDS_AUDIT_LOGIN_UID)))
- mask |= SD_BUS_CREDS_PID;
-
- cmd.attach_flags = attach_flags_to_kdbus(mask);
-
- r = ioctl(bus->input_fd, KDBUS_CMD_BUS_CREATOR_INFO, &cmd);
- if (r < 0)
- return -errno;
-
- creator_info = (struct kdbus_info *) ((uint8_t *) bus->kdbus_buffer + cmd.offset);
-
- r = bus_populate_creds_from_items(bus, creator_info, mask, c);
- bus_kernel_cmd_free(bus, cmd.offset);
- if (r < 0)
- return r;
-
- r = bus_creds_add_more(c, mask, pid, 0);
- if (r < 0)
- return r;
-
- *ret = c;
- c = NULL;
- return 0;
+ return bus_get_name_creds_dbus1(bus, name, mask, creds);
}
static int bus_get_owner_creds_dbus1(sd_bus *bus, uint64_t mask, sd_bus_creds **ret) {
@@ -1176,398 +615,7 @@ _public_ int sd_bus_get_owner_creds(sd_bus *bus, uint64_t mask, sd_bus_creds **r
if (!bus->is_local)
mask &= ~SD_BUS_CREDS_AUGMENT;
- if (bus->is_kernel)
- return bus_get_owner_creds_kdbus(bus, mask, ret);
- else
- return bus_get_owner_creds_dbus1(bus, mask, ret);
-}
-
-static int add_name_change_match(sd_bus *bus,
- uint64_t cookie,
- const char *name,
- const char *old_owner,
- const char *new_owner) {
-
- uint64_t name_id = KDBUS_MATCH_ID_ANY, old_owner_id = 0, new_owner_id = 0;
- int is_name_id = -1, r;
- struct kdbus_item *item;
-
- assert(bus);
-
- /* If we encounter a match that could match against
- * NameOwnerChanged messages, then we need to create
- * KDBUS_ITEM_NAME_{ADD,REMOVE,CHANGE} and
- * KDBUS_ITEM_ID_{ADD,REMOVE} matches for it, possibly
- * multiple if the match is underspecified.
- *
- * The NameOwnerChanged signals take three parameters with
- * unique or well-known names, but only some forms actually
- * exist:
- *
- * WELLKNOWN, "", UNIQUE → KDBUS_ITEM_NAME_ADD
- * WELLKNOWN, UNIQUE, "" → KDBUS_ITEM_NAME_REMOVE
- * WELLKNOWN, UNIQUE, UNIQUE → KDBUS_ITEM_NAME_CHANGE
- * UNIQUE, "", UNIQUE → KDBUS_ITEM_ID_ADD
- * UNIQUE, UNIQUE, "" → KDBUS_ITEM_ID_REMOVE
- *
- * For the latter two the two unique names must be identical.
- *
- * */
-
- if (name) {
- is_name_id = bus_kernel_parse_unique_name(name, &name_id);
- if (is_name_id < 0)
- return 0;
- }
-
- if (!isempty(old_owner)) {
- r = bus_kernel_parse_unique_name(old_owner, &old_owner_id);
- if (r < 0)
- return 0;
- if (r == 0)
- return 0;
- if (is_name_id > 0 && old_owner_id != name_id)
- return 0;
- } else
- old_owner_id = KDBUS_MATCH_ID_ANY;
-
- if (!isempty(new_owner)) {
- r = bus_kernel_parse_unique_name(new_owner, &new_owner_id);
- if (r < 0)
- return r;
- if (r == 0)
- return 0;
- if (is_name_id > 0 && new_owner_id != name_id)
- return 0;
- } else
- new_owner_id = KDBUS_MATCH_ID_ANY;
-
- if (is_name_id <= 0) {
- struct kdbus_cmd_match *m;
- size_t sz, l;
-
- /* If the name argument is missing or is a well-known
- * name, then add KDBUS_ITEM_NAME_{ADD,REMOVE,CHANGE}
- * matches for it */
-
- l = name ? strlen(name) + 1 : 0;
-
- sz = ALIGN8(offsetof(struct kdbus_cmd_match, items) +
- offsetof(struct kdbus_item, name_change) +
- offsetof(struct kdbus_notify_name_change, name) +
- l);
-
- m = alloca0_align(sz, 8);
- m->size = sz;
- m->cookie = cookie;
-
- item = m->items;
- item->size =
- offsetof(struct kdbus_item, name_change) +
- offsetof(struct kdbus_notify_name_change, name) +
- l;
-
- item->name_change.old_id.id = old_owner_id;
- item->name_change.new_id.id = new_owner_id;
-
- memcpy_safe(item->name_change.name, name, l);
-
- /* If the old name is unset or empty, then
- * this can match against added names */
- if (isempty(old_owner)) {
- item->type = KDBUS_ITEM_NAME_ADD;
-
- r = ioctl(bus->input_fd, KDBUS_CMD_MATCH_ADD, m);
- if (r < 0)
- return -errno;
- }
-
- /* If the new name is unset or empty, then
- * this can match against removed names */
- if (isempty(new_owner)) {
- item->type = KDBUS_ITEM_NAME_REMOVE;
-
- r = ioctl(bus->input_fd, KDBUS_CMD_MATCH_ADD, m);
- if (r < 0)
- return -errno;
- }
-
- /* The CHANGE match we need in either case, because
- * what is reported as a name change by the kernel
- * might just be an owner change between starter and
- * normal clients. For userspace such a change should
- * be considered a removal/addition, hence let's
- * subscribe to this unconditionally. */
- item->type = KDBUS_ITEM_NAME_CHANGE;
- r = ioctl(bus->input_fd, KDBUS_CMD_MATCH_ADD, m);
- if (r < 0)
- return -errno;
- }
-
- if (is_name_id != 0) {
- struct kdbus_cmd_match *m;
- uint64_t sz;
-
- /* If the name argument is missing or is a unique
- * name, then add KDBUS_ITEM_ID_{ADD,REMOVE} matches
- * for it */
-
- sz = ALIGN8(offsetof(struct kdbus_cmd_match, items) +
- offsetof(struct kdbus_item, id_change) +
- sizeof(struct kdbus_notify_id_change));
-
- m = alloca0_align(sz, 8);
- m->size = sz;
- m->cookie = cookie;
-
- item = m->items;
- item->size =
- offsetof(struct kdbus_item, id_change) +
- sizeof(struct kdbus_notify_id_change);
- item->id_change.id = name_id;
-
- /* If the old name is unset or empty, then this can
- * match against added ids */
- if (isempty(old_owner)) {
- item->type = KDBUS_ITEM_ID_ADD;
- if (!isempty(new_owner))
- item->id_change.id = new_owner_id;
-
- r = ioctl(bus->input_fd, KDBUS_CMD_MATCH_ADD, m);
- if (r < 0)
- return -errno;
- }
-
- /* If thew new name is unset or empty, then this can
- * match against removed ids */
- if (isempty(new_owner)) {
- item->type = KDBUS_ITEM_ID_REMOVE;
- if (!isempty(old_owner))
- item->id_change.id = old_owner_id;
-
- r = ioctl(bus->input_fd, KDBUS_CMD_MATCH_ADD, m);
- if (r < 0)
- return -errno;
- }
- }
-
- return 0;
-}
-
-int bus_add_match_internal_kernel(
- sd_bus *bus,
- struct bus_match_component *components,
- unsigned n_components,
- uint64_t cookie) {
-
- struct kdbus_cmd_match *m;
- struct kdbus_item *item;
- uint64_t *bloom;
- size_t sz;
- const char *sender = NULL;
- size_t sender_length = 0;
- uint64_t src_id = KDBUS_MATCH_ID_ANY, dst_id = KDBUS_MATCH_ID_ANY;
- bool using_bloom = false;
- unsigned i;
- bool matches_name_change = true;
- const char *name_change_arg[3] = {};
- int r;
-
- assert(bus);
-
- /* Monitor streams don't support matches, make this a NOP */
- if (bus->hello_flags & KDBUS_HELLO_MONITOR)
- return 0;
-
- bloom = alloca0(bus->bloom_size);
-
- sz = ALIGN8(offsetof(struct kdbus_cmd_match, items));
-
- for (i = 0; i < n_components; i++) {
- struct bus_match_component *c = &components[i];
-
- switch (c->type) {
-
- case BUS_MATCH_SENDER:
- if (!streq(c->value_str, "org.freedesktop.DBus"))
- matches_name_change = false;
-
- r = bus_kernel_parse_unique_name(c->value_str, &src_id);
- if (r < 0)
- return r;
- else if (r > 0)
- sz += ALIGN8(offsetof(struct kdbus_item, id) + sizeof(uint64_t));
- else {
- sender = c->value_str;
- sender_length = strlen(sender);
- sz += ALIGN8(offsetof(struct kdbus_item, str) + sender_length + 1);
- }
-
- break;
-
- case BUS_MATCH_MESSAGE_TYPE:
- if (c->value_u8 != SD_BUS_MESSAGE_SIGNAL)
- matches_name_change = false;
-
- bloom_add_pair(bloom, bus->bloom_size, bus->bloom_n_hash, "message-type", bus_message_type_to_string(c->value_u8));
- using_bloom = true;
- break;
-
- case BUS_MATCH_INTERFACE:
- if (!streq(c->value_str, "org.freedesktop.DBus"))
- matches_name_change = false;
-
- bloom_add_pair(bloom, bus->bloom_size, bus->bloom_n_hash, "interface", c->value_str);
- using_bloom = true;
- break;
-
- case BUS_MATCH_MEMBER:
- if (!streq(c->value_str, "NameOwnerChanged"))
- matches_name_change = false;
-
- bloom_add_pair(bloom, bus->bloom_size, bus->bloom_n_hash, "member", c->value_str);
- using_bloom = true;
- break;
-
- case BUS_MATCH_PATH:
- if (!streq(c->value_str, "/org/freedesktop/DBus"))
- matches_name_change = false;
-
- bloom_add_pair(bloom, bus->bloom_size, bus->bloom_n_hash, "path", c->value_str);
- using_bloom = true;
- break;
-
- case BUS_MATCH_PATH_NAMESPACE:
- bloom_add_pair(bloom, bus->bloom_size, bus->bloom_n_hash, "path-slash-prefix", c->value_str);
- using_bloom = true;
- break;
-
- case BUS_MATCH_ARG...BUS_MATCH_ARG_LAST: {
- char buf[sizeof("arg")-1 + 2 + 1];
-
- if (c->type - BUS_MATCH_ARG < 3)
- name_change_arg[c->type - BUS_MATCH_ARG] = c->value_str;
-
- xsprintf(buf, "arg%i", c->type - BUS_MATCH_ARG);
- bloom_add_pair(bloom, bus->bloom_size, bus->bloom_n_hash, buf, c->value_str);
- using_bloom = true;
- break;
- }
-
- case BUS_MATCH_ARG_HAS...BUS_MATCH_ARG_HAS_LAST: {
- char buf[sizeof("arg")-1 + 2 + sizeof("-has")];
-
- xsprintf(buf, "arg%i-has", c->type - BUS_MATCH_ARG_HAS);
- bloom_add_pair(bloom, bus->bloom_size, bus->bloom_n_hash, buf, c->value_str);
- using_bloom = true;
- break;
- }
-
- case BUS_MATCH_ARG_PATH...BUS_MATCH_ARG_PATH_LAST:
- /*
- * XXX: DBus spec defines arg[0..63]path= matching to be
- * a two-way glob. That is, if either string is a prefix
- * of the other, it matches.
- * This is really hard to realize in bloom-filters, as
- * we would have to create a bloom-match for each prefix
- * of @c->value_str. This is excessive, hence we just
- * ignore all those matches and accept everything from
- * the kernel. People should really avoid those matches.
- * If they're used in real-life some day, we will have
- * to properly support multiple-matches here.
- */
- break;
-
- case BUS_MATCH_ARG_NAMESPACE...BUS_MATCH_ARG_NAMESPACE_LAST: {
- char buf[sizeof("arg")-1 + 2 + sizeof("-dot-prefix")];
-
- xsprintf(buf, "arg%i-dot-prefix", c->type - BUS_MATCH_ARG_NAMESPACE);
- bloom_add_pair(bloom, bus->bloom_size, bus->bloom_n_hash, buf, c->value_str);
- using_bloom = true;
- break;
- }
-
- case BUS_MATCH_DESTINATION:
- /*
- * Kernel only supports matching on destination IDs, but
- * not on destination names. So just skip the
- * destination name restriction and verify it in
- * user-space on retrieval.
- */
- r = bus_kernel_parse_unique_name(c->value_str, &dst_id);
- if (r < 0)
- return r;
- else if (r > 0)
- sz += ALIGN8(offsetof(struct kdbus_item, id) + sizeof(uint64_t));
-
- /* if not a broadcast, it cannot be a name-change */
- if (r <= 0 || dst_id != KDBUS_DST_ID_BROADCAST)
- matches_name_change = false;
-
- break;
-
- case BUS_MATCH_ROOT:
- case BUS_MATCH_VALUE:
- case BUS_MATCH_LEAF:
- case _BUS_MATCH_NODE_TYPE_MAX:
- case _BUS_MATCH_NODE_TYPE_INVALID:
- assert_not_reached("Invalid match type?");
- }
- }
-
- if (using_bloom)
- sz += ALIGN8(offsetof(struct kdbus_item, data64) + bus->bloom_size);
-
- m = alloca0_align(sz, 8);
- m->size = sz;
- m->cookie = cookie;
-
- item = m->items;
-
- if (src_id != KDBUS_MATCH_ID_ANY) {
- item->size = offsetof(struct kdbus_item, id) + sizeof(uint64_t);
- item->type = KDBUS_ITEM_ID;
- item->id = src_id;
- item = KDBUS_ITEM_NEXT(item);
- }
-
- if (dst_id != KDBUS_MATCH_ID_ANY) {
- item->size = offsetof(struct kdbus_item, id) + sizeof(uint64_t);
- item->type = KDBUS_ITEM_DST_ID;
- item->id = dst_id;
- item = KDBUS_ITEM_NEXT(item);
- }
-
- if (using_bloom) {
- item->size = offsetof(struct kdbus_item, data64) + bus->bloom_size;
- item->type = KDBUS_ITEM_BLOOM_MASK;
- memcpy(item->data64, bloom, bus->bloom_size);
- item = KDBUS_ITEM_NEXT(item);
- }
-
- if (sender) {
- item->size = offsetof(struct kdbus_item, str) + sender_length + 1;
- item->type = KDBUS_ITEM_NAME;
- memcpy(item->str, sender, sender_length + 1);
- }
-
- r = ioctl(bus->input_fd, KDBUS_CMD_MATCH_ADD, m);
- if (r < 0)
- return -errno;
-
- if (matches_name_change) {
-
- /* If this match could theoretically match
- * NameOwnerChanged messages, we need to
- * install a second non-bloom filter explitly
- * for it */
-
- r = add_name_change_match(bus, cookie, name_change_arg[0], name_change_arg[1], name_change_arg[2]);
- if (r < 0)
- return r;
- }
-
- return 0;
+ return bus_get_owner_creds_dbus1(bus, mask, ret);
}
#define internal_match(bus, m) \
@@ -1610,33 +658,7 @@ int bus_add_match_internal(
if (!bus->bus_client)
return -EINVAL;
- if (bus->is_kernel)
- return bus_add_match_internal_kernel(bus, components, n_components, cookie);
- else
- return bus_add_match_internal_dbus1(bus, match);
-}
-
-int bus_remove_match_internal_kernel(
- sd_bus *bus,
- uint64_t cookie) {
-
- struct kdbus_cmd_match m = {
- .size = offsetof(struct kdbus_cmd_match, items),
- .cookie = cookie,
- };
- int r;
-
- assert(bus);
-
- /* Monitor streams don't support matches, make this a NOP */
- if (bus->hello_flags & KDBUS_HELLO_MONITOR)
- return 0;
-
- r = ioctl(bus->input_fd, KDBUS_CMD_MATCH_REMOVE, &m);
- if (r < 0)
- return -errno;
-
- return 0;
+ return bus_add_match_internal_dbus1(bus, match);
}
static int bus_remove_match_internal_dbus1(
@@ -1672,10 +694,7 @@ int bus_remove_match_internal(
if (!bus->bus_client)
return -EINVAL;
- if (bus->is_kernel)
- return bus_remove_match_internal_kernel(bus, cookie);
- else
- return bus_remove_match_internal_dbus1(bus, match);
+ return bus_remove_match_internal_dbus1(bus, match);
}
_public_ int sd_bus_get_name_machine_id(sd_bus *bus, const char *name, sd_id128_t *machine) {
diff --git a/src/libsystemd/sd-bus/bus-control.h b/src/libsystemd/sd-bus/bus-control.h
index c181aa7959..91efc68d57 100644
--- a/src/libsystemd/sd-bus/bus-control.h
+++ b/src/libsystemd/sd-bus/bus-control.h
@@ -28,5 +28,3 @@ int bus_remove_match_internal(sd_bus *bus, const char *match, uint64_t cookie);
int bus_add_match_internal_kernel(sd_bus *bus, struct bus_match_component *components, unsigned n_components, uint64_t cookie);
int bus_remove_match_internal_kernel(sd_bus *bus, uint64_t cookie);
-
-int bus_get_name_creds_kdbus(sd_bus *bus, const char *name, uint64_t mask, bool allow_activator, sd_bus_creds **creds);
diff --git a/src/libsystemd/sd-bus/bus-convenience.c b/src/libsystemd/sd-bus/bus-convenience.c
index 04158cae4d..e171c53e21 100644
--- a/src/libsystemd/sd-bus/bus-convenience.c
+++ b/src/libsystemd/sd-bus/bus-convenience.c
@@ -533,19 +533,12 @@ _public_ int sd_bus_query_sender_creds(sd_bus_message *call, uint64_t mask, sd_b
* to get it from the sender or peer. */
if (call->sender)
- /* There's a sender, but the creds are
- * missing. This means we are talking via
- * dbus1, or are getting a message that was
- * sent to us via kdbus, but was converted
- * from a dbus1 message by the bus-proxy and
- * thus also lacks the creds. */
+ /* There's a sender, but the creds are missing. */
return sd_bus_get_name_creds(call->bus, call->sender, mask, creds);
else
- /* There's no sender, hence we are on a dbus1
- * direct connection. For direct connections
+ /* There's no sender. For direct connections
* the credentials of the AF_UNIX peer matter,
- * which may be queried via
- * sd_bus_get_owner_creds(). */
+ * which may be queried via sd_bus_get_owner_creds(). */
return sd_bus_get_owner_creds(call->bus, mask, creds);
}
@@ -579,9 +572,6 @@ _public_ int sd_bus_query_sender_privilege(sd_bus_message *call, int capability)
* here. */
assert_return((sd_bus_creds_get_augmented_mask(creds) & SD_BUS_CREDS_EFFECTIVE_CAPS) == 0, -EPERM);
- /* Note that not even on kdbus we might have the caps
- * field, due to faked identities, or namespace
- * translation issues. */
r = sd_bus_creds_has_effective_cap(creds, capability);
if (r > 0)
return 1;
diff --git a/src/libsystemd/sd-bus/bus-creds.c b/src/libsystemd/sd-bus/bus-creds.c
index 349fa57f2d..649fcdba44 100644
--- a/src/libsystemd/sd-bus/bus-creds.c
+++ b/src/libsystemd/sd-bus/bus-creds.c
@@ -165,7 +165,7 @@ _public_ int sd_bus_creds_new_from_pid(sd_bus_creds **ret, pid_t pid, uint64_t m
assert_return(ret, -EINVAL);
if (pid == 0)
- pid = getpid();
+ pid = getpid_cached();
c = bus_creds_new();
if (!c)
diff --git a/src/libsystemd/sd-bus/bus-internal.h b/src/libsystemd/sd-bus/bus-internal.h
index 3575ea8cde..3a181e7a28 100644
--- a/src/libsystemd/sd-bus/bus-internal.h
+++ b/src/libsystemd/sd-bus/bus-internal.h
@@ -28,7 +28,6 @@
#include "bus-kernel.h"
#include "bus-match.h"
#include "hashmap.h"
-#include "kdbus.h"
#include "list.h"
#include "prioq.h"
#include "refcnt.h"
@@ -191,7 +190,6 @@ struct sd_bus {
int message_version;
int message_endian;
- bool is_kernel:1;
bool can_fds:1;
bool bus_client:1;
bool ucred_valid:1;
@@ -203,8 +201,6 @@ struct sd_bus {
bool filter_callbacks_modified:1;
bool nodes_modified:1;
bool trusted:1;
- bool fake_creds_valid:1;
- bool fake_pids_valid:1;
bool manual_peer_interface:1;
bool is_system:1;
bool is_user:1;
@@ -245,7 +241,6 @@ struct sd_bus {
union sockaddr_union sockaddr;
socklen_t sockaddr_size;
- char *kernel;
char *machine;
pid_t nspid;
@@ -276,8 +271,6 @@ struct sd_bus {
unsigned iteration_counter;
- void *kdbus_buffer;
-
/* We do locking around the memfd cache, since we want to
* allow people to process a sd_bus_message in a different
* thread then it was generated on and free it there. Since
@@ -310,10 +303,6 @@ struct sd_bus {
sd_bus **default_bus_ptr;
pid_t tid;
- struct kdbus_creds fake_creds;
- struct kdbus_pids fake_pids;
- char *fake_label;
-
char *cgroup_root;
char *description;
@@ -402,3 +391,65 @@ int bus_maybe_reply_error(sd_bus_message *m, int r, sd_bus_error *error);
if (!assert_log(expr, #expr)) \
return sd_bus_error_set_errno(error, r); \
} while (false)
+
+/**
+ * enum kdbus_attach_flags - flags for metadata attachments
+ * @KDBUS_ATTACH_TIMESTAMP: Timestamp
+ * @KDBUS_ATTACH_CREDS: Credentials
+ * @KDBUS_ATTACH_PIDS: PIDs
+ * @KDBUS_ATTACH_AUXGROUPS: Auxiliary groups
+ * @KDBUS_ATTACH_NAMES: Well-known names
+ * @KDBUS_ATTACH_TID_COMM: The "comm" process identifier of the TID
+ * @KDBUS_ATTACH_PID_COMM: The "comm" process identifier of the PID
+ * @KDBUS_ATTACH_EXE: The path of the executable
+ * @KDBUS_ATTACH_CMDLINE: The process command line
+ * @KDBUS_ATTACH_CGROUP: The croup membership
+ * @KDBUS_ATTACH_CAPS: The process capabilities
+ * @KDBUS_ATTACH_SECLABEL: The security label
+ * @KDBUS_ATTACH_AUDIT: The audit IDs
+ * @KDBUS_ATTACH_CONN_DESCRIPTION: The human-readable connection name
+ * @_KDBUS_ATTACH_ALL: All of the above
+ * @_KDBUS_ATTACH_ANY: Wildcard match to enable any kind of
+ * metatdata.
+ */
+enum kdbus_attach_flags {
+ KDBUS_ATTACH_TIMESTAMP = 1ULL << 0,
+ KDBUS_ATTACH_CREDS = 1ULL << 1,
+ KDBUS_ATTACH_PIDS = 1ULL << 2,
+ KDBUS_ATTACH_AUXGROUPS = 1ULL << 3,
+ KDBUS_ATTACH_NAMES = 1ULL << 4,
+ KDBUS_ATTACH_TID_COMM = 1ULL << 5,
+ KDBUS_ATTACH_PID_COMM = 1ULL << 6,
+ KDBUS_ATTACH_EXE = 1ULL << 7,
+ KDBUS_ATTACH_CMDLINE = 1ULL << 8,
+ KDBUS_ATTACH_CGROUP = 1ULL << 9,
+ KDBUS_ATTACH_CAPS = 1ULL << 10,
+ KDBUS_ATTACH_SECLABEL = 1ULL << 11,
+ KDBUS_ATTACH_AUDIT = 1ULL << 12,
+ KDBUS_ATTACH_CONN_DESCRIPTION = 1ULL << 13,
+ _KDBUS_ATTACH_ALL = (1ULL << 14) - 1,
+ _KDBUS_ATTACH_ANY = ~0ULL
+};
+
+/**
+ * enum kdbus_hello_flags - flags for struct kdbus_cmd_hello
+ * @KDBUS_HELLO_ACCEPT_FD: The connection allows the reception of
+ * any passed file descriptors
+ * @KDBUS_HELLO_ACTIVATOR: Special-purpose connection which registers
+ * a well-know name for a process to be started
+ * when traffic arrives
+ * @KDBUS_HELLO_POLICY_HOLDER: Special-purpose connection which registers
+ * policy entries for a name. The provided name
+ * is not activated and not registered with the
+ * name database, it only allows unprivileged
+ * connections to acquire a name, talk or discover
+ * a service
+ * @KDBUS_HELLO_MONITOR: Special-purpose connection to monitor
+ * bus traffic
+ */
+enum kdbus_hello_flags {
+ KDBUS_HELLO_ACCEPT_FD = 1ULL << 0,
+ KDBUS_HELLO_ACTIVATOR = 1ULL << 1,
+ KDBUS_HELLO_POLICY_HOLDER = 1ULL << 2,
+ KDBUS_HELLO_MONITOR = 1ULL << 3,
+};
diff --git a/src/libsystemd/sd-bus/bus-introspect.c b/src/libsystemd/sd-bus/bus-introspect.c
index 8f93edb8da..5dab4a9af3 100644
--- a/src/libsystemd/sd-bus/bus-introspect.c
+++ b/src/libsystemd/sd-bus/bus-introspect.c
@@ -36,8 +36,8 @@ int introspect_begin(struct introspect *i, bool trusted) {
if (!i->f)
return -ENOMEM;
- fputs(BUS_INTROSPECT_DOCTYPE
- "<node>\n", i->f);
+ fputs_unlocked(BUS_INTROSPECT_DOCTYPE
+ "<node>\n", i->f);
return 0;
}
@@ -45,12 +45,12 @@ int introspect_begin(struct introspect *i, bool trusted) {
int introspect_write_default_interfaces(struct introspect *i, bool object_manager) {
assert(i);
- fputs(BUS_INTROSPECT_INTERFACE_PEER
- BUS_INTROSPECT_INTERFACE_INTROSPECTABLE
- BUS_INTROSPECT_INTERFACE_PROPERTIES, i->f);
+ fputs_unlocked(BUS_INTROSPECT_INTERFACE_PEER
+ BUS_INTROSPECT_INTERFACE_INTROSPECTABLE
+ BUS_INTROSPECT_INTERFACE_PROPERTIES, i->f);
if (object_manager)
- fputs(BUS_INTROSPECT_INTERFACE_OBJECT_MANAGER, i->f);
+ fputs_unlocked(BUS_INTROSPECT_INTERFACE_OBJECT_MANAGER, i->f);
return 0;
}
@@ -76,27 +76,27 @@ int introspect_write_child_nodes(struct introspect *i, Set *s, const char *prefi
static void introspect_write_flags(struct introspect *i, int type, int flags) {
if (flags & SD_BUS_VTABLE_DEPRECATED)
- fputs(" <annotation name=\"org.freedesktop.DBus.Deprecated\" value=\"true\"/>\n", i->f);
+ fputs_unlocked(" <annotation name=\"org.freedesktop.DBus.Deprecated\" value=\"true\"/>\n", i->f);
if (type == _SD_BUS_VTABLE_METHOD && (flags & SD_BUS_VTABLE_METHOD_NO_REPLY))
- fputs(" <annotation name=\"org.freedesktop.DBus.Method.NoReply\" value=\"true\"/>\n", i->f);
+ fputs_unlocked(" <annotation name=\"org.freedesktop.DBus.Method.NoReply\" value=\"true\"/>\n", i->f);
if (type == _SD_BUS_VTABLE_PROPERTY || type == _SD_BUS_VTABLE_WRITABLE_PROPERTY) {
if (flags & SD_BUS_VTABLE_PROPERTY_EXPLICIT)
- fputs(" <annotation name=\"org.freedesktop.systemd1.Explicit\" value=\"true\"/>\n", i->f);
+ fputs_unlocked(" <annotation name=\"org.freedesktop.systemd1.Explicit\" value=\"true\"/>\n", i->f);
if (flags & SD_BUS_VTABLE_PROPERTY_CONST)
- fputs(" <annotation name=\"org.freedesktop.DBus.Property.EmitsChangedSignal\" value=\"const\"/>\n", i->f);
+ fputs_unlocked(" <annotation name=\"org.freedesktop.DBus.Property.EmitsChangedSignal\" value=\"const\"/>\n", i->f);
else if (flags & SD_BUS_VTABLE_PROPERTY_EMITS_INVALIDATION)
- fputs(" <annotation name=\"org.freedesktop.DBus.Property.EmitsChangedSignal\" value=\"invalidates\"/>\n", i->f);
+ fputs_unlocked(" <annotation name=\"org.freedesktop.DBus.Property.EmitsChangedSignal\" value=\"invalidates\"/>\n", i->f);
else if (!(flags & SD_BUS_VTABLE_PROPERTY_EMITS_CHANGE))
- fputs(" <annotation name=\"org.freedesktop.DBus.Property.EmitsChangedSignal\" value=\"false\"/>\n", i->f);
+ fputs_unlocked(" <annotation name=\"org.freedesktop.DBus.Property.EmitsChangedSignal\" value=\"false\"/>\n", i->f);
}
if (!i->trusted &&
(type == _SD_BUS_VTABLE_METHOD || type == _SD_BUS_VTABLE_WRITABLE_PROPERTY) &&
!(flags & SD_BUS_VTABLE_UNPRIVILEGED))
- fputs(" <annotation name=\"org.freedesktop.systemd1.Privileged\" value=\"true\"/>\n", i->f);
+ fputs_unlocked(" <annotation name=\"org.freedesktop.systemd1.Privileged\" value=\"true\"/>\n", i->f);
}
static int introspect_write_arguments(struct introspect *i, const char *signature, const char *direction) {
@@ -117,7 +117,7 @@ static int introspect_write_arguments(struct introspect *i, const char *signatur
if (direction)
fprintf(i->f, " direction=\"%s\"/>\n", direction);
else
- fputs("/>\n", i->f);
+ fputs_unlocked("/>\n", i->f);
signature += l;
}
@@ -140,7 +140,7 @@ int introspect_write_interface(struct introspect *i, const sd_bus_vtable *v) {
case _SD_BUS_VTABLE_START:
if (v->flags & SD_BUS_VTABLE_DEPRECATED)
- fputs(" <annotation name=\"org.freedesktop.DBus.Deprecated\" value=\"true\"/>\n", i->f);
+ fputs_unlocked(" <annotation name=\"org.freedesktop.DBus.Deprecated\" value=\"true\"/>\n", i->f);
break;
case _SD_BUS_VTABLE_METHOD:
@@ -148,7 +148,7 @@ int introspect_write_interface(struct introspect *i, const sd_bus_vtable *v) {
introspect_write_arguments(i, strempty(v->x.method.signature), "in");
introspect_write_arguments(i, strempty(v->x.method.result), "out");
introspect_write_flags(i, v->type, v->flags);
- fputs(" </method>\n", i->f);
+ fputs_unlocked(" </method>\n", i->f);
break;
case _SD_BUS_VTABLE_PROPERTY:
@@ -158,14 +158,14 @@ int introspect_write_interface(struct introspect *i, const sd_bus_vtable *v) {
v->x.property.signature,
v->type == _SD_BUS_VTABLE_WRITABLE_PROPERTY ? "readwrite" : "read");
introspect_write_flags(i, v->type, v->flags);
- fputs(" </property>\n", i->f);
+ fputs_unlocked(" </property>\n", i->f);
break;
case _SD_BUS_VTABLE_SIGNAL:
fprintf(i->f, " <signal name=\"%s\">\n", v->x.signal.member);
introspect_write_arguments(i, strempty(v->x.signal.signature), NULL);
introspect_write_flags(i, v->type, v->flags);
- fputs(" </signal>\n", i->f);
+ fputs_unlocked(" </signal>\n", i->f);
break;
}
@@ -182,7 +182,7 @@ int introspect_finish(struct introspect *i, sd_bus *bus, sd_bus_message *m, sd_b
assert(m);
assert(reply);
- fputs("</node>\n", i->f);
+ fputs_unlocked("</node>\n", i->f);
r = fflush_and_check(i->f);
if (r < 0)
diff --git a/src/libsystemd/sd-bus/bus-kernel.c b/src/libsystemd/sd-bus/bus-kernel.c
index ca6aee7c06..9b1dad9cfc 100644
--- a/src/libsystemd/sd-bus/bus-kernel.c
+++ b/src/libsystemd/sd-bus/bus-kernel.c
@@ -33,7 +33,6 @@
#undef basename
#include "alloc-util.h"
-#include "bus-bloom.h"
#include "bus-internal.h"
#include "bus-kernel.h"
#include "bus-label.h"
@@ -51,1471 +50,14 @@
#include "user-util.h"
#include "util.h"
-#pragma GCC diagnostic ignored "-Wformat"
-
-#define UNIQUE_NAME_MAX (3+DECIMAL_STR_MAX(uint64_t))
-
-int bus_kernel_parse_unique_name(const char *s, uint64_t *id) {
- int r;
-
- assert(s);
- assert(id);
-
- if (!startswith(s, ":1."))
- return 0;
-
- r = safe_atou64(s + 3, id);
- if (r < 0)
- return r;
-
- return 1;
-}
-
-static void append_payload_vec(struct kdbus_item **d, const void *p, size_t sz) {
- assert(d);
- assert(sz > 0);
-
- *d = ALIGN8_PTR(*d);
-
- /* Note that p can be NULL, which encodes a region full of
- * zeroes, which is useful to optimize certain padding
- * conditions */
-
- (*d)->size = offsetof(struct kdbus_item, vec) + sizeof(struct kdbus_vec);
- (*d)->type = KDBUS_ITEM_PAYLOAD_VEC;
- (*d)->vec.address = PTR_TO_UINT64(p);
- (*d)->vec.size = sz;
-
- *d = (struct kdbus_item *) ((uint8_t*) *d + (*d)->size);
-}
-
-static void append_payload_memfd(struct kdbus_item **d, int memfd, size_t start, size_t sz) {
- assert(d);
- assert(memfd >= 0);
- assert(sz > 0);
-
- *d = ALIGN8_PTR(*d);
- (*d)->size = offsetof(struct kdbus_item, memfd) + sizeof(struct kdbus_memfd);
- (*d)->type = KDBUS_ITEM_PAYLOAD_MEMFD;
- (*d)->memfd.fd = memfd;
- (*d)->memfd.start = start;
- (*d)->memfd.size = sz;
-
- *d = (struct kdbus_item *) ((uint8_t*) *d + (*d)->size);
-}
-
-static void append_destination(struct kdbus_item **d, const char *s, size_t length) {
- assert(d);
- assert(s);
-
- *d = ALIGN8_PTR(*d);
-
- (*d)->size = offsetof(struct kdbus_item, str) + length + 1;
- (*d)->type = KDBUS_ITEM_DST_NAME;
- memcpy((*d)->str, s, length + 1);
-
- *d = (struct kdbus_item *) ((uint8_t*) *d + (*d)->size);
-}
-
-static struct kdbus_bloom_filter *append_bloom(struct kdbus_item **d, size_t length) {
- struct kdbus_item *i;
-
- assert(d);
-
- i = ALIGN8_PTR(*d);
-
- i->size = offsetof(struct kdbus_item, bloom_filter) +
- offsetof(struct kdbus_bloom_filter, data) +
- length;
- i->type = KDBUS_ITEM_BLOOM_FILTER;
-
- *d = (struct kdbus_item *) ((uint8_t*) i + i->size);
-
- return &i->bloom_filter;
-}
-
-static void append_fds(struct kdbus_item **d, const int fds[], unsigned n_fds) {
- assert(d);
- assert(fds);
- assert(n_fds > 0);
-
- *d = ALIGN8_PTR(*d);
- (*d)->size = offsetof(struct kdbus_item, fds) + sizeof(int) * n_fds;
- (*d)->type = KDBUS_ITEM_FDS;
- memcpy((*d)->fds, fds, sizeof(int) * n_fds);
-
- *d = (struct kdbus_item *) ((uint8_t*) *d + (*d)->size);
-}
-
-static void add_bloom_arg(void *data, size_t size, unsigned n_hash, unsigned i, const char *t) {
- char buf[sizeof("arg")-1 + 2 + sizeof("-slash-prefix")];
- char *e;
-
- assert(data);
- assert(size > 0);
- assert(i < 64);
- assert(t);
-
- e = stpcpy(buf, "arg");
- if (i < 10)
- *(e++) = '0' + (char) i;
- else {
- *(e++) = '0' + (char) (i / 10);
- *(e++) = '0' + (char) (i % 10);
- }
-
- *e = 0;
- bloom_add_pair(data, size, n_hash, buf, t);
-
- strcpy(e, "-dot-prefix");
- bloom_add_prefixes(data, size, n_hash, buf, t, '.');
- strcpy(e, "-slash-prefix");
- bloom_add_prefixes(data, size, n_hash, buf, t, '/');
-}
-
-static void add_bloom_arg_has(void *data, size_t size, unsigned n_hash, unsigned i, const char *t) {
- char buf[sizeof("arg")-1 + 2 + sizeof("-has")];
- char *e;
-
- assert(data);
- assert(size > 0);
- assert(i < 64);
- assert(t);
-
- e = stpcpy(buf, "arg");
- if (i < 10)
- *(e++) = '0' + (char) i;
- else {
- *(e++) = '0' + (char) (i / 10);
- *(e++) = '0' + (char) (i % 10);
- }
-
- strcpy(e, "-has");
- bloom_add_pair(data, size, n_hash, buf, t);
-}
-
-static int bus_message_setup_bloom(sd_bus_message *m, struct kdbus_bloom_filter *bloom) {
- void *data;
- unsigned i;
- int r;
-
- assert(m);
- assert(bloom);
-
- data = bloom->data;
- memzero(data, m->bus->bloom_size);
- bloom->generation = 0;
-
- bloom_add_pair(data, m->bus->bloom_size, m->bus->bloom_n_hash, "message-type", bus_message_type_to_string(m->header->type));
-
- if (m->interface)
- bloom_add_pair(data, m->bus->bloom_size, m->bus->bloom_n_hash, "interface", m->interface);
- if (m->member)
- bloom_add_pair(data, m->bus->bloom_size, m->bus->bloom_n_hash, "member", m->member);
- if (m->path) {
- bloom_add_pair(data, m->bus->bloom_size, m->bus->bloom_n_hash, "path", m->path);
- bloom_add_pair(data, m->bus->bloom_size, m->bus->bloom_n_hash, "path-slash-prefix", m->path);
- bloom_add_prefixes(data, m->bus->bloom_size, m->bus->bloom_n_hash, "path-slash-prefix", m->path, '/');
- }
-
- r = sd_bus_message_rewind(m, true);
- if (r < 0)
- return r;
-
- for (i = 0; i < 64; i++) {
- const char *t, *contents;
- char type;
-
- r = sd_bus_message_peek_type(m, &type, &contents);
- if (r < 0)
- return r;
-
- if (IN_SET(type, SD_BUS_TYPE_STRING, SD_BUS_TYPE_OBJECT_PATH, SD_BUS_TYPE_SIGNATURE)) {
-
- /* The bloom filter includes simple strings of any kind */
- r = sd_bus_message_read_basic(m, type, &t);
- if (r < 0)
- return r;
-
- add_bloom_arg(data, m->bus->bloom_size, m->bus->bloom_n_hash, i, t);
- }
-
- if (type == SD_BUS_TYPE_ARRAY && STR_IN_SET(contents, "s", "o", "g")) {
-
- /* As well as array of simple strings of any kinds */
- r = sd_bus_message_enter_container(m, type, contents);
- if (r < 0)
- return r;
-
- while ((r = sd_bus_message_read_basic(m, contents[0], &t)) > 0)
- add_bloom_arg_has(data, m->bus->bloom_size, m->bus->bloom_n_hash, i, t);
- if (r < 0)
- return r;
-
- r = sd_bus_message_exit_container(m);
- if (r < 0)
- return r;
-
- } else
- /* Stop adding to bloom filter as soon as we
- * run into the first argument we cannot add
- * to it. */
- break;
- }
-
- return 0;
-}
-
-static int bus_message_setup_kmsg(sd_bus *b, sd_bus_message *m) {
- struct bus_body_part *part;
- struct kdbus_item *d;
- const char *destination;
- bool well_known = false;
- uint64_t dst_id;
- size_t sz, dl;
- unsigned i;
- int r;
-
- assert(b);
- assert(m);
- assert(m->sealed);
-
- /* We put this together only once, if this message is reused
- * we reuse the earlier-built version */
- if (m->kdbus)
- return 0;
-
- destination = m->destination ?: m->destination_ptr;
-
- if (destination) {
- r = bus_kernel_parse_unique_name(destination, &dst_id);
- if (r < 0)
- return r;
- if (r == 0) {
- well_known = true;
-
- /* verify_destination_id will usually be 0, which makes the kernel
- * driver only look at the provided well-known name. Otherwise,
- * the kernel will make sure the provided destination id matches
- * the owner of the provided well-known-name, and fail if they
- * differ. Currently, this is only needed for bus-proxyd. */
- dst_id = m->verify_destination_id;
- }
- } else
- dst_id = KDBUS_DST_ID_BROADCAST;
-
- sz = offsetof(struct kdbus_msg, items);
-
- /* Add in fixed header, fields header and payload */
- sz += (1 + m->n_body_parts) * ALIGN8(offsetof(struct kdbus_item, vec) +
- MAX(sizeof(struct kdbus_vec),
- sizeof(struct kdbus_memfd)));
-
- /* Add space for bloom filter */
- sz += ALIGN8(offsetof(struct kdbus_item, bloom_filter) +
- offsetof(struct kdbus_bloom_filter, data) +
- m->bus->bloom_size);
-
- /* Add in well-known destination header */
- if (well_known) {
- dl = strlen(destination);
- sz += ALIGN8(offsetof(struct kdbus_item, str) + dl + 1);
- }
-
- /* Add space for unix fds */
- if (m->n_fds > 0)
- sz += ALIGN8(offsetof(struct kdbus_item, fds) + sizeof(int)*m->n_fds);
-
- m->kdbus = memalign(8, sz);
- if (!m->kdbus) {
- r = -ENOMEM;
- goto fail;
- }
-
- m->free_kdbus = true;
- memzero(m->kdbus, sz);
-
- m->kdbus->flags =
- ((m->header->flags & BUS_MESSAGE_NO_REPLY_EXPECTED) ? 0 : KDBUS_MSG_EXPECT_REPLY) |
- ((m->header->flags & BUS_MESSAGE_NO_AUTO_START) ? KDBUS_MSG_NO_AUTO_START : 0) |
- ((m->header->type == SD_BUS_MESSAGE_SIGNAL) ? KDBUS_MSG_SIGNAL : 0);
-
- m->kdbus->dst_id = dst_id;
- m->kdbus->payload_type = KDBUS_PAYLOAD_DBUS;
- m->kdbus->cookie = m->header->dbus2.cookie;
- m->kdbus->priority = m->priority;
-
- if (m->header->flags & BUS_MESSAGE_NO_REPLY_EXPECTED)
- m->kdbus->cookie_reply = m->reply_cookie;
- else {
- struct timespec now;
-
- assert_se(clock_gettime(CLOCK_MONOTONIC_COARSE, &now) == 0);
- m->kdbus->timeout_ns = now.tv_sec * NSEC_PER_SEC + now.tv_nsec +
- m->timeout * NSEC_PER_USEC;
- }
-
- d = m->kdbus->items;
-
- if (well_known)
- append_destination(&d, destination, dl);
-
- append_payload_vec(&d, m->header, BUS_MESSAGE_BODY_BEGIN(m));
-
- MESSAGE_FOREACH_PART(part, i, m) {
- if (part->is_zero) {
- /* If this is padding then simply send a
- * vector with a NULL data pointer which the
- * kernel will just pass through. This is the
- * most efficient way to encode zeroes */
-
- append_payload_vec(&d, NULL, part->size);
- continue;
- }
-
- if (part->memfd >= 0 && part->sealed && destination) {
- /* Try to send a memfd, if the part is
- * sealed and this is not a broadcast. Since we can only */
-
- append_payload_memfd(&d, part->memfd, part->memfd_offset, part->size);
- continue;
- }
-
- /* Otherwise, let's send a vector to the actual data.
- * For that, we need to map it first. */
- r = bus_body_part_map(part);
- if (r < 0)
- goto fail;
-
- append_payload_vec(&d, part->data, part->size);
- }
-
- if (m->header->type == SD_BUS_MESSAGE_SIGNAL) {
- struct kdbus_bloom_filter *bloom;
-
- bloom = append_bloom(&d, m->bus->bloom_size);
- r = bus_message_setup_bloom(m, bloom);
- if (r < 0)
- goto fail;
- }
-
- if (m->n_fds > 0)
- append_fds(&d, m->fds, m->n_fds);
-
- m->kdbus->size = (uint8_t*) d - (uint8_t*) m->kdbus;
- assert(m->kdbus->size <= sz);
-
- return 0;
-
-fail:
- m->poisoned = true;
- return r;
-}
-
-static void unset_memfds(struct sd_bus_message *m) {
- struct bus_body_part *part;
- unsigned i;
-
- assert(m);
-
- /* Make sure the memfds are not freed twice */
- MESSAGE_FOREACH_PART(part, i, m)
- if (part->memfd >= 0)
- part->memfd = -1;
-}
-
-static void message_set_timestamp(sd_bus *bus, sd_bus_message *m, const struct kdbus_timestamp *ts) {
- assert(bus);
- assert(m);
-
- if (!ts)
- return;
-
- if (!(bus->attach_flags & KDBUS_ATTACH_TIMESTAMP))
- return;
-
- m->realtime = ts->realtime_ns / NSEC_PER_USEC;
- m->monotonic = ts->monotonic_ns / NSEC_PER_USEC;
- m->seqnum = ts->seqnum;
-}
-
-static int bus_kernel_make_message(sd_bus *bus, struct kdbus_msg *k) {
- sd_bus_message *m = NULL;
- struct kdbus_item *d;
- unsigned n_fds = 0;
- _cleanup_free_ int *fds = NULL;
- struct bus_header *header = NULL;
- void *footer = NULL;
- size_t header_size = 0, footer_size = 0;
- size_t n_bytes = 0, idx = 0;
- const char *destination = NULL, *seclabel = NULL;
- bool last_was_memfd = false;
- int r;
-
- assert(bus);
- assert(k);
- assert(k->payload_type == KDBUS_PAYLOAD_DBUS);
-
- KDBUS_ITEM_FOREACH(d, k, items) {
- size_t l;
-
- l = d->size - offsetof(struct kdbus_item, data);
-
- switch (d->type) {
-
- case KDBUS_ITEM_PAYLOAD_OFF:
- if (!header) {
- header = (struct bus_header*)((uint8_t*) k + d->vec.offset);
- header_size = d->vec.size;
- }
-
- footer = (uint8_t*) k + d->vec.offset;
- footer_size = d->vec.size;
-
- n_bytes += d->vec.size;
- last_was_memfd = false;
- break;
-
- case KDBUS_ITEM_PAYLOAD_MEMFD:
- if (!header) /* memfd cannot be first part */
- return -EBADMSG;
-
- n_bytes += d->memfd.size;
- last_was_memfd = true;
- break;
-
- case KDBUS_ITEM_FDS: {
- int *f;
- unsigned j;
-
- j = l / sizeof(int);
- f = realloc(fds, sizeof(int) * (n_fds + j));
- if (!f)
- return -ENOMEM;
-
- fds = f;
- memcpy(fds + n_fds, d->fds, sizeof(int) * j);
- n_fds += j;
- break;
- }
-
- case KDBUS_ITEM_SECLABEL:
- seclabel = d->str;
- break;
- }
- }
-
- if (last_was_memfd) /* memfd cannot be last part */
- return -EBADMSG;
-
- if (!header)
- return -EBADMSG;
-
- if (header_size < sizeof(struct bus_header))
- return -EBADMSG;
-
- /* on kdbus we only speak native endian gvariant, never dbus1
- * marshalling or reverse endian */
- if (header->version != 2 ||
- header->endian != BUS_NATIVE_ENDIAN)
- return -EPROTOTYPE;
-
- r = bus_message_from_header(
- bus,
- header, header_size,
- footer, footer_size,
- n_bytes,
- fds, n_fds,
- seclabel, 0, &m);
- if (r < 0)
- return r;
-
- /* The well-known names list is different from the other
- credentials. If we asked for it, but nothing is there, this
- means that the list of well-known names is simply empty, not
- that we lack any data */
-
- m->creds.mask |= (SD_BUS_CREDS_UNIQUE_NAME|SD_BUS_CREDS_WELL_KNOWN_NAMES) & bus->creds_mask;
-
- KDBUS_ITEM_FOREACH(d, k, items) {
- size_t l;
-
- l = d->size - offsetof(struct kdbus_item, data);
-
- switch (d->type) {
-
- case KDBUS_ITEM_PAYLOAD_OFF: {
- size_t begin_body;
-
- begin_body = BUS_MESSAGE_BODY_BEGIN(m);
-
- if (idx + d->vec.size > begin_body) {
- struct bus_body_part *part;
-
- /* Contains body material */
-
- part = message_append_part(m);
- if (!part) {
- r = -ENOMEM;
- goto fail;
- }
-
- /* A -1 offset is NUL padding. */
- part->is_zero = d->vec.offset == ~0ULL;
-
- if (idx >= begin_body) {
- if (!part->is_zero)
- part->data = (uint8_t* )k + d->vec.offset;
- part->size = d->vec.size;
- } else {
- if (!part->is_zero)
- part->data = (uint8_t*) k + d->vec.offset + (begin_body - idx);
- part->size = d->vec.size - (begin_body - idx);
- }
-
- part->sealed = true;
- }
-
- idx += d->vec.size;
- break;
- }
-
- case KDBUS_ITEM_PAYLOAD_MEMFD: {
- struct bus_body_part *part;
-
- if (idx < BUS_MESSAGE_BODY_BEGIN(m)) {
- r = -EBADMSG;
- goto fail;
- }
-
- part = message_append_part(m);
- if (!part) {
- r = -ENOMEM;
- goto fail;
- }
-
- part->memfd = d->memfd.fd;
- part->memfd_offset = d->memfd.start;
- part->size = d->memfd.size;
- part->sealed = true;
-
- idx += d->memfd.size;
- break;
- }
-
- case KDBUS_ITEM_PIDS:
-
- /* The PID/TID might be missing, when the data
- * is faked by a bus proxy and it lacks that
- * information about the real client (since
- * SO_PEERCRED is used for that). Also kernel
- * namespacing might make some of this data
- * unavailable when untranslatable. */
-
- if (d->pids.pid > 0) {
- m->creds.pid = (pid_t) d->pids.pid;
- m->creds.mask |= SD_BUS_CREDS_PID & bus->creds_mask;
- }
-
- if (d->pids.tid > 0) {
- m->creds.tid = (pid_t) d->pids.tid;
- m->creds.mask |= SD_BUS_CREDS_TID & bus->creds_mask;
- }
-
- if (d->pids.ppid > 0) {
- m->creds.ppid = (pid_t) d->pids.ppid;
- m->creds.mask |= SD_BUS_CREDS_PPID & bus->creds_mask;
- } else if (d->pids.pid == 1) {
- m->creds.ppid = 0;
- m->creds.mask |= SD_BUS_CREDS_PPID & bus->creds_mask;
- }
-
- break;
-
- case KDBUS_ITEM_CREDS:
-
- /* EUID/SUID/FSUID/EGID/SGID/FSGID might be
- * missing too (see above). */
-
- if ((uid_t) d->creds.uid != UID_INVALID) {
- m->creds.uid = (uid_t) d->creds.uid;
- m->creds.mask |= SD_BUS_CREDS_UID & bus->creds_mask;
- }
-
- if ((uid_t) d->creds.euid != UID_INVALID) {
- m->creds.euid = (uid_t) d->creds.euid;
- m->creds.mask |= SD_BUS_CREDS_EUID & bus->creds_mask;
- }
-
- if ((uid_t) d->creds.suid != UID_INVALID) {
- m->creds.suid = (uid_t) d->creds.suid;
- m->creds.mask |= SD_BUS_CREDS_SUID & bus->creds_mask;
- }
-
- if ((uid_t) d->creds.fsuid != UID_INVALID) {
- m->creds.fsuid = (uid_t) d->creds.fsuid;
- m->creds.mask |= SD_BUS_CREDS_FSUID & bus->creds_mask;
- }
-
- if ((gid_t) d->creds.gid != GID_INVALID) {
- m->creds.gid = (gid_t) d->creds.gid;
- m->creds.mask |= SD_BUS_CREDS_GID & bus->creds_mask;
- }
-
- if ((gid_t) d->creds.egid != GID_INVALID) {
- m->creds.egid = (gid_t) d->creds.egid;
- m->creds.mask |= SD_BUS_CREDS_EGID & bus->creds_mask;
- }
-
- if ((gid_t) d->creds.sgid != GID_INVALID) {
- m->creds.sgid = (gid_t) d->creds.sgid;
- m->creds.mask |= SD_BUS_CREDS_SGID & bus->creds_mask;
- }
-
- if ((gid_t) d->creds.fsgid != GID_INVALID) {
- m->creds.fsgid = (gid_t) d->creds.fsgid;
- m->creds.mask |= SD_BUS_CREDS_FSGID & bus->creds_mask;
- }
-
- break;
-
- case KDBUS_ITEM_TIMESTAMP:
- message_set_timestamp(bus, m, &d->timestamp);
- break;
-
- case KDBUS_ITEM_PID_COMM:
- m->creds.comm = d->str;
- m->creds.mask |= SD_BUS_CREDS_COMM & bus->creds_mask;
- break;
-
- case KDBUS_ITEM_TID_COMM:
- m->creds.tid_comm = d->str;
- m->creds.mask |= SD_BUS_CREDS_TID_COMM & bus->creds_mask;
- break;
-
- case KDBUS_ITEM_EXE:
- m->creds.exe = d->str;
- m->creds.mask |= SD_BUS_CREDS_EXE & bus->creds_mask;
- break;
-
- case KDBUS_ITEM_CMDLINE:
- m->creds.cmdline = d->str;
- m->creds.cmdline_size = l;
- m->creds.mask |= SD_BUS_CREDS_CMDLINE & bus->creds_mask;
- break;
-
- case KDBUS_ITEM_CGROUP:
- m->creds.cgroup = d->str;
- m->creds.mask |= (SD_BUS_CREDS_CGROUP|SD_BUS_CREDS_UNIT|SD_BUS_CREDS_USER_UNIT|SD_BUS_CREDS_SLICE|SD_BUS_CREDS_SESSION|SD_BUS_CREDS_OWNER_UID) & bus->creds_mask;
-
- r = bus_get_root_path(bus);
- if (r < 0)
- goto fail;
-
- m->creds.cgroup_root = bus->cgroup_root;
- break;
-
- case KDBUS_ITEM_AUDIT:
- m->creds.audit_session_id = (uint32_t) d->audit.sessionid;
- m->creds.mask |= SD_BUS_CREDS_AUDIT_SESSION_ID & bus->creds_mask;
-
- m->creds.audit_login_uid = (uid_t) d->audit.loginuid;
- m->creds.mask |= SD_BUS_CREDS_AUDIT_LOGIN_UID & bus->creds_mask;
- break;
-
- case KDBUS_ITEM_CAPS:
- if (d->caps.last_cap != cap_last_cap() ||
- d->size - offsetof(struct kdbus_item, caps.caps) < DIV_ROUND_UP(d->caps.last_cap, 32U) * 4 * 4) {
- r = -EBADMSG;
- goto fail;
- }
-
- m->creds.capability = d->caps.caps;
- m->creds.mask |= (SD_BUS_CREDS_EFFECTIVE_CAPS|SD_BUS_CREDS_PERMITTED_CAPS|SD_BUS_CREDS_INHERITABLE_CAPS|SD_BUS_CREDS_BOUNDING_CAPS) & bus->creds_mask;
- break;
-
- case KDBUS_ITEM_DST_NAME:
- if (!service_name_is_valid(d->str)) {
- r = -EBADMSG;
- goto fail;
- }
-
- destination = d->str;
- break;
-
- case KDBUS_ITEM_OWNED_NAME:
- if (!service_name_is_valid(d->name.name)) {
- r = -EBADMSG;
- goto fail;
- }
-
- if (bus->creds_mask & SD_BUS_CREDS_WELL_KNOWN_NAMES) {
- char **wkn;
- size_t n;
-
- /* We just extend the array here, but
- * do not allocate the strings inside
- * of it, instead we just point to our
- * buffer directly. */
- n = strv_length(m->creds.well_known_names);
- wkn = realloc(m->creds.well_known_names, (n + 2) * sizeof(char*));
- if (!wkn) {
- r = -ENOMEM;
- goto fail;
- }
-
- wkn[n] = d->name.name;
- wkn[n+1] = NULL;
- m->creds.well_known_names = wkn;
-
- m->creds.mask |= SD_BUS_CREDS_WELL_KNOWN_NAMES;
- }
- break;
-
- case KDBUS_ITEM_CONN_DESCRIPTION:
- m->creds.description = d->str;
- m->creds.mask |= SD_BUS_CREDS_DESCRIPTION & bus->creds_mask;
- break;
-
- case KDBUS_ITEM_AUXGROUPS:
-
- if (bus->creds_mask & SD_BUS_CREDS_SUPPLEMENTARY_GIDS) {
- size_t i, n;
- gid_t *g;
-
- n = (d->size - offsetof(struct kdbus_item, data64)) / sizeof(uint64_t);
- g = new(gid_t, n);
- if (!g) {
- r = -ENOMEM;
- goto fail;
- }
-
- for (i = 0; i < n; i++)
- g[i] = d->data64[i];
-
- m->creds.supplementary_gids = g;
- m->creds.n_supplementary_gids = n;
- m->creds.mask |= SD_BUS_CREDS_SUPPLEMENTARY_GIDS;
- }
-
- break;
-
- case KDBUS_ITEM_FDS:
- case KDBUS_ITEM_SECLABEL:
- case KDBUS_ITEM_BLOOM_FILTER:
- break;
-
- default:
- log_debug("Got unknown field from kernel %llu", d->type);
- }
- }
-
- /* If we requested the list of well-known names to be appended
- * and the sender had none no item for it will be
- * attached. However, this does *not* mean that the kernel
- * didn't want to provide this information to us. Hence, let's
- * explicitly mark this information as available if it was
- * requested. */
- m->creds.mask |= bus->creds_mask & SD_BUS_CREDS_WELL_KNOWN_NAMES;
-
- r = bus_message_parse_fields(m);
- if (r < 0)
- goto fail;
-
- /* Refuse messages if kdbus and dbus1 cookie doesn't match up */
- if ((uint64_t) m->header->dbus2.cookie != k->cookie) {
- r = -EBADMSG;
- goto fail;
- }
-
- /* Refuse messages where the reply flag doesn't match up */
- if (!(m->header->flags & BUS_MESSAGE_NO_REPLY_EXPECTED) != !!(k->flags & KDBUS_MSG_EXPECT_REPLY)) {
- r = -EBADMSG;
- goto fail;
- }
-
- /* Refuse reply messages where the reply cookie doesn't match up */
- if ((m->header->flags & BUS_MESSAGE_NO_REPLY_EXPECTED) && m->reply_cookie != k->cookie_reply) {
- r = -EBADMSG;
- goto fail;
- }
-
- /* Refuse messages where the autostart flag doesn't match up */
- if (!(m->header->flags & BUS_MESSAGE_NO_AUTO_START) != !(k->flags & KDBUS_MSG_NO_AUTO_START)) {
- r = -EBADMSG;
- goto fail;
- }
-
- /* Override information from the user header with data from the kernel */
- if (k->src_id == KDBUS_SRC_ID_KERNEL)
- bus_message_set_sender_driver(bus, m);
- else {
- xsprintf(m->sender_buffer, ":1.%llu", k->src_id);
- m->sender = m->creds.unique_name = m->sender_buffer;
- }
-
- if (destination)
- m->destination = destination;
- else if (k->dst_id == KDBUS_DST_ID_BROADCAST)
- m->destination = NULL;
- else if (k->dst_id == KDBUS_DST_ID_NAME)
- m->destination = bus->unique_name; /* fill in unique name if the well-known name is missing */
- else {
- xsprintf(m->destination_buffer, ":1.%llu", k->dst_id);
- m->destination = m->destination_buffer;
- }
-
- /* We take possession of the kmsg struct now */
- m->kdbus = k;
- m->release_kdbus = true;
- m->free_fds = true;
- fds = NULL;
-
- bus->rqueue[bus->rqueue_size++] = m;
-
- return 1;
-
-fail:
- unset_memfds(m);
- sd_bus_message_unref(m);
-
- return r;
-}
-
-int bus_kernel_take_fd(sd_bus *b) {
- struct kdbus_bloom_parameter *bloom = NULL;
- struct kdbus_item *items, *item;
- struct kdbus_cmd_hello *hello;
- _cleanup_free_ char *g = NULL;
- const char *name;
- size_t l = 0, m = 0, sz;
- int r;
-
- assert(b);
-
- if (b->is_server)
- return -EINVAL;
-
- b->use_memfd = 1;
-
- if (b->description) {
- g = bus_label_escape(b->description);
- if (!g)
- return -ENOMEM;
-
- name = g;
- } else {
- char pr[17] = {};
-
- /* If no name is explicitly set, we'll include a hint
- * indicating the library implementation, a hint which
- * kind of bus this is and the thread name */
-
- assert_se(prctl(PR_GET_NAME, (unsigned long) pr) >= 0);
-
- if (isempty(pr)) {
- name = b->is_system ? "sd-system" :
- b->is_user ? "sd-user" : "sd";
- } else {
- _cleanup_free_ char *e = NULL;
-
- e = bus_label_escape(pr);
- if (!e)
- return -ENOMEM;
-
- g = strappend(b->is_system ? "sd-system-" :
- b->is_user ? "sd-user-" : "sd-",
- e);
- if (!g)
- return -ENOMEM;
-
- name = g;
- }
-
- b->description = bus_label_unescape(name);
- if (!b->description)
- return -ENOMEM;
- }
-
- m = strlen(name);
-
- sz = ALIGN8(offsetof(struct kdbus_cmd_hello, items)) +
- ALIGN8(offsetof(struct kdbus_item, str) + m + 1);
-
- if (b->fake_creds_valid)
- sz += ALIGN8(offsetof(struct kdbus_item, creds) + sizeof(struct kdbus_creds));
-
- if (b->fake_pids_valid)
- sz += ALIGN8(offsetof(struct kdbus_item, pids) + sizeof(struct kdbus_pids));
-
- if (b->fake_label) {
- l = strlen(b->fake_label);
- sz += ALIGN8(offsetof(struct kdbus_item, str) + l + 1);
- }
-
- hello = alloca0_align(sz, 8);
- hello->size = sz;
- hello->flags = b->hello_flags;
- hello->attach_flags_send = _KDBUS_ATTACH_ANY;
- hello->attach_flags_recv = b->attach_flags;
- hello->pool_size = KDBUS_POOL_SIZE;
-
- item = hello->items;
-
- item->size = offsetof(struct kdbus_item, str) + m + 1;
- item->type = KDBUS_ITEM_CONN_DESCRIPTION;
- memcpy(item->str, name, m + 1);
- item = KDBUS_ITEM_NEXT(item);
-
- if (b->fake_creds_valid) {
- item->size = offsetof(struct kdbus_item, creds) + sizeof(struct kdbus_creds);
- item->type = KDBUS_ITEM_CREDS;
- item->creds = b->fake_creds;
-
- item = KDBUS_ITEM_NEXT(item);
- }
-
- if (b->fake_pids_valid) {
- item->size = offsetof(struct kdbus_item, pids) + sizeof(struct kdbus_pids);
- item->type = KDBUS_ITEM_PIDS;
- item->pids = b->fake_pids;
-
- item = KDBUS_ITEM_NEXT(item);
- }
-
- if (b->fake_label) {
- item->size = offsetof(struct kdbus_item, str) + l + 1;
- item->type = KDBUS_ITEM_SECLABEL;
- memcpy(item->str, b->fake_label, l+1);
- }
-
- r = ioctl(b->input_fd, KDBUS_CMD_HELLO, hello);
- if (r < 0) {
- if (errno == ENOTTY)
- /* If the ioctl is not supported we assume that the
- * API version changed in a major incompatible way,
- * let's indicate an API incompatibility in this
- * case. */
- return -ESOCKTNOSUPPORT;
-
- return -errno;
- }
-
- if (!b->kdbus_buffer) {
- b->kdbus_buffer = mmap(NULL, KDBUS_POOL_SIZE, PROT_READ, MAP_SHARED, b->input_fd, 0);
- if (b->kdbus_buffer == MAP_FAILED) {
- b->kdbus_buffer = NULL;
- r = -errno;
- goto fail;
- }
- }
-
- /* The higher 32bit of the bus_flags fields are considered
- * 'incompatible flags'. Refuse them all for now. */
- if (hello->bus_flags > 0xFFFFFFFFULL) {
- r = -ESOCKTNOSUPPORT;
- goto fail;
- }
-
- /* extract bloom parameters from items */
- items = (void*)((uint8_t*)b->kdbus_buffer + hello->offset);
- KDBUS_FOREACH(item, items, hello->items_size) {
- switch (item->type) {
- case KDBUS_ITEM_BLOOM_PARAMETER:
- bloom = &item->bloom_parameter;
- break;
- }
- }
-
- if (!bloom || !bloom_validate_parameters((size_t) bloom->size, (unsigned) bloom->n_hash)) {
- r = -EOPNOTSUPP;
- goto fail;
- }
-
- b->bloom_size = (size_t) bloom->size;
- b->bloom_n_hash = (unsigned) bloom->n_hash;
-
- if (asprintf(&b->unique_name, ":1.%llu", hello->id) < 0) {
- r = -ENOMEM;
- goto fail;
- }
-
- b->unique_id = hello->id;
-
- b->is_kernel = true;
- b->bus_client = true;
- b->can_fds = !!(hello->flags & KDBUS_HELLO_ACCEPT_FD);
- b->message_version = 2;
- b->message_endian = BUS_NATIVE_ENDIAN;
-
- /* the kernel told us the UUID of the underlying bus */
- memcpy(b->server_id.bytes, hello->id128, sizeof(b->server_id.bytes));
-
- /* free returned items */
- (void) bus_kernel_cmd_free(b, hello->offset);
- return bus_start_running(b);
-
-fail:
- (void) bus_kernel_cmd_free(b, hello->offset);
- return r;
-}
-
-int bus_kernel_connect(sd_bus *b) {
- assert(b);
- assert(b->input_fd < 0);
- assert(b->output_fd < 0);
- assert(b->kernel);
-
- if (b->is_server)
- return -EINVAL;
-
- b->input_fd = open(b->kernel, O_RDWR|O_NOCTTY|O_CLOEXEC);
- if (b->input_fd < 0)
- return -errno;
-
- b->output_fd = b->input_fd;
-
- return bus_kernel_take_fd(b);
-}
-
-int bus_kernel_cmd_free(sd_bus *bus, uint64_t offset) {
- struct kdbus_cmd_free cmd = {
- .size = sizeof(cmd),
- .offset = offset,
- };
- int r;
-
- assert(bus);
- assert(bus->is_kernel);
-
- r = ioctl(bus->input_fd, KDBUS_CMD_FREE, &cmd);
- if (r < 0)
- return -errno;
-
- return 0;
-}
-
-static void close_kdbus_msg(sd_bus *bus, struct kdbus_msg *k) {
- struct kdbus_item *d;
-
- assert(bus);
- assert(k);
-
- KDBUS_ITEM_FOREACH(d, k, items) {
- if (d->type == KDBUS_ITEM_FDS)
- close_many(d->fds, (d->size - offsetof(struct kdbus_item, fds)) / sizeof(int));
- else if (d->type == KDBUS_ITEM_PAYLOAD_MEMFD)
- safe_close(d->memfd.fd);
- }
-
- bus_kernel_cmd_free(bus, (uint8_t*) k - (uint8_t*) bus->kdbus_buffer);
-}
-
-int bus_kernel_write_message(sd_bus *bus, sd_bus_message *m, bool hint_sync_call) {
- struct kdbus_cmd_send cmd = { };
- int r;
-
- assert(bus);
- assert(m);
- assert(bus->state == BUS_RUNNING);
-
- /* If we can't deliver, we want room for the error message */
- r = bus_rqueue_make_room(bus);
- if (r < 0)
- return r;
-
- r = bus_message_setup_kmsg(bus, m);
- if (r < 0)
- return r;
-
- cmd.size = sizeof(cmd);
- cmd.msg_address = (uintptr_t)m->kdbus;
-
- /* If this is a synchronous method call, then let's tell the
- * kernel, so that it can pass CPU time/scheduling to the
- * destination for the time, if it wants to. If we
- * synchronously wait for the result anyway, we won't need CPU
- * anyway. */
- if (hint_sync_call) {
- m->kdbus->flags |= KDBUS_MSG_EXPECT_REPLY;
- cmd.flags |= KDBUS_SEND_SYNC_REPLY;
- }
-
- r = ioctl(bus->output_fd, KDBUS_CMD_SEND, &cmd);
- if (r < 0) {
- _cleanup_(sd_bus_error_free) sd_bus_error error = SD_BUS_ERROR_NULL;
- sd_bus_message *reply;
-
- if (errno == EAGAIN || errno == EINTR)
- return 0;
- else if (errno == ENXIO || errno == ESRCH) {
-
- /* ENXIO: unique name not known
- * ESRCH: well-known name not known */
-
- if (m->header->type == SD_BUS_MESSAGE_METHOD_CALL)
- sd_bus_error_setf(&error, SD_BUS_ERROR_SERVICE_UNKNOWN, "Destination %s not known", m->destination);
- else {
- log_debug("Could not deliver message to %s as destination is not known. Ignoring.", m->destination);
- return 0;
- }
-
- } else if (errno == EADDRNOTAVAIL) {
-
- /* EADDRNOTAVAIL: activation is possible, but turned off in request flags */
-
- if (m->header->type == SD_BUS_MESSAGE_METHOD_CALL)
- sd_bus_error_setf(&error, SD_BUS_ERROR_SERVICE_UNKNOWN, "Activation of %s not requested", m->destination);
- else {
- log_debug("Could not deliver message to %s as destination is not activated. Ignoring.", m->destination);
- return 0;
- }
- } else
- return -errno;
-
- r = bus_message_new_synthetic_error(
- bus,
- BUS_MESSAGE_COOKIE(m),
- &error,
- &reply);
-
- if (r < 0)
- return r;
-
- r = bus_seal_synthetic_message(bus, reply);
- if (r < 0)
- return r;
-
- bus->rqueue[bus->rqueue_size++] = reply;
-
- } else if (hint_sync_call) {
- struct kdbus_msg *k;
-
- k = (struct kdbus_msg *)((uint8_t *)bus->kdbus_buffer + cmd.reply.offset);
- assert(k);
-
- if (k->payload_type == KDBUS_PAYLOAD_DBUS) {
-
- r = bus_kernel_make_message(bus, k);
- if (r < 0) {
- close_kdbus_msg(bus, k);
-
- /* Anybody can send us invalid messages, let's just drop them. */
- if (r == -EBADMSG || r == -EPROTOTYPE)
- log_debug_errno(r, "Ignoring invalid synchronous reply: %m");
- else
- return r;
- }
- } else {
- log_debug("Ignoring message with unknown payload type %llu.", k->payload_type);
- close_kdbus_msg(bus, k);
- }
- }
-
- return 1;
-}
-
-static int push_name_owner_changed(
- sd_bus *bus,
- const char *name,
- const char *old_owner,
- const char *new_owner,
- const struct kdbus_timestamp *ts) {
-
- _cleanup_(sd_bus_message_unrefp) sd_bus_message *m = NULL;
- int r;
-
- assert(bus);
-
- r = sd_bus_message_new_signal(
- bus,
- &m,
- "/org/freedesktop/DBus",
- "org.freedesktop.DBus",
- "NameOwnerChanged");
- if (r < 0)
- return r;
-
- r = sd_bus_message_append(m, "sss", name, old_owner, new_owner);
- if (r < 0)
- return r;
-
- bus_message_set_sender_driver(bus, m);
- message_set_timestamp(bus, m, ts);
-
- r = bus_seal_synthetic_message(bus, m);
- if (r < 0)
- return r;
-
- bus->rqueue[bus->rqueue_size++] = m;
- m = NULL;
-
- return 1;
-}
-
-static int translate_name_change(
- sd_bus *bus,
- const struct kdbus_msg *k,
- const struct kdbus_item *d,
- const struct kdbus_timestamp *ts) {
-
- char new_owner[UNIQUE_NAME_MAX], old_owner[UNIQUE_NAME_MAX];
-
- assert(bus);
- assert(k);
- assert(d);
-
- if (d->type == KDBUS_ITEM_NAME_ADD || (d->name_change.old_id.flags & (KDBUS_NAME_IN_QUEUE|KDBUS_NAME_ACTIVATOR)))
- old_owner[0] = 0;
- else
- sprintf(old_owner, ":1.%llu", d->name_change.old_id.id);
-
- if (d->type == KDBUS_ITEM_NAME_REMOVE || (d->name_change.new_id.flags & (KDBUS_NAME_IN_QUEUE|KDBUS_NAME_ACTIVATOR))) {
-
- if (isempty(old_owner))
- return 0;
-
- new_owner[0] = 0;
- } else
- sprintf(new_owner, ":1.%llu", d->name_change.new_id.id);
-
- return push_name_owner_changed(bus, d->name_change.name, old_owner, new_owner, ts);
-}
-
-static int translate_id_change(
- sd_bus *bus,
- const struct kdbus_msg *k,
- const struct kdbus_item *d,
- const struct kdbus_timestamp *ts) {
-
- char owner[UNIQUE_NAME_MAX];
-
- assert(bus);
- assert(k);
- assert(d);
-
- sprintf(owner, ":1.%llu", d->id_change.id);
-
- return push_name_owner_changed(
- bus, owner,
- d->type == KDBUS_ITEM_ID_ADD ? NULL : owner,
- d->type == KDBUS_ITEM_ID_ADD ? owner : NULL,
- ts);
-}
-
-static int translate_reply(
- sd_bus *bus,
- const struct kdbus_msg *k,
- const struct kdbus_item *d,
- const struct kdbus_timestamp *ts) {
-
- _cleanup_(sd_bus_message_unrefp) sd_bus_message *m = NULL;
- int r;
-
- assert(bus);
- assert(k);
- assert(d);
-
- r = bus_message_new_synthetic_error(
- bus,
- k->cookie_reply,
- d->type == KDBUS_ITEM_REPLY_TIMEOUT ?
- &SD_BUS_ERROR_MAKE_CONST(SD_BUS_ERROR_NO_REPLY, "Method call timed out") :
- &SD_BUS_ERROR_MAKE_CONST(SD_BUS_ERROR_NO_REPLY, "Method call peer died"),
- &m);
- if (r < 0)
- return r;
-
- message_set_timestamp(bus, m, ts);
-
- r = bus_seal_synthetic_message(bus, m);
- if (r < 0)
- return r;
-
- bus->rqueue[bus->rqueue_size++] = m;
- m = NULL;
-
- return 1;
-}
-
-static int bus_kernel_translate_message(sd_bus *bus, struct kdbus_msg *k) {
- static int (* const translate[])(sd_bus *bus, const struct kdbus_msg *k, const struct kdbus_item *d, const struct kdbus_timestamp *ts) = {
- [KDBUS_ITEM_NAME_ADD - _KDBUS_ITEM_KERNEL_BASE] = translate_name_change,
- [KDBUS_ITEM_NAME_REMOVE - _KDBUS_ITEM_KERNEL_BASE] = translate_name_change,
- [KDBUS_ITEM_NAME_CHANGE - _KDBUS_ITEM_KERNEL_BASE] = translate_name_change,
-
- [KDBUS_ITEM_ID_ADD - _KDBUS_ITEM_KERNEL_BASE] = translate_id_change,
- [KDBUS_ITEM_ID_REMOVE - _KDBUS_ITEM_KERNEL_BASE] = translate_id_change,
-
- [KDBUS_ITEM_REPLY_TIMEOUT - _KDBUS_ITEM_KERNEL_BASE] = translate_reply,
- [KDBUS_ITEM_REPLY_DEAD - _KDBUS_ITEM_KERNEL_BASE] = translate_reply,
- };
-
- struct kdbus_item *d, *found = NULL;
- struct kdbus_timestamp *ts = NULL;
-
- assert(bus);
- assert(k);
- assert(k->payload_type == KDBUS_PAYLOAD_KERNEL);
-
- KDBUS_ITEM_FOREACH(d, k, items) {
- if (d->type == KDBUS_ITEM_TIMESTAMP)
- ts = &d->timestamp;
- else if (d->type >= _KDBUS_ITEM_KERNEL_BASE && d->type < _KDBUS_ITEM_KERNEL_BASE + ELEMENTSOF(translate)) {
- if (found)
- return -EBADMSG;
- found = d;
- } else
- log_debug("Got unknown field from kernel %llu", d->type);
- }
-
- if (!found) {
- log_debug("Didn't find a kernel message to translate.");
- return 0;
- }
-
- return translate[found->type - _KDBUS_ITEM_KERNEL_BASE](bus, k, found, ts);
-}
-
-int bus_kernel_read_message(sd_bus *bus, bool hint_priority, int64_t priority) {
- struct kdbus_cmd_recv recv = { .size = sizeof(recv) };
- struct kdbus_msg *k;
- int r;
-
- assert(bus);
-
- r = bus_rqueue_make_room(bus);
- if (r < 0)
- return r;
-
- if (hint_priority) {
- recv.flags |= KDBUS_RECV_USE_PRIORITY;
- recv.priority = priority;
- }
-
- r = ioctl(bus->input_fd, KDBUS_CMD_RECV, &recv);
- if (recv.return_flags & KDBUS_RECV_RETURN_DROPPED_MSGS)
- log_debug("%s: kdbus reports %" PRIu64 " dropped broadcast messages, ignoring.", strna(bus->description), (uint64_t) recv.dropped_msgs);
- if (r < 0) {
- if (errno == EAGAIN)
- return 0;
-
- return -errno;
- }
-
- k = (struct kdbus_msg *)((uint8_t *)bus->kdbus_buffer + recv.msg.offset);
- if (k->payload_type == KDBUS_PAYLOAD_DBUS) {
- r = bus_kernel_make_message(bus, k);
-
- /* Anybody can send us invalid messages, let's just drop them. */
- if (r == -EBADMSG || r == -EPROTOTYPE) {
- log_debug_errno(r, "Ignoring invalid message: %m");
- r = 0;
- }
-
- if (r <= 0)
- close_kdbus_msg(bus, k);
- } else if (k->payload_type == KDBUS_PAYLOAD_KERNEL) {
- r = bus_kernel_translate_message(bus, k);
- close_kdbus_msg(bus, k);
- } else {
- log_debug("Ignoring message with unknown payload type %llu.", k->payload_type);
- r = 0;
- close_kdbus_msg(bus, k);
- }
-
- return r < 0 ? r : 1;
-}
-
-int bus_kernel_pop_memfd(sd_bus *bus, void **address, size_t *mapped, size_t *allocated) {
- struct memfd_cache *c;
- int fd;
-
- assert(address);
- assert(mapped);
- assert(allocated);
-
- if (!bus || !bus->is_kernel)
- return -EOPNOTSUPP;
-
- assert_se(pthread_mutex_lock(&bus->memfd_cache_mutex) == 0);
-
- if (bus->n_memfd_cache <= 0) {
- int r;
-
- assert_se(pthread_mutex_unlock(&bus->memfd_cache_mutex) == 0);
-
- r = memfd_new(bus->description);
- if (r < 0)
- return r;
-
- *address = NULL;
- *mapped = 0;
- *allocated = 0;
- return r;
- }
-
- c = &bus->memfd_cache[--bus->n_memfd_cache];
-
- assert(c->fd >= 0);
- assert(c->mapped == 0 || c->address);
-
- *address = c->address;
- *mapped = c->mapped;
- *allocated = c->allocated;
- fd = c->fd;
-
- assert_se(pthread_mutex_unlock(&bus->memfd_cache_mutex) == 0);
-
- return fd;
-}
-
-static void close_and_munmap(int fd, void *address, size_t size) {
+void close_and_munmap(int fd, void *address, size_t size) {
if (size > 0)
assert_se(munmap(address, PAGE_ALIGN(size)) >= 0);
safe_close(fd);
}
-void bus_kernel_push_memfd(sd_bus *bus, int fd, void *address, size_t mapped, size_t allocated) {
- struct memfd_cache *c;
- uint64_t max_mapped = PAGE_ALIGN(MEMFD_CACHE_ITEM_SIZE_MAX);
-
- assert(fd >= 0);
- assert(mapped == 0 || address);
-
- if (!bus || !bus->is_kernel) {
- close_and_munmap(fd, address, mapped);
- return;
- }
-
- assert_se(pthread_mutex_lock(&bus->memfd_cache_mutex) == 0);
-
- if (bus->n_memfd_cache >= ELEMENTSOF(bus->memfd_cache)) {
- assert_se(pthread_mutex_unlock(&bus->memfd_cache_mutex) == 0);
-
- close_and_munmap(fd, address, mapped);
- return;
- }
-
- c = &bus->memfd_cache[bus->n_memfd_cache++];
- c->fd = fd;
- c->address = address;
-
- /* If overly long, let's return a bit to the OS */
- if (mapped > max_mapped) {
- assert_se(memfd_set_size(fd, max_mapped) >= 0);
- assert_se(munmap((uint8_t*) address + max_mapped, PAGE_ALIGN(mapped - max_mapped)) >= 0);
- c->mapped = c->allocated = max_mapped;
- } else {
- c->mapped = mapped;
- c->allocated = allocated;
- }
-
- assert_se(pthread_mutex_unlock(&bus->memfd_cache_mutex) == 0);
-}
-
-void bus_kernel_flush_memfd(sd_bus *b) {
+void bus_flush_memfd(sd_bus *b) {
unsigned i;
assert(b);
@@ -1524,21 +66,6 @@ void bus_kernel_flush_memfd(sd_bus *b) {
close_and_munmap(b->memfd_cache[i].fd, b->memfd_cache[i].address, b->memfd_cache[i].mapped);
}
-uint64_t request_name_flags_to_kdbus(uint64_t flags) {
- uint64_t f = 0;
-
- if (flags & SD_BUS_NAME_ALLOW_REPLACEMENT)
- f |= KDBUS_NAME_ALLOW_REPLACEMENT;
-
- if (flags & SD_BUS_NAME_REPLACE_EXISTING)
- f |= KDBUS_NAME_REPLACE_EXISTING;
-
- if (flags & SD_BUS_NAME_QUEUE)
- f |= KDBUS_NAME_QUEUE;
-
- return f;
-}
-
uint64_t attach_flags_to_kdbus(uint64_t mask) {
uint64_t m = 0;
@@ -1584,199 +111,3 @@ uint64_t attach_flags_to_kdbus(uint64_t mask) {
return m;
}
-
-int bus_kernel_create_bus(const char *name, bool world, char **s) {
- struct kdbus_cmd *make;
- struct kdbus_item *n;
- size_t l;
- int fd;
-
- assert(name);
- assert(s);
-
- fd = open("/sys/fs/kdbus/control", O_RDWR|O_NOCTTY|O_CLOEXEC);
- if (fd < 0)
- return -errno;
-
- l = strlen(name);
- make = alloca0_align(offsetof(struct kdbus_cmd, items) +
- ALIGN8(offsetof(struct kdbus_item, bloom_parameter) + sizeof(struct kdbus_bloom_parameter)) +
- ALIGN8(offsetof(struct kdbus_item, data64) + sizeof(uint64_t)) +
- ALIGN8(offsetof(struct kdbus_item, str) + DECIMAL_STR_MAX(uid_t) + 1 + l + 1),
- 8);
-
- make->size = offsetof(struct kdbus_cmd, items);
-
- /* Set the bloom parameters */
- n = make->items;
- n->size = offsetof(struct kdbus_item, bloom_parameter) +
- sizeof(struct kdbus_bloom_parameter);
- n->type = KDBUS_ITEM_BLOOM_PARAMETER;
- n->bloom_parameter.size = DEFAULT_BLOOM_SIZE;
- n->bloom_parameter.n_hash = DEFAULT_BLOOM_N_HASH;
-
- assert_cc(DEFAULT_BLOOM_SIZE > 0);
- assert_cc(DEFAULT_BLOOM_N_HASH > 0);
-
- make->size += ALIGN8(n->size);
-
- /* Provide all metadata via bus-owner queries */
- n = KDBUS_ITEM_NEXT(n);
- n->type = KDBUS_ITEM_ATTACH_FLAGS_SEND;
- n->size = offsetof(struct kdbus_item, data64) + sizeof(uint64_t);
- n->data64[0] = _KDBUS_ATTACH_ANY;
- make->size += ALIGN8(n->size);
-
- /* Set the a good name */
- n = KDBUS_ITEM_NEXT(n);
- sprintf(n->str, UID_FMT "-%s", getuid(), name);
- n->size = offsetof(struct kdbus_item, str) + strlen(n->str) + 1;
- n->type = KDBUS_ITEM_MAKE_NAME;
- make->size += ALIGN8(n->size);
-
- make->flags = world ? KDBUS_MAKE_ACCESS_WORLD : 0;
-
- if (ioctl(fd, KDBUS_CMD_BUS_MAKE, make) < 0) {
- safe_close(fd);
-
- /* Major API change? then the ioctls got shuffled around. */
- if (errno == ENOTTY)
- return -ESOCKTNOSUPPORT;
-
- return -errno;
- }
-
- if (s) {
- char *p;
-
- p = strjoin("/sys/fs/kdbus/", n->str, "/bus");
- if (!p) {
- safe_close(fd);
- return -ENOMEM;
- }
-
- *s = p;
- }
-
- return fd;
-}
-
-int bus_kernel_open_bus_fd(const char *bus, char **path) {
- char *p;
- int fd;
- size_t len;
-
- assert(bus);
-
- len = strlen("/sys/fs/kdbus/") + DECIMAL_STR_MAX(uid_t) + 1 + strlen(bus) + strlen("/bus") + 1;
-
- if (path) {
- p = new(char, len);
- if (!p)
- return -ENOMEM;
- } else
- p = newa(char, len);
-
- sprintf(p, "/sys/fs/kdbus/" UID_FMT "-%s/bus", getuid(), bus);
-
- fd = open(p, O_RDWR|O_NOCTTY|O_CLOEXEC);
- if (fd < 0) {
- if (path)
- free(p);
-
- return -errno;
- }
-
- if (path)
- *path = p;
-
- return fd;
-}
-
-int bus_kernel_try_close(sd_bus *bus) {
- struct kdbus_cmd byebye = { .size = sizeof(byebye) };
-
- assert(bus);
- assert(bus->is_kernel);
-
- if (ioctl(bus->input_fd, KDBUS_CMD_BYEBYE, &byebye) < 0)
- return -errno;
-
- return 0;
-}
-
-int bus_kernel_drop_one(int fd) {
- struct kdbus_cmd_recv recv = {
- .size = sizeof(recv),
- .flags = KDBUS_RECV_DROP,
- };
-
- assert(fd >= 0);
-
- if (ioctl(fd, KDBUS_CMD_RECV, &recv) < 0)
- return -errno;
-
- return 0;
-}
-
-int bus_kernel_realize_attach_flags(sd_bus *bus) {
- struct kdbus_cmd *update;
- struct kdbus_item *n;
-
- assert(bus);
- assert(bus->is_kernel);
-
- update = alloca0_align(offsetof(struct kdbus_cmd, items) +
- ALIGN8(offsetof(struct kdbus_item, data64) + sizeof(uint64_t)),
- 8);
-
- n = update->items;
- n->type = KDBUS_ITEM_ATTACH_FLAGS_RECV;
- n->size = offsetof(struct kdbus_item, data64) + sizeof(uint64_t);
- n->data64[0] = bus->attach_flags;
-
- update->size =
- offsetof(struct kdbus_cmd, items) +
- ALIGN8(n->size);
-
- if (ioctl(bus->input_fd, KDBUS_CMD_UPDATE, update) < 0)
- return -errno;
-
- return 0;
-}
-
-int bus_kernel_get_bus_name(sd_bus *bus, char **name) {
- struct kdbus_cmd_info cmd = {
- .size = sizeof(struct kdbus_cmd_info),
- };
- struct kdbus_info *info;
- struct kdbus_item *item;
- char *n = NULL;
- int r;
-
- assert(bus);
- assert(name);
- assert(bus->is_kernel);
-
- r = ioctl(bus->input_fd, KDBUS_CMD_BUS_CREATOR_INFO, &cmd);
- if (r < 0)
- return -errno;
-
- info = (struct kdbus_info*) ((uint8_t*) bus->kdbus_buffer + cmd.offset);
-
- KDBUS_ITEM_FOREACH(item, info, items)
- if (item->type == KDBUS_ITEM_MAKE_NAME) {
- r = free_and_strdup(&n, item->str);
- break;
- }
-
- bus_kernel_cmd_free(bus, cmd.offset);
-
- if (r < 0)
- return r;
- if (!n)
- return -EIO;
-
- *name = n;
- return 0;
-}
diff --git a/src/libsystemd/sd-bus/bus-kernel.h b/src/libsystemd/sd-bus/bus-kernel.h
index 53ba3bdcf3..49c0ab3a3c 100644
--- a/src/libsystemd/sd-bus/bus-kernel.h
+++ b/src/libsystemd/sd-bus/bus-kernel.h
@@ -19,27 +19,8 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <stdbool.h>
-
#include "sd-bus.h"
-#define KDBUS_ITEM_NEXT(item) \
- (typeof(item))(((uint8_t *)item) + ALIGN8((item)->size))
-
-#define KDBUS_ITEM_FOREACH(part, head, first) \
- for (part = (head)->first; \
- ((uint8_t *)(part) < (uint8_t *)(head) + (head)->size) && \
- ((uint8_t *) part >= (uint8_t *) head); \
- part = KDBUS_ITEM_NEXT(part))
-#define KDBUS_FOREACH(iter, first, _size) \
- for (iter = (first); \
- ((uint8_t *)(iter) < (uint8_t *)(first) + (_size)) && \
- ((uint8_t *)(iter) >= (uint8_t *)(first)); \
- iter = (void*)(((uint8_t *)iter) + ALIGN8((iter)->size)))
-
-#define KDBUS_ITEM_HEADER_SIZE offsetof(struct kdbus_item, data)
-#define KDBUS_ITEM_SIZE(s) ALIGN8((s) + KDBUS_ITEM_HEADER_SIZE)
-
#define MEMFD_CACHE_MAX 32
/* When we cache a memfd block for reuse, we will truncate blocks
@@ -50,10 +31,6 @@
* sending vectors */
#define MEMFD_MIN_SIZE (512*1024)
-/* The size of the per-connection memory pool that we set up and where
- * the kernel places our incoming messages */
-#define KDBUS_POOL_SIZE (16*1024*1024)
-
struct memfd_cache {
int fd;
void *address;
@@ -61,33 +38,7 @@ struct memfd_cache {
size_t allocated;
};
-int bus_kernel_connect(sd_bus *b);
-int bus_kernel_take_fd(sd_bus *b);
-
-int bus_kernel_write_message(sd_bus *bus, sd_bus_message *m, bool hint_sync_call);
-int bus_kernel_read_message(sd_bus *bus, bool hint_priority, int64_t priority);
-
-int bus_kernel_open_bus_fd(const char *bus, char **path);
-
-int bus_kernel_create_bus(const char *name, bool world, char **s);
-int bus_kernel_create_endpoint(const char *bus_name, const char *ep_name, char **path);
+void close_and_munmap(int fd, void *address, size_t size);
+void bus_flush_memfd(sd_bus *bus);
-int bus_kernel_pop_memfd(sd_bus *bus, void **address, size_t *mapped, size_t *allocated);
-void bus_kernel_push_memfd(sd_bus *bus, int fd, void *address, size_t mapped, size_t allocated);
-
-void bus_kernel_flush_memfd(sd_bus *bus);
-
-int bus_kernel_parse_unique_name(const char *s, uint64_t *id);
-
-uint64_t request_name_flags_to_kdbus(uint64_t sd_bus_flags);
uint64_t attach_flags_to_kdbus(uint64_t sd_bus_flags);
-
-int bus_kernel_try_close(sd_bus *bus);
-
-int bus_kernel_drop_one(int fd);
-
-int bus_kernel_realize_attach_flags(sd_bus *bus);
-
-int bus_kernel_get_bus_name(sd_bus *bus, char **name);
-
-int bus_kernel_cmd_free(sd_bus *bus, uint64_t offset);
diff --git a/src/libsystemd/sd-bus/bus-match.c b/src/libsystemd/sd-bus/bus-match.c
index db01f21135..02587a3e8d 100644
--- a/src/libsystemd/sd-bus/bus-match.c
+++ b/src/libsystemd/sd-bus/bus-match.c
@@ -957,18 +957,18 @@ char *bus_match_to_string(struct bus_match_component *components, unsigned n_com
char buf[32];
if (i != 0)
- fputc(',', f);
+ fputc_unlocked(',', f);
- fputs(bus_match_node_type_to_string(components[i].type, buf, sizeof(buf)), f);
- fputc('=', f);
- fputc('\'', f);
+ fputs_unlocked(bus_match_node_type_to_string(components[i].type, buf, sizeof(buf)), f);
+ fputc_unlocked('=', f);
+ fputc_unlocked('\'', f);
if (components[i].type == BUS_MATCH_MESSAGE_TYPE)
- fputs(bus_message_type_to_string(components[i].value_u8), f);
+ fputs_unlocked(bus_message_type_to_string(components[i].value_u8), f);
else
- fputs(components[i].value_str, f);
+ fputs_unlocked(components[i].value_str, f);
- fputc('\'', f);
+ fputc_unlocked('\'', f);
}
r = fflush_and_check(f);
diff --git a/src/libsystemd/sd-bus/bus-message.c b/src/libsystemd/sd-bus/bus-message.c
index da6fd3b896..694033632f 100644
--- a/src/libsystemd/sd-bus/bus-message.c
+++ b/src/libsystemd/sd-bus/bus-message.c
@@ -62,22 +62,9 @@ static void message_free_part(sd_bus_message *m, struct bus_body_part *part) {
assert(m);
assert(part);
- if (part->memfd >= 0) {
- /* If we can reuse the memfd, try that. For that it
- * can't be sealed yet. */
-
- if (!part->sealed) {
- assert(part->memfd_offset == 0);
- assert(part->data == part->mmap_begin);
- bus_kernel_push_memfd(m->bus, part->memfd, part->data, part->mapped, part->allocated);
- } else {
- if (part->mapped > 0)
- assert_se(munmap(part->mmap_begin, part->mapped) == 0);
-
- safe_close(part->memfd);
- }
-
- } else if (part->munmap_this)
+ if (part->memfd >= 0)
+ close_and_munmap(part->memfd, part->mmap_begin, part->mapped);
+ else if (part->munmap_this)
munmap(part->mmap_begin, part->mapped);
else if (part->free_this)
free(part->data);
@@ -129,12 +116,6 @@ static void message_free(sd_bus_message *m) {
message_reset_parts(m);
- if (m->release_kdbus)
- bus_kernel_cmd_free(m->bus, (uint8_t *) m->kdbus - (uint8_t *) m->bus->kdbus_buffer);
-
- if (m->free_kdbus)
- free(m->kdbus);
-
sd_bus_unref(m->bus);
if (m->free_fds) {
@@ -1215,7 +1196,6 @@ static int part_make_space(
void **q) {
void *n;
- int r;
assert(m);
assert(part);
@@ -1224,61 +1204,19 @@ static int part_make_space(
if (m->poisoned)
return -ENOMEM;
- if (!part->data && part->memfd < 0) {
- part->memfd = bus_kernel_pop_memfd(m->bus, &part->data, &part->mapped, &part->allocated);
- part->mmap_begin = part->data;
- }
-
- if (part->memfd >= 0) {
+ if (part->allocated == 0 || sz > part->allocated) {
+ size_t new_allocated;
- if (part->allocated == 0 || sz > part->allocated) {
- uint64_t new_allocated;
-
- new_allocated = PAGE_ALIGN(sz > 0 ? 2 * sz : 1);
- r = memfd_set_size(part->memfd, new_allocated);
- if (r < 0) {
- m->poisoned = true;
- return r;
- }
-
- part->allocated = new_allocated;
- }
-
- if (!part->data || sz > part->mapped) {
- size_t psz;
-
- psz = PAGE_ALIGN(sz > 0 ? sz : 1);
- if (part->mapped <= 0)
- n = mmap(NULL, psz, PROT_READ|PROT_WRITE, MAP_SHARED, part->memfd, 0);
- else
- n = mremap(part->mmap_begin, part->mapped, psz, MREMAP_MAYMOVE);
-
- if (n == MAP_FAILED) {
- m->poisoned = true;
- return -errno;
- }
-
- part->mmap_begin = part->data = n;
- part->mapped = psz;
- part->memfd_offset = 0;
+ new_allocated = sz > 0 ? 2 * sz : 64;
+ n = realloc(part->data, new_allocated);
+ if (!n) {
+ m->poisoned = true;
+ return -ENOMEM;
}
- part->munmap_this = true;
- } else {
- if (part->allocated == 0 || sz > part->allocated) {
- size_t new_allocated;
-
- new_allocated = sz > 0 ? 2 * sz : 64;
- n = realloc(part->data, new_allocated);
- if (!n) {
- m->poisoned = true;
- return -ENOMEM;
- }
-
- part->data = n;
- part->allocated = new_allocated;
- part->free_this = true;
- }
+ part->data = n;
+ part->allocated = new_allocated;
+ part->free_this = true;
}
if (q)
@@ -5368,7 +5306,7 @@ int bus_message_parse_fields(sd_bus_message *m) {
r = message_peek_field_string(m, service_name_is_valid, &ri, item_size, &m->sender);
- if (r >= 0 && m->sender[0] == ':' && m->bus->bus_client && !m->bus->is_kernel) {
+ if (r >= 0 && m->sender[0] == ':' && m->bus->bus_client) {
m->creds.unique_name = (char*) m->sender;
m->creds.mask |= SD_BUS_CREDS_UNIQUE_NAME & m->bus->creds_mask;
}
diff --git a/src/libsystemd/sd-bus/bus-message.h b/src/libsystemd/sd-bus/bus-message.h
index a59aa73833..a84f908f75 100644
--- a/src/libsystemd/sd-bus/bus-message.h
+++ b/src/libsystemd/sd-bus/bus-message.h
@@ -92,9 +92,7 @@ struct sd_bus_message {
bool dont_send:1;
bool allow_fds:1;
bool free_header:1;
- bool free_kdbus:1;
bool free_fds:1;
- bool release_kdbus:1;
bool poisoned:1;
/* The first and last bytes of the message */
@@ -128,8 +126,6 @@ struct sd_bus_message {
struct iovec iovec_fixed[2];
unsigned n_iovec;
- struct kdbus_msg *kdbus;
-
char *peeked_signature;
/* If set replies to this message must carry the signature
diff --git a/src/libsystemd/sd-bus/bus-objects.c b/src/libsystemd/sd-bus/bus-objects.c
index 98911d5203..bb06d302ca 100644
--- a/src/libsystemd/sd-bus/bus-objects.c
+++ b/src/libsystemd/sd-bus/bus-objects.c
@@ -955,7 +955,7 @@ static int process_introspect(
if (!streq_ptr(previous_interface, c->interface)) {
if (previous_interface)
- fputs(" </interface>\n", intro.f);
+ fputs_unlocked(" </interface>\n", intro.f);
fprintf(intro.f, " <interface name=\"%s\">\n", c->interface);
}
@@ -968,7 +968,7 @@ static int process_introspect(
}
if (previous_interface)
- fputs(" </interface>\n", intro.f);
+ fputs_unlocked(" </interface>\n", intro.f);
if (empty) {
/* Nothing?, let's see if we exist at all, and if not
diff --git a/src/libsystemd/sd-bus/bus-socket.c b/src/libsystemd/sd-bus/bus-socket.c
index 8b25002f01..be12516663 100644
--- a/src/libsystemd/sd-bus/bus-socket.c
+++ b/src/libsystemd/sd-bus/bus-socket.c
@@ -593,7 +593,6 @@ void bus_socket_setup(sd_bus *b) {
fd_inc_rcvbuf(b->input_fd, SNDBUF_SIZE);
fd_inc_sndbuf(b->output_fd, SNDBUF_SIZE);
- b->is_kernel = false;
b->message_version = 1;
b->message_endian = 0;
}
diff --git a/src/libsystemd/sd-bus/kdbus.h b/src/libsystemd/sd-bus/kdbus.h
deleted file mode 100644
index ecffc6b13c..0000000000
--- a/src/libsystemd/sd-bus/kdbus.h
+++ /dev/null
@@ -1,980 +0,0 @@
-/*
- * kdbus is free software; you can redistribute it and/or modify it under
- * the terms of the GNU Lesser General Public License as published by the
- * Free Software Foundation; either version 2.1 of the License, or (at
- * your option) any later version.
- */
-
-#ifndef _UAPI_KDBUS_H_
-#define _UAPI_KDBUS_H_
-
-#include <linux/ioctl.h>
-#include <linux/types.h>
-
-#define KDBUS_IOCTL_MAGIC 0x95
-#define KDBUS_SRC_ID_KERNEL (0)
-#define KDBUS_DST_ID_NAME (0)
-#define KDBUS_MATCH_ID_ANY (~0ULL)
-#define KDBUS_DST_ID_BROADCAST (~0ULL)
-#define KDBUS_FLAG_NEGOTIATE (1ULL << 63)
-
-/**
- * struct kdbus_notify_id_change - name registry change message
- * @id: New or former owner of the name
- * @flags: flags field from KDBUS_HELLO_*
- *
- * Sent from kernel to userspace when the owner or activator of
- * a well-known name changes.
- *
- * Attached to:
- * KDBUS_ITEM_ID_ADD
- * KDBUS_ITEM_ID_REMOVE
- */
-struct kdbus_notify_id_change {
- __u64 id;
- __u64 flags;
-} __attribute__((__aligned__(8)));
-
-/**
- * struct kdbus_notify_name_change - name registry change message
- * @old_id: ID and flags of former owner of a name
- * @new_id: ID and flags of new owner of a name
- * @name: Well-known name
- *
- * Sent from kernel to userspace when the owner or activator of
- * a well-known name changes.
- *
- * Attached to:
- * KDBUS_ITEM_NAME_ADD
- * KDBUS_ITEM_NAME_REMOVE
- * KDBUS_ITEM_NAME_CHANGE
- */
-struct kdbus_notify_name_change {
- struct kdbus_notify_id_change old_id;
- struct kdbus_notify_id_change new_id;
- char name[0];
-} __attribute__((__aligned__(8)));
-
-/**
- * struct kdbus_creds - process credentials
- * @uid: User ID
- * @euid: Effective UID
- * @suid: Saved UID
- * @fsuid: Filesystem UID
- * @gid: Group ID
- * @egid: Effective GID
- * @sgid: Saved GID
- * @fsgid: Filesystem GID
- *
- * Attached to:
- * KDBUS_ITEM_CREDS
- */
-struct kdbus_creds {
- __u64 uid;
- __u64 euid;
- __u64 suid;
- __u64 fsuid;
- __u64 gid;
- __u64 egid;
- __u64 sgid;
- __u64 fsgid;
-} __attribute__((__aligned__(8)));
-
-/**
- * struct kdbus_pids - process identifiers
- * @pid: Process ID
- * @tid: Thread ID
- * @ppid: Parent process ID
- *
- * The PID and TID of a process.
- *
- * Attached to:
- * KDBUS_ITEM_PIDS
- */
-struct kdbus_pids {
- __u64 pid;
- __u64 tid;
- __u64 ppid;
-} __attribute__((__aligned__(8)));
-
-/**
- * struct kdbus_caps - process capabilities
- * @last_cap: Highest currently known capability bit
- * @caps: Variable number of 32-bit capabilities flags
- *
- * Contains a variable number of 32-bit capabilities flags.
- *
- * Attached to:
- * KDBUS_ITEM_CAPS
- */
-struct kdbus_caps {
- __u32 last_cap;
- __u32 caps[0];
-} __attribute__((__aligned__(8)));
-
-/**
- * struct kdbus_audit - audit information
- * @sessionid: The audit session ID
- * @loginuid: The audit login uid
- *
- * Attached to:
- * KDBUS_ITEM_AUDIT
- */
-struct kdbus_audit {
- __u32 sessionid;
- __u32 loginuid;
-} __attribute__((__aligned__(8)));
-
-/**
- * struct kdbus_timestamp
- * @seqnum: Global per-domain message sequence number
- * @monotonic_ns: Monotonic timestamp, in nanoseconds
- * @realtime_ns: Realtime timestamp, in nanoseconds
- *
- * Attached to:
- * KDBUS_ITEM_TIMESTAMP
- */
-struct kdbus_timestamp {
- __u64 seqnum;
- __u64 monotonic_ns;
- __u64 realtime_ns;
-} __attribute__((__aligned__(8)));
-
-/**
- * struct kdbus_vec - I/O vector for kdbus payload items
- * @size: The size of the vector
- * @address: Memory address of data buffer
- * @offset: Offset in the in-message payload memory,
- * relative to the message head
- *
- * Attached to:
- * KDBUS_ITEM_PAYLOAD_VEC, KDBUS_ITEM_PAYLOAD_OFF
- */
-struct kdbus_vec {
- __u64 size;
- union {
- __u64 address;
- __u64 offset;
- };
-} __attribute__((__aligned__(8)));
-
-/**
- * struct kdbus_bloom_parameter - bus-wide bloom parameters
- * @size: Size of the bit field in bytes (m / 8)
- * @n_hash: Number of hash functions used (k)
- */
-struct kdbus_bloom_parameter {
- __u64 size;
- __u64 n_hash;
-} __attribute__((__aligned__(8)));
-
-/**
- * struct kdbus_bloom_filter - bloom filter containing n elements
- * @generation: Generation of the element set in the filter
- * @data: Bit field, multiple of 8 bytes
- */
-struct kdbus_bloom_filter {
- __u64 generation;
- __u64 data[0];
-} __attribute__((__aligned__(8)));
-
-/**
- * struct kdbus_memfd - a kdbus memfd
- * @start: The offset into the memfd where the segment starts
- * @size: The size of the memfd segment
- * @fd: The file descriptor number
- * @__pad: Padding to ensure proper alignment and size
- *
- * Attached to:
- * KDBUS_ITEM_PAYLOAD_MEMFD
- */
-struct kdbus_memfd {
- __u64 start;
- __u64 size;
- int fd;
- __u32 __pad;
-} __attribute__((__aligned__(8)));
-
-/**
- * struct kdbus_name - a registered well-known name with its flags
- * @flags: Flags from KDBUS_NAME_*
- * @name: Well-known name
- *
- * Attached to:
- * KDBUS_ITEM_OWNED_NAME
- */
-struct kdbus_name {
- __u64 flags;
- char name[0];
-} __attribute__((__aligned__(8)));
-
-/**
- * enum kdbus_policy_access_type - permissions of a policy record
- * @_KDBUS_POLICY_ACCESS_NULL: Uninitialized/invalid
- * @KDBUS_POLICY_ACCESS_USER: Grant access to a uid
- * @KDBUS_POLICY_ACCESS_GROUP: Grant access to gid
- * @KDBUS_POLICY_ACCESS_WORLD: World-accessible
- */
-enum kdbus_policy_access_type {
- _KDBUS_POLICY_ACCESS_NULL,
- KDBUS_POLICY_ACCESS_USER,
- KDBUS_POLICY_ACCESS_GROUP,
- KDBUS_POLICY_ACCESS_WORLD,
-};
-
-/**
- * enum kdbus_policy_access_flags - mode flags
- * @KDBUS_POLICY_OWN: Allow to own a well-known name
- * Implies KDBUS_POLICY_TALK and KDBUS_POLICY_SEE
- * @KDBUS_POLICY_TALK: Allow communication to a well-known name
- * Implies KDBUS_POLICY_SEE
- * @KDBUS_POLICY_SEE: Allow to see a well-known name
- */
-enum kdbus_policy_type {
- KDBUS_POLICY_SEE = 0,
- KDBUS_POLICY_TALK,
- KDBUS_POLICY_OWN,
-};
-
-/**
- * struct kdbus_policy_access - policy access item
- * @type: One of KDBUS_POLICY_ACCESS_* types
- * @access: Access to grant
- * @id: For KDBUS_POLICY_ACCESS_USER, the uid
- * For KDBUS_POLICY_ACCESS_GROUP, the gid
- */
-struct kdbus_policy_access {
- __u64 type; /* USER, GROUP, WORLD */
- __u64 access; /* OWN, TALK, SEE */
- __u64 id; /* uid, gid, 0 */
-} __attribute__((__aligned__(8)));
-
-/**
- * enum kdbus_attach_flags - flags for metadata attachments
- * @KDBUS_ATTACH_TIMESTAMP: Timestamp
- * @KDBUS_ATTACH_CREDS: Credentials
- * @KDBUS_ATTACH_PIDS: PIDs
- * @KDBUS_ATTACH_AUXGROUPS: Auxiliary groups
- * @KDBUS_ATTACH_NAMES: Well-known names
- * @KDBUS_ATTACH_TID_COMM: The "comm" process identifier of the TID
- * @KDBUS_ATTACH_PID_COMM: The "comm" process identifier of the PID
- * @KDBUS_ATTACH_EXE: The path of the executable
- * @KDBUS_ATTACH_CMDLINE: The process command line
- * @KDBUS_ATTACH_CGROUP: The croup membership
- * @KDBUS_ATTACH_CAPS: The process capabilities
- * @KDBUS_ATTACH_SECLABEL: The security label
- * @KDBUS_ATTACH_AUDIT: The audit IDs
- * @KDBUS_ATTACH_CONN_DESCRIPTION: The human-readable connection name
- * @_KDBUS_ATTACH_ALL: All of the above
- * @_KDBUS_ATTACH_ANY: Wildcard match to enable any kind of
- * metatdata.
- */
-enum kdbus_attach_flags {
- KDBUS_ATTACH_TIMESTAMP = 1ULL << 0,
- KDBUS_ATTACH_CREDS = 1ULL << 1,
- KDBUS_ATTACH_PIDS = 1ULL << 2,
- KDBUS_ATTACH_AUXGROUPS = 1ULL << 3,
- KDBUS_ATTACH_NAMES = 1ULL << 4,
- KDBUS_ATTACH_TID_COMM = 1ULL << 5,
- KDBUS_ATTACH_PID_COMM = 1ULL << 6,
- KDBUS_ATTACH_EXE = 1ULL << 7,
- KDBUS_ATTACH_CMDLINE = 1ULL << 8,
- KDBUS_ATTACH_CGROUP = 1ULL << 9,
- KDBUS_ATTACH_CAPS = 1ULL << 10,
- KDBUS_ATTACH_SECLABEL = 1ULL << 11,
- KDBUS_ATTACH_AUDIT = 1ULL << 12,
- KDBUS_ATTACH_CONN_DESCRIPTION = 1ULL << 13,
- _KDBUS_ATTACH_ALL = (1ULL << 14) - 1,
- _KDBUS_ATTACH_ANY = ~0ULL
-};
-
-/**
- * enum kdbus_item_type - item types to chain data in a list
- * @_KDBUS_ITEM_NULL: Uninitialized/invalid
- * @_KDBUS_ITEM_USER_BASE: Start of user items
- * @KDBUS_ITEM_NEGOTIATE: Negotiate supported items
- * @KDBUS_ITEM_PAYLOAD_VEC: Vector to data
- * @KDBUS_ITEM_PAYLOAD_OFF: Data at returned offset to message head
- * @KDBUS_ITEM_PAYLOAD_MEMFD: Data as sealed memfd
- * @KDBUS_ITEM_FDS: Attached file descriptors
- * @KDBUS_ITEM_CANCEL_FD: FD used to cancel a synchronous
- * operation by writing to it from
- * userspace
- * @KDBUS_ITEM_BLOOM_PARAMETER: Bus-wide bloom parameters, used with
- * KDBUS_CMD_BUS_MAKE, carries a
- * struct kdbus_bloom_parameter
- * @KDBUS_ITEM_BLOOM_FILTER: Bloom filter carried with a message,
- * used to match against a bloom mask of a
- * connection, carries a struct
- * kdbus_bloom_filter
- * @KDBUS_ITEM_BLOOM_MASK: Bloom mask used to match against a
- * message'sbloom filter
- * @KDBUS_ITEM_DST_NAME: Destination's well-known name
- * @KDBUS_ITEM_MAKE_NAME: Name of domain, bus, endpoint
- * @KDBUS_ITEM_ATTACH_FLAGS_SEND: Attach-flags, used for updating which
- * metadata a connection opts in to send
- * @KDBUS_ITEM_ATTACH_FLAGS_RECV: Attach-flags, used for updating which
- * metadata a connection requests to
- * receive for each reeceived message
- * @KDBUS_ITEM_ID: Connection ID
- * @KDBUS_ITEM_NAME: Well-know name with flags
- * @_KDBUS_ITEM_ATTACH_BASE: Start of metadata attach items
- * @KDBUS_ITEM_TIMESTAMP: Timestamp
- * @KDBUS_ITEM_CREDS: Process credentials
- * @KDBUS_ITEM_PIDS: Process identifiers
- * @KDBUS_ITEM_AUXGROUPS: Auxiliary process groups
- * @KDBUS_ITEM_OWNED_NAME: A name owned by the associated
- * connection
- * @KDBUS_ITEM_TID_COMM: Thread ID "comm" identifier
- * (Don't trust this, see below.)
- * @KDBUS_ITEM_PID_COMM: Process ID "comm" identifier
- * (Don't trust this, see below.)
- * @KDBUS_ITEM_EXE: The path of the executable
- * (Don't trust this, see below.)
- * @KDBUS_ITEM_CMDLINE: The process command line
- * (Don't trust this, see below.)
- * @KDBUS_ITEM_CGROUP: The croup membership
- * @KDBUS_ITEM_CAPS: The process capabilities
- * @KDBUS_ITEM_SECLABEL: The security label
- * @KDBUS_ITEM_AUDIT: The audit IDs
- * @KDBUS_ITEM_CONN_DESCRIPTION: The connection's human-readable name
- * (debugging)
- * @_KDBUS_ITEM_POLICY_BASE: Start of policy items
- * @KDBUS_ITEM_POLICY_ACCESS: Policy access block
- * @_KDBUS_ITEM_KERNEL_BASE: Start of kernel-generated message items
- * @KDBUS_ITEM_NAME_ADD: Notification in kdbus_notify_name_change
- * @KDBUS_ITEM_NAME_REMOVE: Notification in kdbus_notify_name_change
- * @KDBUS_ITEM_NAME_CHANGE: Notification in kdbus_notify_name_change
- * @KDBUS_ITEM_ID_ADD: Notification in kdbus_notify_id_change
- * @KDBUS_ITEM_ID_REMOVE: Notification in kdbus_notify_id_change
- * @KDBUS_ITEM_REPLY_TIMEOUT: Timeout has been reached
- * @KDBUS_ITEM_REPLY_DEAD: Destination died
- *
- * N.B: The process and thread COMM fields, as well as the CMDLINE and
- * EXE fields may be altered by unprivileged processes und should
- * hence *not* used for security decisions. Peers should make use of
- * these items only for informational purposes, such as generating log
- * records.
- */
-enum kdbus_item_type {
- _KDBUS_ITEM_NULL,
- _KDBUS_ITEM_USER_BASE,
- KDBUS_ITEM_NEGOTIATE = _KDBUS_ITEM_USER_BASE,
- KDBUS_ITEM_PAYLOAD_VEC,
- KDBUS_ITEM_PAYLOAD_OFF,
- KDBUS_ITEM_PAYLOAD_MEMFD,
- KDBUS_ITEM_FDS,
- KDBUS_ITEM_CANCEL_FD,
- KDBUS_ITEM_BLOOM_PARAMETER,
- KDBUS_ITEM_BLOOM_FILTER,
- KDBUS_ITEM_BLOOM_MASK,
- KDBUS_ITEM_DST_NAME,
- KDBUS_ITEM_MAKE_NAME,
- KDBUS_ITEM_ATTACH_FLAGS_SEND,
- KDBUS_ITEM_ATTACH_FLAGS_RECV,
- KDBUS_ITEM_ID,
- KDBUS_ITEM_NAME,
- KDBUS_ITEM_DST_ID,
-
- /* keep these item types in sync with KDBUS_ATTACH_* flags */
- _KDBUS_ITEM_ATTACH_BASE = 0x1000,
- KDBUS_ITEM_TIMESTAMP = _KDBUS_ITEM_ATTACH_BASE,
- KDBUS_ITEM_CREDS,
- KDBUS_ITEM_PIDS,
- KDBUS_ITEM_AUXGROUPS,
- KDBUS_ITEM_OWNED_NAME,
- KDBUS_ITEM_TID_COMM,
- KDBUS_ITEM_PID_COMM,
- KDBUS_ITEM_EXE,
- KDBUS_ITEM_CMDLINE,
- KDBUS_ITEM_CGROUP,
- KDBUS_ITEM_CAPS,
- KDBUS_ITEM_SECLABEL,
- KDBUS_ITEM_AUDIT,
- KDBUS_ITEM_CONN_DESCRIPTION,
-
- _KDBUS_ITEM_POLICY_BASE = 0x2000,
- KDBUS_ITEM_POLICY_ACCESS = _KDBUS_ITEM_POLICY_BASE,
-
- _KDBUS_ITEM_KERNEL_BASE = 0x8000,
- KDBUS_ITEM_NAME_ADD = _KDBUS_ITEM_KERNEL_BASE,
- KDBUS_ITEM_NAME_REMOVE,
- KDBUS_ITEM_NAME_CHANGE,
- KDBUS_ITEM_ID_ADD,
- KDBUS_ITEM_ID_REMOVE,
- KDBUS_ITEM_REPLY_TIMEOUT,
- KDBUS_ITEM_REPLY_DEAD,
-};
-
-/**
- * struct kdbus_item - chain of data blocks
- * @size: Overall data record size
- * @type: Kdbus_item type of data
- * @data: Generic bytes
- * @data32: Generic 32 bit array
- * @data64: Generic 64 bit array
- * @str: Generic string
- * @id: Connection ID
- * @vec: KDBUS_ITEM_PAYLOAD_VEC
- * @creds: KDBUS_ITEM_CREDS
- * @audit: KDBUS_ITEM_AUDIT
- * @timestamp: KDBUS_ITEM_TIMESTAMP
- * @name: KDBUS_ITEM_NAME
- * @bloom_parameter: KDBUS_ITEM_BLOOM_PARAMETER
- * @bloom_filter: KDBUS_ITEM_BLOOM_FILTER
- * @memfd: KDBUS_ITEM_PAYLOAD_MEMFD
- * @name_change: KDBUS_ITEM_NAME_ADD
- * KDBUS_ITEM_NAME_REMOVE
- * KDBUS_ITEM_NAME_CHANGE
- * @id_change: KDBUS_ITEM_ID_ADD
- * KDBUS_ITEM_ID_REMOVE
- * @policy: KDBUS_ITEM_POLICY_ACCESS
- */
-struct kdbus_item {
- __u64 size;
- __u64 type;
- union {
- __u8 data[0];
- __u32 data32[0];
- __u64 data64[0];
- char str[0];
-
- __u64 id;
- struct kdbus_vec vec;
- struct kdbus_creds creds;
- struct kdbus_pids pids;
- struct kdbus_audit audit;
- struct kdbus_caps caps;
- struct kdbus_timestamp timestamp;
- struct kdbus_name name;
- struct kdbus_bloom_parameter bloom_parameter;
- struct kdbus_bloom_filter bloom_filter;
- struct kdbus_memfd memfd;
- int fds[0];
- struct kdbus_notify_name_change name_change;
- struct kdbus_notify_id_change id_change;
- struct kdbus_policy_access policy_access;
- };
-} __attribute__((__aligned__(8)));
-
-/**
- * enum kdbus_msg_flags - type of message
- * @KDBUS_MSG_EXPECT_REPLY: Expect a reply message, used for
- * method calls. The userspace-supplied
- * cookie identifies the message and the
- * respective reply carries the cookie
- * in cookie_reply
- * @KDBUS_MSG_NO_AUTO_START: Do not start a service if the addressed
- * name is not currently active. This flag is
- * not looked at by the kernel but only
- * serves as hint for userspace implementations.
- * @KDBUS_MSG_SIGNAL: Treat this message as signal
- */
-enum kdbus_msg_flags {
- KDBUS_MSG_EXPECT_REPLY = 1ULL << 0,
- KDBUS_MSG_NO_AUTO_START = 1ULL << 1,
- KDBUS_MSG_SIGNAL = 1ULL << 2,
-};
-
-/**
- * enum kdbus_payload_type - type of payload carried by message
- * @KDBUS_PAYLOAD_KERNEL: Kernel-generated simple message
- * @KDBUS_PAYLOAD_DBUS: D-Bus marshalling "DBusDBus"
- *
- * Any payload-type is accepted. Common types will get added here once
- * established.
- */
-enum kdbus_payload_type {
- KDBUS_PAYLOAD_KERNEL,
- KDBUS_PAYLOAD_DBUS = 0x4442757344427573ULL,
-};
-
-/**
- * struct kdbus_msg - the representation of a kdbus message
- * @size: Total size of the message
- * @flags: Message flags (KDBUS_MSG_*), userspace → kernel
- * @priority: Message queue priority value
- * @dst_id: 64-bit ID of the destination connection
- * @src_id: 64-bit ID of the source connection
- * @payload_type: Payload type (KDBUS_PAYLOAD_*)
- * @cookie: Userspace-supplied cookie, for the connection
- * to identify its messages
- * @timeout_ns: The time to wait for a message reply from the peer.
- * If there is no reply, and the send command is
- * executed asynchronously, a kernel-generated message
- * with an attached KDBUS_ITEM_REPLY_TIMEOUT item
- * is sent to @src_id. For synchronously executed send
- * command, the value denotes the maximum time the call
- * blocks to wait for a reply. The timeout is expected in
- * nanoseconds and as absolute CLOCK_MONOTONIC value.
- * @cookie_reply: A reply to the requesting message with the same
- * cookie. The requesting connection can match its
- * request and the reply with this value
- * @items: A list of kdbus_items containing the message payload
- */
-struct kdbus_msg {
- __u64 size;
- __u64 flags;
- __s64 priority;
- __u64 dst_id;
- __u64 src_id;
- __u64 payload_type;
- __u64 cookie;
- union {
- __u64 timeout_ns;
- __u64 cookie_reply;
- };
- struct kdbus_item items[0];
-} __attribute__((__aligned__(8)));
-
-/**
- * struct kdbus_msg_info - returned message container
- * @offset: Offset of kdbus_msg slice in pool
- * @msg_size: Copy of the kdbus_msg.size field
- * @return_flags: Command return flags, kernel → userspace
- */
-struct kdbus_msg_info {
- __u64 offset;
- __u64 msg_size;
- __u64 return_flags;
-} __attribute__((__aligned__(8)));
-
-/**
- * enum kdbus_send_flags - flags for sending messages
- * @KDBUS_SEND_SYNC_REPLY: Wait for destination connection to
- * reply to this message. The
- * KDBUS_CMD_SEND ioctl() will block
- * until the reply is received, and
- * reply in struct kdbus_cmd_send will
- * yield the offset in the sender's pool
- * where the reply can be found.
- * This flag is only valid if
- * @KDBUS_MSG_EXPECT_REPLY is set as well.
- */
-enum kdbus_send_flags {
- KDBUS_SEND_SYNC_REPLY = 1ULL << 0,
-};
-
-/**
- * struct kdbus_cmd_send - send message
- * @size: Overall size of this structure
- * @flags: Flags to change send behavior (KDBUS_SEND_*)
- * @return_flags: Command return flags, kernel → userspace
- * @msg_address: Storage address of the kdbus_msg to send
- * @reply: Storage for message reply if KDBUS_SEND_SYNC_REPLY
- * was given
- * @items: Additional items for this command
- */
-struct kdbus_cmd_send {
- __u64 size;
- __u64 flags;
- __u64 return_flags;
- __u64 msg_address;
- struct kdbus_msg_info reply;
- struct kdbus_item items[0];
-} __attribute__((__aligned__(8)));
-
-/**
- * enum kdbus_recv_flags - flags for de-queuing messages
- * @KDBUS_RECV_PEEK: Return the next queued message without
- * actually de-queuing it, and without installing
- * any file descriptors or other resources. It is
- * usually used to determine the activating
- * connection of a bus name.
- * @KDBUS_RECV_DROP: Drop and free the next queued message and all
- * its resources without actually receiving it.
- * @KDBUS_RECV_USE_PRIORITY: Only de-queue messages with the specified or
- * higher priority (lowest values); if not set,
- * the priority value is ignored.
- */
-enum kdbus_recv_flags {
- KDBUS_RECV_PEEK = 1ULL << 0,
- KDBUS_RECV_DROP = 1ULL << 1,
- KDBUS_RECV_USE_PRIORITY = 1ULL << 2,
-};
-
-/**
- * enum kdbus_recv_return_flags - return flags for message receive commands
- * @KDBUS_RECV_RETURN_INCOMPLETE_FDS: One or more file descriptors could not
- * be installed. These descriptors in
- * KDBUS_ITEM_FDS will carry the value -1.
- * @KDBUS_RECV_RETURN_DROPPED_MSGS: There have been dropped messages since
- * the last time a message was received.
- * The 'dropped_msgs' counter contains the
- * number of messages dropped pool
- * overflows or other missed broadcasts.
- */
-enum kdbus_recv_return_flags {
- KDBUS_RECV_RETURN_INCOMPLETE_FDS = 1ULL << 0,
- KDBUS_RECV_RETURN_DROPPED_MSGS = 1ULL << 1,
-};
-
-/**
- * struct kdbus_cmd_recv - struct to de-queue a buffered message
- * @size: Overall size of this object
- * @flags: KDBUS_RECV_* flags, userspace → kernel
- * @return_flags: Command return flags, kernel → userspace
- * @priority: Minimum priority of the messages to de-queue. Lowest
- * values have the highest priority.
- * @dropped_msgs: In case there were any dropped messages since the last
- * time a message was received, this will be set to the
- * number of lost messages and
- * KDBUS_RECV_RETURN_DROPPED_MSGS will be set in
- * 'return_flags'. This can only happen if the ioctl
- * returns 0 or EAGAIN.
- * @msg: Return storage for received message.
- * @items: Additional items for this command.
- *
- * This struct is used with the KDBUS_CMD_RECV ioctl.
- */
-struct kdbus_cmd_recv {
- __u64 size;
- __u64 flags;
- __u64 return_flags;
- __s64 priority;
- __u64 dropped_msgs;
- struct kdbus_msg_info msg;
- struct kdbus_item items[0];
-} __attribute__((__aligned__(8)));
-
-/**
- * struct kdbus_cmd_free - struct to free a slice of memory in the pool
- * @size: Overall size of this structure
- * @flags: Flags for the free command, userspace → kernel
- * @return_flags: Command return flags, kernel → userspace
- * @offset: The offset of the memory slice, as returned by other
- * ioctls
- * @items: Additional items to modify the behavior
- *
- * This struct is used with the KDBUS_CMD_FREE ioctl.
- */
-struct kdbus_cmd_free {
- __u64 size;
- __u64 flags;
- __u64 return_flags;
- __u64 offset;
- struct kdbus_item items[0];
-} __attribute__((__aligned__(8)));
-
-/**
- * enum kdbus_hello_flags - flags for struct kdbus_cmd_hello
- * @KDBUS_HELLO_ACCEPT_FD: The connection allows the reception of
- * any passed file descriptors
- * @KDBUS_HELLO_ACTIVATOR: Special-purpose connection which registers
- * a well-know name for a process to be started
- * when traffic arrives
- * @KDBUS_HELLO_POLICY_HOLDER: Special-purpose connection which registers
- * policy entries for a name. The provided name
- * is not activated and not registered with the
- * name database, it only allows unprivileged
- * connections to acquire a name, talk or discover
- * a service
- * @KDBUS_HELLO_MONITOR: Special-purpose connection to monitor
- * bus traffic
- */
-enum kdbus_hello_flags {
- KDBUS_HELLO_ACCEPT_FD = 1ULL << 0,
- KDBUS_HELLO_ACTIVATOR = 1ULL << 1,
- KDBUS_HELLO_POLICY_HOLDER = 1ULL << 2,
- KDBUS_HELLO_MONITOR = 1ULL << 3,
-};
-
-/**
- * struct kdbus_cmd_hello - struct to say hello to kdbus
- * @size: The total size of the structure
- * @flags: Connection flags (KDBUS_HELLO_*), userspace → kernel
- * @return_flags: Command return flags, kernel → userspace
- * @attach_flags_send: Mask of metadata to attach to each message sent
- * off by this connection (KDBUS_ATTACH_*)
- * @attach_flags_recv: Mask of metadata to attach to each message receieved
- * by the new connection (KDBUS_ATTACH_*)
- * @bus_flags: The flags field copied verbatim from the original
- * KDBUS_CMD_BUS_MAKE ioctl. It's intended to be useful
- * to do negotiation of features of the payload that is
- * transferred (kernel → userspace)
- * @id: The ID of this connection (kernel → userspace)
- * @pool_size: Size of the connection's buffer where the received
- * messages are placed
- * @offset: Pool offset where items are returned to report
- * additional information about the bus and the newly
- * created connection.
- * @items_size: Size of buffer returned in the pool slice at @offset.
- * @id128: Unique 128-bit ID of the bus (kernel → userspace)
- * @items: A list of items
- *
- * This struct is used with the KDBUS_CMD_HELLO ioctl.
- */
-struct kdbus_cmd_hello {
- __u64 size;
- __u64 flags;
- __u64 return_flags;
- __u64 attach_flags_send;
- __u64 attach_flags_recv;
- __u64 bus_flags;
- __u64 id;
- __u64 pool_size;
- __u64 offset;
- __u64 items_size;
- __u8 id128[16];
- struct kdbus_item items[0];
-} __attribute__((__aligned__(8)));
-
-/**
- * struct kdbus_info - connection information
- * @size: total size of the struct
- * @id: 64bit object ID
- * @flags: object creation flags
- * @items: list of items
- *
- * Note that the user is responsible for freeing the allocated memory with
- * the KDBUS_CMD_FREE ioctl.
- */
-struct kdbus_info {
- __u64 size;
- __u64 id;
- __u64 flags;
- struct kdbus_item items[0];
-} __attribute__((__aligned__(8)));
-
-/**
- * enum kdbus_list_flags - what to include into the returned list
- * @KDBUS_LIST_UNIQUE: active connections
- * @KDBUS_LIST_ACTIVATORS: activator connections
- * @KDBUS_LIST_NAMES: known well-known names
- * @KDBUS_LIST_QUEUED: queued-up names
- */
-enum kdbus_list_flags {
- KDBUS_LIST_UNIQUE = 1ULL << 0,
- KDBUS_LIST_NAMES = 1ULL << 1,
- KDBUS_LIST_ACTIVATORS = 1ULL << 2,
- KDBUS_LIST_QUEUED = 1ULL << 3,
-};
-
-/**
- * struct kdbus_cmd_list - list connections
- * @size: overall size of this object
- * @flags: flags for the query (KDBUS_LIST_*), userspace → kernel
- * @return_flags: command return flags, kernel → userspace
- * @offset: Offset in the caller's pool buffer where an array of
- * kdbus_info objects is stored.
- * The user must use KDBUS_CMD_FREE to free the
- * allocated memory.
- * @list_size: size of returned list in bytes
- * @items: Items for the command. Reserved for future use.
- *
- * This structure is used with the KDBUS_CMD_LIST ioctl.
- */
-struct kdbus_cmd_list {
- __u64 size;
- __u64 flags;
- __u64 return_flags;
- __u64 offset;
- __u64 list_size;
- struct kdbus_item items[0];
-} __attribute__((__aligned__(8)));
-
-/**
- * struct kdbus_cmd_info - struct used for KDBUS_CMD_CONN_INFO ioctl
- * @size: The total size of the struct
- * @flags: Flags for this ioctl, userspace → kernel
- * @return_flags: Command return flags, kernel → userspace
- * @id: The 64-bit ID of the connection. If set to zero, passing
- * @name is required. kdbus will look up the name to
- * determine the ID in this case.
- * @attach_flags: Set of attach flags to specify the set of information
- * to receive, userspace → kernel
- * @offset: Returned offset in the caller's pool buffer where the
- * kdbus_info struct result is stored. The user must
- * use KDBUS_CMD_FREE to free the allocated memory.
- * @info_size: Output buffer to report size of data at @offset.
- * @items: The optional item list, containing the
- * well-known name to look up as a KDBUS_ITEM_NAME.
- * Only needed in case @id is zero.
- *
- * On success, the KDBUS_CMD_CONN_INFO ioctl will return 0 and @offset will
- * tell the user the offset in the connection pool buffer at which to find the
- * result in a struct kdbus_info.
- */
-struct kdbus_cmd_info {
- __u64 size;
- __u64 flags;
- __u64 return_flags;
- __u64 id;
- __u64 attach_flags;
- __u64 offset;
- __u64 info_size;
- struct kdbus_item items[0];
-} __attribute__((__aligned__(8)));
-
-/**
- * enum kdbus_cmd_match_flags - flags to control the KDBUS_CMD_MATCH_ADD ioctl
- * @KDBUS_MATCH_REPLACE: If entries with the supplied cookie already
- * exists, remove them before installing the new
- * matches.
- */
-enum kdbus_cmd_match_flags {
- KDBUS_MATCH_REPLACE = 1ULL << 0,
-};
-
-/**
- * struct kdbus_cmd_match - struct to add or remove matches
- * @size: The total size of the struct
- * @flags: Flags for match command (KDBUS_MATCH_*),
- * userspace → kernel
- * @return_flags: Command return flags, kernel → userspace
- * @cookie: Userspace supplied cookie. When removing, the cookie
- * identifies the match to remove
- * @items: A list of items for additional information
- *
- * This structure is used with the KDBUS_CMD_MATCH_ADD and
- * KDBUS_CMD_MATCH_REMOVE ioctl.
- */
-struct kdbus_cmd_match {
- __u64 size;
- __u64 flags;
- __u64 return_flags;
- __u64 cookie;
- struct kdbus_item items[0];
-} __attribute__((__aligned__(8)));
-
-/**
- * enum kdbus_make_flags - Flags for KDBUS_CMD_{BUS,ENDPOINT}_MAKE
- * @KDBUS_MAKE_ACCESS_GROUP: Make the bus or endpoint node group-accessible
- * @KDBUS_MAKE_ACCESS_WORLD: Make the bus or endpoint node world-accessible
- */
-enum kdbus_make_flags {
- KDBUS_MAKE_ACCESS_GROUP = 1ULL << 0,
- KDBUS_MAKE_ACCESS_WORLD = 1ULL << 1,
-};
-
-/**
- * enum kdbus_name_flags - flags for KDBUS_CMD_NAME_ACQUIRE
- * @KDBUS_NAME_REPLACE_EXISTING: Try to replace name of other connections
- * @KDBUS_NAME_ALLOW_REPLACEMENT: Allow the replacement of the name
- * @KDBUS_NAME_QUEUE: Name should be queued if busy
- * @KDBUS_NAME_IN_QUEUE: Name is queued
- * @KDBUS_NAME_ACTIVATOR: Name is owned by a activator connection
- */
-enum kdbus_name_flags {
- KDBUS_NAME_REPLACE_EXISTING = 1ULL << 0,
- KDBUS_NAME_ALLOW_REPLACEMENT = 1ULL << 1,
- KDBUS_NAME_QUEUE = 1ULL << 2,
- KDBUS_NAME_IN_QUEUE = 1ULL << 3,
- KDBUS_NAME_ACTIVATOR = 1ULL << 4,
-};
-
-/**
- * struct kdbus_cmd - generic ioctl payload
- * @size: Overall size of this structure
- * @flags: Flags for this ioctl, userspace → kernel
- * @return_flags: Ioctl return flags, kernel → userspace
- * @items: Additional items to modify the behavior
- *
- * This is a generic ioctl payload object. It's used by all ioctls that only
- * take flags and items as input.
- */
-struct kdbus_cmd {
- __u64 size;
- __u64 flags;
- __u64 return_flags;
- struct kdbus_item items[0];
-} __attribute__((__aligned__(8)));
-
-/**
- * Ioctl API
- *
- * KDBUS_CMD_BUS_MAKE: After opening the "control" node, this command
- * creates a new bus with the specified
- * name. The bus is immediately shut down and
- * cleaned up when the opened file descriptor is
- * closed.
- *
- * KDBUS_CMD_ENDPOINT_MAKE: Creates a new named special endpoint to talk to
- * the bus. Such endpoints usually carry a more
- * restrictive policy and grant restricted access
- * to specific applications.
- * KDBUS_CMD_ENDPOINT_UPDATE: Update the properties of a custom enpoint. Used
- * to update the policy.
- *
- * KDBUS_CMD_HELLO: By opening the bus node, a connection is
- * created. After a HELLO the opened connection
- * becomes an active peer on the bus.
- * KDBUS_CMD_UPDATE: Update the properties of a connection. Used to
- * update the metadata subscription mask and
- * policy.
- * KDBUS_CMD_BYEBYE: Disconnect a connection. If there are no
- * messages queued up in the connection's pool,
- * the call succeeds, and the handle is rendered
- * unusable. Otherwise, -EBUSY is returned without
- * any further side-effects.
- * KDBUS_CMD_FREE: Release the allocated memory in the receiver's
- * pool.
- * KDBUS_CMD_CONN_INFO: Retrieve credentials and properties of the
- * initial creator of the connection. The data was
- * stored at registration time and does not
- * necessarily represent the connected process or
- * the actual state of the process.
- * KDBUS_CMD_BUS_CREATOR_INFO: Retrieve information of the creator of the bus
- * a connection is attached to.
- *
- * KDBUS_CMD_SEND: Send a message and pass data from userspace to
- * the kernel.
- * KDBUS_CMD_RECV: Receive a message from the kernel which is
- * placed in the receiver's pool.
- *
- * KDBUS_CMD_NAME_ACQUIRE: Request a well-known bus name to associate with
- * the connection. Well-known names are used to
- * address a peer on the bus.
- * KDBUS_CMD_NAME_RELEASE: Release a well-known name the connection
- * currently owns.
- * KDBUS_CMD_LIST: Retrieve the list of all currently registered
- * well-known and unique names.
- *
- * KDBUS_CMD_MATCH_ADD: Install a match which broadcast messages should
- * be delivered to the connection.
- * KDBUS_CMD_MATCH_REMOVE: Remove a current match for broadcast messages.
- */
-enum kdbus_ioctl_type {
- /* bus owner (00-0f) */
- KDBUS_CMD_BUS_MAKE = _IOW(KDBUS_IOCTL_MAGIC, 0x00,
- struct kdbus_cmd),
-
- /* endpoint owner (10-1f) */
- KDBUS_CMD_ENDPOINT_MAKE = _IOW(KDBUS_IOCTL_MAGIC, 0x10,
- struct kdbus_cmd),
- KDBUS_CMD_ENDPOINT_UPDATE = _IOW(KDBUS_IOCTL_MAGIC, 0x11,
- struct kdbus_cmd),
-
- /* connection owner (80-ff) */
- KDBUS_CMD_HELLO = _IOWR(KDBUS_IOCTL_MAGIC, 0x80,
- struct kdbus_cmd_hello),
- KDBUS_CMD_UPDATE = _IOW(KDBUS_IOCTL_MAGIC, 0x81,
- struct kdbus_cmd),
- KDBUS_CMD_BYEBYE = _IOW(KDBUS_IOCTL_MAGIC, 0x82,
- struct kdbus_cmd),
- KDBUS_CMD_FREE = _IOW(KDBUS_IOCTL_MAGIC, 0x83,
- struct kdbus_cmd_free),
- KDBUS_CMD_CONN_INFO = _IOR(KDBUS_IOCTL_MAGIC, 0x84,
- struct kdbus_cmd_info),
- KDBUS_CMD_BUS_CREATOR_INFO = _IOR(KDBUS_IOCTL_MAGIC, 0x85,
- struct kdbus_cmd_info),
- KDBUS_CMD_LIST = _IOR(KDBUS_IOCTL_MAGIC, 0x86,
- struct kdbus_cmd_list),
-
- KDBUS_CMD_SEND = _IOW(KDBUS_IOCTL_MAGIC, 0x90,
- struct kdbus_cmd_send),
- KDBUS_CMD_RECV = _IOR(KDBUS_IOCTL_MAGIC, 0x91,
- struct kdbus_cmd_recv),
-
- KDBUS_CMD_NAME_ACQUIRE = _IOW(KDBUS_IOCTL_MAGIC, 0xa0,
- struct kdbus_cmd),
- KDBUS_CMD_NAME_RELEASE = _IOW(KDBUS_IOCTL_MAGIC, 0xa1,
- struct kdbus_cmd),
-
- KDBUS_CMD_MATCH_ADD = _IOW(KDBUS_IOCTL_MAGIC, 0xb0,
- struct kdbus_cmd_match),
- KDBUS_CMD_MATCH_REMOVE = _IOW(KDBUS_IOCTL_MAGIC, 0xb1,
- struct kdbus_cmd_match),
-};
-
-#endif /* _UAPI_KDBUS_H_ */
diff --git a/src/libsystemd/sd-bus/sd-bus.c b/src/libsystemd/sd-bus/sd-bus.c
index 2f065c2657..40b6c468c9 100644
--- a/src/libsystemd/sd-bus/sd-bus.c
+++ b/src/libsystemd/sd-bus/sd-bus.c
@@ -131,17 +131,12 @@ static void bus_free(sd_bus *b) {
bus_close_fds(b);
- if (b->kdbus_buffer)
- munmap(b->kdbus_buffer, KDBUS_POOL_SIZE);
-
free(b->label);
free(b->rbuffer);
free(b->unique_name);
free(b->auth_buffer);
free(b->address);
- free(b->kernel);
free(b->machine);
- free(b->fake_label);
free(b->cgroup_root);
free(b->description);
@@ -165,7 +160,7 @@ static void bus_free(sd_bus *b) {
assert(hashmap_isempty(b->nodes));
hashmap_free(b->nodes);
- bus_kernel_flush_memfd(b);
+ bus_flush_memfd(b);
assert_se(pthread_mutex_destroy(&b->memfd_cache_mutex) == 0);
@@ -187,7 +182,7 @@ _public_ int sd_bus_new(sd_bus **ret) {
r->creds_mask |= SD_BUS_CREDS_WELL_KNOWN_NAMES|SD_BUS_CREDS_UNIQUE_NAME;
r->hello_flags |= KDBUS_HELLO_ACCEPT_FD;
r->attach_flags |= KDBUS_ATTACH_NAMES;
- r->original_pid = getpid();
+ r->original_pid = getpid_cached();
assert_se(pthread_mutex_init(&r->memfd_cache_mutex, NULL) == 0);
@@ -300,8 +295,6 @@ _public_ int sd_bus_negotiate_timestamp(sd_bus *bus, int b) {
return 0;
bus->attach_flags = new_flags;
- if (bus->state != BUS_UNSET && bus->is_kernel)
- bus_kernel_realize_attach_flags(bus);
return 0;
}
@@ -325,8 +318,6 @@ _public_ int sd_bus_negotiate_creds(sd_bus *bus, int b, uint64_t mask) {
return 0;
bus->attach_flags = new_flags;
- if (bus->state != BUS_UNSET && bus->is_kernel)
- bus_kernel_realize_attach_flags(bus);
return 0;
}
@@ -420,7 +411,7 @@ static int bus_send_hello(sd_bus *bus) {
assert(bus);
- if (!bus->bus_client || bus->is_kernel)
+ if (!bus->bus_client)
return 0;
r = sd_bus_message_new_method_call(
@@ -439,7 +430,7 @@ static int bus_send_hello(sd_bus *bus) {
int bus_start_running(sd_bus *bus) {
assert(bus);
- if (bus->bus_client && !bus->is_kernel) {
+ if (bus->bus_client) {
bus->state = BUS_HELLO;
return 1;
}
@@ -755,43 +746,6 @@ fail:
return r;
}
-static int parse_kernel_address(sd_bus *b, const char **p, char **guid) {
- _cleanup_free_ char *path = NULL;
- int r;
-
- assert(b);
- assert(p);
- assert(*p);
- assert(guid);
-
- while (**p != 0 && **p != ';') {
- r = parse_address_key(p, "guid", guid);
- if (r < 0)
- return r;
- else if (r > 0)
- continue;
-
- r = parse_address_key(p, "path", &path);
- if (r < 0)
- return r;
- else if (r > 0)
- continue;
-
- skip_address_key(p);
- }
-
- if (!path)
- return -EINVAL;
-
- free(b->kernel);
- b->kernel = path;
- path = NULL;
-
- b->is_local = true;
-
- return 0;
-}
-
static int parse_container_unix_address(sd_bus *b, const char **p, char **guid) {
_cleanup_free_ char *machine = NULL, *pid = NULL;
int r;
@@ -852,67 +806,6 @@ static int parse_container_unix_address(sd_bus *b, const char **p, char **guid)
return 0;
}
-static int parse_container_kernel_address(sd_bus *b, const char **p, char **guid) {
- _cleanup_free_ char *machine = NULL, *pid = NULL;
- int r;
-
- assert(b);
- assert(p);
- assert(*p);
- assert(guid);
-
- while (**p != 0 && **p != ';') {
- r = parse_address_key(p, "guid", guid);
- if (r < 0)
- return r;
- else if (r > 0)
- continue;
-
- r = parse_address_key(p, "machine", &machine);
- if (r < 0)
- return r;
- else if (r > 0)
- continue;
-
- r = parse_address_key(p, "pid", &pid);
- if (r < 0)
- return r;
- else if (r > 0)
- continue;
-
- skip_address_key(p);
- }
-
- if (!machine == !pid)
- return -EINVAL;
-
- if (machine) {
- if (!machine_name_is_valid(machine))
- return -EINVAL;
-
- free(b->machine);
- b->machine = machine;
- machine = NULL;
- } else {
- b->machine = mfree(b->machine);
- }
-
- if (pid) {
- r = parse_pid(pid, &b->nspid);
- if (r < 0)
- return r;
- } else
- b->nspid = 0;
-
- r = free_and_strdup(&b->kernel, "/sys/fs/kdbus/0-system/bus");
- if (r < 0)
- return r;
-
- b->is_local = false;
-
- return 0;
-}
-
static void bus_reset_parsed_address(sd_bus *b) {
assert(b);
@@ -921,7 +814,6 @@ static void bus_reset_parsed_address(sd_bus *b) {
b->exec_argv = strv_free(b->exec_argv);
b->exec_path = mfree(b->exec_path);
b->server_id = SD_ID128_NULL;
- b->kernel = mfree(b->kernel);
b->machine = mfree(b->machine);
b->nspid = 0;
}
@@ -975,14 +867,6 @@ static int bus_parse_next_address(sd_bus *b) {
break;
- } else if (startswith(a, "kernel:")) {
-
- a += 7;
- r = parse_kernel_address(b, &a, &guid);
- if (r < 0)
- return r;
-
- break;
} else if (startswith(a, "x-machine-unix:")) {
a += 15;
@@ -991,14 +875,6 @@ static int bus_parse_next_address(sd_bus *b) {
return r;
break;
- } else if (startswith(a, "x-machine-kernel:")) {
-
- a += 17;
- r = parse_container_kernel_address(b, &a, &guid);
- if (r < 0)
- return r;
-
- break;
}
a = strchr(a, ';');
@@ -1017,68 +893,43 @@ static int bus_parse_next_address(sd_bus *b) {
}
static int bus_start_address(sd_bus *b) {
- bool container_kdbus_available = false;
- bool kdbus_available = false;
int r;
assert(b);
for (;;) {
- bool skipped = false;
-
bus_close_fds(b);
- /*
- * Usually, if you provide multiple different bus-addresses, we
- * try all of them in order. We use the first one that
- * succeeds. However, if you mix kernel and unix addresses, we
- * never try unix-addresses if a previous kernel address was
- * tried and kdbus was available. This is required to prevent
- * clients to fallback to the bus-proxy if kdbus is available
- * but failed (eg., too many connections).
- */
+ /* If you provide multiple different bus-addresses, we
+ * try all of them in order and use the first one that
+ * succeeds. */
if (b->exec_path)
r = bus_socket_exec(b);
- else if ((b->nspid > 0 || b->machine) && b->kernel) {
- r = bus_container_connect_kernel(b);
- if (r < 0 && !IN_SET(r, -ENOENT, -ESOCKTNOSUPPORT))
- container_kdbus_available = true;
-
- } else if ((b->nspid > 0 || b->machine) && b->sockaddr.sa.sa_family != AF_UNSPEC) {
- if (!container_kdbus_available)
- r = bus_container_connect_socket(b);
- else
- skipped = true;
-
- } else if (b->kernel) {
- r = bus_kernel_connect(b);
- if (r < 0 && !IN_SET(r, -ENOENT, -ESOCKTNOSUPPORT))
- kdbus_available = true;
-
- } else if (b->sockaddr.sa.sa_family != AF_UNSPEC) {
- if (!kdbus_available)
- r = bus_socket_connect(b);
- else
- skipped = true;
- } else
- skipped = true;
- if (!skipped) {
- if (r >= 0) {
- r = attach_io_events(b);
- if (r >= 0)
- return r;
- }
+ else if ((b->nspid > 0 || b->machine) && b->sockaddr.sa.sa_family != AF_UNSPEC)
+ r = bus_container_connect_socket(b);
+
+ else if (b->sockaddr.sa.sa_family != AF_UNSPEC)
+ r = bus_socket_connect(b);
- b->last_connect_error = -r;
+ else
+ goto next;
+
+ if (r >= 0) {
+ r = attach_io_events(b);
+ if (r >= 0)
+ return r;
}
+ b->last_connect_error = -r;
+
+ next:
r = bus_parse_next_address(b);
if (r < 0)
return r;
if (r == 0)
- return b->last_connect_error ? -b->last_connect_error : -ECONNREFUSED;
+ return b->last_connect_error > 0 ? -b->last_connect_error : -ECONNREFUSED;
}
}
@@ -1118,10 +969,7 @@ static int bus_start_fd(sd_bus *b) {
if (fstat(b->input_fd, &st) < 0)
return -errno;
- if (S_ISCHR(b->input_fd))
- return bus_kernel_take_fd(b);
- else
- return bus_socket_take_fd(b);
+ return bus_socket_take_fd(b);
}
_public_ int sd_bus_start(sd_bus *bus) {
@@ -1138,7 +986,7 @@ _public_ int sd_bus_start(sd_bus *bus) {
if (bus->input_fd >= 0)
r = bus_start_fd(bus);
- else if (bus->address || bus->sockaddr.sa.sa_family != AF_UNSPEC || bus->exec_path || bus->kernel || bus->machine)
+ else if (bus->address || bus->sockaddr.sa.sa_family != AF_UNSPEC || bus->exec_path || bus->machine)
r = bus_start_address(bus);
else
return -EINVAL;
@@ -1256,8 +1104,7 @@ fail:
int bus_set_address_user(sd_bus *b) {
const char *e;
- uid_t uid;
- int r;
+ _cleanup_free_ char *ee = NULL, *s = NULL;
assert(b);
@@ -1265,25 +1112,20 @@ int bus_set_address_user(sd_bus *b) {
if (e)
return sd_bus_set_address(b, e);
- r = cg_pid_get_owner_uid(0, &uid);
- if (r < 0)
- uid = getuid();
-
e = secure_getenv("XDG_RUNTIME_DIR");
- if (e) {
- _cleanup_free_ char *ee = NULL;
-
- ee = bus_address_escape(e);
- if (!ee)
- return -ENOMEM;
+ if (!e)
+ return -ENOENT;
- (void) asprintf(&b->address, KERNEL_USER_BUS_ADDRESS_FMT ";" UNIX_USER_BUS_ADDRESS_FMT, uid, ee);
- } else
- (void) asprintf(&b->address, KERNEL_USER_BUS_ADDRESS_FMT, uid);
+ ee = bus_address_escape(e);
+ if (!ee)
+ return -ENOMEM;
- if (!b->address)
+ if (asprintf(&s, UNIX_USER_BUS_ADDRESS_FMT, ee) < 0)
return -ENOMEM;
+ b->address = s;
+ s = NULL;
+
return 0;
}
@@ -1403,7 +1245,7 @@ int bus_set_address_system_machine(sd_bus *b, const char *machine) {
if (!e)
return -ENOMEM;
- b->address = strjoin("x-machine-kernel:machine=", e, ";x-machine-unix:machine=", e);
+ b->address = strjoin("x-machine-unix:machine=", e);
if (!b->address)
return -ENOMEM;
@@ -1460,13 +1302,7 @@ _public_ void sd_bus_close(sd_bus *bus) {
* the bus object and the bus may be freed */
bus_reset_queues(bus);
- if (!bus->is_kernel)
- bus_close_fds(bus);
-
- /* We'll leave the fd open in case this is a kernel bus, since
- * there might still be memblocks around that reference this
- * bus, and they might need to invoke the KDBUS_CMD_FREE
- * ioctl on the fd when they are freed. */
+ bus_close_fds(bus);
}
_public_ sd_bus* sd_bus_flush_close_unref(sd_bus *bus) {
@@ -1594,14 +1430,6 @@ static int bus_remarshal_message(sd_bus *b, sd_bus_message **m) {
if (b->message_endian != 0 && b->message_endian != (*m)->header->endian)
remarshal = true;
- /* TODO: kdbus-messages received from the kernel contain data which is
- * not allowed to be passed to KDBUS_CMD_SEND. Therefore, we have to
- * force remarshaling of the message. Technically, we could just
- * recreate the kdbus message, but that is non-trivial as other parts of
- * the message refer to m->kdbus already. This should be fixed! */
- if ((*m)->kdbus && (*m)->release_kdbus)
- remarshal = true;
-
return remarshal ? bus_message_remarshal(b, m) : 0;
}
@@ -1635,15 +1463,11 @@ static int bus_write_message(sd_bus *bus, sd_bus_message *m, bool hint_sync_call
assert(bus);
assert(m);
- if (bus->is_kernel)
- r = bus_kernel_write_message(bus, m, hint_sync_call);
- else
- r = bus_socket_write_message(bus, m, idx);
-
+ r = bus_socket_write_message(bus, m, idx);
if (r <= 0)
return r;
- if (bus->is_kernel || *idx >= BUS_MESSAGE_SIZE(m))
+ if (*idx >= BUS_MESSAGE_SIZE(m))
log_debug("Sent message type=%s sender=%s destination=%s object=%s interface=%s member=%s cookie=%" PRIu64 " reply_cookie=%" PRIu64 " error=%s",
bus_message_type_to_string(m->header->type),
strna(sd_bus_message_get_sender(m)),
@@ -1672,7 +1496,7 @@ static int dispatch_wqueue(sd_bus *bus) {
else if (r == 0)
/* Didn't do anything this time */
return ret;
- else if (bus->is_kernel || bus->windex >= BUS_MESSAGE_SIZE(bus->wqueue[0])) {
+ else if (bus->windex >= BUS_MESSAGE_SIZE(bus->wqueue[0])) {
/* Fully written. Let's drop the entry from
* the queue.
*
@@ -1698,10 +1522,7 @@ static int dispatch_wqueue(sd_bus *bus) {
static int bus_read_message(sd_bus *bus, bool hint_priority, int64_t priority) {
assert(bus);
- if (bus->is_kernel)
- return bus_kernel_read_message(bus, hint_priority, priority);
- else
- return bus_socket_read_message(bus);
+ return bus_socket_read_message(bus);
}
int bus_rqueue_make_room(sd_bus *bus) {
@@ -1758,7 +1579,6 @@ static int bus_send_internal(sd_bus *bus, sd_bus_message *_m, uint64_t *cookie,
bus = m->bus;
assert_return(!bus_pid_changed(bus), -ECHILD);
- assert_return(!bus->is_kernel || !(bus->hello_flags & KDBUS_HELLO_MONITOR), -EROFS);
if (!BUS_IS_OPEN(bus->state))
return -ENOTCONN;
@@ -1804,7 +1624,7 @@ static int bus_send_internal(sd_bus *bus, sd_bus_message *_m, uint64_t *cookie,
return r;
}
- if (!bus->is_kernel && idx < BUS_MESSAGE_SIZE(m)) {
+ if (idx < BUS_MESSAGE_SIZE(m)) {
/* Wasn't fully written. So let's remember how
* much was written. Note that the first entry
* of the wqueue array is always allocated so
@@ -1910,7 +1730,6 @@ _public_ int sd_bus_call_async(
bus = m->bus;
assert_return(!bus_pid_changed(bus), -ECHILD);
- assert_return(!bus->is_kernel || !(bus->hello_flags & KDBUS_HELLO_MONITOR), -EROFS);
if (!BUS_IS_OPEN(bus->state))
return -ENOTCONN;
@@ -2011,7 +1830,6 @@ _public_ int sd_bus_call(
bus = m->bus;
bus_assert_return(!bus_pid_changed(bus), -ECHILD, error);
- bus_assert_return(!bus->is_kernel || !(bus->hello_flags & KDBUS_HELLO_MONITOR), -EROFS, error);
if (!BUS_IS_OPEN(bus->state)) {
r = -ENOTCONN;
@@ -2330,9 +2148,6 @@ static int process_reply(sd_bus *bus, sd_bus_message *m) {
m->header->type != SD_BUS_MESSAGE_METHOD_ERROR)
return 0;
- if (bus->is_kernel && (bus->hello_flags & KDBUS_HELLO_MONITOR))
- return 0;
-
if (m->destination && bus->unique_name && !streq_ptr(m->destination, bus->unique_name))
return 0;
@@ -3054,20 +2869,16 @@ _public_ int sd_bus_add_match(
scope = bus_match_get_scope(components, n_components);
/* Do not install server-side matches for matches
- * against the local service, interface or bus
- * path. */
+ * against the local service, interface or bus path. */
if (scope != BUS_MATCH_LOCAL) {
- if (!bus->is_kernel) {
- /* When this is not a kernel transport, we
- * store the original match string, so that we
- * can use it to remove the match again */
+ /* We store the original match string, so that
+ * we can use it to remove the match again. */
- s->match_callback.match_string = strdup(match);
- if (!s->match_callback.match_string) {
- r = -ENOMEM;
- goto finish;
- }
+ s->match_callback.match_string = strdup(match);
+ if (!s->match_callback.match_string) {
+ r = -ENOMEM;
+ goto finish;
}
r = bus_add_match_internal(bus, s->match_callback.match_string, components, n_components, s->match_callback.cookie);
@@ -3131,7 +2942,7 @@ bool bus_pid_changed(sd_bus *bus) {
/* We don't support people creating a bus connection and
* keeping it around over a fork(). Let's complain. */
- return bus->original_pid != getpid();
+ return bus->original_pid != getpid_cached();
}
static int io_callback(sd_event_source *s, int fd, uint32_t revents, void *userdata) {
@@ -3683,29 +3494,10 @@ _public_ int sd_bus_path_decode_many(const char *path, const char *path_template
}
_public_ int sd_bus_try_close(sd_bus *bus) {
- int r;
-
assert_return(bus, -EINVAL);
assert_return(!bus_pid_changed(bus), -ECHILD);
- if (!bus->is_kernel)
- return -EOPNOTSUPP;
-
- if (!BUS_IS_OPEN(bus->state))
- return -ENOTCONN;
-
- if (bus->rqueue_size > 0)
- return -EBUSY;
-
- if (bus->wqueue_size > 0)
- return -EBUSY;
-
- r = bus_kernel_try_close(bus);
- if (r < 0)
- return r;
-
- sd_bus_close(bus);
- return 0;
+ return -EOPNOTSUPP;
}
_public_ int sd_bus_get_description(sd_bus *bus, const char **description) {
@@ -3737,32 +3529,10 @@ int bus_get_root_path(sd_bus *bus) {
}
_public_ int sd_bus_get_scope(sd_bus *bus, const char **scope) {
- int r;
-
assert_return(bus, -EINVAL);
assert_return(scope, -EINVAL);
assert_return(!bus_pid_changed(bus), -ECHILD);
- if (bus->is_kernel) {
- _cleanup_free_ char *n = NULL;
- const char *dash;
-
- r = bus_kernel_get_bus_name(bus, &n);
- if (r < 0)
- return r;
-
- if (streq(n, "0-system")) {
- *scope = "system";
- return 0;
- }
-
- dash = strchr(n, '-');
- if (streq_ptr(dash, "-user")) {
- *scope = "user";
- return 0;
- }
- }
-
if (bus->is_user) {
*scope = "user";
return 0;
diff --git a/src/libsystemd/sd-bus/test-bus-benchmark.c b/src/libsystemd/sd-bus/test-bus-benchmark.c
index 56ac2ab3dd..6f0ca47df6 100644
--- a/src/libsystemd/sd-bus/test-bus-benchmark.c
+++ b/src/libsystemd/sd-bus/test-bus-benchmark.c
@@ -35,7 +35,6 @@
static usec_t arg_loop_usec = 100 * USEC_PER_MSEC;
typedef enum Type {
- TYPE_KDBUS,
TYPE_LEGACY,
TYPE_DIRECT,
} Type;
@@ -190,9 +189,6 @@ static void client_chart(Type type, const char *address, const char *server_name
assert_se(r >= 0);
switch (type) {
- case TYPE_KDBUS:
- printf("SIZE\tCOPY\tMEMFD\n");
- break;
case TYPE_LEGACY:
printf("SIZE\tLEGACY\n");
break;
@@ -203,25 +199,10 @@ static void client_chart(Type type, const char *address, const char *server_name
for (csize = 1; csize <= MAX_SIZE; csize *= 2) {
usec_t t;
- unsigned n_copying, n_memfd;
+ unsigned n_memfd;
printf("%zu\t", csize);
- if (type == TYPE_KDBUS) {
- b->use_memfd = 0;
-
- t = now(CLOCK_MONOTONIC);
- for (n_copying = 0;; n_copying++) {
- transaction(b, csize, server_name);
- if (now(CLOCK_MONOTONIC) >= t + arg_loop_usec)
- break;
- }
-
- printf("%u\t", (unsigned) ((n_copying * USEC_PER_SEC) / arg_loop_usec));
-
- b->use_memfd = -1;
- }
-
t = now(CLOCK_MONOTONIC);
for (n_memfd = 0;; n_memfd++) {
transaction(b, csize, server_name);
@@ -245,7 +226,7 @@ int main(int argc, char *argv[]) {
MODE_BISECT,
MODE_CHART,
} mode = MODE_BISECT;
- Type type = TYPE_KDBUS;
+ Type type = TYPE_LEGACY;
int i, pair[2] = { -1, -1 };
_cleanup_free_ char *name = NULL, *bus_name = NULL, *address = NULL, *server_name = NULL;
_cleanup_close_ int bus_ref = -1;
@@ -271,22 +252,9 @@ int main(int argc, char *argv[]) {
assert_se(parse_sec(argv[i], &arg_loop_usec) >= 0);
}
- assert_se(!MODE_BISECT || TYPE_KDBUS);
-
assert_se(arg_loop_usec > 0);
- if (type == TYPE_KDBUS) {
- assert_se(asprintf(&name, "deine-mutter-%u", (unsigned) getpid()) >= 0);
-
- bus_ref = bus_kernel_create_bus(name, false, &bus_name);
- if (bus_ref == -ENOENT)
- exit(EXIT_TEST_SKIP);
-
- assert_se(bus_ref >= 0);
-
- address = strappend("kernel:path=", bus_name);
- assert_se(address);
- } else if (type == TYPE_LEGACY) {
+ if (type == TYPE_LEGACY) {
const char *e;
e = secure_getenv("DBUS_SESSION_BUS_ADDRESS");
diff --git a/src/libsystemd/sd-bus/test-bus-kernel-bloom.c b/src/libsystemd/sd-bus/test-bus-kernel-bloom.c
deleted file mode 100644
index eb6179d7d2..0000000000
--- a/src/libsystemd/sd-bus/test-bus-kernel-bloom.c
+++ /dev/null
@@ -1,141 +0,0 @@
-/***
- This file is part of systemd.
-
- Copyright 2013 Lennart Poettering
-
- systemd is free software; you can redistribute it and/or modify it
- under the terms of the GNU Lesser General Public License as published by
- the Free Software Foundation; either version 2.1 of the License, or
- (at your option) any later version.
-
- systemd is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public License
- along with systemd; If not, see <http://www.gnu.org/licenses/>.
-***/
-
-#include "sd-bus.h"
-
-#include "alloc-util.h"
-#include "bus-kernel.h"
-#include "bus-util.h"
-#include "fd-util.h"
-#include "log.h"
-#include "util.h"
-
-static int test_match(sd_bus_message *m, void *userdata, sd_bus_error *ret_error) {
- int *found = userdata;
-
- *found = 1;
-
- return 0;
-}
-
-static void test_one(
- const char *path,
- const char *interface,
- const char *member,
- bool as_list,
- const char *arg0,
- const char *match,
- bool good) {
-
- _cleanup_close_ int bus_ref = -1;
- _cleanup_free_ char *name = NULL, *bus_name = NULL, *address = NULL;
- _cleanup_(sd_bus_message_unrefp) sd_bus_message *m = NULL;
- sd_bus *a, *b;
- int r, found = 0;
-
- assert_se(asprintf(&name, "deine-mutter-%u", (unsigned) getpid()) >= 0);
-
- bus_ref = bus_kernel_create_bus(name, false, &bus_name);
- if (bus_ref == -ENOENT)
- exit(EXIT_TEST_SKIP);
-
- assert_se(bus_ref >= 0);
-
- address = strappend("kernel:path=", bus_name);
- assert_se(address);
-
- r = sd_bus_new(&a);
- assert_se(r >= 0);
-
- r = sd_bus_new(&b);
- assert_se(r >= 0);
-
- r = sd_bus_set_address(a, address);
- assert_se(r >= 0);
-
- r = sd_bus_set_address(b, address);
- assert_se(r >= 0);
-
- r = sd_bus_start(a);
- assert_se(r >= 0);
-
- r = sd_bus_start(b);
- assert_se(r >= 0);
-
- log_debug("match");
- r = sd_bus_add_match(b, NULL, match, test_match, &found);
- assert_se(r >= 0);
-
- log_debug("signal");
-
- if (as_list)
- r = sd_bus_emit_signal(a, path, interface, member, "as", 1, arg0);
- else
- r = sd_bus_emit_signal(a, path, interface, member, "s", arg0);
- assert_se(r >= 0);
-
- r = sd_bus_process(b, &m);
- assert_se(r >= 0 && good == !!found);
-
- sd_bus_unref(a);
- sd_bus_unref(b);
-}
-
-int main(int argc, char *argv[]) {
- log_set_max_level(LOG_DEBUG);
-
- test_one("/foo/bar/waldo", "waldo.com", "Piep", false, "foobar", "", true);
- test_one("/foo/bar/waldo", "waldo.com", "Piep", false, "foobar", "path='/foo/bar/waldo'", true);
- test_one("/foo/bar/waldo", "waldo.com", "Piep", false, "foobar", "path='/foo/bar/waldo/tuut'", false);
- test_one("/foo/bar/waldo", "waldo.com", "Piep", false, "foobar", "interface='waldo.com'", true);
- test_one("/foo/bar/waldo", "waldo.com", "Piep", false, "foobar", "member='Piep'", true);
- test_one("/foo/bar/waldo", "waldo.com", "Piep", false, "foobar", "member='Pi_ep'", false);
- test_one("/foo/bar/waldo", "waldo.com", "Piep", false, "foobar", "arg0='foobar'", true);
- test_one("/foo/bar/waldo", "waldo.com", "Piep", false, "foobar", "arg0='foo_bar'", false);
- test_one("/foo/bar/waldo", "waldo.com", "Piep", true, "foobar", "arg0='foobar'", false);
- test_one("/foo/bar/waldo", "waldo.com", "Piep", true, "foobar", "arg0='foo_bar'", false);
- test_one("/foo/bar/waldo", "waldo.com", "Piep", true, "foobar", "arg0has='foobar'", true);
- test_one("/foo/bar/waldo", "waldo.com", "Piep", true, "foobar", "arg0has='foo_bar'", false);
- test_one("/foo/bar/waldo", "waldo.com", "Piep", false, "foobar", "path='/foo/bar/waldo',interface='waldo.com',member='Piep',arg0='foobar'", true);
- test_one("/foo/bar/waldo", "waldo.com", "Piep", false, "foobar", "path='/foo/bar/waldo',interface='waldo.com',member='Piep',arg0='foobar2'", false);
-
- test_one("/foo/bar/waldo", "waldo.com", "Piep", false, "foobar", "path='/foo/bar/waldo'", true);
- test_one("/foo/bar/waldo", "waldo.com", "Piep", false, "foobar", "path='/foo/bar'", false);
- test_one("/foo/bar/waldo", "waldo.com", "Piep", false, "foobar", "path='/foo'", false);
- test_one("/foo/bar/waldo", "waldo.com", "Piep", false, "foobar", "path='/'", false);
- test_one("/foo/bar/waldo", "waldo.com", "Piep", false, "foobar", "path='/foo/bar/waldo/quux'", false);
- test_one("/foo/bar/waldo", "waldo.com", "Piep", false, "foobar", "path_namespace='/foo/bar/waldo'", true);
- test_one("/foo/bar/waldo", "waldo.com", "Piep", false, "foobar", "path_namespace='/foo/bar'", true);
- test_one("/foo/bar/waldo", "waldo.com", "Piep", false, "foobar", "path_namespace='/foo'", true);
- test_one("/foo/bar/waldo", "waldo.com", "Piep", false, "foobar", "path_namespace='/'", true);
- test_one("/foo/bar/waldo", "waldo.com", "Piep", false, "foobar", "path_namespace='/quux'", false);
- test_one("/", "waldo.com", "Piep", false, "foobar", "path_namespace='/'", true);
-
- test_one("/foo/bar/waldo", "waldo.com", "Piep", false, "foobar", "path='/foo/bar/waldo/'", false);
- test_one("/foo/bar/waldo", "waldo.com", "Piep", false, "foobar", "path='/foo/'", false);
- test_one("/foo/bar/waldo", "waldo.com", "Piep", false, "foobar", "path_namespace='/foo/bar/waldo/'", false);
- test_one("/foo/bar/waldo", "waldo.com", "Piep", false, "foobar", "path_namespace='/foo/'", true);
-
- test_one("/foo/bar/waldo", "waldo.com", "Piep", false, "/foo/bar/waldo", "arg0path='/foo/'", true);
- test_one("/foo/bar/waldo", "waldo.com", "Piep", false, "/foo", "arg0path='/foo'", true);
- test_one("/foo/bar/waldo", "waldo.com", "Piep", false, "/foo", "arg0path='/foo/bar/waldo'", false);
- test_one("/foo/bar/waldo", "waldo.com", "Piep", false, "/foo/", "arg0path='/foo/bar/waldo'", true);
-
- return 0;
-}
diff --git a/src/libsystemd/sd-bus/test-bus-kernel.c b/src/libsystemd/sd-bus/test-bus-kernel.c
deleted file mode 100644
index 2214817312..0000000000
--- a/src/libsystemd/sd-bus/test-bus-kernel.c
+++ /dev/null
@@ -1,190 +0,0 @@
-/***
- This file is part of systemd.
-
- Copyright 2013 Lennart Poettering
-
- systemd is free software; you can redistribute it and/or modify it
- under the terms of the GNU Lesser General Public License as published by
- the Free Software Foundation; either version 2.1 of the License, or
- (at your option) any later version.
-
- systemd is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public License
- along with systemd; If not, see <http://www.gnu.org/licenses/>.
-***/
-
-#include <fcntl.h>
-
-#include "sd-bus.h"
-
-#include "alloc-util.h"
-#include "bus-dump.h"
-#include "bus-kernel.h"
-#include "bus-util.h"
-#include "fd-util.h"
-#include "log.h"
-#include "util.h"
-
-int main(int argc, char *argv[]) {
- _cleanup_close_ int bus_ref = -1;
- _cleanup_free_ char *name = NULL, *bus_name = NULL, *address = NULL, *bname = NULL;
- _cleanup_(sd_bus_message_unrefp) sd_bus_message *m = NULL;
- _cleanup_(sd_bus_error_free) sd_bus_error error = SD_BUS_ERROR_NULL;
- const char *ua = NULL, *ub = NULL, *the_string = NULL;
- sd_bus *a, *b;
- int r, pipe_fds[2];
- const char *nn;
-
- log_set_max_level(LOG_DEBUG);
-
- assert_se(asprintf(&name, "deine-mutter-%u", (unsigned) getpid()) >= 0);
-
- bus_ref = bus_kernel_create_bus(name, false, &bus_name);
- if (bus_ref == -ENOENT)
- return EXIT_TEST_SKIP;
-
- assert_se(bus_ref >= 0);
-
- address = strappend("kernel:path=", bus_name);
- assert_se(address);
-
- r = sd_bus_new(&a);
- assert_se(r >= 0);
-
- r = sd_bus_new(&b);
- assert_se(r >= 0);
-
- r = sd_bus_set_description(a, "a");
- assert_se(r >= 0);
-
- r = sd_bus_set_address(a, address);
- assert_se(r >= 0);
-
- r = sd_bus_set_address(b, address);
- assert_se(r >= 0);
-
- assert_se(sd_bus_negotiate_timestamp(a, 1) >= 0);
- assert_se(sd_bus_negotiate_creds(a, true, _SD_BUS_CREDS_ALL) >= 0);
-
- assert_se(sd_bus_negotiate_timestamp(b, 0) >= 0);
- assert_se(sd_bus_negotiate_creds(b, true, 0) >= 0);
-
- r = sd_bus_start(a);
- assert_se(r >= 0);
-
- r = sd_bus_start(b);
- assert_se(r >= 0);
-
- assert_se(sd_bus_negotiate_timestamp(b, 1) >= 0);
- assert_se(sd_bus_negotiate_creds(b, true, _SD_BUS_CREDS_ALL) >= 0);
-
- r = sd_bus_get_unique_name(a, &ua);
- assert_se(r >= 0);
- printf("unique a: %s\n", ua);
-
- r = sd_bus_get_description(a, &nn);
- assert_se(r >= 0);
- printf("name of a: %s\n", nn);
-
- r = sd_bus_get_unique_name(b, &ub);
- assert_se(r >= 0);
- printf("unique b: %s\n", ub);
-
- r = sd_bus_get_description(b, &nn);
- assert_se(r >= 0);
- printf("name of b: %s\n", nn);
-
- assert_se(bus_kernel_get_bus_name(b, &bname) >= 0);
- assert_se(endswith(bname, name));
-
- r = sd_bus_call_method(a, "this.doesnt.exist", "/foo", "meh.mah", "muh", &error, NULL, "s", "yayayay");
- assert_se(sd_bus_error_has_name(&error, SD_BUS_ERROR_SERVICE_UNKNOWN));
- assert_se(r == -EHOSTUNREACH);
-
- r = sd_bus_add_match(b, NULL, "interface='waldo.com',member='Piep'", NULL, NULL);
- assert_se(r >= 0);
-
- r = sd_bus_emit_signal(a, "/foo/bar/waldo", "waldo.com", "Piep", "sss", "I am a string", "/this/is/a/path", "and.this.a.domain.name");
- assert_se(r >= 0);
-
- r = sd_bus_try_close(b);
- assert_se(r == -EBUSY);
-
- r = sd_bus_process_priority(b, -10, &m);
- assert_se(r == 0);
-
- r = sd_bus_process(b, &m);
- assert_se(r > 0);
- assert_se(m);
-
- bus_message_dump(m, stdout, BUS_MESSAGE_DUMP_WITH_HEADER);
- assert_se(sd_bus_message_rewind(m, true) >= 0);
-
- r = sd_bus_message_read(m, "s", &the_string);
- assert_se(r >= 0);
- assert_se(streq(the_string, "I am a string"));
-
- sd_bus_message_unref(m);
- m = NULL;
-
- r = sd_bus_request_name(a, "net.x0pointer.foobar", 0);
- assert_se(r >= 0);
-
- r = sd_bus_message_new_method_call(b, &m, "net.x0pointer.foobar", "/a/path", "an.inter.face", "AMethod");
- assert_se(r >= 0);
-
- assert_se(pipe2(pipe_fds, O_CLOEXEC) >= 0);
-
- assert_se(write(pipe_fds[1], "x", 1) == 1);
-
- pipe_fds[1] = safe_close(pipe_fds[1]);
-
- r = sd_bus_message_append(m, "h", pipe_fds[0]);
- assert_se(r >= 0);
-
- pipe_fds[0] = safe_close(pipe_fds[0]);
-
- r = sd_bus_send(b, m, NULL);
- assert_se(r >= 0);
-
- for (;;) {
- sd_bus_message_unref(m);
- m = NULL;
- r = sd_bus_process(a, &m);
- assert_se(r > 0);
- assert_se(m);
-
- bus_message_dump(m, stdout, BUS_MESSAGE_DUMP_WITH_HEADER);
- assert_se(sd_bus_message_rewind(m, true) >= 0);
-
- if (sd_bus_message_is_method_call(m, "an.inter.face", "AMethod")) {
- int fd;
- char x;
-
- r = sd_bus_message_read(m, "h", &fd);
- assert_se(r >= 0);
-
- assert_se(read(fd, &x, 1) == 1);
- assert_se(x == 'x');
- break;
- }
- }
-
- r = sd_bus_release_name(a, "net.x0pointer.foobar");
- assert_se(r >= 0);
-
- r = sd_bus_release_name(a, "net.x0pointer.foobar");
- assert_se(r == -ESRCH);
-
- r = sd_bus_try_close(a);
- assert_se(r >= 0);
-
- sd_bus_unref(a);
- sd_bus_unref(b);
-
- return 0;
-}
diff --git a/src/libsystemd/sd-bus/test-bus-zero-copy.c b/src/libsystemd/sd-bus/test-bus-zero-copy.c
deleted file mode 100644
index 3380e8500a..0000000000
--- a/src/libsystemd/sd-bus/test-bus-zero-copy.c
+++ /dev/null
@@ -1,210 +0,0 @@
-/***
- This file is part of systemd.
-
- Copyright 2013 Lennart Poettering
-
- systemd is free software; you can redistribute it and/or modify it
- under the terms of the GNU Lesser General Public License as published by
- the Free Software Foundation; either version 2.1 of the License, or
- (at your option) any later version.
-
- systemd is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public License
- along with systemd; If not, see <http://www.gnu.org/licenses/>.
-***/
-
-#include <sys/mman.h>
-
-#include "sd-bus.h"
-
-#include "alloc-util.h"
-#include "bus-dump.h"
-#include "bus-kernel.h"
-#include "bus-message.h"
-#include "fd-util.h"
-#include "log.h"
-#include "memfd-util.h"
-#include "string-util.h"
-#include "util.h"
-
-#define FIRST_ARRAY 17
-#define SECOND_ARRAY 33
-
-#define STRING_SIZE 123
-
-int main(int argc, char *argv[]) {
- _cleanup_free_ char *name = NULL, *bus_name = NULL, *address = NULL;
- const char *unique;
- uint8_t *p;
- sd_bus *a, *b;
- int r, bus_ref;
- sd_bus_message *m;
- int f;
- uint64_t sz;
- uint32_t u32;
- size_t i, l;
- char *s;
- _cleanup_close_ int sfd = -1;
-
- log_set_max_level(LOG_DEBUG);
-
- assert_se(asprintf(&name, "deine-mutter-%u", (unsigned) getpid()) >= 0);
-
- bus_ref = bus_kernel_create_bus(name, false, &bus_name);
- if (bus_ref == -ENOENT)
- return EXIT_TEST_SKIP;
-
- assert_se(bus_ref >= 0);
-
- address = strappend("kernel:path=", bus_name);
- assert_se(address);
-
- r = sd_bus_new(&a);
- assert_se(r >= 0);
-
- r = sd_bus_new(&b);
- assert_se(r >= 0);
-
- r = sd_bus_set_address(a, address);
- assert_se(r >= 0);
-
- r = sd_bus_set_address(b, address);
- assert_se(r >= 0);
-
- r = sd_bus_start(a);
- assert_se(r >= 0);
-
- r = sd_bus_start(b);
- assert_se(r >= 0);
-
- r = sd_bus_get_unique_name(a, &unique);
- assert_se(r >= 0);
-
- r = sd_bus_message_new_method_call(b, &m, unique, "/a/path", "an.inter.face", "AMethod");
- assert_se(r >= 0);
-
- r = sd_bus_message_open_container(m, 'r', "aysay");
- assert_se(r >= 0);
-
- r = sd_bus_message_append_array_space(m, 'y', FIRST_ARRAY, (void**) &p);
- assert_se(r >= 0);
-
- p[0] = '<';
- memset(p+1, 'L', FIRST_ARRAY-2);
- p[FIRST_ARRAY-1] = '>';
-
- f = memfd_new_and_map(NULL, STRING_SIZE, (void**) &s);
- assert_se(f >= 0);
-
- s[0] = '<';
- for (i = 1; i < STRING_SIZE-2; i++)
- s[i] = '0' + (i % 10);
- s[STRING_SIZE-2] = '>';
- s[STRING_SIZE-1] = 0;
- munmap(s, STRING_SIZE);
-
- r = memfd_get_size(f, &sz);
- assert_se(r >= 0);
- assert_se(sz == STRING_SIZE);
-
- r = sd_bus_message_append_string_memfd(m, f, 0, (uint64_t) -1);
- assert_se(r >= 0);
-
- close(f);
-
- f = memfd_new_and_map(NULL, SECOND_ARRAY, (void**) &p);
- assert_se(f >= 0);
-
- p[0] = '<';
- memset(p+1, 'P', SECOND_ARRAY-2);
- p[SECOND_ARRAY-1] = '>';
- munmap(p, SECOND_ARRAY);
-
- r = memfd_get_size(f, &sz);
- assert_se(r >= 0);
- assert_se(sz == SECOND_ARRAY);
-
- r = sd_bus_message_append_array_memfd(m, 'y', f, 0, (uint64_t) -1);
- assert_se(r >= 0);
-
- close(f);
-
- r = sd_bus_message_close_container(m);
- assert_se(r >= 0);
-
- r = sd_bus_message_append(m, "u", 4711);
- assert_se(r >= 0);
-
- assert_se((sfd = memfd_new_and_map(NULL, 6, (void**) &p)) >= 0);
- memcpy(p, "abcd\0", 6);
- munmap(p, 6);
- assert_se(sd_bus_message_append_string_memfd(m, sfd, 1, 4) >= 0);
-
- r = bus_message_seal(m, 55, 99*USEC_PER_SEC);
- assert_se(r >= 0);
-
- bus_message_dump(m, stdout, BUS_MESSAGE_DUMP_WITH_HEADER);
-
- r = sd_bus_send(b, m, NULL);
- assert_se(r >= 0);
-
- sd_bus_message_unref(m);
-
- r = sd_bus_process(a, &m);
- assert_se(r > 0);
-
- bus_message_dump(m, stdout, BUS_MESSAGE_DUMP_WITH_HEADER);
- sd_bus_message_rewind(m, true);
-
- r = sd_bus_message_enter_container(m, 'r', "aysay");
- assert_se(r > 0);
-
- r = sd_bus_message_read_array(m, 'y', (const void**) &p, &l);
- assert_se(r > 0);
- assert_se(l == FIRST_ARRAY);
-
- assert_se(p[0] == '<');
- for (i = 1; i < l-1; i++)
- assert_se(p[i] == 'L');
- assert_se(p[l-1] == '>');
-
- r = sd_bus_message_read(m, "s", &s);
- assert_se(r > 0);
-
- assert_se(s[0] == '<');
- for (i = 1; i < STRING_SIZE-2; i++)
- assert_se(s[i] == (char) ('0' + (i % 10)));
- assert_se(s[STRING_SIZE-2] == '>');
- assert_se(s[STRING_SIZE-1] == 0);
-
- r = sd_bus_message_read_array(m, 'y', (const void**) &p, &l);
- assert_se(r > 0);
- assert_se(l == SECOND_ARRAY);
-
- assert_se(p[0] == '<');
- for (i = 1; i < l-1; i++)
- assert_se(p[i] == 'P');
- assert_se(p[l-1] == '>');
-
- r = sd_bus_message_exit_container(m);
- assert_se(r > 0);
-
- r = sd_bus_message_read(m, "u", &u32);
- assert_se(r > 0);
- assert_se(u32 == 4711);
-
- r = sd_bus_message_read(m, "s", &s);
- assert_se(r > 0);
- assert_se(streq_ptr(s, "bcd"));
-
- sd_bus_message_unref(m);
-
- sd_bus_unref(a);
- sd_bus_unref(b);
-
- return 0;
-}
diff --git a/src/libsystemd/sd-daemon/Makefile b/src/libsystemd/sd-daemon/Makefile
deleted file mode 120000
index d0b0e8e008..0000000000
--- a/src/libsystemd/sd-daemon/Makefile
+++ /dev/null
@@ -1 +0,0 @@
-../Makefile \ No newline at end of file
diff --git a/src/libsystemd/sd-daemon/sd-daemon.c b/src/libsystemd/sd-daemon/sd-daemon.c
index a9a32dd5a2..be1f01112e 100644
--- a/src/libsystemd/sd-daemon/sd-daemon.c
+++ b/src/libsystemd/sd-daemon/sd-daemon.c
@@ -70,7 +70,7 @@ _public_ int sd_listen_fds(int unset_environment) {
goto finish;
/* Is this for us? */
- if (getpid() != pid) {
+ if (getpid_cached() != pid) {
r = 0;
goto finish;
}
@@ -518,7 +518,7 @@ _public_ int sd_pid_notify_with_fds(pid_t pid, int unset_environment, const char
msghdr.msg_namelen = SOCKADDR_UN_LEN(sockaddr.un);
- have_pid = pid != 0 && pid != getpid();
+ have_pid = pid != 0 && pid != getpid_cached();
if (n_fds > 0 || have_pid) {
/* CMSG_SPACE(0) may return value different than zero, which results in miscalculated controllen. */
@@ -659,7 +659,7 @@ _public_ int sd_watchdog_enabled(int unset_environment, uint64_t *usec) {
goto finish;
/* Is this for us? */
- if (getpid() != pid) {
+ if (getpid_cached() != pid) {
r = 0;
goto finish;
}
diff --git a/src/libsystemd/sd-device/Makefile b/src/libsystemd/sd-device/Makefile
deleted file mode 120000
index d0b0e8e008..0000000000
--- a/src/libsystemd/sd-device/Makefile
+++ /dev/null
@@ -1 +0,0 @@
-../Makefile \ No newline at end of file
diff --git a/src/libsystemd/sd-event/Makefile b/src/libsystemd/sd-event/Makefile
deleted file mode 120000
index 94aaae2c4d..0000000000
--- a/src/libsystemd/sd-event/Makefile
+++ /dev/null
@@ -1 +0,0 @@
-../../Makefile \ No newline at end of file
diff --git a/src/libsystemd/sd-event/sd-event.c b/src/libsystemd/sd-event/sd-event.c
index b4686d0065..320a1ca5c0 100644
--- a/src/libsystemd/sd-event/sd-event.c
+++ b/src/libsystemd/sd-event/sd-event.c
@@ -436,7 +436,7 @@ _public_ int sd_event_new(sd_event** ret) {
e->watchdog_fd = e->epoll_fd = e->realtime.fd = e->boottime.fd = e->monotonic.fd = e->realtime_alarm.fd = e->boottime_alarm.fd = -1;
e->realtime.next = e->boottime.next = e->monotonic.next = e->realtime_alarm.next = e->boottime_alarm.next = USEC_INFINITY;
e->realtime.wakeup = e->boottime.wakeup = e->monotonic.wakeup = e->realtime_alarm.wakeup = e->boottime_alarm.wakeup = WAKEUP_CLOCK_DATA;
- e->original_pid = getpid();
+ e->original_pid = getpid_cached();
e->perturb = USEC_INFINITY;
r = prioq_ensure_allocated(&e->pending, pending_prioq_compare);
@@ -493,7 +493,7 @@ static bool event_pid_changed(sd_event *e) {
/* We don't support people creating an event loop and keeping
* it around over a fork(). Let's complain. */
- return e->original_pid != getpid();
+ return e->original_pid != getpid_cached();
}
static void source_io_unregister(sd_event_source *s) {
diff --git a/src/libsystemd/sd-event/test-event.c b/src/libsystemd/sd-event/test-event.c
index 8425378f34..1a581ae23e 100644
--- a/src/libsystemd/sd-event/test-event.c
+++ b/src/libsystemd/sd-event/test-event.c
@@ -317,11 +317,11 @@ static void test_rtqueue(void) {
assert_se(sd_event_source_set_priority(v, -10) >= 0);
- assert(sigqueue(getpid(), SIGRTMIN+2, (union sigval) { .sival_int = 1 }) >= 0);
- assert(sigqueue(getpid(), SIGRTMIN+3, (union sigval) { .sival_int = 2 }) >= 0);
- assert(sigqueue(getpid(), SIGUSR2, (union sigval) { .sival_int = 3 }) >= 0);
- assert(sigqueue(getpid(), SIGRTMIN+3, (union sigval) { .sival_int = 4 }) >= 0);
- assert(sigqueue(getpid(), SIGUSR2, (union sigval) { .sival_int = 5 }) >= 0);
+ assert(sigqueue(getpid_cached(), SIGRTMIN+2, (union sigval) { .sival_int = 1 }) >= 0);
+ assert(sigqueue(getpid_cached(), SIGRTMIN+3, (union sigval) { .sival_int = 2 }) >= 0);
+ assert(sigqueue(getpid_cached(), SIGUSR2, (union sigval) { .sival_int = 3 }) >= 0);
+ assert(sigqueue(getpid_cached(), SIGRTMIN+3, (union sigval) { .sival_int = 4 }) >= 0);
+ assert(sigqueue(getpid_cached(), SIGUSR2, (union sigval) { .sival_int = 5 }) >= 0);
assert_se(n_rtqueue == 0);
assert_se(last_rtqueue_sigval == 0);
diff --git a/src/libsystemd/sd-hwdb/Makefile b/src/libsystemd/sd-hwdb/Makefile
deleted file mode 120000
index 94aaae2c4d..0000000000
--- a/src/libsystemd/sd-hwdb/Makefile
+++ /dev/null
@@ -1 +0,0 @@
-../../Makefile \ No newline at end of file
diff --git a/src/libsystemd/sd-id128/Makefile b/src/libsystemd/sd-id128/Makefile
deleted file mode 120000
index 94aaae2c4d..0000000000
--- a/src/libsystemd/sd-id128/Makefile
+++ /dev/null
@@ -1 +0,0 @@
-../../Makefile \ No newline at end of file
diff --git a/src/libsystemd/sd-login/Makefile b/src/libsystemd/sd-login/Makefile
deleted file mode 120000
index d0b0e8e008..0000000000
--- a/src/libsystemd/sd-login/Makefile
+++ /dev/null
@@ -1 +0,0 @@
-../Makefile \ No newline at end of file
diff --git a/src/libsystemd/sd-netlink/Makefile b/src/libsystemd/sd-netlink/Makefile
deleted file mode 120000
index 94aaae2c4d..0000000000
--- a/src/libsystemd/sd-netlink/Makefile
+++ /dev/null
@@ -1 +0,0 @@
-../../Makefile \ No newline at end of file
diff --git a/src/libsystemd/sd-netlink/sd-netlink.c b/src/libsystemd/sd-netlink/sd-netlink.c
index 68435564de..d67244676c 100644
--- a/src/libsystemd/sd-netlink/sd-netlink.c
+++ b/src/libsystemd/sd-netlink/sd-netlink.c
@@ -44,7 +44,7 @@ static int sd_netlink_new(sd_netlink **ret) {
rtnl->n_ref = REFCNT_INIT;
rtnl->fd = -1;
rtnl->sockaddr.nl.nl_family = AF_NETLINK;
- rtnl->original_pid = getpid();
+ rtnl->original_pid = getpid_cached();
LIST_HEAD_INIT(rtnl->match_callbacks);
@@ -99,7 +99,7 @@ static bool rtnl_pid_changed(sd_netlink *rtnl) {
/* We don't support people creating an rtnl connection and
* keeping it around over a fork(). Let's complain. */
- return rtnl->original_pid != getpid();
+ return rtnl->original_pid != getpid_cached();
}
int sd_netlink_open_fd(sd_netlink **ret, int fd) {
diff --git a/src/libsystemd/sd-network/Makefile b/src/libsystemd/sd-network/Makefile
deleted file mode 120000
index d0b0e8e008..0000000000
--- a/src/libsystemd/sd-network/Makefile
+++ /dev/null
@@ -1 +0,0 @@
-../Makefile \ No newline at end of file
diff --git a/src/libsystemd/sd-path/Makefile b/src/libsystemd/sd-path/Makefile
deleted file mode 120000
index d0b0e8e008..0000000000
--- a/src/libsystemd/sd-path/Makefile
+++ /dev/null
@@ -1 +0,0 @@
-../Makefile \ No newline at end of file
diff --git a/src/libsystemd/sd-path/sd-path.c b/src/libsystemd/sd-path/sd-path.c
index 752c1ba56b..6e41dac1ad 100644
--- a/src/libsystemd/sd-path/sd-path.c
+++ b/src/libsystemd/sd-path/sd-path.c
@@ -23,6 +23,7 @@
#include "architecture.h"
#include "fd-util.h"
#include "fileio.h"
+#include "fs-util.h"
#include "missing.h"
#include "path-util.h"
#include "string-util.h"
@@ -219,10 +220,10 @@ static int get_path(uint64_t type, char **buffer, const char **ret) {
switch (type) {
case SD_PATH_TEMPORARY:
- return from_environment("TMPDIR", "/tmp", ret);
+ return tmp_dir(ret);
case SD_PATH_TEMPORARY_LARGE:
- return from_environment("TMPDIR", "/var/tmp", ret);
+ return var_tmp_dir(ret);
case SD_PATH_SYSTEM_BINARIES:
*ret = "/usr/bin";
diff --git a/src/libsystemd/sd-resolve/Makefile b/src/libsystemd/sd-resolve/Makefile
deleted file mode 120000
index 94aaae2c4d..0000000000
--- a/src/libsystemd/sd-resolve/Makefile
+++ /dev/null
@@ -1 +0,0 @@
-../../Makefile \ No newline at end of file
diff --git a/src/libsystemd/sd-resolve/sd-resolve.c b/src/libsystemd/sd-resolve/sd-resolve.c
index 60aa55de3b..12fae65e6b 100644
--- a/src/libsystemd/sd-resolve/sd-resolve.c
+++ b/src/libsystemd/sd-resolve/sd-resolve.c
@@ -459,7 +459,7 @@ static bool resolve_pid_changed(sd_resolve *r) {
/* We don't support people creating a resolver and keeping it
* around after fork(). Let's complain. */
- return r->original_pid != getpid();
+ return r->original_pid != getpid_cached();
}
_public_ int sd_resolve_new(sd_resolve **ret) {
@@ -473,7 +473,7 @@ _public_ int sd_resolve_new(sd_resolve **ret) {
return -ENOMEM;
resolve->n_ref = 1;
- resolve->original_pid = getpid();
+ resolve->original_pid = getpid_cached();
for (i = 0; i < _FD_MAX; i++)
resolve->fds[i] = -1;
diff --git a/src/libsystemd/sd-utf8/Makefile b/src/libsystemd/sd-utf8/Makefile
deleted file mode 120000
index 94aaae2c4d..0000000000
--- a/src/libsystemd/sd-utf8/Makefile
+++ /dev/null
@@ -1 +0,0 @@
-../../Makefile \ No newline at end of file
diff --git a/src/libudev/.gitignore b/src/libudev/.gitignore
deleted file mode 100644
index 0c8a5d5231..0000000000
--- a/src/libudev/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-/libudev.pc
diff --git a/src/libudev/Makefile b/src/libudev/Makefile
deleted file mode 120000
index d0b0e8e008..0000000000
--- a/src/libudev/Makefile
+++ /dev/null
@@ -1 +0,0 @@
-../Makefile \ No newline at end of file
diff --git a/src/locale/.gitignore b/src/locale/.gitignore
deleted file mode 100644
index b1e0ba755e..0000000000
--- a/src/locale/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-org.freedesktop.locale1.policy
diff --git a/src/locale/Makefile b/src/locale/Makefile
deleted file mode 120000
index d0b0e8e008..0000000000
--- a/src/locale/Makefile
+++ /dev/null
@@ -1 +0,0 @@
-../Makefile \ No newline at end of file
diff --git a/src/locale/keymap-util.c b/src/locale/keymap-util.c
index 105d9b0ee4..ec48e8ba6d 100644
--- a/src/locale/keymap-util.c
+++ b/src/locale/keymap-util.c
@@ -361,12 +361,12 @@ int x11_write_data(Context *c) {
fchmod(fileno(f), 0644);
- fputs("# Written by systemd-localed(8), read by systemd-localed and Xorg. It's\n"
- "# probably wise not to edit this file manually. Use localectl(1) to\n"
- "# instruct systemd-localed to update it.\n"
- "Section \"InputClass\"\n"
- " Identifier \"system-keyboard\"\n"
- " MatchIsKeyboard \"on\"\n", f);
+ fputs_unlocked("# Written by systemd-localed(8), read by systemd-localed and Xorg. It's\n"
+ "# probably wise not to edit this file manually. Use localectl(1) to\n"
+ "# instruct systemd-localed to update it.\n"
+ "Section \"InputClass\"\n"
+ " Identifier \"system-keyboard\"\n"
+ " MatchIsKeyboard \"on\"\n", f);
if (!isempty(c->x11_layout))
fprintf(f, " Option \"XkbLayout\" \"%s\"\n", c->x11_layout);
@@ -380,7 +380,7 @@ int x11_write_data(Context *c) {
if (!isempty(c->x11_options))
fprintf(f, " Option \"XkbOptions\" \"%s\"\n", c->x11_options);
- fputs("EndSection\n", f);
+ fputs_unlocked("EndSection\n", f);
r = fflush_and_check(f);
if (r < 0)
diff --git a/src/login/.gitignore b/src/login/.gitignore
deleted file mode 100644
index 3a8ba497c1..0000000000
--- a/src/login/.gitignore
+++ /dev/null
@@ -1,6 +0,0 @@
-/logind-gperf.c
-/logind.conf
-/org.freedesktop.login1.policy
-/71-seat.rules
-/73-seat-late.rules
-/systemd-user
diff --git a/src/login/Makefile b/src/login/Makefile
deleted file mode 120000
index d0b0e8e008..0000000000
--- a/src/login/Makefile
+++ /dev/null
@@ -1 +0,0 @@
-../Makefile \ No newline at end of file
diff --git a/src/login/logind-seat.c b/src/login/logind-seat.c
index 30dac7997b..85258737c3 100644
--- a/src/login/logind-seat.c
+++ b/src/login/logind-seat.c
@@ -127,7 +127,7 @@ int seat_save(Seat *s) {
if (s->sessions) {
Session *i;
- fputs("SESSIONS=", f);
+ fputs_unlocked("SESSIONS=", f);
LIST_FOREACH(sessions_by_seat, i, s->sessions) {
fprintf(f,
"%s%c",
@@ -135,7 +135,7 @@ int seat_save(Seat *s) {
i->sessions_by_seat_next ? ' ' : '\n');
}
- fputs("UIDS=", f);
+ fputs_unlocked("UIDS=", f);
LIST_FOREACH(sessions_by_seat, i, s->sessions)
fprintf(f,
UID_FMT"%c",
diff --git a/src/login/logind-user.c b/src/login/logind-user.c
index 888a97c2fc..66d9d06b5f 100644
--- a/src/login/logind-user.c
+++ b/src/login/logind-user.c
@@ -182,18 +182,18 @@ static int user_save_internal(User *u) {
Session *i;
bool first;
- fputs("SESSIONS=", f);
+ fputs_unlocked("SESSIONS=", f);
first = true;
LIST_FOREACH(sessions_by_user, i, u->sessions) {
if (first)
first = false;
else
- fputc(' ', f);
+ fputc_unlocked(' ', f);
- fputs(i->id, f);
+ fputs_unlocked(i->id, f);
}
- fputs("\nSEATS=", f);
+ fputs_unlocked("\nSEATS=", f);
first = true;
LIST_FOREACH(sessions_by_user, i, u->sessions) {
if (!i->seat)
@@ -202,12 +202,12 @@ static int user_save_internal(User *u) {
if (first)
first = false;
else
- fputc(' ', f);
+ fputc_unlocked(' ', f);
- fputs(i->seat->id, f);
+ fputs_unlocked(i->seat->id, f);
}
- fputs("\nACTIVE_SESSIONS=", f);
+ fputs_unlocked("\nACTIVE_SESSIONS=", f);
first = true;
LIST_FOREACH(sessions_by_user, i, u->sessions) {
if (!session_is_active(i))
@@ -216,12 +216,12 @@ static int user_save_internal(User *u) {
if (first)
first = false;
else
- fputc(' ', f);
+ fputc_unlocked(' ', f);
- fputs(i->id, f);
+ fputs_unlocked(i->id, f);
}
- fputs("\nONLINE_SESSIONS=", f);
+ fputs_unlocked("\nONLINE_SESSIONS=", f);
first = true;
LIST_FOREACH(sessions_by_user, i, u->sessions) {
if (session_get_state(i) == SESSION_CLOSING)
@@ -230,12 +230,12 @@ static int user_save_internal(User *u) {
if (first)
first = false;
else
- fputc(' ', f);
+ fputc_unlocked(' ', f);
- fputs(i->id, f);
+ fputs_unlocked(i->id, f);
}
- fputs("\nACTIVE_SEATS=", f);
+ fputs_unlocked("\nACTIVE_SEATS=", f);
first = true;
LIST_FOREACH(sessions_by_user, i, u->sessions) {
if (!session_is_active(i) || !i->seat)
@@ -244,12 +244,12 @@ static int user_save_internal(User *u) {
if (first)
first = false;
else
- fputc(' ', f);
+ fputc_unlocked(' ', f);
- fputs(i->seat->id, f);
+ fputs_unlocked(i->seat->id, f);
}
- fputs("\nONLINE_SEATS=", f);
+ fputs_unlocked("\nONLINE_SEATS=", f);
first = true;
LIST_FOREACH(sessions_by_user, i, u->sessions) {
if (session_get_state(i) == SESSION_CLOSING || !i->seat)
@@ -258,11 +258,11 @@ static int user_save_internal(User *u) {
if (first)
first = false;
else
- fputc(' ', f);
+ fputc_unlocked(' ', f);
- fputs(i->seat->id, f);
+ fputs_unlocked(i->seat->id, f);
}
- fputc('\n', f);
+ fputc_unlocked('\n', f);
}
r = fflush_and_check(f);
diff --git a/src/login/logind.c b/src/login/logind.c
index fb70972b80..6046596684 100644
--- a/src/login/logind.c
+++ b/src/login/logind.c
@@ -1254,7 +1254,7 @@ int main(int argc, char *argv[]) {
goto finish;
}
- log_debug("systemd-logind running as pid "PID_FMT, getpid());
+ log_debug("systemd-logind running as pid "PID_FMT, getpid_cached());
sd_notify(false,
"READY=1\n"
@@ -1262,7 +1262,7 @@ int main(int argc, char *argv[]) {
r = manager_run(m);
- log_debug("systemd-logind stopped as pid "PID_FMT, getpid());
+ log_debug("systemd-logind stopped as pid "PID_FMT, getpid_cached());
finish:
sd_notify(false,
diff --git a/src/login/pam_systemd.c b/src/login/pam_systemd.c
index dab082a26e..df16907ed2 100644
--- a/src/login/pam_systemd.c
+++ b/src/login/pam_systemd.c
@@ -41,6 +41,7 @@
#include "login-util.h"
#include "macro.h"
#include "parse-util.h"
+#include "process-util.h"
#include "socket-util.h"
#include "strv.h"
#include "terminal-util.h"
@@ -372,7 +373,7 @@ _public_ PAM_EXTERN int pam_sm_open_session(
if (debug)
pam_syslog(handle, LOG_DEBUG, "Asking logind to create session: "
"uid="UID_FMT" pid="PID_FMT" service=%s type=%s class=%s desktop=%s seat=%s vtnr=%"PRIu32" tty=%s display=%s remote=%s remote_user=%s remote_host=%s",
- pw->pw_uid, getpid(),
+ pw->pw_uid, getpid_cached(),
strempty(service),
type, class, strempty(desktop),
strempty(seat), vtnr, strempty(tty), strempty(display),
@@ -387,7 +388,7 @@ _public_ PAM_EXTERN int pam_sm_open_session(
&reply,
"uusssssussbssa(sv)",
(uint32_t) pw->pw_uid,
- (uint32_t) getpid(),
+ (uint32_t) getpid_cached(),
service,
type,
class,
diff --git a/src/machine-id-setup/Makefile b/src/machine-id-setup/Makefile
deleted file mode 120000
index d0b0e8e008..0000000000
--- a/src/machine-id-setup/Makefile
+++ /dev/null
@@ -1 +0,0 @@
-../Makefile \ No newline at end of file
diff --git a/src/machine/.gitignore b/src/machine/.gitignore
deleted file mode 100644
index e1065b5894..0000000000
--- a/src/machine/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-/org.freedesktop.machine1.policy
diff --git a/src/machine/Makefile b/src/machine/Makefile
deleted file mode 120000
index d0b0e8e008..0000000000
--- a/src/machine/Makefile
+++ /dev/null
@@ -1 +0,0 @@
-../Makefile \ No newline at end of file
diff --git a/src/machine/machine.c b/src/machine/machine.c
index d3433d9b96..399e41f870 100644
--- a/src/machine/machine.c
+++ b/src/machine/machine.c
@@ -199,16 +199,16 @@ int machine_save(Machine *m) {
if (m->n_netif > 0) {
unsigned i;
- fputs("NETIF=", f);
+ fputs_unlocked("NETIF=", f);
for (i = 0; i < m->n_netif; i++) {
if (i != 0)
- fputc(' ', f);
+ fputc_unlocked(' ', f);
fprintf(f, "%i", m->netif[i]);
}
- fputc('\n', f);
+ fputc_unlocked('\n', f);
}
r = fflush_and_check(f);
diff --git a/src/machine/machined.c b/src/machine/machined.c
index 8719e01de9..d8ddbec8b9 100644
--- a/src/machine/machined.c
+++ b/src/machine/machined.c
@@ -34,6 +34,7 @@
#include "label.h"
#include "machine-image.h"
#include "machined.h"
+#include "process-util.h"
#include "signal-util.h"
Manager *manager_new(void) {
@@ -398,7 +399,7 @@ int main(int argc, char *argv[]) {
goto finish;
}
- log_debug("systemd-machined running as pid "PID_FMT, getpid());
+ log_debug("systemd-machined running as pid "PID_FMT, getpid_cached());
sd_notify(false,
"READY=1\n"
@@ -406,7 +407,7 @@ int main(int argc, char *argv[]) {
r = manager_run(m);
- log_debug("systemd-machined stopped as pid "PID_FMT, getpid());
+ log_debug("systemd-machined stopped as pid "PID_FMT, getpid_cached());
finish:
manager_free(m);
diff --git a/src/modules-load/Makefile b/src/modules-load/Makefile
deleted file mode 120000
index d0b0e8e008..0000000000
--- a/src/modules-load/Makefile
+++ /dev/null
@@ -1 +0,0 @@
-../Makefile \ No newline at end of file
diff --git a/src/mount/Makefile b/src/mount/Makefile
deleted file mode 120000
index d0b0e8e008..0000000000
--- a/src/mount/Makefile
+++ /dev/null
@@ -1 +0,0 @@
-../Makefile \ No newline at end of file
diff --git a/src/network/.gitignore b/src/network/.gitignore
deleted file mode 100644
index 230671763d..0000000000
--- a/src/network/.gitignore
+++ /dev/null
@@ -1,2 +0,0 @@
-/networkd-network-gperf.c
-/networkd-gperf.c
diff --git a/src/network/Makefile b/src/network/Makefile
deleted file mode 120000
index d0b0e8e008..0000000000
--- a/src/network/Makefile
+++ /dev/null
@@ -1 +0,0 @@
-../Makefile \ No newline at end of file
diff --git a/src/network/netdev/.gitignore b/src/network/netdev/.gitignore
deleted file mode 100644
index 0f1a65d2e6..0000000000
--- a/src/network/netdev/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-/netdev-gperf.c
diff --git a/src/network/netdev/Makefile b/src/network/netdev/Makefile
deleted file mode 120000
index 94aaae2c4d..0000000000
--- a/src/network/netdev/Makefile
+++ /dev/null
@@ -1 +0,0 @@
-../../Makefile \ No newline at end of file
diff --git a/src/network/networkd-link.c b/src/network/networkd-link.c
index 4c57fa1793..03b8f8c3c4 100644
--- a/src/network/networkd-link.c
+++ b/src/network/networkd-link.c
@@ -3276,16 +3276,16 @@ static void print_link_hashmap(FILE *f, const char *prefix, Hashmap* h) {
if (hashmap_isempty(h))
return;
- fputs(prefix, f);
+ fputs_unlocked(prefix, f);
HASHMAP_FOREACH(link, h, i) {
if (space)
- fputc(' ', f);
+ fputc_unlocked(' ', f);
fprintf(f, "%i", link->ifindex);
space = true;
}
- fputc('\n', f);
+ fputc_unlocked('\n', f);
}
int link_save(Link *link) {
@@ -3343,7 +3343,7 @@ int link_save(Link *link) {
fprintf(f, "NETWORK_FILE=%s\n", link->network->filename);
- fputs("DNS=", f);
+ fputs_unlocked("DNS=", f);
space = false;
for (j = 0; j < link->network->n_dns; j++) {
@@ -3357,8 +3357,8 @@ int link_save(Link *link) {
}
if (space)
- fputc(' ', f);
- fputs(b, f);
+ fputc_unlocked(' ', f);
+ fputs_unlocked(b, f);
space = true;
}
@@ -3369,7 +3369,7 @@ int link_save(Link *link) {
r = sd_dhcp_lease_get_dns(link->dhcp_lease, &addresses);
if (r > 0) {
if (space)
- fputc(' ', f);
+ fputc_unlocked(' ', f);
serialize_in_addrs(f, addresses, r);
space = true;
}
@@ -3381,7 +3381,7 @@ int link_save(Link *link) {
r = sd_dhcp6_lease_get_dns(dhcp6_lease, &in6_addrs);
if (r > 0) {
if (space)
- fputc(' ', f);
+ fputc_unlocked(' ', f);
serialize_in6_addrs(f, in6_addrs, r);
space = true;
}
@@ -3395,16 +3395,16 @@ int link_save(Link *link) {
SET_FOREACH(dd, link->ndisc_rdnss, i) {
if (space)
- fputc(' ', f);
+ fputc_unlocked(' ', f);
serialize_in6_addrs(f, &dd->address, 1);
space = true;
}
}
- fputc('\n', f);
+ fputc_unlocked('\n', f);
- fputs("NTP=", f);
+ fputs_unlocked("NTP=", f);
space = false;
fputstrv(f, link->network->ntp, NULL, &space);
@@ -3415,7 +3415,7 @@ int link_save(Link *link) {
r = sd_dhcp_lease_get_ntp(link->dhcp_lease, &addresses);
if (r > 0) {
if (space)
- fputc(' ', f);
+ fputc_unlocked(' ', f);
serialize_in_addrs(f, addresses, r);
space = true;
}
@@ -3429,7 +3429,7 @@ int link_save(Link *link) {
&in6_addrs);
if (r > 0) {
if (space)
- fputc(' ', f);
+ fputc_unlocked(' ', f);
serialize_in6_addrs(f, in6_addrs, r);
space = true;
}
@@ -3439,7 +3439,7 @@ int link_save(Link *link) {
fputstrv(f, hosts, NULL, &space);
}
- fputc('\n', f);
+ fputc_unlocked('\n', f);
if (link->network->dhcp_use_domains != DHCP_USE_DOMAINS_NO) {
if (link->dhcp_lease) {
@@ -3450,7 +3450,7 @@ int link_save(Link *link) {
(void) sd_dhcp6_lease_get_domains(dhcp6_lease, &dhcp6_domains);
}
- fputs("DOMAINS=", f);
+ fputs_unlocked("DOMAINS=", f);
space = false;
fputstrv(f, link->network->search_domains, NULL, &space);
@@ -3468,9 +3468,9 @@ int link_save(Link *link) {
fputs_with_space(f, NDISC_DNSSL_DOMAIN(dd), NULL, &space);
}
- fputc('\n', f);
+ fputc_unlocked('\n', f);
- fputs("ROUTE_DOMAINS=", f);
+ fputs_unlocked("ROUTE_DOMAINS=", f);
space = false;
fputstrv(f, link->network->route_domains, NULL, &space);
@@ -3488,7 +3488,7 @@ int link_save(Link *link) {
fputs_with_space(f, NDISC_DNSSL_DOMAIN(dd), NULL, &space);
}
- fputc('\n', f);
+ fputc_unlocked('\n', f);
fprintf(f, "LLMNR=%s\n",
resolve_support_to_string(link->network->llmnr));
@@ -3502,14 +3502,14 @@ int link_save(Link *link) {
if (!set_isempty(link->network->dnssec_negative_trust_anchors)) {
const char *n;
- fputs("DNSSEC_NTA=", f);
+ fputs_unlocked("DNSSEC_NTA=", f);
space = false;
SET_FOREACH(n, link->network->dnssec_negative_trust_anchors, i)
fputs_with_space(f, n, NULL, &space);
- fputc('\n', f);
+ fputc_unlocked('\n', f);
}
- fputs("ADDRESSES=", f);
+ fputs_unlocked("ADDRESSES=", f);
space = false;
SET_FOREACH(a, link->addresses, i) {
_cleanup_free_ char *address_str = NULL;
@@ -3521,9 +3521,9 @@ int link_save(Link *link) {
fprintf(f, "%s%s/%u", space ? " " : "", address_str, a->prefixlen);
space = true;
}
- fputc('\n', f);
+ fputc_unlocked('\n', f);
- fputs("ROUTES=", f);
+ fputs_unlocked("ROUTES=", f);
space = false;
SET_FOREACH(route, link->routes, i) {
_cleanup_free_ char *route_str = NULL;
@@ -3537,7 +3537,7 @@ int link_save(Link *link) {
space = true;
}
- fputc('\n', f);
+ fputc_unlocked('\n', f);
}
print_link_hashmap(f, "CARRIER_BOUND_TO=", link->bound_to_links);
@@ -3555,9 +3555,9 @@ int link_save(Link *link) {
r = sd_dhcp_lease_get_address(link->dhcp_lease, &address);
if (r >= 0) {
- fputs("DHCP4_ADDRESS=", f);
+ fputs_unlocked("DHCP4_ADDRESS=", f);
serialize_in_addrs(f, &address, 1);
- fputc('\n', f);
+ fputc_unlocked('\n', f);
}
r = dhcp_lease_save(link->dhcp_lease, link->lease_file);
@@ -3575,9 +3575,9 @@ int link_save(Link *link) {
r = sd_ipv4ll_get_address(link->ipv4ll, &address);
if (r >= 0) {
- fputs("IPV4LL_ADDRESS=", f);
+ fputs_unlocked("IPV4LL_ADDRESS=", f);
serialize_in_addrs(f, &address, 1);
- fputc('\n', f);
+ fputc_unlocked('\n', f);
}
}
diff --git a/src/network/networkd-manager.c b/src/network/networkd-manager.c
index 5f10b4f993..c28088d3a3 100644
--- a/src/network/networkd-manager.c
+++ b/src/network/networkd-manager.c
@@ -866,12 +866,12 @@ static void print_string_set(FILE *f, const char *field, OrderedSet *s) {
if (ordered_set_isempty(s))
return;
- fputs(field, f);
+ fputs_unlocked(field, f);
ORDERED_SET_FOREACH(p, s, i)
fputs_with_space(f, p, NULL, &space);
- fputc('\n', f);
+ fputc_unlocked('\n', f);
}
static int manager_save(Manager *m) {
diff --git a/src/network/wait-online/Makefile b/src/network/wait-online/Makefile
deleted file mode 120000
index 94aaae2c4d..0000000000
--- a/src/network/wait-online/Makefile
+++ /dev/null
@@ -1 +0,0 @@
-../../Makefile \ No newline at end of file
diff --git a/src/notify/Makefile b/src/notify/Makefile
deleted file mode 120000
index d0b0e8e008..0000000000
--- a/src/notify/Makefile
+++ /dev/null
@@ -1 +0,0 @@
-../Makefile \ No newline at end of file
diff --git a/src/nspawn/.gitignore b/src/nspawn/.gitignore
deleted file mode 100644
index 85c81fff24..0000000000
--- a/src/nspawn/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-/nspawn-gperf.c
diff --git a/src/nspawn/Makefile b/src/nspawn/Makefile
deleted file mode 120000
index d0b0e8e008..0000000000
--- a/src/nspawn/Makefile
+++ /dev/null
@@ -1 +0,0 @@
-../Makefile \ No newline at end of file
diff --git a/src/nspawn/nspawn-mount.c b/src/nspawn/nspawn-mount.c
index ac7290732e..e80c944e9f 100644
--- a/src/nspawn/nspawn-mount.c
+++ b/src/nspawn/nspawn-mount.c
@@ -456,9 +456,6 @@ int mount_sysfs(const char *dest, MountSettingsMask mount_settings) {
if (rmdir(full) < 0)
return log_error_errno(errno, "Failed to remove %s: %m", full);
- x = prefix_roota(top, "/fs/kdbus");
- (void) mkdir_p(x, 0755);
-
/* Create mountpoint for cgroups. Otherwise we are not allowed since we
* remount /sys read-only.
*/
diff --git a/src/nspawn/nspawn.c b/src/nspawn/nspawn.c
index 8a5fedd4b0..0cbd8c3491 100644
--- a/src/nspawn/nspawn.c
+++ b/src/nspawn/nspawn.c
@@ -2836,7 +2836,7 @@ static int nspawn_dispatch_notify_fd(sd_event_source *source, int fd, uint32_t r
}
if (!ucred || ucred->pid != inner_child_pid) {
- log_warning("Received notify message without valid credentials. Ignoring.");
+ log_debug("Received notify message without valid credentials. Ignoring.");
return 0;
}
diff --git a/src/nss-myhostname/Makefile b/src/nss-myhostname/Makefile
deleted file mode 120000
index d0b0e8e008..0000000000
--- a/src/nss-myhostname/Makefile
+++ /dev/null
@@ -1 +0,0 @@
-../Makefile \ No newline at end of file
diff --git a/src/nss-mymachines/Makefile b/src/nss-mymachines/Makefile
deleted file mode 120000
index d0b0e8e008..0000000000
--- a/src/nss-mymachines/Makefile
+++ /dev/null
@@ -1 +0,0 @@
-../Makefile \ No newline at end of file
diff --git a/src/nss-resolve/Makefile b/src/nss-resolve/Makefile
deleted file mode 120000
index d0b0e8e008..0000000000
--- a/src/nss-resolve/Makefile
+++ /dev/null
@@ -1 +0,0 @@
-../Makefile \ No newline at end of file
diff --git a/src/nss-systemd/Makefile b/src/nss-systemd/Makefile
deleted file mode 120000
index d0b0e8e008..0000000000
--- a/src/nss-systemd/Makefile
+++ /dev/null
@@ -1 +0,0 @@
-../Makefile \ No newline at end of file
diff --git a/src/path/Makefile b/src/path/Makefile
deleted file mode 120000
index d0b0e8e008..0000000000
--- a/src/path/Makefile
+++ /dev/null
@@ -1 +0,0 @@
-../Makefile \ No newline at end of file
diff --git a/src/quotacheck/Makefile b/src/quotacheck/Makefile
deleted file mode 120000
index d0b0e8e008..0000000000
--- a/src/quotacheck/Makefile
+++ /dev/null
@@ -1 +0,0 @@
-../Makefile \ No newline at end of file
diff --git a/src/random-seed/Makefile b/src/random-seed/Makefile
deleted file mode 120000
index d0b0e8e008..0000000000
--- a/src/random-seed/Makefile
+++ /dev/null
@@ -1 +0,0 @@
-../Makefile \ No newline at end of file
diff --git a/src/rc-local-generator/Makefile b/src/rc-local-generator/Makefile
deleted file mode 120000
index d0b0e8e008..0000000000
--- a/src/rc-local-generator/Makefile
+++ /dev/null
@@ -1 +0,0 @@
-../Makefile \ No newline at end of file
diff --git a/src/remount-fs/Makefile b/src/remount-fs/Makefile
deleted file mode 120000
index d0b0e8e008..0000000000
--- a/src/remount-fs/Makefile
+++ /dev/null
@@ -1 +0,0 @@
-../Makefile \ No newline at end of file
diff --git a/src/reply-password/Makefile b/src/reply-password/Makefile
deleted file mode 120000
index d0b0e8e008..0000000000
--- a/src/reply-password/Makefile
+++ /dev/null
@@ -1 +0,0 @@
-../Makefile \ No newline at end of file
diff --git a/src/resolve/.gitignore b/src/resolve/.gitignore
deleted file mode 100644
index f0835923b7..0000000000
--- a/src/resolve/.gitignore
+++ /dev/null
@@ -1,6 +0,0 @@
-/resolved-gperf.c
-/resolved.conf
-/dns_type-from-name.gperf
-/dns_type-from-name.h
-/dns_type-list.txt
-/dns_type-to-name.h
diff --git a/src/resolve/Makefile b/src/resolve/Makefile
deleted file mode 120000
index d0b0e8e008..0000000000
--- a/src/resolve/Makefile
+++ /dev/null
@@ -1 +0,0 @@
-../Makefile \ No newline at end of file
diff --git a/src/resolve/resolved-link.c b/src/resolve/resolved-link.c
index 61a3f20362..ea3b061877 100644
--- a/src/resolve/resolved-link.c
+++ b/src/resolve/resolved-link.c
@@ -1050,7 +1050,7 @@ int link_save_user(Link *l) {
if (r < 0)
goto fail;
- fputs("# This is private data. Do not parse.\n", f);
+ fputs_unlocked("# This is private data. Do not parse.\n", f);
v = resolve_support_to_string(l->llmnr_support);
if (v)
@@ -1067,11 +1067,11 @@ int link_save_user(Link *l) {
if (l->dns_servers) {
DnsServer *server;
- fputs("SERVERS=", f);
+ fputs_unlocked("SERVERS=", f);
LIST_FOREACH(servers, server, l->dns_servers) {
if (server != l->dns_servers)
- fputc(' ', f);
+ fputc_unlocked(' ', f);
v = dns_server_string(server);
if (!v) {
@@ -1079,26 +1079,26 @@ int link_save_user(Link *l) {
goto fail;
}
- fputs(v, f);
+ fputs_unlocked(v, f);
}
- fputc('\n', f);
+ fputc_unlocked('\n', f);
}
if (l->search_domains) {
DnsSearchDomain *domain;
- fputs("DOMAINS=", f);
+ fputs_unlocked("DOMAINS=", f);
LIST_FOREACH(domains, domain, l->search_domains) {
if (domain != l->search_domains)
- fputc(' ', f);
+ fputc_unlocked(' ', f);
if (domain->route_only)
- fputc('~', f);
+ fputc_unlocked('~', f);
- fputs(DNS_SEARCH_DOMAIN_NAME(domain), f);
+ fputs_unlocked(DNS_SEARCH_DOMAIN_NAME(domain), f);
}
- fputc('\n', f);
+ fputc_unlocked('\n', f);
}
if (!set_isempty(l->dnssec_negative_trust_anchors)) {
@@ -1106,16 +1106,16 @@ int link_save_user(Link *l) {
Iterator i;
char *nta;
- fputs("NTAS=", f);
+ fputs_unlocked("NTAS=", f);
SET_FOREACH(nta, l->dnssec_negative_trust_anchors, i) {
if (space)
- fputc(' ', f);
+ fputc_unlocked(' ', f);
- fputs(nta, f);
+ fputs_unlocked(nta, f);
space = true;
}
- fputc('\n', f);
+ fputc_unlocked('\n', f);
}
r = fflush_and_check(f);
diff --git a/src/resolve/resolved-resolv-conf.c b/src/resolve/resolved-resolv-conf.c
index 3c62550872..f4e071ebaa 100644
--- a/src/resolve/resolved-resolv-conf.c
+++ b/src/resolve/resolved-resolv-conf.c
@@ -165,7 +165,7 @@ static void write_resolv_conf_server(DnsServer *s, FILE *f, unsigned *count) {
}
if (*count == MAXNS)
- fputs("# Too many DNS servers configured, the following entries may be ignored.\n", f);
+ fputs_unlocked("# Too many DNS servers configured, the following entries may be ignored.\n", f);
(*count)++;
fprintf(f, "nameserver %s\n", dns_server_string(s));
@@ -181,39 +181,39 @@ static void write_resolv_conf_search(
assert(domains);
assert(f);
- fputs("search", f);
+ fputs_unlocked("search", f);
ORDERED_SET_FOREACH(domain, domains, i) {
if (++count > MAXDNSRCH) {
- fputs("\n# Too many search domains configured, remaining ones ignored.", f);
+ fputs_unlocked("\n# Too many search domains configured, remaining ones ignored.", f);
break;
}
length += strlen(domain) + 1;
if (length > 256) {
- fputs("\n# Total length of all search domains is too long, remaining ones ignored.", f);
+ fputs_unlocked("\n# Total length of all search domains is too long, remaining ones ignored.", f);
break;
}
- fputc(' ', f);
- fputs(domain, f);
+ fputc_unlocked(' ', f);
+ fputs_unlocked(domain, f);
}
- fputs("\n", f);
+ fputs_unlocked("\n", f);
}
static int write_resolv_conf_contents(FILE *f, OrderedSet *dns, OrderedSet *domains) {
Iterator i;
- fputs("# This file is managed by man:systemd-resolved(8). Do not edit.\n#\n"
- "# This is a dynamic resolv.conf file for connecting local clients directly to\n"
- "# all known DNS servers.\n#\n"
- "# Third party programs must not access this file directly, but only through the\n"
- "# symlink at /etc/resolv.conf. To manage man:resolv.conf(5) in a different way,\n"
- "# replace this symlink by a static file or a different symlink.\n#\n"
- "# See man:systemd-resolved.service(8) for details about the supported modes of\n"
- "# operation for /etc/resolv.conf.\n\n", f);
+ fputs_unlocked("# This file is managed by man:systemd-resolved(8). Do not edit.\n#\n"
+ "# This is a dynamic resolv.conf file for connecting local clients directly to\n"
+ "# all known DNS servers.\n#\n"
+ "# Third party programs must not access this file directly, but only through the\n"
+ "# symlink at /etc/resolv.conf. To manage man:resolv.conf(5) in a different way,\n"
+ "# replace this symlink by a static file or a different symlink.\n#\n"
+ "# See man:systemd-resolved.service(8) for details about the supported modes of\n"
+ "# operation for /etc/resolv.conf.\n\n", f);
if (ordered_set_isempty(dns))
- fputs("# No DNS servers known.\n", f);
+ fputs_unlocked("# No DNS servers known.\n", f);
else {
unsigned count = 0;
DnsServer *s;
diff --git a/src/rfkill/Makefile b/src/rfkill/Makefile
deleted file mode 120000
index d0b0e8e008..0000000000
--- a/src/rfkill/Makefile
+++ /dev/null
@@ -1 +0,0 @@
-../Makefile \ No newline at end of file
diff --git a/src/run/Makefile b/src/run/Makefile
deleted file mode 120000
index d0b0e8e008..0000000000
--- a/src/run/Makefile
+++ /dev/null
@@ -1 +0,0 @@
-../Makefile \ No newline at end of file
diff --git a/src/run/run.c b/src/run/run.c
index 2e6765aa18..86e3040918 100644
--- a/src/run/run.c
+++ b/src/run/run.c
@@ -655,7 +655,7 @@ static int transient_scope_set_properties(sd_bus_message *m) {
if (r < 0)
return r;
- r = sd_bus_message_append(m, "(sv)", "PIDs", "au", 1, (uint32_t) getpid());
+ r = sd_bus_message_append(m, "(sv)", "PIDs", "au", 1, (uint32_t) getpid_cached());
if (r < 0)
return r;
diff --git a/src/shared/Makefile b/src/shared/Makefile
deleted file mode 120000
index d0b0e8e008..0000000000
--- a/src/shared/Makefile
+++ /dev/null
@@ -1 +0,0 @@
-../Makefile \ No newline at end of file
diff --git a/src/shared/ask-password-api.c b/src/shared/ask-password-api.c
index e3b29e390c..0ce8e54573 100644
--- a/src/shared/ask-password-api.c
+++ b/src/shared/ask-password-api.c
@@ -49,6 +49,7 @@
#include "macro.h"
#include "missing.h"
#include "mkdir.h"
+#include "process-util.h"
#include "random-util.h"
#include "signal-util.h"
#include "socket-util.h"
@@ -519,7 +520,7 @@ int ask_password_agent(
"AcceptCached=%i\n"
"Echo=%i\n"
"NotAfter="USEC_FMT"\n",
- getpid(),
+ getpid_cached(),
socket_name,
(flags & ASK_PASSWORD_ACCEPT_CACHED) ? 1 : 0,
(flags & ASK_PASSWORD_ECHO) ? 1 : 0,
diff --git a/src/shared/bus-unit-util.c b/src/shared/bus-unit-util.c
index 5cbe663fa8..1d77c18edb 100644
--- a/src/shared/bus-unit-util.c
+++ b/src/shared/bus-unit-util.c
@@ -267,7 +267,7 @@ int bus_append_unit_property_assignment(sd_bus_message *m, const char *assignmen
"Description", "Slice", "Type", "WorkingDirectory",
"RootDirectory", "SyslogIdentifier", "ProtectSystem",
"ProtectHome", "SELinuxContext", "Restart", "RootImage",
- "NotifyAccess"))
+ "NotifyAccess", "RuntimeDirectoryPreserve"))
r = sd_bus_message_append(m, "v", "s", eq);
else if (streq(field, "SyslogLevel")) {
@@ -548,7 +548,16 @@ int bus_append_unit_property_assignment(sd_bus_message *m, const char *assignmen
r = sd_bus_message_close_container(m);
- } else if (streq(field, "RuntimeDirectory")) {
+ } else if (STR_IN_SET(field, "RuntimeDirectoryMode", "StateDirectoryMode", "CacheDirectoryMode", "LogsDirectoryMode", "ConfigurationDirectoryMode")) {
+ mode_t mode;
+
+ r = parse_mode(eq, &mode);
+ if (r < 0)
+ return log_error_errno(r, "Failed to parse %s value %s", field, eq);
+
+ r = sd_bus_message_append(m, "v", "u", mode);
+
+ } else if (STR_IN_SET(field, "RuntimeDirectory", "StateDirectory", "CacheDirectory", "LogsDirectory", "ConfigurationDirectory")) {
const char *p;
r = sd_bus_message_open_container(m, 'v', "as");
diff --git a/src/shared/bus-util.c b/src/shared/bus-util.c
index 207b5e66fc..7850aa60c7 100644
--- a/src/shared/bus-util.c
+++ b/src/shared/bus-util.c
@@ -592,28 +592,8 @@ int bus_connect_system_systemd(sd_bus **_bus) {
if (geteuid() != 0)
return sd_bus_default_system(_bus);
- /* If we are root and kdbus is not available, then let's talk
- * directly to the system instance, instead of going via the
- * bus */
-
- r = sd_bus_new(&bus);
- if (r < 0)
- return r;
-
- r = sd_bus_set_address(bus, KERNEL_SYSTEM_BUS_ADDRESS);
- if (r < 0)
- return r;
-
- bus->bus_client = true;
-
- r = sd_bus_start(bus);
- if (r >= 0) {
- *_bus = bus;
- bus = NULL;
- return 0;
- }
-
- bus = sd_bus_unref(bus);
+ /* If we are root then let's talk directly to the system
+ * instance, instead of going via the bus */
r = sd_bus_new(&bus);
if (r < 0)
@@ -643,28 +623,8 @@ int bus_connect_user_systemd(sd_bus **_bus) {
const char *e;
int r;
- /* Try via kdbus first, and then directly */
-
assert(_bus);
- r = sd_bus_new(&bus);
- if (r < 0)
- return r;
-
- if (asprintf(&bus->address, KERNEL_USER_BUS_ADDRESS_FMT, getuid()) < 0)
- return -ENOMEM;
-
- bus->bus_client = true;
-
- r = sd_bus_start(bus);
- if (r >= 0) {
- *_bus = bus;
- bus = NULL;
- return 0;
- }
-
- bus = sd_bus_unref(bus);
-
e = secure_getenv("XDG_RUNTIME_DIR");
if (!e)
return sd_bus_default_user(_bus);
diff --git a/src/shared/condition.c b/src/shared/condition.c
index 1af74c61f0..103f8d2e39 100644
--- a/src/shared/condition.c
+++ b/src/shared/condition.c
@@ -48,6 +48,7 @@
#include "parse-util.h"
#include "path-util.h"
#include "proc-cmdline.h"
+#include "process-util.h"
#include "selinux-util.h"
#include "smack-util.h"
#include "stat-util.h"
@@ -164,7 +165,7 @@ static int condition_test_user(Condition *c) {
if (streq(username, c->parameter))
return 1;
- if (getpid() == 1)
+ if (getpid_cached() == 1)
return streq(c->parameter, "root");
u = c->parameter;
@@ -188,7 +189,7 @@ static int condition_test_group(Condition *c) {
return in_gid(id);
/* Avoid any NSS lookups if we are PID1 */
- if (getpid() == 1)
+ if (getpid_cached() == 1)
return streq(c->parameter, "root");
return in_group(c->parameter) > 0;
diff --git a/src/shared/dropin.c b/src/shared/dropin.c
index 15ccd1b6ca..7d8fbeb435 100644
--- a/src/shared/dropin.c
+++ b/src/shared/dropin.c
@@ -187,7 +187,7 @@ int unit_file_find_dropin_paths(
Set *names,
char ***ret) {
- _cleanup_strv_free_ char **dirs = NULL, **ans = NULL;
+ _cleanup_strv_free_ char **dirs = NULL;
Iterator i;
char *t, **p;
int r;
@@ -203,12 +203,9 @@ int unit_file_find_dropin_paths(
return 0;
}
- r = conf_files_list_strv(&ans, file_suffix, NULL, (const char**) dirs);
+ r = conf_files_list_strv(ret, file_suffix, NULL, (const char**) dirs);
if (r < 0)
- return log_warning_errno(r, "Failed to sort the list of configuration files: %m");
-
- *ret = ans;
- ans = NULL;
+ return log_warning_errno(r, "Failed to create the list of configuration files: %m");
return 1;
}
diff --git a/src/shared/generator.c b/src/shared/generator.c
index 6a78ebbda7..86e9356dd1 100644
--- a/src/shared/generator.c
+++ b/src/shared/generator.c
@@ -37,6 +37,22 @@
#include "unit-name.h"
#include "util.h"
+int generator_add_symlink(const char *root, const char *dst, const char *dep_type, const char *src) {
+ /* Adds a symlink from <dst>.<dep_type>.d/ to ../<src> */
+
+ const char *from, *to;
+
+ from = strjoina("../", src);
+ to = strjoina(root, "/", dst, ".", dep_type, "/", src);
+
+ mkdir_parents_label(to, 0755);
+ if (symlink(from, to) < 0)
+ if (errno != EEXIST)
+ return log_error_errno(errno, "Failed to create symlink \"%s\": %m", to);
+
+ return 0;
+}
+
static int write_fsck_sysroot_service(const char *dir, const char *what) {
_cleanup_free_ char *device = NULL, *escaped = NULL;
_cleanup_fclose_ FILE *f = NULL;
@@ -182,6 +198,10 @@ int generator_write_timeouts(
node = fstab_node_to_udev_node(what);
if (!node)
return log_oom();
+ if (!is_device_path(node)) {
+ log_warning("x-systemd.device-timeout ignored for %s", what);
+ return 0;
+ }
r = unit_name_from_path(node, ".device", &unit);
if (r < 0)
diff --git a/src/shared/generator.h b/src/shared/generator.h
index 825d934c8e..e70016839f 100644
--- a/src/shared/generator.h
+++ b/src/shared/generator.h
@@ -21,6 +21,8 @@
#include <stdio.h>
+int generator_add_symlink(const char *root, const char *dst, const char *dep_type, const char *src);
+
int generator_write_fsck_deps(
FILE *f,
const char *dir,
diff --git a/src/shared/pager.c b/src/shared/pager.c
index 4d7b02c63c..ad48652527 100644
--- a/src/shared/pager.c
+++ b/src/shared/pager.c
@@ -87,7 +87,7 @@ int pager_open(bool no_pager, bool jump_to_end) {
if (pipe(fd) < 0)
return log_error_errno(errno, "Failed to create pager pipe: %m");
- parent_pid = getpid();
+ parent_pid = getpid_cached();
pager_pid = fork();
if (pager_pid < 0)
diff --git a/src/shared/seccomp-util.c b/src/shared/seccomp-util.c
index 36843d4bf5..5d8a6986b7 100644
--- a/src/shared/seccomp-util.c
+++ b/src/shared/seccomp-util.c
@@ -692,7 +692,7 @@ static int seccomp_add_syscall_filter_set(
r = seccomp_rule_add_exact(seccomp, action, id, 0);
if (r < 0)
/* If the system call is not known on this architecture, then that's fine, let's ignore it */
- log_debug_errno(r, "Failed to add rule for system call %s, ignoring: %m", sys);
+ log_debug_errno(r, "Failed to add rule for system call %s() / %d, ignoring: %m", sys, id);
}
}
@@ -761,7 +761,7 @@ int seccomp_load_syscall_filter_set_raw(uint32_t default_action, Set* set, uint3
_cleanup_free_ char *n = NULL;
n = seccomp_syscall_resolve_num_arch(arch, PTR_TO_INT(id) - 1);
- log_debug_errno(r, "Failed to add rule for system call %s, ignoring: %m", strna(n));
+ log_debug_errno(r, "Failed to add rule for system call %s() / %d, ignoring: %m", strna(n), PTR_TO_INT(id) - 1);
}
}
@@ -899,6 +899,10 @@ int seccomp_protect_sysctl(void) {
log_debug("Operating on architecture: %s", seccomp_arch_to_string(arch));
+ if (IN_SET(arch, SCMP_ARCH_X32, SCMP_ARCH_AARCH64))
+ /* No _sysctl syscall */
+ continue;
+
r = seccomp_init_for_arch(&seccomp, arch, SCMP_ACT_ALLOW);
if (r < 0)
return r;
@@ -1219,10 +1223,6 @@ int seccomp_memory_deny_write_execute(void) {
break;
- case SCMP_ARCH_AARCH64:
- block_syscall = SCMP_SYS(mmap);
- /* fall through */
-
case SCMP_ARCH_ARM:
filter_syscall = SCMP_SYS(mmap2); /* arm has only mmap2 */
shmat_syscall = SCMP_SYS(shmat);
@@ -1230,7 +1230,8 @@ int seccomp_memory_deny_write_execute(void) {
case SCMP_ARCH_X86_64:
case SCMP_ARCH_X32:
- filter_syscall = SCMP_SYS(mmap); /* amd64 and x32 have only mmap */
+ case SCMP_ARCH_AARCH64:
+ filter_syscall = SCMP_SYS(mmap); /* amd64, x32, and arm64 have only mmap */
shmat_syscall = SCMP_SYS(shmat);
break;
diff --git a/src/sleep/Makefile b/src/sleep/Makefile
deleted file mode 120000
index d0b0e8e008..0000000000
--- a/src/sleep/Makefile
+++ /dev/null
@@ -1 +0,0 @@
-../Makefile \ No newline at end of file
diff --git a/src/socket-proxy/Makefile b/src/socket-proxy/Makefile
deleted file mode 120000
index d0b0e8e008..0000000000
--- a/src/socket-proxy/Makefile
+++ /dev/null
@@ -1 +0,0 @@
-../Makefile \ No newline at end of file
diff --git a/src/sulogin-shell/.gitignore b/src/sulogin-shell/.gitignore
deleted file mode 100644
index 01a315524b..0000000000
--- a/src/sulogin-shell/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-systemd-sulogin-shell
diff --git a/src/sysctl/Makefile b/src/sysctl/Makefile
deleted file mode 120000
index d0b0e8e008..0000000000
--- a/src/sysctl/Makefile
+++ /dev/null
@@ -1 +0,0 @@
-../Makefile \ No newline at end of file
diff --git a/src/system-update-generator/Makefile b/src/system-update-generator/Makefile
deleted file mode 120000
index d0b0e8e008..0000000000
--- a/src/system-update-generator/Makefile
+++ /dev/null
@@ -1 +0,0 @@
-../Makefile \ No newline at end of file
diff --git a/src/systemctl/Makefile b/src/systemctl/Makefile
deleted file mode 120000
index d0b0e8e008..0000000000
--- a/src/systemctl/Makefile
+++ /dev/null
@@ -1 +0,0 @@
-../Makefile \ No newline at end of file
diff --git a/src/systemctl/systemctl.c b/src/systemctl/systemctl.c
index 83ed9ef9f7..55fce62480 100644
--- a/src/systemctl/systemctl.c
+++ b/src/systemctl/systemctl.c
@@ -7259,11 +7259,6 @@ static void help_states(void) {
puts(automount_state_to_string(i));
if (!arg_no_legend)
- puts("\nAvailable busname unit substates:");
- for (i = 0; i < _BUSNAME_STATE_MAX; i++)
- puts(busname_state_to_string(i));
-
- if (!arg_no_legend)
puts("\nAvailable device unit substates:");
for (i = 0; i < _DEVICE_STATE_MAX; i++)
puts(device_state_to_string(i));
diff --git a/src/systemd/Makefile b/src/systemd/Makefile
deleted file mode 120000
index d0b0e8e008..0000000000
--- a/src/systemd/Makefile
+++ /dev/null
@@ -1 +0,0 @@
-../Makefile \ No newline at end of file
diff --git a/src/sysusers/Makefile b/src/sysusers/Makefile
deleted file mode 120000
index d0b0e8e008..0000000000
--- a/src/sysusers/Makefile
+++ /dev/null
@@ -1 +0,0 @@
-../Makefile \ No newline at end of file
diff --git a/src/sysv-generator/Makefile b/src/sysv-generator/Makefile
deleted file mode 120000
index d0b0e8e008..0000000000
--- a/src/sysv-generator/Makefile
+++ /dev/null
@@ -1 +0,0 @@
-../Makefile \ No newline at end of file
diff --git a/src/sysv-generator/sysv-generator.c b/src/sysv-generator/sysv-generator.c
index 9828078443..3f3237d9b3 100644
--- a/src/sysv-generator/sysv-generator.c
+++ b/src/sysv-generator/sysv-generator.c
@@ -28,6 +28,7 @@
#include "exit-status.h"
#include "fd-util.h"
#include "fileio.h"
+#include "generator.h"
#include "hashmap.h"
#include "hexdecoct.h"
#include "install.h"
@@ -101,29 +102,6 @@ static void free_sysvstub_hashmapp(Hashmap **h) {
hashmap_free(*h);
}
-static int add_symlink(const char *service, const char *where) {
- const char *from, *to;
- int r;
-
- assert(service);
- assert(where);
-
- from = strjoina(arg_dest, "/", service);
- to = strjoina(arg_dest, "/", where, ".wants/", service);
-
- mkdir_parents_label(to, 0755);
-
- r = symlink(from, to);
- if (r < 0) {
- if (errno == EEXIST)
- return 0;
-
- return -errno;
- }
-
- return 1;
-}
-
static int add_alias(const char *service, const char *alias) {
const char *link;
int r;
@@ -219,11 +197,8 @@ static int generate_unit_file(SysvStub *s) {
if (r < 0)
return log_error_errno(r, "Failed to write unit %s: %m", unit);
- STRV_FOREACH(p, s->wanted_by) {
- r = add_symlink(s->name, *p);
- if (r < 0)
- log_warning_errno(r, "Failed to create 'Wants' symlink to %s, ignoring: %m", *p);
- }
+ STRV_FOREACH(p, s->wanted_by)
+ (void) generator_add_symlink(arg_dest, *p, "wants", s->name);
return 1;
}
diff --git a/src/test/.gitignore b/src/test/.gitignore
deleted file mode 100644
index e4c198a4f7..0000000000
--- a/src/test/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-test-hashmap-ordered.c
diff --git a/src/test/Makefile b/src/test/Makefile
deleted file mode 120000
index d0b0e8e008..0000000000
--- a/src/test/Makefile
+++ /dev/null
@@ -1 +0,0 @@
-../Makefile \ No newline at end of file
diff --git a/src/test/meson.build b/src/test/meson.build
index 7b493a4d05..4f079876c4 100644
--- a/src/test/meson.build
+++ b/src/test/meson.build
@@ -756,21 +756,10 @@ tests += [
[],
[]],
- [['src/libsystemd/sd-bus/test-bus-kernel.c'],
- [],
- []],
-
- [['src/libsystemd/sd-bus/test-bus-kernel-bloom.c'],
- [],
- []],
-
[['src/libsystemd/sd-bus/test-bus-benchmark.c'],
[],
- [threads]],
-
- [['src/libsystemd/sd-bus/test-bus-zero-copy.c'],
- [],
- []],
+ [threads],
+ '', 'manual'],
[['src/libsystemd/sd-bus/test-bus-introspect.c'],
[],
diff --git a/src/test/test-cgroup.c b/src/test/test-cgroup.c
index 5336c19652..71e318a15b 100644
--- a/src/test/test-cgroup.c
+++ b/src/test/test-cgroup.c
@@ -35,19 +35,19 @@ int main(int argc, char*argv[]) {
assert_se(cg_create(SYSTEMD_CGROUP_CONTROLLER, "/test-b/test-c") == 0);
assert_se(cg_create_and_attach(SYSTEMD_CGROUP_CONTROLLER, "/test-b", 0) == 0);
- assert_se(cg_pid_get_path(SYSTEMD_CGROUP_CONTROLLER, getpid(), &path) == 0);
+ assert_se(cg_pid_get_path(SYSTEMD_CGROUP_CONTROLLER, getpid_cached(), &path) == 0);
assert_se(streq(path, "/test-b"));
free(path);
assert_se(cg_attach(SYSTEMD_CGROUP_CONTROLLER, "/test-a", 0) == 0);
- assert_se(cg_pid_get_path(SYSTEMD_CGROUP_CONTROLLER, getpid(), &path) == 0);
+ assert_se(cg_pid_get_path(SYSTEMD_CGROUP_CONTROLLER, getpid_cached(), &path) == 0);
assert_se(path_equal(path, "/test-a"));
free(path);
assert_se(cg_create_and_attach(SYSTEMD_CGROUP_CONTROLLER, "/test-b/test-d", 0) == 0);
- assert_se(cg_pid_get_path(SYSTEMD_CGROUP_CONTROLLER, getpid(), &path) == 0);
+ assert_se(cg_pid_get_path(SYSTEMD_CGROUP_CONTROLLER, getpid_cached(), &path) == 0);
assert_se(path_equal(path, "/test-b/test-d"));
free(path);
diff --git a/src/test/test-condition.c b/src/test/test-condition.c
index 121345cfd1..b15f1b98c0 100644
--- a/src/test/test-condition.c
+++ b/src/test/test-condition.c
@@ -390,7 +390,7 @@ static void test_condition_test_user(void) {
assert_se(condition);
r = condition_test(condition);
log_info("ConditionUser=@system → %i", r);
- if (geteuid() == 0)
+ if (getuid() < SYSTEM_UID_MAX || geteuid() < SYSTEM_UID_MAX)
assert_se(r > 0);
else
assert_se(r == 0);
diff --git a/src/test/test-log.c b/src/test/test-log.c
index 626d2c6135..8ab569f477 100644
--- a/src/test/test-log.c
+++ b/src/test/test-log.c
@@ -39,7 +39,7 @@ int main(int argc, char* argv[]) {
log_open();
log_struct(LOG_INFO,
- "MESSAGE=Waldo PID="PID_FMT, getpid(),
+ "MESSAGE=Waldo PID="PID_FMT, getpid_cached(),
"SERVICE=piepapo",
NULL);
@@ -47,12 +47,12 @@ int main(int argc, char* argv[]) {
log_open();
log_struct(LOG_INFO,
- "MESSAGE=Foobar PID="PID_FMT, getpid(),
+ "MESSAGE=Foobar PID="PID_FMT, getpid_cached(),
"SERVICE=foobar",
NULL);
log_struct(LOG_INFO,
- "MESSAGE=Foobar PID="PID_FMT, getpid(),
+ "MESSAGE=Foobar PID="PID_FMT, getpid_cached(),
"FORMAT_STR_TEST=1=%i A=%c 2=%hi 3=%li 4=%lli 1=%p foo=%s 2.5=%g 3.5=%g 4.5=%Lg",
(int) 1, 'A', (short) 2, (long int) 3, (long long int) 4, (void*) 1, "foo", (float) 2.5f, (double) 3.5, (long double) 4.5,
"SUFFIX=GOT IT",
diff --git a/src/test/test-process-util.c b/src/test/test-process-util.c
index c5edbcc5d2..046a96fdc8 100644
--- a/src/test/test-process-util.c
+++ b/src/test/test-process-util.c
@@ -115,7 +115,7 @@ static void test_pid_is_unwaited(void) {
waitpid(pid, &status, 0);
assert_se(!pid_is_unwaited(pid));
}
- assert_se(pid_is_unwaited(getpid()));
+ assert_se(pid_is_unwaited(getpid_cached()));
assert_se(!pid_is_unwaited(-1));
}
@@ -132,7 +132,7 @@ static void test_pid_is_alive(void) {
waitpid(pid, &status, 0);
assert_se(!pid_is_alive(pid));
}
- assert_se(pid_is_alive(getpid()));
+ assert_se(pid_is_alive(getpid_cached()));
assert_se(!pid_is_alive(-1));
}
@@ -205,149 +205,149 @@ static void test_get_process_cmdline_harder(void) {
assert_se(prctl(PR_SET_NAME, "testa") >= 0);
- assert_se(get_process_cmdline(getpid(), 0, false, &line) == -ENOENT);
+ assert_se(get_process_cmdline(getpid_cached(), 0, false, &line) == -ENOENT);
- assert_se(get_process_cmdline(getpid(), 0, true, &line) >= 0);
+ assert_se(get_process_cmdline(getpid_cached(), 0, true, &line) >= 0);
assert_se(streq(line, "[testa]"));
line = mfree(line);
- assert_se(get_process_cmdline(getpid(), 1, true, &line) >= 0);
+ assert_se(get_process_cmdline(getpid_cached(), 1, true, &line) >= 0);
assert_se(streq(line, ""));
line = mfree(line);
- assert_se(get_process_cmdline(getpid(), 2, true, &line) >= 0);
+ assert_se(get_process_cmdline(getpid_cached(), 2, true, &line) >= 0);
assert_se(streq(line, "["));
line = mfree(line);
- assert_se(get_process_cmdline(getpid(), 3, true, &line) >= 0);
+ assert_se(get_process_cmdline(getpid_cached(), 3, true, &line) >= 0);
assert_se(streq(line, "[."));
line = mfree(line);
- assert_se(get_process_cmdline(getpid(), 4, true, &line) >= 0);
+ assert_se(get_process_cmdline(getpid_cached(), 4, true, &line) >= 0);
assert_se(streq(line, "[.."));
line = mfree(line);
- assert_se(get_process_cmdline(getpid(), 5, true, &line) >= 0);
+ assert_se(get_process_cmdline(getpid_cached(), 5, true, &line) >= 0);
assert_se(streq(line, "[..."));
line = mfree(line);
- assert_se(get_process_cmdline(getpid(), 6, true, &line) >= 0);
+ assert_se(get_process_cmdline(getpid_cached(), 6, true, &line) >= 0);
assert_se(streq(line, "[...]"));
line = mfree(line);
- assert_se(get_process_cmdline(getpid(), 7, true, &line) >= 0);
+ assert_se(get_process_cmdline(getpid_cached(), 7, true, &line) >= 0);
assert_se(streq(line, "[t...]"));
line = mfree(line);
- assert_se(get_process_cmdline(getpid(), 8, true, &line) >= 0);
+ assert_se(get_process_cmdline(getpid_cached(), 8, true, &line) >= 0);
assert_se(streq(line, "[testa]"));
line = mfree(line);
assert_se(write(fd, "\0\0\0\0\0\0\0\0\0", 10) == 10);
- assert_se(get_process_cmdline(getpid(), 0, false, &line) == -ENOENT);
+ assert_se(get_process_cmdline(getpid_cached(), 0, false, &line) == -ENOENT);
- assert_se(get_process_cmdline(getpid(), 0, true, &line) >= 0);
+ assert_se(get_process_cmdline(getpid_cached(), 0, true, &line) >= 0);
assert_se(streq(line, "[testa]"));
line = mfree(line);
assert_se(write(fd, "foo\0bar\0\0\0\0\0", 10) == 10);
- assert_se(get_process_cmdline(getpid(), 0, false, &line) >= 0);
+ assert_se(get_process_cmdline(getpid_cached(), 0, false, &line) >= 0);
assert_se(streq(line, "foo bar"));
line = mfree(line);
- assert_se(get_process_cmdline(getpid(), 0, true, &line) >= 0);
+ assert_se(get_process_cmdline(getpid_cached(), 0, true, &line) >= 0);
assert_se(streq(line, "foo bar"));
line = mfree(line);
assert_se(write(fd, "quux", 4) == 4);
- assert_se(get_process_cmdline(getpid(), 0, false, &line) >= 0);
+ assert_se(get_process_cmdline(getpid_cached(), 0, false, &line) >= 0);
assert_se(streq(line, "foo bar quux"));
line = mfree(line);
- assert_se(get_process_cmdline(getpid(), 0, true, &line) >= 0);
+ assert_se(get_process_cmdline(getpid_cached(), 0, true, &line) >= 0);
assert_se(streq(line, "foo bar quux"));
line = mfree(line);
- assert_se(get_process_cmdline(getpid(), 1, true, &line) >= 0);
+ assert_se(get_process_cmdline(getpid_cached(), 1, true, &line) >= 0);
assert_se(streq(line, ""));
line = mfree(line);
- assert_se(get_process_cmdline(getpid(), 2, true, &line) >= 0);
+ assert_se(get_process_cmdline(getpid_cached(), 2, true, &line) >= 0);
assert_se(streq(line, "."));
line = mfree(line);
- assert_se(get_process_cmdline(getpid(), 3, true, &line) >= 0);
+ assert_se(get_process_cmdline(getpid_cached(), 3, true, &line) >= 0);
assert_se(streq(line, ".."));
line = mfree(line);
- assert_se(get_process_cmdline(getpid(), 4, true, &line) >= 0);
+ assert_se(get_process_cmdline(getpid_cached(), 4, true, &line) >= 0);
assert_se(streq(line, "..."));
line = mfree(line);
- assert_se(get_process_cmdline(getpid(), 5, true, &line) >= 0);
+ assert_se(get_process_cmdline(getpid_cached(), 5, true, &line) >= 0);
assert_se(streq(line, "f..."));
line = mfree(line);
- assert_se(get_process_cmdline(getpid(), 6, true, &line) >= 0);
+ assert_se(get_process_cmdline(getpid_cached(), 6, true, &line) >= 0);
assert_se(streq(line, "fo..."));
line = mfree(line);
- assert_se(get_process_cmdline(getpid(), 7, true, &line) >= 0);
+ assert_se(get_process_cmdline(getpid_cached(), 7, true, &line) >= 0);
assert_se(streq(line, "foo..."));
line = mfree(line);
- assert_se(get_process_cmdline(getpid(), 8, true, &line) >= 0);
+ assert_se(get_process_cmdline(getpid_cached(), 8, true, &line) >= 0);
assert_se(streq(line, "foo..."));
line = mfree(line);
- assert_se(get_process_cmdline(getpid(), 9, true, &line) >= 0);
+ assert_se(get_process_cmdline(getpid_cached(), 9, true, &line) >= 0);
assert_se(streq(line, "foo b..."));
line = mfree(line);
- assert_se(get_process_cmdline(getpid(), 10, true, &line) >= 0);
+ assert_se(get_process_cmdline(getpid_cached(), 10, true, &line) >= 0);
assert_se(streq(line, "foo ba..."));
line = mfree(line);
- assert_se(get_process_cmdline(getpid(), 11, true, &line) >= 0);
+ assert_se(get_process_cmdline(getpid_cached(), 11, true, &line) >= 0);
assert_se(streq(line, "foo bar..."));
line = mfree(line);
- assert_se(get_process_cmdline(getpid(), 12, true, &line) >= 0);
+ assert_se(get_process_cmdline(getpid_cached(), 12, true, &line) >= 0);
assert_se(streq(line, "foo bar..."));
line = mfree(line);
- assert_se(get_process_cmdline(getpid(), 13, true, &line) >= 0);
+ assert_se(get_process_cmdline(getpid_cached(), 13, true, &line) >= 0);
assert_se(streq(line, "foo bar quux"));
line = mfree(line);
- assert_se(get_process_cmdline(getpid(), 14, true, &line) >= 0);
+ assert_se(get_process_cmdline(getpid_cached(), 14, true, &line) >= 0);
assert_se(streq(line, "foo bar quux"));
line = mfree(line);
- assert_se(get_process_cmdline(getpid(), 1000, true, &line) >= 0);
+ assert_se(get_process_cmdline(getpid_cached(), 1000, true, &line) >= 0);
assert_se(streq(line, "foo bar quux"));
line = mfree(line);
assert_se(ftruncate(fd, 0) >= 0);
assert_se(prctl(PR_SET_NAME, "aaaa bbbb cccc") >= 0);
- assert_se(get_process_cmdline(getpid(), 0, false, &line) == -ENOENT);
+ assert_se(get_process_cmdline(getpid_cached(), 0, false, &line) == -ENOENT);
- assert_se(get_process_cmdline(getpid(), 0, true, &line) >= 0);
+ assert_se(get_process_cmdline(getpid_cached(), 0, true, &line) >= 0);
assert_se(streq(line, "[aaaa bbbb cccc]"));
line = mfree(line);
- assert_se(get_process_cmdline(getpid(), 10, true, &line) >= 0);
+ assert_se(get_process_cmdline(getpid_cached(), 10, true, &line) >= 0);
assert_se(streq(line, "[aaaa...]"));
line = mfree(line);
- assert_se(get_process_cmdline(getpid(), 11, true, &line) >= 0);
+ assert_se(get_process_cmdline(getpid_cached(), 11, true, &line) >= 0);
assert_se(streq(line, "[aaaa...]"));
line = mfree(line);
- assert_se(get_process_cmdline(getpid(), 12, true, &line) >= 0);
+ assert_se(get_process_cmdline(getpid_cached(), 12, true, &line) >= 0);
assert_se(streq(line, "[aaaa b...]"));
line = mfree(line);
@@ -410,6 +410,61 @@ static void test_rename_process(void) {
test_rename_process_one("1234567", 1); /* should always fit */
}
+static void test_getpid_cached(void) {
+ siginfo_t si;
+ pid_t a, b, c, d, e, f, child;
+
+ a = raw_getpid();
+ b = getpid_cached();
+ c = getpid();
+
+ assert_se(a == b && a == c);
+
+ child = fork();
+ assert_se(child >= 0);
+
+ if (child == 0) {
+ /* In child */
+ a = raw_getpid();
+ b = getpid_cached();
+ c = getpid();
+
+ assert_se(a == b && a == c);
+ _exit(0);
+ }
+
+ d = raw_getpid();
+ e = getpid_cached();
+ f = getpid();
+
+ assert_se(a == d && a == e && a == f);
+
+ assert_se(wait_for_terminate(child, &si) >= 0);
+ assert_se(si.si_status == 0);
+ assert_se(si.si_code == CLD_EXITED);
+}
+
+#define MEASURE_ITERATIONS (10000000LLU)
+
+static void test_getpid_measure(void) {
+ unsigned long long i;
+ usec_t t, q;
+
+ t = now(CLOCK_MONOTONIC);
+ for (i = 0; i < MEASURE_ITERATIONS; i++)
+ (void) getpid();
+ q = now(CLOCK_MONOTONIC) - t;
+
+ log_info(" glibc getpid(): %llu/s\n", (unsigned long long) (MEASURE_ITERATIONS*USEC_PER_SEC/q));
+
+ t = now(CLOCK_MONOTONIC);
+ for (i = 0; i < MEASURE_ITERATIONS; i++)
+ (void) getpid_cached();
+ q = now(CLOCK_MONOTONIC) - t;
+
+ log_info("getpid_cached(): %llu/s\n", (unsigned long long) (MEASURE_ITERATIONS*USEC_PER_SEC/q));
+}
+
int main(int argc, char *argv[]) {
log_set_max_level(LOG_DEBUG);
@@ -434,6 +489,8 @@ int main(int argc, char *argv[]) {
test_personality();
test_get_process_cmdline_harder();
test_rename_process();
+ test_getpid_cached();
+ test_getpid_measure();
return 0;
}
diff --git a/src/test/test-seccomp.c b/src/test/test-seccomp.c
index efd145e063..28fe206507 100644
--- a/src/test/test-seccomp.c
+++ b/src/test/test-seccomp.c
@@ -244,13 +244,17 @@ static void test_protect_sysctl(void) {
assert_se(pid >= 0);
if (pid == 0) {
+#if __NR__sysctl > 0
assert_se(syscall(__NR__sysctl, NULL) < 0);
assert_se(errno == EFAULT);
+#endif
assert_se(seccomp_protect_sysctl() >= 0);
+#if __NR__sysctl > 0
assert_se(syscall(__NR__sysctl, 0, 0, 0) < 0);
assert_se(errno == EPERM);
+#endif
_exit(EXIT_SUCCESS);
}
@@ -525,7 +529,11 @@ static void test_load_syscall_filter_set_raw(void) {
assert_se(poll(NULL, 0, 0) == 0);
assert_se(s = set_new(NULL));
+#if SCMP_SYS(access) >= 0
assert_se(set_put(s, UINT32_TO_PTR(__NR_access + 1)) >= 0);
+#else
+ assert_se(set_put(s, UINT32_TO_PTR(__NR_faccessat + 1)) >= 0);
+#endif
assert_se(seccomp_load_syscall_filter_set_raw(SCMP_ACT_ALLOW, s, SCMP_ACT_ERRNO(EUCLEAN)) >= 0);
@@ -537,7 +545,11 @@ static void test_load_syscall_filter_set_raw(void) {
s = set_free(s);
assert_se(s = set_new(NULL));
+#if SCMP_SYS(poll) >= 0
assert_se(set_put(s, UINT32_TO_PTR(__NR_poll + 1)) >= 0);
+#else
+ assert_se(set_put(s, UINT32_TO_PTR(__NR_ppoll + 1)) >= 0);
+#endif
assert_se(seccomp_load_syscall_filter_set_raw(SCMP_ACT_ALLOW, s, SCMP_ACT_ERRNO(EUNATCH)) >= 0);
diff --git a/src/test/test-signal-util.c b/src/test/test-signal-util.c
index 671eb869cb..92e3927784 100644
--- a/src/test/test-signal-util.c
+++ b/src/test/test-signal-util.c
@@ -50,12 +50,12 @@ static void test_block_signals(void) {
static void test_ignore_signals(void) {
assert_se(ignore_signals(SIGINT, -1) >= 0);
- assert_se(kill(getpid(), SIGINT) >= 0);
+ assert_se(kill(getpid_cached(), SIGINT) >= 0);
assert_se(ignore_signals(SIGUSR1, SIGUSR2, SIGTERM, SIGPIPE, -1) >= 0);
- assert_se(kill(getpid(), SIGUSR1) >= 0);
- assert_se(kill(getpid(), SIGUSR2) >= 0);
- assert_se(kill(getpid(), SIGTERM) >= 0);
- assert_se(kill(getpid(), SIGPIPE) >= 0);
+ assert_se(kill(getpid_cached(), SIGUSR1) >= 0);
+ assert_se(kill(getpid_cached(), SIGUSR2) >= 0);
+ assert_se(kill(getpid_cached(), SIGTERM) >= 0);
+ assert_se(kill(getpid_cached(), SIGPIPE) >= 0);
assert_se(default_signals(SIGINT, SIGUSR1, SIGUSR2, SIGTERM, SIGPIPE, -1) >= 0);
}
diff --git a/src/test/test-tables.c b/src/test/test-tables.c
index 294d219869..a16b04dbd2 100644
--- a/src/test/test-tables.c
+++ b/src/test/test-tables.c
@@ -19,7 +19,6 @@
#include "architecture.h"
#include "automount.h"
-#include "busname.h"
#include "cgroup.h"
#include "compress.h"
#include "condition.h"
@@ -54,9 +53,6 @@ int main(int argc, char **argv) {
test_table(architecture, ARCHITECTURE);
test_table(automount_result, AUTOMOUNT_RESULT);
test_table(automount_state, AUTOMOUNT_STATE);
- test_table(bus_policy_access, BUS_POLICY_ACCESS);
- test_table(busname_result, BUSNAME_RESULT);
- test_table(busname_state, BUSNAME_STATE);
test_table(cgroup_device_policy, CGROUP_DEVICE_POLICY);
test_table(condition_type, CONDITION_TYPE);
test_table(assert_type, CONDITION_TYPE);
diff --git a/src/test/test-tmpfiles.c b/src/test/test-tmpfiles.c
index a7c86d155a..b4c76048a4 100644
--- a/src/test/test-tmpfiles.c
+++ b/src/test/test-tmpfiles.c
@@ -45,7 +45,7 @@ int main(int argc, char** argv) {
fd = open_tmpfile_unlinkable(p, O_RDWR|O_CLOEXEC);
assert_se(fd >= 0);
- assert_se(asprintf(&cmd, "ls -l /proc/"PID_FMT"/fd/%d", getpid(), fd) > 0);
+ assert_se(asprintf(&cmd, "ls -l /proc/"PID_FMT"/fd/%d", getpid_cached(), fd) > 0);
(void) system(cmd);
assert_se(readlink_malloc(cmd + 6, &ans) >= 0);
log_debug("link1: %s", ans);
@@ -55,7 +55,7 @@ int main(int argc, char** argv) {
assert_se(fd >= 0);
assert_se(unlink(pattern) == 0);
- assert_se(asprintf(&cmd2, "ls -l /proc/"PID_FMT"/fd/%d", getpid(), fd2) > 0);
+ assert_se(asprintf(&cmd2, "ls -l /proc/"PID_FMT"/fd/%d", getpid_cached(), fd2) > 0);
(void) system(cmd2);
assert_se(readlink_malloc(cmd2 + 6, &ans2) >= 0);
log_debug("link2: %s", ans2);
diff --git a/src/test/test-unit-name.c b/src/test/test-unit-name.c
index 2fd83f321c..818ac5e372 100644
--- a/src/test/test-unit-name.c
+++ b/src/test/test-unit-name.c
@@ -30,9 +30,11 @@
#include "macro.h"
#include "manager.h"
#include "path-util.h"
+#include "rm-rf.h"
#include "specifier.h"
#include "string-util.h"
#include "test-helper.h"
+#include "tests.h"
#include "unit-name.h"
#include "unit-printf.h"
#include "unit.h"
@@ -210,8 +212,8 @@ static int test_unit_printf(void) {
assert_se(get_shell(&shell) >= 0);
r = manager_new(UNIT_FILE_USER, true, &m);
- if (r == -EPERM || r == -EACCES || r == -EADDRINUSE) {
- puts("manager_new: Permission denied. Skipping test.");
+ if (MANAGER_SKIP_TEST(r)) {
+ log_notice_errno(r, "Skipping test: manager_new: %m");
return EXIT_TEST_SKIP;
}
assert_se(r == 0);
@@ -228,8 +230,6 @@ static int test_unit_printf(void) {
assert_se(streq(t, expected)); \
}
- assert_se(setenv("XDG_RUNTIME_DIR", "/run/user/1/", 1) == 0);
-
assert_se(u = unit_new(m, sizeof(Service)));
assert_se(unit_add_name(u, "blah.service") == 0);
assert_se(unit_add_name(u, "blah.service") == 0);
@@ -463,7 +463,14 @@ static void test_unit_name_path_unescape(void) {
}
int main(int argc, char* argv[]) {
+ _cleanup_(rm_rf_physical_and_freep) char *runtime_dir = NULL;
int rc = 0;
+
+ log_parse_environment();
+ log_open();
+
+ assert_se(runtime_dir = setup_fake_runtime_dir());
+
test_unit_name_is_valid();
test_unit_name_replace_instance();
test_unit_name_from_path();
diff --git a/src/timedate/.gitignore b/src/timedate/.gitignore
deleted file mode 100644
index 48757f0968..0000000000
--- a/src/timedate/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-org.freedesktop.timedate1.policy
diff --git a/src/timedate/Makefile b/src/timedate/Makefile
deleted file mode 120000
index d0b0e8e008..0000000000
--- a/src/timedate/Makefile
+++ /dev/null
@@ -1 +0,0 @@
-../Makefile \ No newline at end of file
diff --git a/src/timesync/.gitignore b/src/timesync/.gitignore
deleted file mode 100644
index 35f4d76f79..0000000000
--- a/src/timesync/.gitignore
+++ /dev/null
@@ -1,2 +0,0 @@
-/timesyncd.conf
-/timesyncd-gperf.c
diff --git a/src/timesync/Makefile b/src/timesync/Makefile
deleted file mode 120000
index d0b0e8e008..0000000000
--- a/src/timesync/Makefile
+++ /dev/null
@@ -1 +0,0 @@
-../Makefile \ No newline at end of file
diff --git a/src/timesync/timesyncd-manager.c b/src/timesync/timesyncd-manager.c
index a24c821bdc..e0c92946d1 100644
--- a/src/timesync/timesyncd-manager.c
+++ b/src/timesync/timesyncd-manager.c
@@ -1092,6 +1092,10 @@ static int manager_network_monitor_listen(Manager *m) {
assert(m);
r = sd_network_monitor_new(&m->network_monitor, NULL);
+ if (r == -ENOENT) {
+ log_info("Systemd does not appear to be running, not listening for systmed-networkd events.");
+ return 0;
+ }
if (r < 0)
return r;
diff --git a/src/timesync/timesyncd.c b/src/timesync/timesyncd.c
index ff90f04070..86c14020b4 100644
--- a/src/timesync/timesyncd.c
+++ b/src/timesync/timesyncd.c
@@ -25,6 +25,7 @@
#include "fd-util.h"
#include "fs-util.h"
#include "network-util.h"
+#include "process-util.h"
#include "signal-util.h"
#include "timesyncd-conf.h"
#include "timesyncd-manager.h"
@@ -138,7 +139,7 @@ int main(int argc, char *argv[]) {
goto finish;
}
- log_debug("systemd-timesyncd running as pid " PID_FMT, getpid());
+ log_debug("systemd-timesyncd running as pid " PID_FMT, getpid_cached());
sd_notify(false,
"READY=1\n"
"STATUS=Daemon is running");
diff --git a/src/tmpfiles/Makefile b/src/tmpfiles/Makefile
deleted file mode 120000
index d0b0e8e008..0000000000
--- a/src/tmpfiles/Makefile
+++ /dev/null
@@ -1 +0,0 @@
-../Makefile \ No newline at end of file
diff --git a/src/tty-ask-password-agent/Makefile b/src/tty-ask-password-agent/Makefile
deleted file mode 120000
index d0b0e8e008..0000000000
--- a/src/tty-ask-password-agent/Makefile
+++ /dev/null
@@ -1 +0,0 @@
-../Makefile \ No newline at end of file
diff --git a/src/udev/.gitignore b/src/udev/.gitignore
deleted file mode 100644
index f5d8be3dc1..0000000000
--- a/src/udev/.gitignore
+++ /dev/null
@@ -1,4 +0,0 @@
-/udev.pc
-/keyboard-keys-from-name.gperf
-/keyboard-keys-from-name.h
-/keyboard-keys-list.txt
diff --git a/src/udev/Makefile b/src/udev/Makefile
deleted file mode 120000
index d0b0e8e008..0000000000
--- a/src/udev/Makefile
+++ /dev/null
@@ -1 +0,0 @@
-../Makefile \ No newline at end of file
diff --git a/src/udev/ata_id/Makefile b/src/udev/ata_id/Makefile
deleted file mode 120000
index d0b0e8e008..0000000000
--- a/src/udev/ata_id/Makefile
+++ /dev/null
@@ -1 +0,0 @@
-../Makefile \ No newline at end of file
diff --git a/src/udev/cdrom_id/Makefile b/src/udev/cdrom_id/Makefile
deleted file mode 120000
index d0b0e8e008..0000000000
--- a/src/udev/cdrom_id/Makefile
+++ /dev/null
@@ -1 +0,0 @@
-../Makefile \ No newline at end of file
diff --git a/src/udev/collect/Makefile b/src/udev/collect/Makefile
deleted file mode 120000
index d0b0e8e008..0000000000
--- a/src/udev/collect/Makefile
+++ /dev/null
@@ -1 +0,0 @@
-../Makefile \ No newline at end of file
diff --git a/src/udev/mtd_probe/Makefile b/src/udev/mtd_probe/Makefile
deleted file mode 120000
index d0b0e8e008..0000000000
--- a/src/udev/mtd_probe/Makefile
+++ /dev/null
@@ -1 +0,0 @@
-../Makefile \ No newline at end of file
diff --git a/src/udev/net/.gitignore b/src/udev/net/.gitignore
deleted file mode 100644
index 9ca85bacc9..0000000000
--- a/src/udev/net/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-/link-config-gperf.c
diff --git a/src/udev/net/Makefile b/src/udev/net/Makefile
deleted file mode 120000
index 94aaae2c4d..0000000000
--- a/src/udev/net/Makefile
+++ /dev/null
@@ -1 +0,0 @@
-../../Makefile \ No newline at end of file
diff --git a/src/udev/scsi_id/.gitignore b/src/udev/scsi_id/.gitignore
deleted file mode 100644
index 6aebddd809..0000000000
--- a/src/udev/scsi_id/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-scsi_id_version.h
diff --git a/src/udev/scsi_id/Makefile b/src/udev/scsi_id/Makefile
deleted file mode 120000
index d0b0e8e008..0000000000
--- a/src/udev/scsi_id/Makefile
+++ /dev/null
@@ -1 +0,0 @@
-../Makefile \ No newline at end of file
diff --git a/src/udev/udevd.c b/src/udev/udevd.c
index acbddd4180..0e49e62688 100644
--- a/src/udev/udevd.c
+++ b/src/udev/udevd.c
@@ -174,7 +174,7 @@ static void event_free(struct event *event) {
if (udev_list_node_is_empty(&event->manager->events)) {
/* only clean up the queue from the process that created it */
- if (event->manager->pid == getpid()) {
+ if (event->manager->pid == getpid_cached()) {
r = unlink("/run/udev/queue");
if (r < 0)
log_warning_errno(errno, "could not unlink /run/udev/queue: %m");
@@ -593,9 +593,9 @@ static int event_queue_insert(Manager *manager, struct udev_device *dev) {
/* only one process can add events to the queue */
if (manager->pid == 0)
- manager->pid = getpid();
+ manager->pid = getpid_cached();
- assert(manager->pid == getpid());
+ assert(manager->pid == getpid_cached());
event = new0(struct event, 1);
if (!event)
diff --git a/src/udev/v4l_id/Makefile b/src/udev/v4l_id/Makefile
deleted file mode 120000
index d0b0e8e008..0000000000
--- a/src/udev/v4l_id/Makefile
+++ /dev/null
@@ -1 +0,0 @@
-../Makefile \ No newline at end of file
diff --git a/src/update-done/Makefile b/src/update-done/Makefile
deleted file mode 120000
index d0b0e8e008..0000000000
--- a/src/update-done/Makefile
+++ /dev/null
@@ -1 +0,0 @@
-../Makefile \ No newline at end of file
diff --git a/src/update-utmp/Makefile b/src/update-utmp/Makefile
deleted file mode 120000
index d0b0e8e008..0000000000
--- a/src/update-utmp/Makefile
+++ /dev/null
@@ -1 +0,0 @@
-../Makefile \ No newline at end of file
diff --git a/src/update-utmp/update-utmp.c b/src/update-utmp/update-utmp.c
index ae9859ccad..f68d60a134 100644
--- a/src/update-utmp/update-utmp.c
+++ b/src/update-utmp/update-utmp.c
@@ -33,6 +33,7 @@
#include "format-util.h"
#include "log.h"
#include "macro.h"
+#include "process-util.h"
#include "special.h"
#include "strv.h"
#include "unit-name.h"
@@ -258,7 +259,7 @@ int main(int argc, char *argv[]) {
goto finish;
}
- log_debug("systemd-update-utmp running as pid "PID_FMT, getpid());
+ log_debug("systemd-update-utmp running as pid "PID_FMT, getpid_cached());
if (streq(argv[1], "reboot"))
r = on_reboot(&c);
@@ -271,7 +272,7 @@ int main(int argc, char *argv[]) {
r = -EINVAL;
}
- log_debug("systemd-update-utmp stopped as pid "PID_FMT, getpid());
+ log_debug("systemd-update-utmp stopped as pid "PID_FMT, getpid_cached());
finish:
#ifdef HAVE_AUDIT
diff --git a/src/user-sessions/Makefile b/src/user-sessions/Makefile
deleted file mode 120000
index d0b0e8e008..0000000000
--- a/src/user-sessions/Makefile
+++ /dev/null
@@ -1 +0,0 @@
-../Makefile \ No newline at end of file
diff --git a/src/vconsole/.gitignore b/src/vconsole/.gitignore
deleted file mode 100644
index 82741b2fb3..0000000000
--- a/src/vconsole/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-/90-vconsole.rules
diff --git a/src/vconsole/Makefile b/src/vconsole/Makefile
deleted file mode 120000
index d0b0e8e008..0000000000
--- a/src/vconsole/Makefile
+++ /dev/null
@@ -1 +0,0 @@
-../Makefile \ No newline at end of file
diff --git a/src/veritysetup/Makefile b/src/veritysetup/Makefile
deleted file mode 120000
index d0b0e8e008..0000000000
--- a/src/veritysetup/Makefile
+++ /dev/null
@@ -1 +0,0 @@
-../Makefile \ No newline at end of file
diff --git a/src/volatile-root/Makefile b/src/volatile-root/Makefile
deleted file mode 120000
index d0b0e8e008..0000000000
--- a/src/volatile-root/Makefile
+++ /dev/null
@@ -1 +0,0 @@
-../Makefile \ No newline at end of file
diff --git a/sysctl.d/.gitignore b/sysctl.d/.gitignore
deleted file mode 100644
index e326c180c3..0000000000
--- a/sysctl.d/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-/50-coredump.conf
diff --git a/sysctl.d/Makefile b/sysctl.d/Makefile
deleted file mode 120000
index bd1047548b..0000000000
--- a/sysctl.d/Makefile
+++ /dev/null
@@ -1 +0,0 @@
-../src/Makefile \ No newline at end of file
diff --git a/system-preset/Makefile b/system-preset/Makefile
deleted file mode 120000
index bd1047548b..0000000000
--- a/system-preset/Makefile
+++ /dev/null
@@ -1 +0,0 @@
-../src/Makefile \ No newline at end of file
diff --git a/sysusers.d/.gitignore b/sysusers.d/.gitignore
deleted file mode 100644
index c065034d29..0000000000
--- a/sysusers.d/.gitignore
+++ /dev/null
@@ -1,3 +0,0 @@
-/basic.conf
-/systemd.conf
-/systemd-remote.conf
diff --git a/sysusers.d/Makefile b/sysusers.d/Makefile
deleted file mode 120000
index bd1047548b..0000000000
--- a/sysusers.d/Makefile
+++ /dev/null
@@ -1 +0,0 @@
-../src/Makefile \ No newline at end of file
diff --git a/test/Makefile b/test/Makefile
deleted file mode 100644
index 987a32548f..0000000000
--- a/test/Makefile
+++ /dev/null
@@ -1,20 +0,0 @@
-# Just a little hook script to easy building when in this directory
-.PHONY: all check clean
-
-all:
- $(MAKE) -C ..
-
-clean:
- @for i in TEST-[0-9]*; do \
- [ -d $$i ] || continue ; \
- [ -f $$i/Makefile ] || continue ; \
- make -C $$i clean ; \
- done
-
-check:
- $(MAKE) -C .. all
- @for i in TEST-[0-9]*; do \
- [ -d $$i ] || continue ; \
- [ -f $$i/Makefile ] || continue ; \
- make -C $$i all ; \
- done
diff --git a/test/Makefile.guess b/test/Makefile.guess
new file mode 100644
index 0000000000..1916d09a6c
--- /dev/null
+++ b/test/Makefile.guess
@@ -0,0 +1,14 @@
+# Try to guess the build directory:
+# we look for subdirectories of ../.. that look like ninja build dirs.
+
+ifeq ($(BUILD_DIR),)
+ dirs = $(dir $(wildcard ../../*/.ninja_log))
+ ifeq ($(dirs),)
+ $(error Cannot guess build dir, set BUILD_DIR)
+ endif
+ ifneq ($(firstword $(dirs)),$(dirs))
+ $(warning Candidates: $(dirs))
+ $(error Too many build dirs to pick from, set BUILD_DIR)
+ endif
+ BUILD_DIR=$(dirs)
+endif
diff --git a/test/TEST-01-BASIC/Makefile b/test/TEST-01-BASIC/Makefile
index 5e89a29eff..b895de8bcb 100644
--- a/test/TEST-01-BASIC/Makefile
+++ b/test/TEST-01-BASIC/Makefile
@@ -1,10 +1,4 @@
-all:
- @make -s --no-print-directory -C ../.. all
- @basedir=../.. TEST_BASE_DIR=../ ./test.sh --all
-setup:
- @make --no-print-directory -C ../.. all
- @basedir=../.. TEST_BASE_DIR=../ ./test.sh --setup
-clean:
- @basedir=../.. TEST_BASE_DIR=../ ./test.sh --clean
-run:
- @basedir=../.. TEST_BASE_DIR=../ ./test.sh --run
+include ../Makefile.guess
+
+all setup clean run:
+ @basedir=../.. TEST_BASE_DIR=../ BUILD_DIR=$(BUILD_DIR) ./test.sh --$@
diff --git a/test/TEST-13-NSPAWN-SMOKE/Makefile b/test/TEST-13-NSPAWN-SMOKE/Makefile
index ff1470f852..41cca23c7f 100644
--- a/test/TEST-13-NSPAWN-SMOKE/Makefile
+++ b/test/TEST-13-NSPAWN-SMOKE/Makefile
@@ -1,11 +1,7 @@
-all:
- @make -s --no-print-directory -C ../.. all
- @basedir=../.. TEST_BASE_DIR=../ ./test.sh --all
-setup:
- @make --no-print-directory -C ../.. all
- @basedir=../.. TEST_BASE_DIR=../ ./test.sh --setup
+include ../Makefile.guess
+
+all setup run:
+ @basedir=../.. TEST_BASE_DIR=../ BUILD_DIR=$(BUILD_DIR) ./test.sh --$@
clean:
@basedir=../.. TEST_BASE_DIR=../ ./test.sh --clean
@rm -f has-overflow
-run:
- @basedir=../.. TEST_BASE_DIR=../ ./test.sh --run
diff --git a/test/TEST-14-MACHINE-ID/Makefile b/test/TEST-14-MACHINE-ID/Makefile
index 5e89a29eff..e9f93b1104 100644..120000
--- a/test/TEST-14-MACHINE-ID/Makefile
+++ b/test/TEST-14-MACHINE-ID/Makefile
@@ -1,10 +1 @@
-all:
- @make -s --no-print-directory -C ../.. all
- @basedir=../.. TEST_BASE_DIR=../ ./test.sh --all
-setup:
- @make --no-print-directory -C ../.. all
- @basedir=../.. TEST_BASE_DIR=../ ./test.sh --setup
-clean:
- @basedir=../.. TEST_BASE_DIR=../ ./test.sh --clean
-run:
- @basedir=../.. TEST_BASE_DIR=../ ./test.sh --run
+../TEST-01-BASIC/Makefile \ No newline at end of file
diff --git a/test/bus-policy/check-own-rules.conf b/test/bus-policy/check-own-rules.conf
deleted file mode 100644
index bc2f415fcb..0000000000
--- a/test/bus-policy/check-own-rules.conf
+++ /dev/null
@@ -1,14 +0,0 @@
-<!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"
- "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
-<busconfig>
- <user>mybususer</user>
- <listen>unix:path=/foo/bar</listen>
- <listen>tcp:port=1234</listen>
- <servicedir>/usr/share/foo</servicedir>
- <policy context="default">
- <allow user="*"/>
- <deny own="*"/>
- <allow own_prefix="org.freedesktop.ManySystems"/>
- </policy>
-
-</busconfig>
diff --git a/test/bus-policy/hello.conf b/test/bus-policy/hello.conf
deleted file mode 100644
index af09893de6..0000000000
--- a/test/bus-policy/hello.conf
+++ /dev/null
@@ -1,14 +0,0 @@
-<?xml version="1.0"?> <!--*-nxml-*-->
-<!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"
- "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
-
-<busconfig>
-
- <policy context="default">
- <allow user="*"/>
-
- <deny user="1"/>
- <deny group="1"/>
- </policy>
-
-</busconfig>
diff --git a/test/bus-policy/many-rules.conf b/test/bus-policy/many-rules.conf
deleted file mode 100644
index 70dd538c11..0000000000
--- a/test/bus-policy/many-rules.conf
+++ /dev/null
@@ -1,61 +0,0 @@
-<!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"
- "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
-<busconfig>
- <user>mybususer</user>
- <listen>unix:path=/foo/bar</listen>
- <listen>tcp:port=1234</listen>
- <includedir>basic.d</includedir>
- <standard_session_servicedirs />
- <servicedir>/usr/share/foo</servicedir>
- <include ignore_missing="yes">nonexistent.conf</include>
- <policy context="default">
- <allow user="*"/>
- <deny send_interface="org.freedesktop.System" send_member="Reboot"/>
- <deny receive_interface="org.freedesktop.System" receive_member="Reboot"/>
- <deny send_path="/foo/bar/SystemObjectThing" send_member="Reboot"/>
- <deny own="org.freedesktop.System"/>
- <deny own_prefix="org.freedesktop.ManySystems"/>
- <deny send_destination="org.freedesktop.System"/>
- <deny receive_sender="org.freedesktop.System"/>
- <deny user="root"/>
- <deny group="bin"/>
- <allow send_type="error"/>
- <allow send_type="method_call"/>
- <allow send_type="method_return"/>
- <allow send_type="signal"/>
- <deny send_destination="org.freedesktop.Bar" send_interface="org.freedesktop.Foo"/>
- <deny send_destination="org.freedesktop.Bar" send_interface="org.freedesktop.Foo" send_type="method_call"/>
- </policy>
-
- <policy context="mandatory">
- <allow user="*"/>
- <deny send_interface="org.freedesktop.System" send_member="Reboot"/>
- <deny receive_interface="org.freedesktop.System" receive_member="Reboot"/>
- <deny send_path="/foo/bar/SystemObjectThing" send_member="Reboot"/>
- <deny own="org.freedesktop.System"/>
- <deny own_prefix="org.freedesktop.ManySystems"/>
- <deny send_destination="org.freedesktop.System"/>
- <deny receive_sender="org.freedesktop.System"/>
- <deny user="root"/>
- <deny group="bin"/>
- <allow send_type="error"/>
- <allow send_type="method_call"/>
- <allow send_type="method_return"/>
- <allow send_type="signal"/>
- <deny send_destination="org.freedesktop.Bar" send_interface="org.freedesktop.Foo"/>
- <deny send_destination="org.freedesktop.Bar" send_interface="org.freedesktop.Foo" send_type="method_call"/>
- </policy>
-
- <limit name="max_incoming_bytes">5000</limit>
- <limit name="max_outgoing_bytes">5000</limit>
- <limit name="max_message_size">300</limit>
- <limit name="service_start_timeout">5000</limit>
- <limit name="auth_timeout">6000</limit>
- <limit name="max_completed_connections">50</limit>
- <limit name="max_incomplete_connections">80</limit>
- <limit name="max_connections_per_user">64</limit>
- <limit name="max_pending_service_starts">64</limit>
- <limit name="max_names_per_connection">256</limit>
- <limit name="max_match_rules_per_connection">512</limit>
-
-</busconfig>
diff --git a/test/bus-policy/methods.conf b/test/bus-policy/methods.conf
deleted file mode 100644
index 4bc38f9151..0000000000
--- a/test/bus-policy/methods.conf
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0"?> <!--*-nxml-*-->
-<!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"
- "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
-
-<busconfig>
-
- <policy context="default">
- <deny send_type="method_call"/>
-
- <deny send_destination="org.test.test1"/>
- <allow send_destination="org.test.test1" send_interface="org.test.int1"/>
- <allow send_destination="org.test.test1" send_interface="org.test.int2"/>
-
- <allow receive_sender="org.test.test3" receive_interface="org.test.int3" receive_member="Member111"/>
- </policy>
-
-</busconfig>
diff --git a/test/bus-policy/ownerships.conf b/test/bus-policy/ownerships.conf
deleted file mode 100644
index bc3a230a26..0000000000
--- a/test/bus-policy/ownerships.conf
+++ /dev/null
@@ -1,24 +0,0 @@
-<?xml version="1.0"?> <!--*-nxml-*-->
-<!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"
- "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
-
-<busconfig>
-
- <policy context="default">
- <allow own="org.test.test1"/>
- </policy>
-
- <policy context="mandatory">
- <deny own="org.test.test3"/>
- </policy>
-
- <policy user="root">
- <allow own="org.test.test2"/>
- <allow own="org.test.test3"/>
- </policy>
-
- <policy user="1">
- <allow own="org.test.test4"/>
- </policy>
-
-</busconfig>
diff --git a/test/bus-policy/signals.conf b/test/bus-policy/signals.conf
deleted file mode 100644
index 440e3fe6d0..0000000000
--- a/test/bus-policy/signals.conf
+++ /dev/null
@@ -1,15 +0,0 @@
-<?xml version="1.0"?> <!--*-nxml-*-->
-<!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"
- "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
-
-<busconfig>
-
- <policy context="default">
- <allow send_type="signal"/>
- </policy>
-
- <policy user="1">
- <deny send_type="signal"/>
- </policy>
-
-</busconfig>
diff --git a/test/bus-policy/test.conf b/test/bus-policy/test.conf
deleted file mode 100644
index ee6afcdfbb..0000000000
--- a/test/bus-policy/test.conf
+++ /dev/null
@@ -1,20 +0,0 @@
-<!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"
- "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
-<busconfig>
- <!-- The following demonstrates how to punch holes in a default deny-all
- policy so that a particular user can own a service, and other
- connections can get messages from it -->
-
- <!-- Only root can own the FooService service, and
- this user can only send the one kind of message -->
- <policy user="root">
- <allow own="org.foo.FooService"/>
- <allow send_interface="org.foo.FooBroadcastInterface"/>
- </policy>
-
- <!-- Allow any connection to receive the message, but
- only if the message is sent by the owner of FooService -->
- <policy context="default">
- <allow receive_interface="org.foo.FooBroadcastInterface" receive_sender="org.foo.FooService"/>
- </policy>
-</busconfig>
diff --git a/test/meson.build b/test/meson.build
index 55e693ac72..c16ca92702 100644
--- a/test/meson.build
+++ b/test/meson.build
@@ -126,13 +126,6 @@ test_data_files = '''
test-execute/exec-read-only-path-succeed.service
test-execute/exec-privatedevices-yes-capability-sys-rawio.service
test-execute/exec-privatedevices-no-capability-sys-rawio.service
- bus-policy/hello.conf
- bus-policy/methods.conf
- bus-policy/ownerships.conf
- bus-policy/signals.conf
- bus-policy/check-own-rules.conf
- bus-policy/many-rules.conf
- bus-policy/test.conf
hwdb/10-bad.hwdb
journal-data/journal-1.txt
journal-data/journal-2.txt
@@ -165,3 +158,9 @@ if install_tests
install_dir : testsdir + '/testdata/' + subdir)
endforeach
endif
+
+############################################################
+
+sysv_generator_test_py = find_program('sysv-generator-test.py')
+test('sysv-generator-test',
+ sysv_generator_test_py)
diff --git a/test/networkd-test.py b/test/networkd-test.py
index eee8b65ec0..9bf7ee0019 100755
--- a/test/networkd-test.py
+++ b/test/networkd-test.py
@@ -334,7 +334,7 @@ DHCP=%s
# check networkctl state
out = subprocess.check_output(['networkctl'])
- self.assertRegex(out, (r'%s\s+ether\s+routable\s+unmanaged' % self.if_router).encode())
+ self.assertRegex(out, (r'%s\s+ether\s+[a-z-]+\s+unmanaged' % self.if_router).encode())
self.assertRegex(out, (r'%s\s+ether\s+routable\s+configured' % self.iface).encode())
out = subprocess.check_output(['networkctl', 'status', self.iface])
diff --git a/test/sysv-generator-test.py b/test/sysv-generator-test.py
index d116fffe38..99e323db3b 100755
--- a/test/sysv-generator-test.py
+++ b/test/sysv-generator-test.py
@@ -153,7 +153,8 @@ class SysvGeneratorTest(unittest.TestCase):
link = os.path.join(self.out_dir, '%s.target.wants' % target, unit)
if target in targets:
unit_file = os.readlink(link)
- self.assertTrue(os.path.exists(unit_file))
+ # os.path.exists() will fail on a dangling symlink
+ self.assertTrue(os.path.exists(link))
self.assertEqual(os.path.basename(unit_file), unit)
else:
self.assertFalse(os.path.exists(link),
diff --git a/test/test-functions b/test/test-functions
index ea4f700841..64926089d4 100644
--- a/test/test-functions
+++ b/test/test-functions
@@ -155,7 +155,7 @@ $KERNEL_APPEND \
run_nspawn() {
[[ -d /run/systemd/system ]] || return 1
- local _nspawn_cmd="../../systemd-nspawn --register=no --kill-signal=SIGKILL --directory=$TESTDIR/nspawn-root $ROOTLIBDIR/systemd $KERNEL_APPEND"
+ local _nspawn_cmd="$BUILD_DIR/systemd-nspawn --register=no --kill-signal=SIGKILL --directory=$TESTDIR/nspawn-root $ROOTLIBDIR/systemd $KERNEL_APPEND"
if [[ "$NSPAWN_TIMEOUT" != "infinity" ]]; then
_nspawn_cmd="timeout --foreground $NSPAWN_TIMEOUT $_nspawn_cmd"
fi
@@ -317,7 +317,7 @@ install_dmevent() {
install_systemd() {
# install compiled files
- (cd $TEST_BASE_DIR/..; set -x; make DESTDIR=$initdir install)
+ (set -x; DESTDIR=$initdir ninja -C $BUILD_DIR install)
# remove unneeded documentation
rm -fr $initdir/usr/share/{man,doc}
# we strip binaries since debug symbols increase binaries size a lot
@@ -396,7 +396,7 @@ EOF
install_execs() {
ddebug "install any Execs from the service files"
(
- export PKG_CONFIG_PATH=$TEST_BASE_DIR/../src/core/
+ export PKG_CONFIG_PATH=$BUILD_DIR/src/core/
systemdsystemunitdir=$(pkg-config --variable=systemdsystemunitdir systemd)
systemduserunitdir=$(pkg-config --variable=systemduserunitdir systemd)
egrep -ho '^Exec[^ ]*=[^ ]+' $initdir/{$systemdsystemunitdir,$systemduserunitdir}/*.service \
diff --git a/tmpfiles.d/.gitignore b/tmpfiles.d/.gitignore
deleted file mode 100644
index 73c62c1045..0000000000
--- a/tmpfiles.d/.gitignore
+++ /dev/null
@@ -1,4 +0,0 @@
-/etc.conf
-/systemd.conf
-/systemd-remote.conf
-/var.conf
diff --git a/tmpfiles.d/Makefile b/tmpfiles.d/Makefile
deleted file mode 120000
index bd1047548b..0000000000
--- a/tmpfiles.d/Makefile
+++ /dev/null
@@ -1 +0,0 @@
-../src/Makefile \ No newline at end of file
diff --git a/tools/add-git-hook.sh b/tools/add-git-hook.sh
new file mode 100755
index 0000000000..4ee919faf4
--- /dev/null
+++ b/tools/add-git-hook.sh
@@ -0,0 +1,11 @@
+#!/bin/sh -eu
+
+cd "$MESON_SOURCE_ROOT"
+
+if [ ! -f .git/hooks/pre-commit.sample -o -f .git/hooks/pre-commit ]; then
+ exit 2 # not needed
+fi
+
+cp -p .git/hooks/pre-commit.sample .git/hooks/pre-commit
+chmod +x .git/hooks/pre-commit
+echo 'Activated pre-commit hook'
diff --git a/tools/make-directive-index.py b/tools/make-directive-index.py
index 1b287997fa..f9203ddd1a 100755
--- a/tools/make-directive-index.py
+++ b/tools/make-directive-index.py
@@ -21,7 +21,7 @@
import sys
import collections
import re
-from xml_helper import *
+from xml_helper import xml_parse, xml_print, tree
from copy import deepcopy
TEMPLATE = '''\
diff --git a/tools/make-man-index.py b/tools/make-man-index.py
index abc33e7394..0618e2e677 100755
--- a/tools/make-man-index.py
+++ b/tools/make-man-index.py
@@ -22,7 +22,7 @@
import collections
import sys
import re
-from xml_helper import *
+from xml_helper import xml_parse, xml_print, tree
MDASH = ' — ' if sys.version_info.major >= 3 else ' -- '
diff --git a/tools/make-man-rules.py b/tools/make-man-rules.py
index e9e39f10af..e0f18d6fbe 100755
--- a/tools/make-man-rules.py
+++ b/tools/make-man-rules.py
@@ -23,57 +23,13 @@ import collections
import sys
import os.path
import pprint
-from xml_helper import *
-
-SECTION = '''\
-MANPAGES += \\
- {manpages}
-MANPAGES_ALIAS += \\
- {aliases}
-{rules}
-{htmlrules}
-'''
-
-CONDITIONAL = '''\
-if {conditional}
-''' \
-+ SECTION + \
-'''\
-endif
-'''
-
-HEADER = '''\
-# Do not edit. Generated by make-man-rules.py.
-# To regenerate:
-# 1. Create, update, or remove source .xml files in man/
-# 2. Run 'make update-man-list'
-# 3. Run 'make man' to generate manpages
-#
-# To make a man page conditional on a configure switch add
-# attribute conditional="ENABLE_WHAT" or conditional="WITH_WHAT"
-# to <refentry> element.
-'''
-
-HTML_ALIAS_RULE = '''\
-{}.html: {}.html
- $(html-alias)
-'''
-
-FOOTER = '''\
-
-# Really, do not edit this file.
-
-EXTRA_DIST += \\
- {dist_files}
-'''
-
-meson = False
+from xml_helper import xml_parse
def man(page, number):
- return ('man/' if not meson else '') + '{}.{}'.format(page, number)
+ return '{}.{}'.format(page, number)
def xml(file):
- return ('man/' if not meson else '') + os.path.basename(file)
+ return os.path.basename(file)
def add_rules(rules, name):
xml = xml_parse(name)
@@ -110,21 +66,6 @@ def create_rules(xml_files):
def mjoin(files):
return ' \\\n\t'.join(sorted(files) or '#')
-def make_makefile(rules, dist_files):
- return HEADER + '\n'.join(
- (CONDITIONAL if conditional else SECTION).format(
- manpages=mjoin(set(rulegroup.values())),
- aliases=mjoin(k for k,v in rulegroup.items() if k != v),
- rules='\n'.join('{}: {}'.format(k,v)
- for k,v in sorted(rulegroup.items())
- if k != v),
- htmlrules='\n'.join(HTML_ALIAS_RULE.format(k[:-2],v[:-2])
- for k,v in sorted(rulegroup.items())
- if k != v),
- conditional=conditional)
- for conditional,rulegroup in sorted(rules.items())
- ) + FOOTER.format(dist_files=mjoin(sorted(dist_files)))
-
MESON_HEADER = '''\
# Do not edit. Generated by make-man-rules.py.
manpages = ['''
@@ -151,14 +92,10 @@ def make_mesonfile(rules, dist_files):
return '\n'.join((MESON_HEADER, pprint.pformat(lines)[1:-1], MESON_FOOTER))
if __name__ == '__main__':
- meson = sys.argv[1] == '--meson'
- pages = sys.argv[1+meson:]
+ pages = sys.argv[1:]
rules = create_rules(pages)
dist_files = (xml(file) for file in pages
if not file.endswith(".directives.xml") and
not file.endswith(".index.xml"))
- if meson:
- print(make_mesonfile(rules, dist_files))
- else:
- print(make_makefile(rules, dist_files), end='')
+ print(make_mesonfile(rules, dist_files))
diff --git a/units/.gitignore b/units/.gitignore
deleted file mode 100644
index 4398a59f91..0000000000
--- a/units/.gitignore
+++ /dev/null
@@ -1,80 +0,0 @@
-/user@.service.m4
-/console-getty.service
-/console-getty.service.m4
-/container-getty@.service
-/container-getty@.service.m4
-/debug-shell.service
-/emergency.service
-/getty@.service
-/halt-local.service
-/initrd-cleanup.service
-/initrd-parse-etc.service
-/initrd-switch-root.service
-/initrd-udevadm-cleanup-db.service
-/kmod-static-nodes.service
-/quotaon.service
-/rc-local.service
-/rescue.service
-/serial-getty@.service
-/system-update-cleanup.service
-/systemd-ask-password-console.service
-/systemd-ask-password-wall.service
-/systemd-backlight@.service
-/systemd-binfmt.service
-/systemd-coredump@.service
-/systemd-firstboot.service
-/systemd-fsck-root.service
-/systemd-fsck@.service
-/systemd-machine-id-commit.service
-/systemd-halt.service
-/systemd-exit.service
-/systemd-hibernate.service
-/systemd-hostnamed.service
-/systemd-hybrid-sleep.service
-/systemd-importd.service
-/systemd-initctl.service
-/systemd-journal-catalog-update.service
-/systemd-journal-flush.service
-/systemd-journal-gatewayd.service
-/systemd-journal-remote.service
-/systemd-journal-upload.service
-/systemd-journald.service
-/systemd-kexec.service
-/systemd-localed.service
-/systemd-logind.service
-/systemd-machined.service
-/systemd-modules-load.service
-/systemd-networkd-wait-online.service
-/systemd-networkd.service
-/systemd-networkd.service.m4
-/systemd-nspawn@.service
-/systemd-poweroff.service
-/systemd-quotacheck.service
-/systemd-random-seed.service
-/systemd-reboot.service
-/systemd-remount-fs.service
-/systemd-resolved.service
-/systemd-resolved.service.m4
-/systemd-hibernate-resume@.service
-/systemd-rfkill.service
-/systemd-suspend.service
-/systemd-sysctl.service
-/systemd-sysusers.service
-/systemd-timedated.service
-/systemd-timesyncd.service
-/systemd-tmpfiles-clean.service
-/systemd-tmpfiles-setup-dev.service
-/systemd-tmpfiles-setup.service
-/systemd-tmpfiles.service
-/systemd-hwdb-update.service
-/systemd-udev-settle.service
-/systemd-udev-trigger.service
-/systemd-udevd.service
-/systemd-update-done.service
-/systemd-update-utmp-runlevel.service
-/systemd-update-utmp.service
-/systemd-user-sessions.service
-/systemd-vconsole-setup.service
-/systemd-volatile-root.service
-/tmp.mount
-/user@.service
diff --git a/units/Makefile b/units/Makefile
deleted file mode 120000
index bd1047548b..0000000000
--- a/units/Makefile
+++ /dev/null
@@ -1 +0,0 @@
-../src/Makefile \ No newline at end of file
diff --git a/units/org.freedesktop.hostname1.busname b/units/org.freedesktop.hostname1.busname
deleted file mode 100644
index f7b41331bf..0000000000
--- a/units/org.freedesktop.hostname1.busname
+++ /dev/null
@@ -1,15 +0,0 @@
-# This file is part of systemd.
-#
-# systemd is free software; you can redistribute it and/or modify it
-# under the terms of the GNU Lesser General Public License as published by
-# the Free Software Foundation; either version 2.1 of the License, or
-# (at your option) any later version.
-
-[Unit]
-Description=Hostname Service Bus Name
-Documentation=man:systemd-hostnamed.service(8) man:hostname(5) man:machine-info(5)
-Documentation=https://www.freedesktop.org/wiki/Software/systemd/hostnamed
-
-[BusName]
-Service=systemd-hostnamed.service
-AllowWorld=talk
diff --git a/units/org.freedesktop.import1.busname b/units/org.freedesktop.import1.busname
deleted file mode 100644
index ca6dcef98a..0000000000
--- a/units/org.freedesktop.import1.busname
+++ /dev/null
@@ -1,14 +0,0 @@
-# This file is part of systemd.
-#
-# systemd is free software; you can redistribute it and/or modify it
-# under the terms of the GNU Lesser General Public License as published by
-# the Free Software Foundation; either version 2.1 of the License, or
-# (at your option) any later version.
-
-[Unit]
-Description=Virtual Machine and Container Download Service Bus Name
-Documentation=man:systemd-importd.service(8)
-
-[BusName]
-Service=systemd-importd.service
-AllowWorld=talk
diff --git a/units/org.freedesktop.locale1.busname b/units/org.freedesktop.locale1.busname
deleted file mode 100644
index e0c498e8ff..0000000000
--- a/units/org.freedesktop.locale1.busname
+++ /dev/null
@@ -1,15 +0,0 @@
-# This file is part of systemd.
-#
-# systemd is free software; you can redistribute it and/or modify it
-# under the terms of the GNU Lesser General Public License as published by
-# the Free Software Foundation; either version 2.1 of the License, or
-# (at your option) any later version.
-
-[Unit]
-Description=Locale Service Bus Name
-Documentation=man:systemd-localed.service(8) man:locale.conf(5) man:vconsole.conf(5)
-Documentation=https://www.freedesktop.org/wiki/Software/systemd/localed
-
-[BusName]
-Service=systemd-localed.service
-AllowWorld=talk
diff --git a/units/org.freedesktop.login1.busname b/units/org.freedesktop.login1.busname
deleted file mode 100644
index b169720f8e..0000000000
--- a/units/org.freedesktop.login1.busname
+++ /dev/null
@@ -1,16 +0,0 @@
-# This file is part of systemd.
-#
-# systemd is free software; you can redistribute it and/or modify it
-# under the terms of the GNU Lesser General Public License as published by
-# the Free Software Foundation; either version 2.1 of the License, or
-# (at your option) any later version.
-
-[Unit]
-Description=Login Service Bus Name
-Documentation=man:systemd-logind.service(8) man:logind.conf(5)
-Documentation=https://www.freedesktop.org/wiki/Software/systemd/logind
-Documentation=https://www.freedesktop.org/wiki/Software/systemd/multiseat
-
-[BusName]
-Service=systemd-logind.service
-AllowWorld=talk
diff --git a/units/org.freedesktop.machine1.busname b/units/org.freedesktop.machine1.busname
deleted file mode 100644
index a1f0154778..0000000000
--- a/units/org.freedesktop.machine1.busname
+++ /dev/null
@@ -1,15 +0,0 @@
-# This file is part of systemd.
-#
-# systemd is free software; you can redistribute it and/or modify it
-# under the terms of the GNU Lesser General Public License as published by
-# the Free Software Foundation; either version 2.1 of the License, or
-# (at your option) any later version.
-
-[Unit]
-Description=Virtual Machine and Container Registration Service Bus Name
-Documentation=man:systemd-machined.service(8)
-Documentation=https://www.freedesktop.org/wiki/Software/systemd/machined
-
-[BusName]
-Service=systemd-machined.service
-AllowWorld=talk
diff --git a/units/org.freedesktop.network1.busname b/units/org.freedesktop.network1.busname
deleted file mode 100644
index 3a0e1189ad..0000000000
--- a/units/org.freedesktop.network1.busname
+++ /dev/null
@@ -1,20 +0,0 @@
-# This file is part of systemd.
-#
-# systemd is free software; you can redistribute it and/or modify it
-# under the terms of the GNU Lesser General Public License as published by
-# the Free Software Foundation; either version 2.1 of the License, or
-# (at your option) any later version.
-
-[Unit]
-Description=Network Service Bus Name
-Documentation=man:systemd-networkd.service(8)
-
-# This is pulled in by systemd-networkd.service, since it cannot run
-# without its policy set. However, let's conditionalize this unit on
-# non-kdbus system.
-ConditionPathExists=/sys/fs/kdbus/0-system/
-
-[BusName]
-Service=systemd-networkd.service
-AllowWorld=talk
-AllowUser=systemd-network own
diff --git a/units/org.freedesktop.resolve1.busname b/units/org.freedesktop.resolve1.busname
deleted file mode 100644
index 28c8f97037..0000000000
--- a/units/org.freedesktop.resolve1.busname
+++ /dev/null
@@ -1,21 +0,0 @@
-# This file is part of systemd.
-#
-# systemd is free software; you can redistribute it and/or modify it
-# under the terms of the GNU Lesser General Public License as published by
-# the Free Software Foundation; either version 2.1 of the License, or
-# (at your option) any later version.
-
-[Unit]
-Description=Network Name Resolution Service Bus Name
-Documentation=man:systemd-resolved.service(8)
-Documentation=https://www.freedesktop.org/wiki/Software/systemd/resolved
-
-# This is pulled in by systemd-resolved.service, since it cannot run
-# without its policy set. However, let's conditionalize this unit on
-# non-kdbus system.
-ConditionPathExists=/sys/fs/kdbus/0-system/
-
-[BusName]
-Service=systemd-resolved.service
-AllowWorld=talk
-AllowUser=systemd-resolve own
diff --git a/units/org.freedesktop.systemd1.busname b/units/org.freedesktop.systemd1.busname
deleted file mode 100644
index f9f41cbaf0..0000000000
--- a/units/org.freedesktop.systemd1.busname
+++ /dev/null
@@ -1,15 +0,0 @@
-# This file is part of systemd.
-#
-# systemd is free software; you can redistribute it and/or modify it
-# under the terms of the GNU Lesser General Public License as published by
-# the Free Software Foundation; either version 2.1 of the License, or
-# (at your option) any later version.
-
-[Unit]
-Description=System and Service Manager Bus Name
-Documentation=man:systemd(1)
-Documentation=https://www.freedesktop.org/wiki/Software/systemd
-
-[BusName]
-Activating=no
-AllowWorld=talk
diff --git a/units/org.freedesktop.timedate1.busname b/units/org.freedesktop.timedate1.busname
deleted file mode 100644
index 1c962b5f8a..0000000000
--- a/units/org.freedesktop.timedate1.busname
+++ /dev/null
@@ -1,15 +0,0 @@
-# This file is part of systemd.
-#
-# systemd is free software; you can redistribute it and/or modify it
-# under the terms of the GNU Lesser General Public License as published by
-# the Free Software Foundation; either version 2.1 of the License, or
-# (at your option) any later version.
-
-[Unit]
-Description=Time & Date Service Bus Name
-Documentation=man:systemd-timedated.service(8) man:localtime(5)
-Documentation=https://www.freedesktop.org/wiki/Software/systemd/timedated
-
-[BusName]
-Service=systemd-timedated.service
-AllowWorld=talk
diff --git a/units/systemd-journald.service.in b/units/systemd-journald.service.in
index 66b7c6a48e..1e86d63648 100644
--- a/units/systemd-journald.service.in
+++ b/units/systemd-journald.service.in
@@ -21,7 +21,7 @@ Restart=always
RestartSec=0
StandardOutput=null
WatchdogSec=3min
-FileDescriptorStoreMax=1024
+FileDescriptorStoreMax=4224
CapabilityBoundingSet=CAP_SYS_ADMIN CAP_DAC_OVERRIDE CAP_SYS_PTRACE CAP_SYSLOG CAP_AUDIT_CONTROL CAP_AUDIT_READ CAP_CHOWN CAP_DAC_READ_SEARCH CAP_FOWNER CAP_SETUID CAP_SETGID CAP_MAC_OVERRIDE
MemoryDenyWriteExecute=yes
RestrictRealtime=yes
diff --git a/units/systemd-logind.service.in b/units/systemd-logind.service.in
index bb4a23ec83..f851373658 100644
--- a/units/systemd-logind.service.in
+++ b/units/systemd-logind.service.in
@@ -13,8 +13,7 @@ Documentation=https://www.freedesktop.org/wiki/Software/systemd/multiseat
Wants=user.slice
After=nss-user-lookup.target user.slice
-# Ask for the dbus socket. If running over kdbus, the socket will
-# not be actually used.
+# Ask for the dbus socket.
Wants=dbus.socket
After=dbus.socket
diff --git a/units/systemd-networkd.service.m4.in b/units/systemd-networkd.service.m4.in
index 15e6ad99d8..218e5c4d3f 100644
--- a/units/systemd-networkd.service.m4.in
+++ b/units/systemd-networkd.service.m4.in
@@ -16,11 +16,6 @@ Before=network.target multi-user.target shutdown.target
Conflicts=shutdown.target
Wants=network.target
-# On kdbus systems we pull in the busname explicitly, because it
-# carries policy that allows the daemon to acquire its name.
-Wants=org.freedesktop.network1.busname
-After=org.freedesktop.network1.busname
-
[Service]
Type=notify
Restart=on-failure
diff --git a/units/systemd-resolved.service.m4.in b/units/systemd-resolved.service.m4.in
index 931156a861..9821e1cfee 100644
--- a/units/systemd-resolved.service.m4.in
+++ b/units/systemd-resolved.service.m4.in
@@ -15,11 +15,6 @@ After=systemd-networkd.service network.target
Before=network-online.target nss-lookup.target
Wants=nss-lookup.target
-# On kdbus systems we pull in the busname explicitly, because it
-# carries policy that allows the daemon to acquire its name.
-Wants=org.freedesktop.resolve1.busname
-After=org.freedesktop.resolve1.busname
-
[Service]
Type=notify
Restart=always
diff --git a/units/user/.gitignore b/units/user/.gitignore
deleted file mode 100644
index 41a74f5461..0000000000
--- a/units/user/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-/systemd-exit.service
diff --git a/units/user/Makefile b/units/user/Makefile
deleted file mode 120000
index 50be21181f..0000000000
--- a/units/user/Makefile
+++ /dev/null
@@ -1 +0,0 @@
-../../src/Makefile \ No newline at end of file