mirror of
https://github.com/systemd/systemd.git
synced 2026-07-15 12:00:34 +00:00
If sh is not bash, some builtin command behave slightly differently. E.g. if sh is provided by busybox, its builtin test command does not check if the path is a mount point or not, and 'test -w' only checks the access mode of the inode. So, even if a readonly filesystem is mounted on a directory, the test command may succeed. To avoid such confusion, let's unconditionally use bash.
17 lines
487 B
Desktop File
17 lines
487 B
Desktop File
# SPDX-License-Identifier: LGPL-2.1-or-later
|
|
[Unit]
|
|
Description=Test for TemporaryFileSystem on /usr
|
|
|
|
[Service]
|
|
Type=oneshot
|
|
|
|
# Check TemporaryFileSystem= are empty
|
|
ExecStart=bash -c 'for i in $$(ls -A /usr); do test $$i = lib -o $$i = lib64 -o $$i = bin -o $$i = sbin || false; done'
|
|
|
|
# Cannot create files under /usr
|
|
ExecStart=bash -c '! touch /usr/hoge'
|
|
ExecStart=bash -c '! touch /usr/bin/hoge'
|
|
|
|
TemporaryFileSystem=/usr:ro
|
|
BindReadOnlyPaths=-/usr/lib -/usr/lib64 /usr/bin /usr/sbin
|