mirror of
https://github.com/morgan9e/systemd
synced 2026-04-14 00:14:32 +09:00
service: setup credentials for ExecCondition
Closes #35788
This gives access to credentials within ExecCondition=. As described in
ticket #35788, I do have a use-case for this and as noted in the
commit that dropped this[1], this is OK to be revisited if there are
use-cases.
[1] a145623bc4
This commit is contained in:
committed by
Yu Watanabe
parent
96e5612d9f
commit
4dabc30050
@@ -446,6 +446,13 @@ systemd-run -p DynamicUser=yes -p 'LoadCredential=os:/etc/os-release' \
|
||||
--service-type=oneshot --wait --pipe \
|
||||
true | cmp /etc/os-release
|
||||
|
||||
# https://github.com/systemd/systemd/issues/35788
|
||||
systemd-run -p DynamicUser=yes -p 'LoadCredential=os:/etc/os-release' \
|
||||
-p 'ExecCondition=systemd-creds cat os' \
|
||||
--unit=test-54-exec-condition.service \
|
||||
--service-type=oneshot --wait --pipe \
|
||||
true | cmp /etc/os-release
|
||||
|
||||
# https://github.com/systemd/systemd/pull/24734#issuecomment-1925440546
|
||||
# Also ExecStartPre= should be able to update creds
|
||||
dd if=/dev/urandom of=/tmp/cred-huge bs=600K count=1
|
||||
|
||||
Reference in New Issue
Block a user