8adb3d63e6
Also, tests for DynamicUser= should really run for system mode, as we allocate from a system resource. (This also increases the test timeout to 2min. If one of our tests really hangs then waiting for 2min longer doesn't hurt either. The old 2s is really short, given that we run in potentially slow VM environments for this test. This becomes noticable when the slow "find" command this adds is triggered)
20 lines
850 B
Desktop File
20 lines
850 B
Desktop File
[Unit]
|
|
Description=Test DynamicUser= with StateDirectory=
|
|
|
|
[Service]
|
|
ExecStart=/usr/bin/test -w /var/lib/waldo
|
|
ExecStart=/usr/bin/test -w /var/lib/quux/pief
|
|
ExecStart=/bin/touch /var/lib/waldo/yay
|
|
ExecStart=/bin/touch /var/lib/quux/pief/yayyay
|
|
ExecStart=/usr/bin/test -f /var/lib/waldo/yay
|
|
ExecStart=/usr/bin/test -f /var/lib/quux/pief/yayyay
|
|
ExecStart=/usr/bin/test -f /var/lib/private/waldo/yay
|
|
ExecStart=/usr/bin/test -f /var/lib/private/quux/pief/yayyay
|
|
|
|
# Make sure that /var/lib/private/waldo is really the only writable directory besides the obvious candidates
|
|
ExecStart=/bin/sh -x -c 'test $$(find / -type d -writable 2> /dev/null | egrep -v -e \'^(/var/tmp$$|/tmp$$|/proc/|/dev/mqueue$$|/dev/shm$$)\' | sort -u | tr -d '\\\\n') = /var/lib/private/quux/pief/var/lib/private/waldo'
|
|
|
|
Type=oneshot
|
|
DynamicUser=yes
|
|
StateDirectory=waldo quux/pief
|