From 1ab6ae19575c55d134ed630fa0e13874ce1a6de4 Mon Sep 17 00:00:00 2001 From: Daan De Meyer Date: Thu, 8 Jun 2023 14:09:36 +0200 Subject: [PATCH] units: Use ImportCredential= where applicable --- units/systemd-firstboot.service | 11 ++++------- units/systemd-resolved.service.in | 4 ++-- units/systemd-sysctl.service.in | 2 +- units/systemd-sysusers.service | 8 ++++---- units/systemd-tmpfiles-clean.service | 2 +- units/systemd-tmpfiles-setup-dev.service | 2 +- units/systemd-tmpfiles-setup.service | 10 +++++----- units/systemd-vconsole-setup.service.in | 6 +----- 8 files changed, 19 insertions(+), 26 deletions(-) diff --git a/units/systemd-firstboot.service b/units/systemd-firstboot.service index 984ebf282a..0c8d574ef8 100644 --- a/units/systemd-firstboot.service +++ b/units/systemd-firstboot.service @@ -32,10 +32,7 @@ StandardError=tty # Optionally, pick up basic fields from credentials passed to the service # manager. This is useful for importing this data from nspawn's # --set-credential= switch. -LoadCredential=passwd.hashed-password.root -LoadCredential=passwd.plaintext-password.root -LoadCredential=passwd.shell.root -LoadCredential=firstboot.locale -LoadCredential=firstboot.locale-messages -LoadCredential=firstboot.keymap -LoadCredential=firstboot.timezone +ImportCredential=passwd.hashed-password.root +ImportCredential=passwd.plaintext-password.root +ImportCredential=passwd.shell.root +ImportCredential=firstboot.* diff --git a/units/systemd-resolved.service.in b/units/systemd-resolved.service.in index 10ce49345e..a078a9dd68 100644 --- a/units/systemd-resolved.service.in +++ b/units/systemd-resolved.service.in @@ -50,8 +50,8 @@ SystemCallErrorNumber=EPERM SystemCallFilter=@system-service Type=notify User=systemd-resolve -LoadCredential=network.dns -LoadCredential=network.search_domains +ImportCredential=network.dns +ImportCredential=network.search_domains {{SERVICE_WATCHDOG}} [Install] diff --git a/units/systemd-sysctl.service.in b/units/systemd-sysctl.service.in index 77793f3894..7307601a7d 100644 --- a/units/systemd-sysctl.service.in +++ b/units/systemd-sysctl.service.in @@ -21,4 +21,4 @@ Type=oneshot RemainAfterExit=yes ExecStart={{ROOTLIBEXECDIR}}/systemd-sysctl TimeoutSec=90s -LoadCredential=sysctl.extra +ImportCredential=sysctl.* diff --git a/units/systemd-sysusers.service b/units/systemd-sysusers.service index 2ec2766841..84fd66de37 100644 --- a/units/systemd-sysusers.service +++ b/units/systemd-sysusers.service @@ -29,9 +29,9 @@ TimeoutSec=90s # Optionally, pick up a root password and shell for the root user from a # credential passed to the service manager. This is useful for importing this # data from nspawn's --set-credential= switch. -LoadCredential=passwd.hashed-password.root -LoadCredential=passwd.plaintext-password.root -LoadCredential=passwd.shell.root +ImportCredential=passwd.hashed-password.root +ImportCredential=passwd.plaintext-password.root +ImportCredential=passwd.shell.root # Also, allow configuring extra sysusers lines via a credential -LoadCredential=sysusers.extra +ImportCredential=sysusers.* diff --git a/units/systemd-tmpfiles-clean.service b/units/systemd-tmpfiles-clean.service index 4163aef729..7b0edba412 100644 --- a/units/systemd-tmpfiles-clean.service +++ b/units/systemd-tmpfiles-clean.service @@ -21,4 +21,4 @@ Type=oneshot ExecStart=systemd-tmpfiles --clean SuccessExitStatus=DATAERR IOSchedulingClass=idle -LoadCredential=tmpfiles.extra +ImportCredential=tmpfiles.* diff --git a/units/systemd-tmpfiles-setup-dev.service b/units/systemd-tmpfiles-setup-dev.service index 635e840a48..acaa9510aa 100644 --- a/units/systemd-tmpfiles-setup-dev.service +++ b/units/systemd-tmpfiles-setup-dev.service @@ -22,4 +22,4 @@ Type=oneshot RemainAfterExit=yes ExecStart=systemd-tmpfiles --prefix=/dev --create --boot --graceful SuccessExitStatus=DATAERR CANTCREAT -LoadCredential=tmpfiles.extra +ImportCredential=tmpfiles.* diff --git a/units/systemd-tmpfiles-setup.service b/units/systemd-tmpfiles-setup.service index 506f53eaa2..6c5e3de8fd 100644 --- a/units/systemd-tmpfiles-setup.service +++ b/units/systemd-tmpfiles-setup.service @@ -23,8 +23,8 @@ Type=oneshot RemainAfterExit=yes ExecStart=systemd-tmpfiles --create --remove --boot SuccessExitStatus=DATAERR CANTCREAT -LoadCredential=tmpfiles.extra -LoadCredential=login.motd -LoadCredential=login.issue -LoadCredential=network.hosts -LoadCredential=ssh.authorized_keys.root +ImportCredential=tmpfiles.* +ImportCredential=login.motd +ImportCredential=login.issue +ImportCredential=network.hosts +ImportCredential=ssh.authorized_keys.root diff --git a/units/systemd-vconsole-setup.service.in b/units/systemd-vconsole-setup.service.in index 41d738a63d..0604ed0173 100644 --- a/units/systemd-vconsole-setup.service.in +++ b/units/systemd-vconsole-setup.service.in @@ -21,8 +21,4 @@ Before=initrd-switch-root.target shutdown.target Type=oneshot RemainAfterExit=yes ExecStart={{ROOTLIBEXECDIR}}/systemd-vconsole-setup -LoadCredential=vconsole.keymap -LoadCredential=vconsole.keymap_toggle -LoadCredential=vconsole.font -LoadCredential=vconsole.font_map -LoadCredential=vconsole.font_unimap +ImportCredential=vconsole.*