From 5bc7452b3219456e07f931e40da30bb94a884293 Mon Sep 17 00:00:00 2001 From: Ronny Chevalier Date: Mon, 21 Sep 2015 15:45:51 +0200 Subject: core: fix group ownership when Group is set When Group is set in the unit, the runtime directories are owned by this group and not the default group of the user (same for cgroup paths and standard outputs) Fix #1231 --- test/exec-runtimedirectory-owner.service | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 test/exec-runtimedirectory-owner.service (limited to 'test') diff --git a/test/exec-runtimedirectory-owner.service b/test/exec-runtimedirectory-owner.service new file mode 100644 index 0000000000..077e08d1c5 --- /dev/null +++ b/test/exec-runtimedirectory-owner.service @@ -0,0 +1,9 @@ +[Unit] +Description=Test for RuntimeDirectory owner (must not be the default group of the user if Group is set) + +[Service] +ExecStart=/bin/sh -c 'f=/tmp/test-exec_runtimedirectory-owner;g=$(stat -c %G $f); echo "$g"; exit $(test $g = "nobody")' +Type=oneshot +Group=nobody +User=root +RuntimeDirectory=test-exec_runtimedirectory-owner -- cgit v1.2.3-54-g00ecf