units: drop full paths for utilities in $PATH

This makes things a bit simpler and the build a bit faster, because we don't
have to rewrite files to do the trivial substitution. @rootbindir@ is always in
our internal $PATH that we use for non-absolute paths, so there should be no
functional change.
This commit is contained in:
Zbigniew Jędrzejewski-Szmek 2019-12-18 09:14:57 +01:00 committed by Lennart Poettering
parent 5608deb847
commit cdc6804b60
27 changed files with 65 additions and 78 deletions

View File

@ -281,7 +281,6 @@ substs.set('userenvgeneratordir', userenvgeneratordi
substs.set('systemshutdowndir', systemshutdowndir)
substs.set('systemsleepdir', systemsleepdir)
substs.set('CERTIFICATEROOT', get_option('certificate-root'))
substs.set('SYSTEMCTL', join_paths(rootbindir, 'systemctl'))
substs.set('RANDOM_SEED', join_paths(randomseeddir, 'random-seed'))
substs.set('SYSTEM_SYSVINIT_PATH', sysvinit_path)
substs.set('SYSTEM_SYSVRCND_PATH', sysvrcnd_path)

View File

@ -17,4 +17,4 @@ After=initrd-root-fs.target initrd-fs.target initrd.target
[Service]
Type=oneshot
ExecStart=@rootbindir@/systemctl --no-block isolate initrd-switch-root.target
ExecStart=systemctl --no-block isolate initrd-switch-root.target

View File

@ -18,7 +18,7 @@ ConditionPathExists=/etc/initrd-release
[Service]
Type=oneshot
ExecStartPre=-@rootbindir@/systemctl daemon-reload
ExecStartPre=-systemctl daemon-reload
# we have to retrigger initrd-fs.target after daemon-reload
ExecStart=-@rootbindir@/systemctl --no-block start initrd-fs.target
ExecStart=@rootbindir@/systemctl --no-block start initrd-cleanup.service
ExecStart=-systemctl --no-block start initrd-fs.target
ExecStart=systemctl --no-block start initrd-cleanup.service

View File

@ -17,4 +17,4 @@ AllowIsolate=yes
[Service]
Type=oneshot
ExecStart=@rootbindir@/systemctl --no-block switch-root /sysroot
ExecStart=systemctl --no-block switch-root /sysroot

View File

@ -17,4 +17,4 @@ Before=initrd-switch-root.target
[Service]
Type=oneshot
ExecStart=-@rootbindir@/udevadm info --cleanup-db
ExecStart=-udevadm info --cleanup-db

View File

@ -23,10 +23,14 @@ units = [
['hibernate.target', 'ENABLE_HIBERNATE'],
['hybrid-sleep.target', 'ENABLE_HIBERNATE'],
['suspend-then-hibernate.target', 'ENABLE_HIBERNATE'],
['initrd-cleanup.service', ''],
['initrd-fs.target', ''],
['initrd-parse-etc.service', ''],
['initrd-root-device.target', ''],
['initrd-root-fs.target', ''],
['initrd-switch-root.service', ''],
['initrd-switch-root.target', ''],
['initrd-udevadm-cleanup-db.service', ''],
['initrd.target', ''],
['kexec.target', ''],
['ldconfig.service', 'ENABLE_LDCONFIG',
@ -81,13 +85,24 @@ units = [
['system-update-cleanup.service', ''],
['systemd-ask-password-console.path', '',
'sysinit.target.wants/'],
['systemd-ask-password-console.service', ''],
['systemd-ask-password-wall.path', '',
'multi-user.target.wants/'],
['systemd-ask-password-wall.service', ''],
['systemd-boot-system-token.service', 'ENABLE_EFI',
'sysinit.target.wants/'],
['systemd-coredump.socket', 'ENABLE_COREDUMP',
'sockets.target.wants/'],
['systemd-exit.service', ''],
['systemd-exit.service', ''],
['systemd-firstboot.service', 'ENABLE_FIRSTBOOT',
'sysinit.target.wants/'],
['systemd-halt.service', ''],
['systemd-initctl.socket', '',
'sockets.target.wants/'],
['systemd-journal-catalog-update.service', '',
'sysinit.target.wants/'],
['systemd-journal-flush.service', '',
'sysinit.target.wants/'],
['systemd-journal-gatewayd.socket', 'ENABLE_REMOTE HAVE_MICROHTTPD'],
['systemd-journal-remote.socket', 'ENABLE_REMOTE HAVE_MICROHTTPD'],
['systemd-journald-audit.socket', '',
@ -96,18 +111,31 @@ units = [
'sockets.target.wants/'],
['systemd-journald.socket', '',
'sockets.target.wants/'],
['systemd-userdbd.socket', 'ENABLE_USERDB',
'sockets.target.wants/'],
['systemd-kexec.service', ''],
['systemd-machine-id-commit.service', '',
'sysinit.target.wants/'],
['systemd-networkd.socket', 'ENABLE_NETWORKD'],
['systemd-poweroff.service', ''],
['systemd-reboot.service', ''],
['systemd-poweroff.service', ''],
['systemd-reboot.service', ''],
['systemd-rfkill.socket', 'ENABLE_RFKILL'],
['systemd-sysusers.service', 'ENABLE_SYSUSERS',
'sysinit.target.wants/'],
['systemd-tmpfiles-clean.service', 'ENABLE_TMPFILES'],
['systemd-tmpfiles-clean.timer', 'ENABLE_TMPFILES',
'timers.target.wants/'],
['systemd-tmpfiles-setup-dev.service', 'ENABLE_TMPFILES',
'sysinit.target.wants/'],
['systemd-tmpfiles-setup.service', 'ENABLE_TMPFILES',
'sysinit.target.wants/'],
['systemd-udevd-control.socket', '',
'sockets.target.wants/'],
['systemd-udev-settle.service', ''],
['systemd-udev-trigger.service', '',
'sysinit.target.wants/'],
['systemd-udevd-kernel.socket', '',
'sockets.target.wants/'],
['systemd-userdbd.socket', 'ENABLE_USERDB',
'sockets.target.wants/'],
['time-set.target', ''],
['time-sync.target', ''],
['timers.target', ''],
@ -122,31 +150,20 @@ units = [
in_units = [
['debug-shell.service', ''],
['emergency.service', ''],
['initrd-cleanup.service', ''],
['initrd-parse-etc.service', ''],
['initrd-switch-root.service', ''],
['initrd-udevadm-cleanup-db.service', ''],
['kmod-static-nodes.service', 'HAVE_KMOD ENABLE_TMPFILES',
'sysinit.target.wants/'],
['quotaon.service', 'ENABLE_QUOTACHECK'],
['rc-local.service', 'HAVE_SYSV_COMPAT'],
['rescue.service', ''],
['systemd-ask-password-console.service', ''],
['systemd-ask-password-wall.service', ''],
['systemd-backlight@.service', 'ENABLE_BACKLIGHT'],
['systemd-binfmt.service', 'ENABLE_BINFMT',
'sysinit.target.wants/'],
['systemd-bless-boot.service', 'ENABLE_EFI HAVE_BLKID'],
['systemd-boot-check-no-failures.service', ''],
['systemd-boot-system-token.service', 'ENABLE_EFI',
'sysinit.target.wants/'],
['systemd-coredump@.service', 'ENABLE_COREDUMP'],
['systemd-pstore.service', 'ENABLE_PSTORE'],
['systemd-firstboot.service', 'ENABLE_FIRSTBOOT',
'sysinit.target.wants/'],
['systemd-fsck-root.service', ''],
['systemd-fsck@.service', ''],
['systemd-halt.service', ''],
['systemd-hibernate-resume@.service', 'ENABLE_HIBERNATE'],
['systemd-hibernate.service', 'ENABLE_HIBERNATE'],
['systemd-hybrid-sleep.service', 'ENABLE_HIBERNATE'],
@ -158,22 +175,15 @@ in_units = [
['systemd-importd.service', 'ENABLE_IMPORTD',
'dbus-org.freedesktop.import1.service'],
['systemd-initctl.service', ''],
['systemd-journal-catalog-update.service', '',
'sysinit.target.wants/'],
['systemd-journal-flush.service', '',
'sysinit.target.wants/'],
['systemd-journal-gatewayd.service', 'ENABLE_REMOTE HAVE_MICROHTTPD'],
['systemd-journal-remote.service', 'ENABLE_REMOTE HAVE_MICROHTTPD'],
['systemd-journal-upload.service', 'ENABLE_REMOTE HAVE_LIBCURL'],
['systemd-journald.service', '',
'sysinit.target.wants/'],
['systemd-kexec.service', ''],
['systemd-localed.service', 'ENABLE_LOCALED',
'dbus-org.freedesktop.locale1.service'],
['systemd-logind.service', 'ENABLE_LOGIND',
'multi-user.target.wants/ dbus-org.freedesktop.login1.service'],
['systemd-machine-id-commit.service', '',
'sysinit.target.wants/'],
['systemd-machined.service', 'ENABLE_MACHINED',
'dbus-org.freedesktop.machine1.service'],
['systemd-modules-load.service', 'HAVE_KMOD',
@ -194,20 +204,10 @@ in_units = [
['systemd-suspend.service', ''],
['systemd-sysctl.service', '',
'sysinit.target.wants/'],
['systemd-sysusers.service', 'ENABLE_SYSUSERS',
'sysinit.target.wants/'],
['systemd-timedated.service', 'ENABLE_TIMEDATED',
'dbus-org.freedesktop.timedate1.service'],
['systemd-timesyncd.service', 'ENABLE_TIMESYNCD'],
['systemd-time-wait-sync.service', 'ENABLE_TIMESYNCD'],
['systemd-tmpfiles-clean.service', 'ENABLE_TMPFILES'],
['systemd-tmpfiles-setup-dev.service', 'ENABLE_TMPFILES',
'sysinit.target.wants/'],
['systemd-tmpfiles-setup.service', 'ENABLE_TMPFILES',
'sysinit.target.wants/'],
['systemd-udev-settle.service', ''],
['systemd-udev-trigger.service', '',
'sysinit.target.wants/'],
['systemd-udevd.service', '',
'sysinit.target.wants/'],
['systemd-update-done.service', '',

View File

@ -17,5 +17,5 @@ Before=shutdown.target
ConditionPathExists=!/run/plymouth/pid
[Service]
ExecStart=@rootbindir@/systemd-tty-ask-password-agent --watch --console
ExecStart=systemd-tty-ask-password-agent --watch --console
SystemCallArchitectures=native

View File

@ -13,6 +13,6 @@ Documentation=man:systemd-ask-password-console.service(8)
After=systemd-user-sessions.service
[Service]
ExecStartPre=-@SYSTEMCTL@ stop systemd-ask-password-console.path systemd-ask-password-console.service systemd-ask-password-plymouth.path systemd-ask-password-plymouth.service
ExecStart=@rootbindir@/systemd-tty-ask-password-agent --wall
ExecStartPre=-systemctl stop systemd-ask-password-console.path systemd-ask-password-console.service systemd-ask-password-plymouth.path systemd-ask-password-plymouth.service
ExecStart=systemd-tty-ask-password-agent --wall
SystemCallArchitectures=native

View File

@ -31,4 +31,4 @@ ConditionPathExists=|!/sys/firmware/efi/efivars/LoaderRandomSeed-4a67b082-0a4c-4
[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=@bindir@/bootctl random-seed --graceful
ExecStart=bootctl random-seed --graceful

View File

@ -20,7 +20,7 @@ ConditionFirstBoot=yes
[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=@rootbindir@/systemd-firstboot --prompt-locale --prompt-timezone --prompt-root-password
ExecStart=systemd-firstboot --prompt-locale --prompt-timezone --prompt-root-password
StandardOutput=tty
StandardInput=tty
StandardError=tty

View File

@ -16,4 +16,4 @@ After=shutdown.target umount.target final.target
[Service]
Type=oneshot
ExecStart=@SYSTEMCTL@ --force halt
ExecStart=systemctl --force halt

View File

@ -22,5 +22,5 @@ ConditionDirectoryNotEmpty=|/etc/udev/hwdb.d/
[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=@rootbindir@/systemd-hwdb update
ExecStart=systemd-hwdb update
TimeoutSec=90s

View File

@ -19,5 +19,5 @@ ConditionNeedsUpdate=/var
[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=@rootbindir@/journalctl --update-catalog
ExecStart=journalctl --update-catalog
TimeoutSec=90s

View File

@ -17,8 +17,8 @@ Before=systemd-tmpfiles-setup.service
RequiresMountsFor=/var/log/journal
[Service]
ExecStart=@rootbindir@/journalctl --flush
ExecStop=@rootbindir@/journalctl --smart-relinquish-var
ExecStart=journalctl --flush
ExecStop=journalctl --smart-relinquish-var
Type=oneshot
RemainAfterExit=yes
TimeoutSec=90s

View File

@ -16,4 +16,4 @@ After=shutdown.target umount.target final.target
[Service]
Type=oneshot
ExecStart=@SYSTEMCTL@ --force kexec
ExecStart=systemctl --force kexec

View File

@ -20,5 +20,5 @@ ConditionPathIsMountPoint=/etc/machine-id
[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=@rootbindir@/systemd-machine-id-setup --commit
ExecStart=systemd-machine-id-setup --commit
TimeoutSec=30s

View File

@ -18,7 +18,7 @@ RequiresMountsFor=/var/lib/machines
[Service]
# Make sure the DeviceAllow= lines below can properly resolve the 'block-loop' expression (and others)
ExecStart=@bindir@/systemd-nspawn --quiet --keep-unit --boot --link-journal=try-guest --network-veth -U --settings=override --machine=%i
ExecStart=systemd-nspawn --quiet --keep-unit --boot --link-journal=try-guest --network-veth -U --settings=override --machine=%i
KillMode=mixed
Type=notify
RestartForceExitStatus=133

View File

@ -19,5 +19,5 @@ ConditionNeedsUpdate=/etc
[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=@rootbindir@/systemd-sysusers
ExecStart=systemd-sysusers
TimeoutSec=90s

View File

@ -17,6 +17,6 @@ Before=shutdown.target
[Service]
Type=oneshot
ExecStart=@rootbindir@/systemd-tmpfiles --clean
ExecStart=systemd-tmpfiles --clean
SuccessExitStatus=DATAERR
IOSchedulingClass=idle

View File

@ -18,5 +18,5 @@ Before=sysinit.target local-fs-pre.target systemd-udevd.service shutdown.target
[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=@rootbindir@/systemd-tmpfiles --prefix=/dev --create --boot
ExecStart=systemd-tmpfiles --prefix=/dev --create --boot
SuccessExitStatus=DATAERR CANTCREAT

View File

@ -19,5 +19,5 @@ RefuseManualStop=yes
[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=@rootbindir@/systemd-tmpfiles --create --remove --boot --exclude-prefix=/dev
ExecStart=systemd-tmpfiles --create --remove --boot --exclude-prefix=/dev
SuccessExitStatus=DATAERR CANTCREAT

View File

@ -24,4 +24,4 @@ ConditionPathIsReadWrite=/sys
Type=oneshot
TimeoutSec=180
RemainAfterExit=yes
ExecStart=@rootbindir@/udevadm settle
ExecStart=udevadm settle

View File

@ -19,5 +19,5 @@ ConditionPathIsReadWrite=/sys
[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=@rootbindir@/udevadm trigger --type=subsystems --action=add
ExecStart=@rootbindir@/udevadm trigger --type=devices --action=add
ExecStart=udevadm trigger --type=subsystems --action=add
ExecStart=udevadm trigger --type=devices --action=add

View File

@ -23,7 +23,7 @@ Sockets=systemd-udevd-control.socket systemd-udevd-kernel.socket
Restart=always
RestartSec=0
ExecStart=@rootlibexecdir@/systemd-udevd
ExecReload=@rootbindir@/udevadm control --reload --timeout 0
ExecReload=udevadm control --reload --timeout 0
KillMode=mixed
TasksMax=infinity
PrivateMounts=yes

View File

@ -13,26 +13,14 @@ units = [
'smartcard.target',
'sockets.target',
'sound.target',
'timers.target',
'systemd-exit.service',
'systemd-tmpfiles-clean.service',
'systemd-tmpfiles-clean.timer',
'systemd-tmpfiles-setup.service',
'timers.target',
]
foreach file : units
install_data(file,
install_dir : userunitdir)
endforeach
in_units = [
'systemd-tmpfiles-clean.service',
'systemd-tmpfiles-setup.service',
]
foreach file : in_units
gen = configure_file(
input : file + '.in',
output : file,
configuration : substs)
install_data(gen,
install_dir : userunitdir)
endforeach

View File

@ -16,6 +16,6 @@ Before=basic.target shutdown.target
[Service]
Type=oneshot
ExecStart=@rootbindir@/systemd-tmpfiles --user --clean
ExecStart=systemd-tmpfiles --user --clean
SuccessExitStatus=DATAERR
IOSchedulingClass=idle

View File

@ -18,7 +18,7 @@ RefuseManualStop=yes
[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=@rootbindir@/systemd-tmpfiles --user --create --remove --boot
ExecStart=systemd-tmpfiles --user --create --remove --boot
SuccessExitStatus=DATAERR
[Install]