Browse Source

wip

nin-wip
parent
commit
15d1e0badf
Signed by: NinjaTrappeur
GPG Key ID: EFD315F31848DBA4
  1. 1
      src/core/execute.c
  2. 32
      test/units/testsuite-33.sh

1
src/core/execute.c

@ -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);
}

32
test/units/testsuite-33.sh

@ -74,6 +74,38 @@ 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 '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
ls -l /run/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…
Cancel
Save