2021-10-17 16:07:22 +00:00
|
|
|
# SPDX-License-Identifier: LGPL-2.1-or-later
|
2019-11-20 01:25:23 +00:00
|
|
|
[Unit]
|
|
|
|
Description=Test Group=group is applied after PrivateDevices=yes
|
|
|
|
|
|
|
|
[Service]
|
|
|
|
PrivateDevices=yes
|
|
|
|
Group=daemon
|
|
|
|
Type=oneshot
|
|
|
|
|
|
|
|
# Check the group applied
|
2024-01-04 14:24:52 +00:00
|
|
|
ExecStart=sh -x -c 'test "$$(id -n -g)" = "daemon"'
|
2019-11-20 01:25:23 +00:00
|
|
|
|
|
|
|
# Check that the namespace applied
|
2024-01-04 14:24:52 +00:00
|
|
|
ExecStart=sh -c 'test ! -c /dev/kmsg'
|
2019-11-20 01:25:23 +00:00
|
|
|
|
|
|
|
# Check that the owning group of a node is not daemon (should be the host root)
|
2024-01-04 14:24:52 +00:00
|
|
|
ExecStart=sh -x -c 'test ! "$$(stat -c %%G /dev/stderr)" = "daemon"'
|