wip
This commit is contained in:
parent
91737e1453
commit
6a31dc7297
|
@ -4861,6 +4861,7 @@ int exec_context_destroy_runtime_directory(const ExecContext *c, const char *run
|
|||
|
||||
/* We execute this synchronously, since we need to be sure this is gone when we start the
|
||||
* service next. */
|
||||
// here
|
||||
(void) rm_rf(p, REMOVE_ROOT);
|
||||
}
|
||||
|
||||
|
|
|
@ -74,6 +74,36 @@ systemctl clean testservice --what=all
|
|||
! test -e /var/cache/testservice
|
||||
! test -e /var/log/testservice
|
||||
|
||||
cat > /etc/systemd/system/testservice.service <<EOF
|
||||
[Service]
|
||||
ConfigurationDirectory=testservice
|
||||
RuntimeDirectory=testservice
|
||||
StateDirectory=testservice
|
||||
CacheDirectory=testservice
|
||||
LogsDirectory=testservice
|
||||
RuntimeDirectoryPreserve=no
|
||||
ExecStart=sh -x -c 'printenv && touch "$$RUNTIME_DIRECTORY"/ro-file && chmod 400 "$$RUNTIME_DIRECTORY"/ro-file && /bin/sleep infinity'
|
||||
Type=exec
|
||||
EOF
|
||||
|
||||
systemctl daemon-reload
|
||||
|
||||
! test -e /etc/testservice
|
||||
! test -e /run/testservice
|
||||
! test -e /var/lib/testservice
|
||||
! test -e /var/cache/testservice
|
||||
! test -e /var/log/testservice
|
||||
|
||||
systemctl start testservice
|
||||
|
||||
test -e /run/testservice/ro-file
|
||||
|
||||
systemctl stop testservice
|
||||
|
||||
! test -e /run/testservice
|
||||
|
||||
systemctl clean testservice --what=all
|
||||
|
||||
cat > /etc/systemd/system/testservice.service <<EOF
|
||||
[Service]
|
||||
DynamicUser=yes
|
||||
|
|
Loading…
Reference in a new issue