1
0
mirror of https://github.com/systemd/systemd synced 2026-03-26 16:54:53 +01:00

Compare commits

..

No commits in common. "80cfe9abf267e9e51049e9d6200f02b7922bd4d7" and "450f4ed58a3dbf9bceaf5b5dbb030d2a3b19b838" have entirely different histories.

218 changed files with 1064 additions and 1387 deletions

View File

@ -47,7 +47,7 @@ for phase in "${PHASES[@]}"; do
# correctly detect the environment. # correctly detect the environment.
env \ env \
SYSTEMD_IN_CHROOT=yes \ SYSTEMD_IN_CHROOT=yes \
meson test -C build --print-errorlogs --no-stdsplit meson test -C build --print-errorlogs
;; ;;
CLEANUP) CLEANUP)
info "Cleanup phase" info "Cleanup phase"

View File

@ -109,7 +109,7 @@ for phase in "${PHASES[@]}"; do
run_meson -Dnobody-group=nogroup --werror -Dtests=unsafe -Dslow-tests=true -Dfuzz-tests=true "${MESON_ARGS[@]}" build run_meson -Dnobody-group=nogroup --werror -Dtests=unsafe -Dslow-tests=true -Dfuzz-tests=true "${MESON_ARGS[@]}" build
ninja -C build -v ninja -C build -v
# Ensure setting a timezone (like the reproducible build tests do) does not break time/date unit tests # Ensure setting a timezone (like the reproducible build tests do) does not break time/date unit tests
TZ=GMT+12 meson test "${MESON_TEST_ARGS[@]}" -C build --print-errorlogs --no-stdsplit TZ=GMT+12 meson test "${MESON_TEST_ARGS[@]}" -C build --print-errorlogs
;; ;;
RUN_ASAN_UBSAN|RUN_GCC_ASAN_UBSAN|RUN_CLANG_ASAN_UBSAN|RUN_CLANG_ASAN_UBSAN_NO_DEPS) RUN_ASAN_UBSAN|RUN_GCC_ASAN_UBSAN|RUN_CLANG_ASAN_UBSAN|RUN_CLANG_ASAN_UBSAN_NO_DEPS)
# TODO: drop after we switch to ubuntu 26.04 # TODO: drop after we switch to ubuntu 26.04
@ -151,7 +151,7 @@ for phase in "${PHASES[@]}"; do
# during debugging, wonderful), so let's at least keep a workaround # during debugging, wonderful), so let's at least keep a workaround
# here to make the builds stable for the time being. # here to make the builds stable for the time being.
(set +x; while :; do echo -ne "\n[WATCHDOG] $(date)\n"; sleep 30; done) & (set +x; while :; do echo -ne "\n[WATCHDOG] $(date)\n"; sleep 30; done) &
meson test --timeout-multiplier=3 -C build --print-errorlogs --no-stdsplit meson test --timeout-multiplier=3 -C build --print-errorlogs
;; ;;
CLEANUP) CLEANUP)
info "Cleanup phase" info "Cleanup phase"

View File

@ -244,14 +244,11 @@ int manager_add_inhibitor(Manager *m, const char* id, Inhibitor **ret) {
int manager_add_button(Manager *m, const char *name, Button **ret_button) { int manager_add_button(Manager *m, const char *name, Button **ret_button) {
Button *b; Button *b;
bool is_new;
assert(m); assert(m);
assert(name); assert(name);
b = hashmap_get(m->buttons, name); b = hashmap_get(m->buttons, name);
is_new = !b;
if (!b) { if (!b) {
b = button_new(m, name); b = button_new(m, name);
if (!b) if (!b)
@ -261,7 +258,7 @@ int manager_add_button(Manager *m, const char *name, Button **ret_button) {
if (ret_button) if (ret_button)
*ret_button = b; *ret_button = b;
return is_new; return 0;
} }
int manager_process_seat_device(Manager *m, sd_device *d) { int manager_process_seat_device(Manager *m, sd_device *d) {
@ -331,7 +328,7 @@ int manager_process_seat_device(Manager *m, sd_device *d) {
return 0; return 0;
} }
int manager_process_button_device(Manager *m, sd_device *d, Button **ret_button) { int manager_process_button_device(Manager *m, sd_device *d) {
const char *sysname; const char *sysname;
Button *b; Button *b;
int r; int r;
@ -343,40 +340,29 @@ int manager_process_button_device(Manager *m, sd_device *d, Button **ret_button)
return r; return r;
if (device_for_action(d, SD_DEVICE_REMOVE) || if (device_for_action(d, SD_DEVICE_REMOVE) ||
sd_device_has_current_tag(d, "power-switch") <= 0) { sd_device_has_current_tag(d, "power-switch") <= 0)
b = hashmap_get(m->buttons, sysname); button_free(hashmap_get(m->buttons, sysname));
goto unwatch;
else {
const char *sn;
r = manager_add_button(m, sysname, &b);
if (r < 0)
return r;
r = device_get_seat(d, &sn);
if (r < 0)
return r;
button_set_seat(b, sn);
r = button_open(b);
if (r < 0) /* event device doesn't have any keys or switches relevant to us? (or any other error
* opening the device?) let's close the button again. */
button_free(b);
} }
r = manager_add_button(m, sysname, &b);
if (r < 0)
return r;
bool is_new = r > 0;
const char *sn;
r = device_get_seat(d, &sn);
if (r < 0)
return r;
button_set_seat(b, sn);
r = button_open(b);
if (r < 0) /* event device doesn't have any keys or switches relevant to us? (or any other error
* opening the device?) let's close the button again. */
goto unwatch;
if (ret_button)
*ret_button = b;
return is_new;
unwatch:
button_free(b);
if (ret_button)
*ret_button = NULL;
return 0; return 0;
} }

View File

@ -236,7 +236,7 @@ static int manager_enumerate_buttons(Manager *m) {
FOREACH_DEVICE(e, d) { FOREACH_DEVICE(e, d) {
if (device_is_processed(d) <= 0) if (device_is_processed(d) <= 0)
continue; continue;
RET_GATHER(r, manager_process_button_device(m, d, /* ret_button= */ NULL)); RET_GATHER(r, manager_process_button_device(m, d));
} }
return r; return r;
@ -739,13 +739,10 @@ static int manager_dispatch_vcsa_udev(sd_device_monitor *monitor, sd_device *dev
static int manager_dispatch_button_udev(sd_device_monitor *monitor, sd_device *device, void *userdata) { static int manager_dispatch_button_udev(sd_device_monitor *monitor, sd_device *device, void *userdata) {
Manager *m = ASSERT_PTR(userdata); Manager *m = ASSERT_PTR(userdata);
Button *b;
assert(device); assert(device);
if (manager_process_button_device(m, device, &b) > 0) manager_process_button_device(m, device);
(void) button_check_switches(b);
return 0; return 0;
} }

View File

@ -153,7 +153,7 @@ int manager_add_user_by_uid(Manager *m, uid_t uid, User **ret_user);
int manager_add_inhibitor(Manager *m, const char* id, Inhibitor **ret_inhibitor); int manager_add_inhibitor(Manager *m, const char* id, Inhibitor **ret_inhibitor);
int manager_process_seat_device(Manager *m, sd_device *d); int manager_process_seat_device(Manager *m, sd_device *d);
int manager_process_button_device(Manager *m, sd_device *d, Button **ret_button); int manager_process_button_device(Manager *m, sd_device *d);
int manager_spawn_autovt(Manager *m, unsigned vtnr); int manager_spawn_autovt(Manager *m, unsigned vtnr);

View File

@ -1,7 +1,6 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */ /* SPDX-License-Identifier: LGPL-2.1-or-later */
#include <fnmatch.h> #include <fnmatch.h>
#include <gnu/libc-version.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <sys/mount.h> #include <sys/mount.h>
@ -369,12 +368,6 @@ static void test_exec_workingdirectory(Manager *m) {
} }
static void test_exec_execsearchpath(Manager *m) { static void test_exec_execsearchpath(Manager *m) {
int r;
ASSERT_OK(r = is_symlink("/bin/ls"));
if (r > 0)
return (void) log_tests_skipped("/bin/ls is a symlink, maybe coreutils is built with --enable-single-binary=symlinks");
ASSERT_OK(mkdir_p("/tmp/test-exec_execsearchpath", 0755)); ASSERT_OK(mkdir_p("/tmp/test-exec_execsearchpath", 0755));
ASSERT_OK(copy_file("/bin/ls", "/tmp/test-exec_execsearchpath/ls_temp", 0, 0777, COPY_REPLACE)); ASSERT_OK(copy_file("/bin/ls", "/tmp/test-exec_execsearchpath/ls_temp", 0, 0777, COPY_REPLACE));
@ -1177,9 +1170,6 @@ static void test_exec_capabilityboundingset(Manager *m) {
} }
static void test_exec_basic(Manager *m) { static void test_exec_basic(Manager *m) {
if (isempty(gnu_get_libc_version()))
return (void) log_tests_skipped("ConditionVersion=glibc will not pass under musl");
if (MANAGER_IS_SYSTEM(m) || have_userns_privileges()) if (MANAGER_IS_SYSTEM(m) || have_userns_privileges())
test(m, "exec-basic.service", can_unshare || MANAGER_IS_SYSTEM(m) ? 0 : EXIT_NAMESPACE, CLD_EXITED); test(m, "exec-basic.service", can_unshare || MANAGER_IS_SYSTEM(m) ? 0 : EXIT_NAMESPACE, CLD_EXITED);
else else

View File

@ -611,10 +611,7 @@ TEST(memory_deny_write_execute_shmat) {
void *p; void *p;
p = shmat(shmid, NULL, 0); p = shmat(shmid, NULL, 0);
if (p == MAP_FAILED) { assert_se(p != MAP_FAILED);
log_tests_skipped_errno(errno, "shmat() is already disabled");
_exit(EXIT_SUCCESS);
}
assert_se(shmdt(p) == 0); assert_se(shmdt(p) == 0);
p = shmat(shmid, NULL, SHM_EXEC); p = shmat(shmid, NULL, SHM_EXEC);

View File

@ -4,4 +4,4 @@ Description=ForeverPrintHola service
[Service] [Service]
Type=exec Type=exec
ExecStart=bash -x -c 'while :; do printf "Hola\n" || touch /tmp/i-lose-my-logs; sleep 1; done' ExecStart=sh -x -c 'while :; do printf "Hola\n" || touch /tmp/i-lose-my-logs; sleep 1; done'

View File

@ -3,4 +3,4 @@ Description=Test for DeferReactivation=yes (service)
[Service] [Service]
Type=simple Type=simple
ExecStart=bash -c 'date +%%s >>/tmp/defer-reactivation.log; sleep 5' ExecStart=sh -c 'date +%%s >>/tmp/defer-reactivation.log; sleep 5'

View File

@ -4,4 +4,4 @@ Description=This unit should not remain active once the shell process exits
[Service] [Service]
Type=oneshot Type=oneshot
ExecStart=bash -c 'sleep infinity & exit 0' ExecStart=sh -c 'sleep infinity & exit 0'

View File

@ -7,7 +7,7 @@ integration_tests += [
'service' : integration_test_template['configuration']['service'] + { 'service' : integration_test_template['configuration']['service'] + {
'NotifyAccess' : 'all', 'NotifyAccess' : 'all',
# Issue: https://github.com/systemd/systemd/issues/2691 # Issue: https://github.com/systemd/systemd/issues/2691
'ExecStop' : 'bash -c \'kill -SEGV $$$$\'', 'ExecStop' : 'sh -c \'kill -SEGV $$$$\'',
'RemainAfterExit' : 'yes', 'RemainAfterExit' : 'yes',
'TimeoutStopSec' : '270s', 'TimeoutStopSec' : '270s',
}, },

View File

@ -4,6 +4,6 @@ integration_tests += [
integration_test_template + { integration_test_template + {
'name' : fs.name(meson.current_source_dir()), 'name' : fs.name(meson.current_source_dir()),
'vm' : true, 'vm' : true,
'coredump-exclude-regex' : '/(coreutils|sleep|udevadm)$', 'coredump-exclude-regex' : '/(sleep|udevadm)$',
}, },
] ]

View File

@ -10,4 +10,4 @@ PrivateTmp=yes
BindPaths=/run/TEST-23-UNIT-FILE-marker-fixed:/tmp/testfile-marker-fixed BindPaths=/run/TEST-23-UNIT-FILE-marker-fixed:/tmp/testfile-marker-fixed
InaccessiblePaths=/run/inaccessible InaccessiblePaths=/run/inaccessible
ExecStartPre=grep -q -F MARKER_FIXED /tmp/testfile-marker-fixed ExecStartPre=grep -q -F MARKER_FIXED /tmp/testfile-marker-fixed
ExecStart=bash -c 'systemd-notify --ready; until grep -q -F MARKER_RUNTIME /tmp/testfile-marker-runtime; do sleep 0.1; done; test ! -f /run/inaccessible/testfile-marker-fixed' ExecStart=sh -c 'systemd-notify --ready; until grep -q -F MARKER_RUNTIME /tmp/testfile-marker-runtime; do sleep 0.1; done; test ! -f /run/inaccessible/testfile-marker-fixed'

View File

@ -3,4 +3,4 @@
RuntimeMaxSec=5 RuntimeMaxSec=5
Type=notify Type=notify
RemainAfterExit=yes RemainAfterExit=yes
ExecStart=bash -c 'systemd-notify --ready; until grep -q -F MARKER_RUNTIME /tmp/testfile-marker-runtime; do sleep 0.1; done; exit 0' ExecStart=sh -c 'systemd-notify --ready; until grep -q -F MARKER_RUNTIME /tmp/testfile-marker-runtime; do sleep 0.1; done; exit 0'

View File

@ -5,5 +5,5 @@ Description=Failed Dependency Unit
[Service] [Service]
Type=oneshot Type=oneshot
RemainAfterExit=yes RemainAfterExit=yes
ExecStart=bash -c "if [ -f /tmp/TEST-23-UNIT-FILE-retry-fail ]; then exit 0; else exit 1; fi" ExecStart=sh -c "if [ -f /tmp/TEST-23-UNIT-FILE-retry-fail ]; then exit 0; else exit 1; fi"
Restart=no Restart=no

View File

@ -5,7 +5,7 @@ After=multi-user.target
[Service] [Service]
ExecStart=/usr/lib/systemd/tests/testdata/TEST-52-HONORFIRSTSHUTDOWN.units/%N.sh ExecStart=/usr/lib/systemd/tests/testdata/TEST-52-HONORFIRSTSHUTDOWN.units/%N.sh
ExecStop=bash -c 'kill -KILL $MAINPID' ExecStop=sh -c 'kill -KILL $MAINPID'
FailureAction=reboot FailureAction=reboot
[Install] [Install]

View File

@ -3,6 +3,6 @@
integration_tests += [ integration_tests += [
integration_test_template + { integration_test_template + {
'name' : fs.name(meson.current_source_dir()), 'name' : fs.name(meson.current_source_dir()),
'coredump-exclude-regex' : '/(coreutils|sleep|bash|systemd-notify)$', 'coredump-exclude-regex' : '/(sleep|bash|systemd-notify)$',
}, },
] ]

View File

@ -2,8 +2,8 @@
[Unit] [Unit]
Description=TEST-62-RESTRICT-IFACES-all-pings-work Description=TEST-62-RESTRICT-IFACES-all-pings-work
[Service] [Service]
ExecStart=bash -c 'ping -c 1 -W 0.2 192.168.113.1' ExecStart=sh -c 'ping -c 1 -W 0.2 192.168.113.1'
ExecStart=bash -c 'ping -c 1 -W 0.2 192.168.113.5' ExecStart=sh -c 'ping -c 1 -W 0.2 192.168.113.5'
ExecStart=bash -c 'ping -c 1 -W 0.2 192.168.113.9' ExecStart=sh -c 'ping -c 1 -W 0.2 192.168.113.9'
RestrictNetworkInterfaces= RestrictNetworkInterfaces=
Type=oneshot Type=oneshot

View File

@ -2,9 +2,9 @@
[Unit] [Unit]
Description=TEST-62-RESTRICT-IFACES-allow-list Description=TEST-62-RESTRICT-IFACES-allow-list
[Service] [Service]
ExecStart=bash -c 'ping -c 1 -W 0.2 192.168.113.1' ExecStart=sh -c 'ping -c 1 -W 0.2 192.168.113.1'
ExecStart=bash -c 'ping -c 1 -W 0.2 192.168.113.5' ExecStart=sh -c 'ping -c 1 -W 0.2 192.168.113.5'
ExecStart=bash -c '! ping -c 1 -W 0.2 192.168.113.9' ExecStart=sh -c '! ping -c 1 -W 0.2 192.168.113.9'
RestrictNetworkInterfaces=veth0 RestrictNetworkInterfaces=veth0
RestrictNetworkInterfaces=veth1 RestrictNetworkInterfaces=veth1
Type=oneshot Type=oneshot

View File

@ -2,9 +2,9 @@
[Unit] [Unit]
Description=TEST-62-RESTRICT-IFACES-deny-list Description=TEST-62-RESTRICT-IFACES-deny-list
[Service] [Service]
ExecStart=bash -c '! ping -c 1 -W 0.2 192.168.113.1' ExecStart=sh -c '! ping -c 1 -W 0.2 192.168.113.1'
ExecStart=bash -c '! ping -c 1 -W 0.2 192.168.113.5' ExecStart=sh -c '! ping -c 1 -W 0.2 192.168.113.5'
ExecStart=bash -c 'ping -c 1 -W 0.2 192.168.113.9' ExecStart=sh -c 'ping -c 1 -W 0.2 192.168.113.9'
RestrictNetworkInterfaces=~veth0 RestrictNetworkInterfaces=~veth0
RestrictNetworkInterfaces=~veth1 RestrictNetworkInterfaces=~veth1
Type=oneshot Type=oneshot

View File

@ -2,9 +2,9 @@
[Unit] [Unit]
Description=TEST-62-RESTRICT-IFACES-empty-assignment Description=TEST-62-RESTRICT-IFACES-empty-assignment
[Service] [Service]
ExecStart=bash -c 'ping -c 1 -W 0.2 192.168.113.1' ExecStart=sh -c 'ping -c 1 -W 0.2 192.168.113.1'
ExecStart=bash -c 'ping -c 1 -W 0.2 192.168.113.5' ExecStart=sh -c 'ping -c 1 -W 0.2 192.168.113.5'
ExecStart=bash -c 'ping -c 1 -W 0.2 192.168.113.9' ExecStart=sh -c 'ping -c 1 -W 0.2 192.168.113.9'
RestrictNetworkInterfaces=veth0 RestrictNetworkInterfaces=veth0
RestrictNetworkInterfaces= RestrictNetworkInterfaces=
Type=oneshot Type=oneshot

View File

@ -2,9 +2,9 @@
[Unit] [Unit]
Description=TEST-62-RESTRICT-IFACES-invert-assignment Description=TEST-62-RESTRICT-IFACES-invert-assignment
[Service] [Service]
ExecStart=bash -c '! ping -c 1 -W 0.2 192.168.113.1' ExecStart=sh -c '! ping -c 1 -W 0.2 192.168.113.1'
ExecStart=bash -c 'ping -c 1 -W 0.2 192.168.113.5' ExecStart=sh -c 'ping -c 1 -W 0.2 192.168.113.5'
ExecStart=bash -c '! ping -c 1 -W 0.2 192.168.113.9' ExecStart=sh -c '! ping -c 1 -W 0.2 192.168.113.9'
RestrictNetworkInterfaces=veth0 RestrictNetworkInterfaces=veth0
RestrictNetworkInterfaces=veth0 veth1 RestrictNetworkInterfaces=veth0 veth1
RestrictNetworkInterfaces=~veth0 RestrictNetworkInterfaces=~veth0

View File

@ -2,9 +2,9 @@
[Unit] [Unit]
Description=TEST-62-RESTRICT-IFACES-altname Description=TEST-62-RESTRICT-IFACES-altname
[Service] [Service]
ExecStart=bash -c 'ping -c 1 -W 0.2 192.168.113.1' ExecStart=sh -c 'ping -c 1 -W 0.2 192.168.113.1'
ExecStart=bash -c 'ping -c 1 -W 0.2 192.168.113.5' ExecStart=sh -c 'ping -c 1 -W 0.2 192.168.113.5'
ExecStart=bash -c '! ping -c 1 -W 0.2 192.168.113.9' ExecStart=sh -c '! ping -c 1 -W 0.2 192.168.113.9'
RestrictNetworkInterfaces=veth0-altname-with-more-than-15-chars RestrictNetworkInterfaces=veth0-altname-with-more-than-15-chars
RestrictNetworkInterfaces=veth1-altname-with-more-than-15-chars RestrictNetworkInterfaces=veth1-altname-with-more-than-15-chars
Type=oneshot Type=oneshot

View File

@ -1,7 +1,7 @@
# SPDX-License-Identifier: LGPL-2.1-or-later # SPDX-License-Identifier: LGPL-2.1-or-later
[Service] [Service]
ExecStartPre=bash -c 'test "$TRIGGER_PATH" = /tmp/test63-glob-foo' ExecStartPre=sh -c 'test "$TRIGGER_PATH" = /tmp/test63-glob-foo'
ExecStartPre=bash -c 'test "$TRIGGER_UNIT" = test63-glob.path' ExecStartPre=sh -c 'test "$TRIGGER_UNIT" = test63-glob.path'
ExecStart=systemd-notify --ready ExecStart=systemd-notify --ready
RemainAfterExit=yes RemainAfterExit=yes
Type=notify Type=notify

View File

@ -3,6 +3,6 @@
ConditionPathExists=/tmp/nonexistent ConditionPathExists=/tmp/nonexistent
[Service] [Service]
ExecStartPre=bash -c 'test "$TRIGGER_PATH" = /tmp/test63' ExecStartPre=sh -c 'test "$TRIGGER_PATH" = /tmp/test63'
ExecStartPre=bash -c 'test "$TRIGGER_UNIT" = test63.path' ExecStartPre=sh -c 'test "$TRIGGER_UNIT" = test63.path'
ExecStart=true ExecStart=true

View File

@ -3,7 +3,7 @@
Description=Test for AmbientCapabilities (dynamic user) Description=Test for AmbientCapabilities (dynamic user)
[Service] [Service]
ExecStart=bash -x -c 'c=$$(grep "CapAmb:" /proc/self/status); test "$$c" = "CapAmb: 0000000000002081"' ExecStart=sh -x -c 'c=$$(grep "CapAmb:" /proc/self/status); test "$$c" = "CapAmb: 0000000000002081"'
Type=oneshot Type=oneshot
AmbientCapabilities=CAP_CHOWN CAP_SETUID CAP_NET_RAW AmbientCapabilities=CAP_CHOWN CAP_SETUID CAP_NET_RAW
DynamicUser=yes DynamicUser=yes

View File

@ -3,7 +3,7 @@
Description=Test for AmbientCapabilities Description=Test for AmbientCapabilities
[Service] [Service]
ExecStart=bash -x -c 'c=$$(grep "CapAmb:" /proc/self/status); test "$$c" = "CapAmb: 0000000000002001"' ExecStart=sh -x -c 'c=$$(grep "CapAmb:" /proc/self/status); test "$$c" = "CapAmb: 0000000000002001"'
Type=oneshot Type=oneshot
User=nfsnobody User=nfsnobody
AmbientCapabilities=CAP_CHOWN AmbientCapabilities=CAP_CHOWN

View File

@ -3,7 +3,7 @@
Description=Test for AmbientCapabilities Description=Test for AmbientCapabilities
[Service] [Service]
ExecStart=bash -x -c 'c=$$(grep "CapAmb:" /proc/self/status); test "$$c" = "CapAmb: 0000000000002001"' ExecStart=sh -x -c 'c=$$(grep "CapAmb:" /proc/self/status); test "$$c" = "CapAmb: 0000000000002001"'
Type=oneshot Type=oneshot
User=nobody User=nobody
AmbientCapabilities=CAP_CHOWN AmbientCapabilities=CAP_CHOWN

View File

@ -3,7 +3,7 @@
Description=Test for AmbientCapabilities (daemon) Description=Test for AmbientCapabilities (daemon)
[Service] [Service]
ExecStart=bash -x -c 'c=$$(grep "CapAmb:" /proc/self/status); test "$$c" = "CapAmb: 0000000000002001"' ExecStart=sh -x -c 'c=$$(grep "CapAmb:" /proc/self/status); test "$$c" = "CapAmb: 0000000000002001"'
Type=oneshot Type=oneshot
User=daemon User=daemon
AmbientCapabilities=CAP_CHOWN AmbientCapabilities=CAP_CHOWN

View File

@ -3,7 +3,7 @@
Description=Test for AmbientCapabilities Description=Test for AmbientCapabilities
[Service] [Service]
ExecStart=bash -x -c 'c=$$(grep "CapAmb:" /proc/self/status); test "$$c" = "CapAmb: 0000000000002001"' ExecStart=sh -x -c 'c=$$(grep "CapAmb:" /proc/self/status); test "$$c" = "CapAmb: 0000000000002001"'
Type=oneshot Type=oneshot
User=nfsnobody User=nfsnobody
AmbientCapabilities=CAP_CHOWN CAP_NET_RAW AmbientCapabilities=CAP_CHOWN CAP_NET_RAW

View File

@ -3,7 +3,7 @@
Description=Test for AmbientCapabilities Description=Test for AmbientCapabilities
[Service] [Service]
ExecStart=bash -x -c 'c=$$(grep "CapAmb:" /proc/self/status); test "$$c" = "CapAmb: 0000000000002001"' ExecStart=sh -x -c 'c=$$(grep "CapAmb:" /proc/self/status); test "$$c" = "CapAmb: 0000000000002001"'
Type=oneshot Type=oneshot
User=nobody User=nobody
AmbientCapabilities=CAP_CHOWN CAP_NET_RAW AmbientCapabilities=CAP_CHOWN CAP_NET_RAW

View File

@ -3,7 +3,7 @@
Description=Test for AmbientCapabilities (daemon) Description=Test for AmbientCapabilities (daemon)
[Service] [Service]
ExecStart=bash -x -c 'c=$$(grep "CapAmb:" /proc/self/status); test "$$c" = "CapAmb: 0000000000002001"' ExecStart=sh -x -c 'c=$$(grep "CapAmb:" /proc/self/status); test "$$c" = "CapAmb: 0000000000002001"'
Type=oneshot Type=oneshot
User=daemon User=daemon
AmbientCapabilities=CAP_CHOWN CAP_NET_RAW AmbientCapabilities=CAP_CHOWN CAP_NET_RAW

View File

@ -27,7 +27,7 @@ ConditionVersion=glibc " >= 2" " <= 9000 " "!= 1"
ConditionVersion=glibc " >= 2" " * " ConditionVersion=glibc " >= 2" " * "
[Service] [Service]
ExecStart=touch /tmp/a ; bash -c 'touch /tmp/b' ; touch /tmp/c ExecStart=touch /tmp/a ; /bin/sh -c 'touch /tmp/b' ; touch /tmp/c
ExecStart=test -f /tmp/a ExecStart=test -f /tmp/a
ExecStart=!test -f /tmp/b ExecStart=!test -f /tmp/b
ExecStart=!!test -f /tmp/c ExecStart=!!test -f /tmp/c

View File

@ -11,7 +11,7 @@ ExecStart=test -f /tmp/thisisasimpletest
# Also, through /tmp/test-exec-bindreadonlypaths # Also, through /tmp/test-exec-bindreadonlypaths
ExecStart=test -f /tmp/test-exec-bindreadonlypaths/thisisasimpletest ExecStart=test -f /tmp/test-exec-bindreadonlypaths/thisisasimpletest
# The file cannot modify through /tmp/test-exec-bindreadonlypaths # The file cannot modify through /tmp/test-exec-bindreadonlypaths
ExecStart=bash -x -c '! touch /tmp/test-exec-bindreadonlypaths/thisisasimpletest' ExecStart=sh -x -c '! touch /tmp/test-exec-bindreadonlypaths/thisisasimpletest'
# Cleanup # Cleanup
ExecStart=rm /tmp/thisisasimpletest ExecStart=rm /tmp/thisisasimpletest
BindPaths=/tmp:/tmp/test-exec-bindpaths BindPaths=/tmp:/tmp/test-exec-bindpaths

View File

@ -4,6 +4,6 @@ Description=Test for CapabilityBoundingSet
[Service] [Service]
# sed: remove dropped (cap_xxx-[epi]) and IAB capabilities from the output # sed: remove dropped (cap_xxx-[epi]) and IAB capabilities from the output
ExecStart=bash -x -c '! capsh --print | sed -re "s/[^ ]+?\-[epi]+//g" -e '/IAB/d' | grep "^Bounding set .*cap_chown"' ExecStart=sh -x -c '! capsh --print | sed -re "s/[^ ]+?\-[epi]+//g" -e '/IAB/d' | grep "^Bounding set .*cap_chown"'
Type=oneshot Type=oneshot
CapabilityBoundingSet=~CAP_CHOWN CapabilityBoundingSet=~CAP_CHOWN

View File

@ -3,7 +3,7 @@
Description=Test for CapabilityBoundingSet Description=Test for CapabilityBoundingSet
[Service] [Service]
ExecStart=bash -x -c 'c=$$(capsh --print | grep "Bounding set "); test "$$c" = "Bounding set =cap_chown,cap_fowner,cap_kill"' ExecStart=sh -x -c 'c=$$(capsh --print | grep "Bounding set "); test "$$c" = "Bounding set =cap_chown,cap_fowner,cap_kill"'
Type=oneshot Type=oneshot
CapabilityBoundingSet=CAP_FOWNER CapabilityBoundingSet=CAP_FOWNER
CapabilityBoundingSet=CAP_KILL CAP_CHOWN CapabilityBoundingSet=CAP_KILL CAP_CHOWN

View File

@ -3,7 +3,7 @@
Description=Test for CapabilityBoundingSet Description=Test for CapabilityBoundingSet
[Service] [Service]
ExecStart=bash -x -c 'c=$$(capsh --print | grep "Bounding set "); test "$$c" = "Bounding set ="' ExecStart=sh -x -c 'c=$$(capsh --print | grep "Bounding set "); test "$$c" = "Bounding set ="'
Type=oneshot Type=oneshot
CapabilityBoundingSet=CAP_FOWNER CAP_KILL CapabilityBoundingSet=CAP_FOWNER CAP_KILL
CapabilityBoundingSet= CapabilityBoundingSet=

View File

@ -3,6 +3,6 @@
Description=Test for CapabilityBoundingSet Description=Test for CapabilityBoundingSet
[Service] [Service]
ExecStart=bash -x -c 'c=$$(capsh --print | grep "Bounding set "); test "$$c" = "Bounding set =cap_fowner,cap_kill"' ExecStart=sh -x -c 'c=$$(capsh --print | grep "Bounding set "); test "$$c" = "Bounding set =cap_fowner,cap_kill"'
Type=oneshot Type=oneshot
CapabilityBoundingSet=CAP_FOWNER CAP_KILL CapabilityBoundingSet=CAP_FOWNER CAP_KILL

View File

@ -6,7 +6,7 @@ Description=Test for exec condition that fails the unit
Type=oneshot Type=oneshot
# exit 255 will fail the unit # exit 255 will fail the unit
ExecCondition=bash -c 'exit 255' ExecCondition=/bin/sh -c 'exit 255'
# This should not get run # This should not get run
ExecStart=bash -c 'true' ExecStart=sh -c 'true'

View File

@ -6,11 +6,11 @@ Description=Test for exec condition that triggers skipping
Type=oneshot Type=oneshot
# exit codes [1, 254] will result in skipping the rest of execution # exit codes [1, 254] will result in skipping the rest of execution
ExecCondition=bash -c 'exit 0' ExecCondition=/bin/sh -c 'exit 0'
ExecCondition=bash -c 'exit 254' ExecCondition=/bin/sh -c 'exit 254'
# This would normally fail the unit but will not get run due to the skip above # This would normally fail the unit but will not get run due to the skip above
ExecCondition=bash -c 'exit 255' ExecCondition=/bin/sh -c 'exit 255'
# This should not get run # This should not get run
ExecStart=bash -c 'true' ExecStart=sh -c 'true'

View File

@ -3,5 +3,5 @@
Description=Test for CPUAffinity (simple) Description=Test for CPUAffinity (simple)
[Service] [Service]
ExecStart=bash -c 'test $$(cat /proc/self/status | grep Cpus_allowed: | rev | cut -c 1) = 1' ExecStart=sh -c 'test $$(cat /proc/self/status | grep Cpus_allowed: | rev | cut -c 1) = 1'
CPUAffinity=0 CPUAffinity=0

View File

@ -3,7 +3,7 @@
Description=Test for CPUAffinity (reset) Description=Test for CPUAffinity (reset)
[Service] [Service]
ExecStart=bash -c 'test $$(cat /proc/self/status | grep Cpus_allowed: | rev | cut -c 1) = 1' ExecStart=sh -c 'test $$(cat /proc/self/status | grep Cpus_allowed: | rev | cut -c 1) = 1'
CPUAffinity=0-1 3 CPUAffinity=0-1 3
CPUAffinity= CPUAffinity=
CPUAffinity=0 CPUAffinity=0

View File

@ -3,6 +3,6 @@
Description=Test for CPUAffinity (merge) Description=Test for CPUAffinity (merge)
[Service] [Service]
ExecStart=bash -c 'test $$(cat /proc/self/status | grep Cpus_allowed: | rev | cut -c 1) = 7' ExecStart=sh -c 'test $$(cat /proc/self/status | grep Cpus_allowed: | rev | cut -c 1) = 7'
CPUAffinity=0,1 CPUAffinity=0,1
CPUAffinity=1-2 CPUAffinity=1-2

View File

@ -9,10 +9,10 @@ Environment=TOP_SECRET=%d/very_top_secret
ExecStart=test %d/very_top_secret = "${CREDENTIALS_DIRECTORY}/very_top_secret" ExecStart=test %d/very_top_secret = "${CREDENTIALS_DIRECTORY}/very_top_secret"
LoadCredential=very_top_secret LoadCredential=very_top_secret
ExecStart=test %d/very_top_secret = "${CREDENTIALS_DIRECTORY}/very_top_secret" ExecStart=test %d/very_top_secret = "${CREDENTIALS_DIRECTORY}/very_top_secret"
ExecStart=bash -c 'test %d/very_top_secret = "$TOP_SECRET"' ExecStart=sh -c 'test %d/very_top_secret = "$TOP_SECRET"'
ExecStartPost=test %d/very_top_secret = "${CREDENTIALS_DIRECTORY}/very_top_secret" ExecStartPost=test %d/very_top_secret = "${CREDENTIALS_DIRECTORY}/very_top_secret"
ExecStartPost=bash -c 'test %d/very_top_secret = "$TOP_SECRET"' ExecStartPost=sh -c 'test %d/very_top_secret = "$TOP_SECRET"'
ExecStop=test %d/very_top_secret = "${CREDENTIALS_DIRECTORY}/very_top_secret" ExecStop=test %d/very_top_secret = "${CREDENTIALS_DIRECTORY}/very_top_secret"
ExecStop=bash -c 'test %d/very_top_secret = "$TOP_SECRET"' ExecStop=sh -c 'test %d/very_top_secret = "$TOP_SECRET"'
ExecStopPost=test %d/very_top_secret = "${CREDENTIALS_DIRECTORY}/very_top_secret" ExecStopPost=test %d/very_top_secret = "${CREDENTIALS_DIRECTORY}/very_top_secret"
ExecStopPost=bash -c 'test %d/very_top_secret = "$TOP_SECRET"' ExecStopPost=sh -c 'test %d/very_top_secret = "$TOP_SECRET"'

View File

@ -5,9 +5,9 @@ Description=Test DynamicUser with static User= whose uid and gid are different
[Service] [Service]
Type=oneshot Type=oneshot
ExecStart=bash -x -c 'test "$$(id -nG)" = "adm" && test "$$(id -ng)" = "adm" && test "$$(id -nu)" = "adm"' ExecStart=sh -x -c 'test "$$(id -nG)" = "adm" && test "$$(id -ng)" = "adm" && test "$$(id -nu)" = "adm"'
# Multiple ExecStart= lines causes the issue #9702. # Multiple ExecStart= lines causes the issue #9702.
ExecStart=bash -x -c 'test "$$(id -nG)" = "adm" && test "$$(id -ng)" = "adm" && test "$$(id -nu)" = "adm"' ExecStart=sh -x -c 'test "$$(id -nG)" = "adm" && test "$$(id -ng)" = "adm" && test "$$(id -nu)" = "adm"'
DynamicUser=yes DynamicUser=yes
User=adm User=adm
ReadWritePaths=-/coverage ReadWritePaths=-/coverage

View File

@ -2,13 +2,12 @@
[Unit] [Unit]
Description=Test DynamicUser with static User= whose uid and gid are different Description=Test DynamicUser with static User= whose uid and gid are different
# On Ubuntu or Debian, user games has uid==5 and gid==60. # On Ubuntu or Debian, user games has uid==5 and gid==60.
# On Alpine/postmarketOS, the user 'games' in the 'games' and 'users' groups.
[Service] [Service]
Type=oneshot Type=oneshot
ExecStart=bash -x -c '[[ "$$(id -nG)" =~ "games" ]] && test "$$(id -ng)" = "games" && test "$$(id -nu)" = "games"' ExecStart=sh -x -c 'test "$$(id -nG)" = "games" && test "$$(id -ng)" = "games" && test "$$(id -nu)" = "games"'
# Multiple ExecStart= lines causes the issue #9702. # Multiple ExecStart= lines causes the issue #9702.
ExecStart=bash -x -c '[[ "$$(id -nG)" =~ "games" ]] && test "$$(id -ng)" = "games" && test "$$(id -nu)" = "games"' ExecStart=sh -x -c 'test "$$(id -nG)" = "games" && test "$$(id -ng)" = "games" && test "$$(id -nu)" = "games"'
DynamicUser=yes DynamicUser=yes
User=games User=games
ReadWritePaths=-/coverage ReadWritePaths=-/coverage

View File

@ -3,8 +3,8 @@
Description=Test DynamicUser with User= and SupplementaryGroups= Description=Test DynamicUser with User= and SupplementaryGroups=
[Service] [Service]
ExecStart=bash -x -c 'for g in $$(id -G); do test "$$g" = "1" && exit 0; done; exit 1' ExecStart=sh -x -c 'for g in $$(id -G); do test "$$g" = "1" && exit 0; done; exit 1'
ExecStart=bash -x -c 'test "$$(id -g)" = "1" && test "$$(id -u)" = "1"' ExecStart=sh -x -c 'test "$$(id -g)" = "1" && test "$$(id -u)" = "1"'
Type=oneshot Type=oneshot
User=1 User=1
DynamicUser=yes DynamicUser=yes

View File

@ -3,8 +3,8 @@
Description=Test DynamicUser with User= Description=Test DynamicUser with User=
[Service] [Service]
ExecStart=bash -x -c 'for g in $$(id -G); do test "$$g" = "1" && exit 0; done; exit 1' ExecStart=sh -x -c 'for g in $$(id -G); do test "$$g" = "1" && exit 0; done; exit 1'
ExecStart=bash -x -c 'test "$$(id -g)" = "1" && test "$$(id -u)" = "1"' ExecStart=sh -x -c 'test "$$(id -g)" = "1" && test "$$(id -u)" = "1"'
Type=oneshot Type=oneshot
User=1 User=1
DynamicUser=yes DynamicUser=yes

View File

@ -3,9 +3,9 @@
Description=Test for RuntimeDirectory with RuntimeDirectoryPreserve=yes and DynamicUser=yes Description=Test for RuntimeDirectory with RuntimeDirectoryPreserve=yes and DynamicUser=yes
[Service] [Service]
ExecStart=bash -x -c 'test -d %t/test-exec_runtimedirectorypreserve' ExecStart=sh -x -c 'test -d %t/test-exec_runtimedirectorypreserve'
ExecStart=bash -x -c 'test "$$RUNTIME_DIRECTORY" = "%t/test-exec_runtimedirectorypreserve"' ExecStart=sh -x -c 'test "$$RUNTIME_DIRECTORY" = "%t/test-exec_runtimedirectorypreserve"'
ExecStart=bash -x -c 'touch $$RUNTIME_DIRECTORY/test' ExecStart=sh -x -c 'touch $$RUNTIME_DIRECTORY/test'
Type=oneshot Type=oneshot
RuntimeDirectory=test-exec_runtimedirectorypreserve RuntimeDirectory=test-exec_runtimedirectorypreserve
RuntimeDirectoryPreserve=yes RuntimeDirectoryPreserve=yes

View File

@ -3,10 +3,10 @@
Description=Test for RuntimeDirectory with RuntimeDirectoryPreserve=yes and DynamicUser=yes 2nd trial Description=Test for RuntimeDirectory with RuntimeDirectoryPreserve=yes and DynamicUser=yes 2nd trial
[Service] [Service]
ExecStart=bash -x -c 'test -d %t/test-exec_runtimedirectorypreserve' ExecStart=sh -x -c 'test -d %t/test-exec_runtimedirectorypreserve'
ExecStart=bash -x -c 'test "$$RUNTIME_DIRECTORY" = "%t/test-exec_runtimedirectorypreserve"' ExecStart=sh -x -c 'test "$$RUNTIME_DIRECTORY" = "%t/test-exec_runtimedirectorypreserve"'
ExecStart=bash -x -c 'test -f $$RUNTIME_DIRECTORY/test' ExecStart=sh -x -c 'test -f $$RUNTIME_DIRECTORY/test'
ExecStart=bash -x -c 'touch $$RUNTIME_DIRECTORY/test' ExecStart=sh -x -c 'touch $$RUNTIME_DIRECTORY/test'
Type=oneshot Type=oneshot
RuntimeDirectory=test-exec_runtimedirectorypreserve RuntimeDirectory=test-exec_runtimedirectorypreserve
RuntimeDirectoryPreserve=yes RuntimeDirectoryPreserve=yes

View File

@ -3,10 +3,10 @@
Description=Test for RuntimeDirectory with DynamicUser=yes migrated from RuntimeDirectoryPreserve=yes Description=Test for RuntimeDirectory with DynamicUser=yes migrated from RuntimeDirectoryPreserve=yes
[Service] [Service]
ExecStart=bash -x -c 'test -d %t/test-exec_runtimedirectorypreserve' ExecStart=sh -x -c 'test -d %t/test-exec_runtimedirectorypreserve'
ExecStart=bash -x -c 'test "$$RUNTIME_DIRECTORY" = "%t/test-exec_runtimedirectorypreserve"' ExecStart=sh -x -c 'test "$$RUNTIME_DIRECTORY" = "%t/test-exec_runtimedirectorypreserve"'
ExecStart=bash -x -c 'test -f $$RUNTIME_DIRECTORY/test' ExecStart=sh -x -c 'test -f $$RUNTIME_DIRECTORY/test'
ExecStart=bash -x -c 'touch $$RUNTIME_DIRECTORY/test' ExecStart=sh -x -c 'touch $$RUNTIME_DIRECTORY/test'
Type=oneshot Type=oneshot
RuntimeDirectory=test-exec_runtimedirectorypreserve RuntimeDirectory=test-exec_runtimedirectorypreserve
DynamicUser=yes DynamicUser=yes

View File

@ -11,7 +11,7 @@ ExecStart=test -d %S/test-dynamicuser-migrate
ExecStart=test -d %S/test-dynamicuser-migrate2/hoge ExecStart=test -d %S/test-dynamicuser-migrate2/hoge
ExecStart=touch %S/test-dynamicuser-migrate/yay ExecStart=touch %S/test-dynamicuser-migrate/yay
ExecStart=touch %S/test-dynamicuser-migrate2/hoge/yayyay ExecStart=touch %S/test-dynamicuser-migrate2/hoge/yayyay
ExecStart=bash -x -c 'test "$$STATE_DIRECTORY" = "%S/test-dynamicuser-migrate:%S/test-dynamicuser-migrate2/hoge"' ExecStart=sh -x -c 'test "$$STATE_DIRECTORY" = "%S/test-dynamicuser-migrate:%S/test-dynamicuser-migrate2/hoge"'
Type=oneshot Type=oneshot
DynamicUser=no DynamicUser=no

View File

@ -19,7 +19,7 @@ ExecStart=touch %S/test-dynamicuser-migrate/yay
ExecStart=touch %S/test-dynamicuser-migrate2/hoge/yayyay ExecStart=touch %S/test-dynamicuser-migrate2/hoge/yayyay
ExecStart=touch %S/private/test-dynamicuser-migrate/yay ExecStart=touch %S/private/test-dynamicuser-migrate/yay
ExecStart=touch %S/private/test-dynamicuser-migrate2/hoge/yayyay ExecStart=touch %S/private/test-dynamicuser-migrate2/hoge/yayyay
ExecStart=bash -x -c 'test "$$STATE_DIRECTORY" = "%S/test-dynamicuser-migrate:%S/test-dynamicuser-migrate2/hoge"' ExecStart=sh -x -c 'test "$$STATE_DIRECTORY" = "%S/test-dynamicuser-migrate:%S/test-dynamicuser-migrate2/hoge"'
Type=oneshot Type=oneshot
DynamicUser=yes DynamicUser=yes

View File

@ -78,7 +78,7 @@ ExecStart=test -f %S/private/xxx/foo
ExecStart=test -f %S/private/xxx/yyy/foo ExecStart=test -f %S/private/xxx/yyy/foo
ExecStart=test -f %S/private/xxx/zzz/foo ExecStart=test -f %S/private/xxx/zzz/foo
ExecStart=bash -x -c 'test "$$STATE_DIRECTORY" = "%S/aaa:%S/aaa/bbb:%S/aaa/ccc:%S/abc:%S/quux/pief:%S/waldo:%S/xxx:%S/xxx/yyy:%S/xxx/zzz"' ExecStart=sh -x -c 'test "$$STATE_DIRECTORY" = "%S/aaa:%S/aaa/bbb:%S/aaa/ccc:%S/abc:%S/quux/pief:%S/waldo:%S/xxx:%S/xxx/yyy:%S/xxx/zzz"'
Type=oneshot Type=oneshot
DynamicUser=yes DynamicUser=yes

View File

@ -3,8 +3,8 @@
Description=Test DynamicUser with SupplementaryGroups= Description=Test DynamicUser with SupplementaryGroups=
[Service] [Service]
ExecStart=bash -x -c 'for g in $$(id -G); do test "$$g" = "1" && exit 0; done; exit 1' ExecStart=sh -x -c 'for g in $$(id -G); do test "$$g" = "1" && exit 0; done; exit 1'
ExecStart=bash -x -c 'for g in $$(id -G); do test "$$g" = "2" && exit 0; done; exit 1' ExecStart=sh -x -c 'for g in $$(id -G); do test "$$g" = "2" && exit 0; done; exit 1'
Type=oneshot Type=oneshot
DynamicUser=yes DynamicUser=yes
SupplementaryGroups=1 2 SupplementaryGroups=1 2

View File

@ -3,7 +3,7 @@
Description=Test for Environment Description=Test for Environment
[Service] [Service]
ExecStart=bash -x -c 'test "$${VAR1-unset}" = "unset" && test "$${VAR2-unset}" = "unset" && test "$${VAR3-unset}" = "unset"' ExecStart=sh -x -c 'test "$${VAR1-unset}" = "unset" && test "$${VAR2-unset}" = "unset" && test "$${VAR3-unset}" = "unset"'
Type=oneshot Type=oneshot
Environment="VAR1=word1 word2" VAR2=word3 "VAR3=$word 5 6" Environment="VAR1=word1 word2" VAR2=word3 "VAR3=$word 5 6"
Environment= Environment=

View File

@ -3,7 +3,7 @@
Description=Test for Environment Description=Test for Environment
[Service] [Service]
ExecStart=bash -x -c 'test "$$VAR1" = "word1 word2" && test "$$VAR2" = word3 && test "$$VAR3" = foobar' ExecStart=sh -x -c 'test "$$VAR1" = "word1 word2" && test "$$VAR2" = word3 && test "$$VAR3" = foobar'
Type=oneshot Type=oneshot
Environment="VAR1=word1 word2" VAR2=word3 "VAR3=$word 5 6" Environment="VAR1=word1 word2" VAR2=word3 "VAR3=$word 5 6"
Environment="VAR3=foobar" Environment="VAR3=foobar"

View File

@ -3,7 +3,7 @@
Description=Test for No Environment Variable Substitution Description=Test for No Environment Variable Substitution
[Service] [Service]
ExecStart=bash -x -c 'test "$${VAR1-unset}" = "unset" && test "$${VAR2}" = "word3" && test "$${VAR3-unset}" = \'$word 5 6\'' ExecStart=sh -x -c 'test "$${VAR1-unset}" = "unset" && test "$${VAR2}" = "word3" && test "$${VAR3-unset}" = \'$word 5 6\''
ExecStart=:bash -x -c 'test "$${VAR1-unset}" != "unset" && test "$${VAR2}" != "word3" && test "$${VAR3-unset}" != \'$word 5 6\'' ExecStart=:/bin/sh -x -c 'test "$${VAR1-unset}" != "unset" && test "$${VAR2}" != "word3" && test "$${VAR3-unset}" != \'$word 5 6\''
Type=oneshot Type=oneshot
Environment="VAR2=word3" "VAR3=$word 5 6" Environment="VAR2=word3" "VAR3=$word 5 6"

View File

@ -3,6 +3,6 @@
Description=Test for Environment Description=Test for Environment
[Service] [Service]
ExecStart=bash -x -c 'test "$$VAR1" = "word1 word2" && test "$$VAR2" = word3 && test "$$VAR3" = "\\$$word 5 6"' ExecStart=sh -x -c 'test "$$VAR1" = "word1 word2" && test "$$VAR2" = word3 && test "$$VAR3" = "\\$$word 5 6"'
Type=oneshot Type=oneshot
Environment="VAR1=word1 word2" VAR2=word3 "VAR3=$word 5 6" Environment="VAR1=word1 word2" VAR2=word3 "VAR3=$word 5 6"

View File

@ -3,6 +3,6 @@
Description=Test for EnvironmentFile Description=Test for EnvironmentFile
[Service] [Service]
ExecStart=bash -x -c 'test "$$VAR1" = "word1 word2" && test "$$VAR2" = word3 && test "$$VAR3" = "\\$$word 5 6" && test "$$VAR4" = "new\nline" && test "$$VAR5" = passwordwithbackslashes' ExecStart=sh -x -c 'test "$$VAR1" = "word1 word2" && test "$$VAR2" = word3 && test "$$VAR3" = "\\$$word 5 6" && test "$$VAR4" = "new\nline" && test "$$VAR5" = passwordwithbackslashes'
Type=oneshot Type=oneshot
EnvironmentFile=/tmp/test-exec_environmentfile.conf EnvironmentFile=/tmp/test-exec_environmentfile.conf

View File

@ -1,6 +1,6 @@
# SPDX-License-Identifier: LGPL-2.1-or-later # SPDX-License-Identifier: LGPL-2.1-or-later
[Service] [Service]
ExecStart=bash -x -c 'test "$$PATH" = "/usr" && test "$$VAR1" = word3 && test "$$VAR2" = "\\$$word 5 6"' ExecStart=sh -x -c 'test "$$PATH" = "/usr" && test "$$VAR1" = word3 && test "$$VAR2" = "\\$$word 5 6"'
Type=oneshot Type=oneshot
ExecSearchPath=/tmp:/bin ExecSearchPath=/tmp:/bin
Environment="PATH=/usr" VAR1=word3 "VAR2=$word 5 6" Environment="PATH=/usr" VAR1=word3 "VAR2=$word 5 6"

View File

@ -1,6 +1,6 @@
# SPDX-License-Identifier: LGPL-2.1-or-later # SPDX-License-Identifier: LGPL-2.1-or-later
[Service] [Service]
ExecStart=bash -x -c 'test "$$VAR1" = "word1 word2" && test "$$VAR2" = word3 && test "$$VAR3" = "\\$$word 5 6" && test "$$PATH" = "/tmp:/bin"' ExecStart=sh -x -c 'test "$$VAR1" = "word1 word2" && test "$$VAR2" = word3 && test "$$VAR3" = "\\$$word 5 6" && test "$$PATH" = "/tmp:/bin"'
Type=oneshot Type=oneshot
ExecSearchPath=/tmp:/bin ExecSearchPath=/tmp:/bin
Environment="VAR1=word1 word2" VAR2=word3 "VAR3=$word 5 6" Environment="VAR1=word1 word2" VAR2=word3 "VAR3=$word 5 6"

View File

@ -3,7 +3,7 @@
Description=Test for ExecSearchPath with EnvironmentFile where EnvironmentFile sets PATH Description=Test for ExecSearchPath with EnvironmentFile where EnvironmentFile sets PATH
[Service] [Service]
ExecStart=bash -x -c 'test "$$VAR1" = "word1 word2" && test "$$VAR2" = word3 && test "$$VAR3" = "\\$$word 5 6" && test "$$VAR4" = "new\nline" && test "$$VAR5" = passwordwithbackslashes && test "$$PATH" = /usr' ExecStart=sh -x -c 'test "$$VAR1" = "word1 word2" && test "$$VAR2" = word3 && test "$$VAR3" = "\\$$word 5 6" && test "$$VAR4" = "new\nline" && test "$$VAR5" = passwordwithbackslashes && test "$$PATH" = /usr'
Type=oneshot Type=oneshot
EnvironmentFile=/tmp/test-exec_execsearchpath_environmentfile-set.conf EnvironmentFile=/tmp/test-exec_execsearchpath_environmentfile-set.conf
ExecSearchPath=/tmp:/bin ExecSearchPath=/tmp:/bin

View File

@ -3,7 +3,7 @@
Description=Test for ExecSearchPath with EnvironmentFile where EnvironmentFile does not set PATH Description=Test for ExecSearchPath with EnvironmentFile where EnvironmentFile does not set PATH
[Service] [Service]
ExecStart=bash -x -c 'test "$$VAR1" = "word1 word2" && test "$$VAR2" = word3 && test "$$VAR3" = "\\$$word 5 6" && test "$$VAR4" = "new\nline" && test "$$VAR5" = passwordwithbackslashes && test "$$PATH" = "/tmp:/bin"' ExecStart=sh -x -c 'test "$$VAR1" = "word1 word2" && test "$$VAR2" = word3 && test "$$VAR3" = "\\$$word 5 6" && test "$$VAR4" = "new\nline" && test "$$VAR5" = passwordwithbackslashes && test "$$PATH" = "/tmp:/bin"'
Type=oneshot Type=oneshot
ExecSearchPath=/tmp:/bin ExecSearchPath=/tmp:/bin
EnvironmentFile=/tmp/test-exec_execsearchpath_environmentfile.conf EnvironmentFile=/tmp/test-exec_execsearchpath_environmentfile.conf

View File

@ -3,7 +3,7 @@
Description=Test for PassEnvironment with ExecSearchPath with PATH set by user Description=Test for PassEnvironment with ExecSearchPath with PATH set by user
[Service] [Service]
ExecStart=bash -x -c 'test "$$VAR1" = "word1 word2" && test "$$VAR2" = word3 && test "$$VAR3" = "\\$$word 5 6" && test "$$VAR4" = "new\nline" && test "$$VAR5" = passwordwithbackslashes && test "$$PATH" = "/usr"' ExecStart=sh -x -c 'test "$$VAR1" = "word1 word2" && test "$$VAR2" = word3 && test "$$VAR3" = "\\$$word 5 6" && test "$$VAR4" = "new\nline" && test "$$VAR5" = passwordwithbackslashes && test "$$PATH" = "/usr"'
Type=oneshot Type=oneshot
PassEnvironment=VAR1 VAR2 VAR3 VAR4 VAR5 PATH PassEnvironment=VAR1 VAR2 VAR3 VAR4 VAR5 PATH
ExecSearchPath=/tmp:/bin ExecSearchPath=/tmp:/bin

View File

@ -3,7 +3,7 @@
Description=Test for PassEnvironment with ExecSearchPath with PATH not set by user Description=Test for PassEnvironment with ExecSearchPath with PATH not set by user
[Service] [Service]
ExecStart=bash -x -c 'test "$$VAR1" = "word1 word2" && test "$$VAR2" = word3 && test "$$VAR3" = "\\$$word 5 6" && test "$$VAR4" = "new\nline" && test "$$VAR5" = passwordwithbackslashes && test "$$PATH" = "/tmp:/bin"' ExecStart=sh -x -c 'test "$$VAR1" = "word1 word2" && test "$$VAR2" = word3 && test "$$VAR3" = "\\$$word 5 6" && test "$$VAR4" = "new\nline" && test "$$VAR5" = passwordwithbackslashes && test "$$PATH" = "/tmp:/bin"'
Type=oneshot Type=oneshot
PassEnvironment=VAR1 VAR2 VAR3 VAR4 VAR5 PassEnvironment=VAR1 VAR2 VAR3 VAR4 VAR5
ExecSearchPath=/tmp:/bin ExecSearchPath=/tmp:/bin

View File

@ -5,4 +5,4 @@ Description=Test for specifiers with exec search path
[Service] [Service]
Type=oneshot Type=oneshot
ExecSearchPath=/tmp:/bin:/usr/bin:%V ExecSearchPath=/tmp:/bin:/usr/bin:%V
ExecStart=bash -x -c 'test %V = /var/tmp && test "$$PATH" = "/tmp:/bin:/usr/bin:/var/tmp"' ExecStart=sh -x -c 'test %V = /var/tmp && test "$$PATH" = "/tmp:/bin:/usr/bin:/var/tmp"'

View File

@ -3,6 +3,6 @@
Description=Test for Group Description=Test for Group
[Service] [Service]
ExecStart=bash -x -c 'test "$$(id -n -g)" = "nfsnobody"' ExecStart=sh -x -c 'test "$$(id -n -g)" = "nfsnobody"'
Type=oneshot Type=oneshot
Group=nfsnobody Group=nfsnobody

View File

@ -3,6 +3,6 @@
Description=Test for Group Description=Test for Group
[Service] [Service]
ExecStart=bash -x -c 'test "$$(id -n -g)" = "nobody"' ExecStart=sh -x -c 'test "$$(id -n -g)" = "nobody"'
Type=oneshot Type=oneshot
Group=nobody Group=nobody

View File

@ -3,6 +3,6 @@
Description=Test for Group Description=Test for Group
[Service] [Service]
ExecStart=bash -x -c 'test "$$(id -n -g)" = "nogroup"' ExecStart=sh -x -c 'test "$$(id -n -g)" = "nogroup"'
Type=oneshot Type=oneshot
Group=nogroup Group=nogroup

View File

@ -3,6 +3,6 @@
Description=Test for Group (daemon) Description=Test for Group (daemon)
[Service] [Service]
ExecStart=bash -x -c 'test "$$(id -n -g)" = "daemon"' ExecStart=sh -x -c 'test "$$(id -n -g)" = "daemon"'
Type=oneshot Type=oneshot
Group=daemon Group=daemon

View File

@ -3,6 +3,6 @@
Description=Test for IgnoreSIGPIPE=no Description=Test for IgnoreSIGPIPE=no
[Service] [Service]
ExecStart=bash -x -c 'kill -PIPE 0' ExecStart=sh -x -c 'kill -PIPE 0'
Type=oneshot Type=oneshot
IgnoreSIGPIPE=no IgnoreSIGPIPE=no

View File

@ -3,6 +3,6 @@
Description=Test for IgnoreSIGPIPE=yes Description=Test for IgnoreSIGPIPE=yes
[Service] [Service]
ExecStart=bash -x -c 'kill -PIPE 0' ExecStart=sh -x -c 'kill -PIPE 0'
Type=oneshot Type=oneshot
IgnoreSIGPIPE=yes IgnoreSIGPIPE=yes

View File

@ -4,5 +4,5 @@ Description=Test to make sure that InaccessiblePaths= disconnect mount propagati
[Service] [Service]
InaccessiblePaths=-/i-dont-exist InaccessiblePaths=-/i-dont-exist
ExecStart=bash -x -c 'd=$$(mktemp -d -p /tmp); trap "umount \'$$d\' && rmdir \'$$d\'" EXIT; mount -t tmpfs tmpfs "$$d"; grep "$$d" /proc/self/mountinfo && ! grep "$$d" /proc/$${PPID}/mountinfo && ! grep "$$d" /proc/1/mountinfo' ExecStart=sh -x -c 'd=$$(mktemp -d -p /tmp); trap "umount \'$$d\' && rmdir \'$$d\'" EXIT; mount -t tmpfs tmpfs "$$d"; grep "$$d" /proc/self/mountinfo && ! grep "$$d" /proc/$${PPID}/mountinfo && ! grep "$$d" /proc/1/mountinfo'
Type=oneshot Type=oneshot

View File

@ -4,5 +4,5 @@ Description=Test to make sure that mount namespace setup works properly with the
[Service] [Service]
InaccessiblePaths=/sys InaccessiblePaths=/sys
ExecStart=bash -x -c 'test "$$(stat -c %%a /sys)" = "0"' ExecStart=sh -x -c 'test "$$(stat -c %%a /sys)" = "0"'
Type=oneshot Type=oneshot

View File

@ -3,6 +3,6 @@
Description=Test for IOSchedulingClass=best-effort Description=Test for IOSchedulingClass=best-effort
[Service] [Service]
ExecStart=bash -x -c 'c=$$(LC_ALL=C ionice); test "$${c%%:*}" = "best-effort"' ExecStart=sh -x -c 'c=$$(LC_ALL=C ionice); test "$${c%%:*}" = "best-effort"'
Type=oneshot Type=oneshot
IOSchedulingClass=best-effort IOSchedulingClass=best-effort

View File

@ -3,6 +3,6 @@
Description=Test for IOSchedulingClass=idle Description=Test for IOSchedulingClass=idle
[Service] [Service]
ExecStart=bash -x -c 'c=$$(LC_ALL=C ionice); test "$${c%%:*}" = "idle"' ExecStart=sh -x -c 'c=$$(LC_ALL=C ionice); test "$${c%%:*}" = "idle"'
Type=oneshot Type=oneshot
IOSchedulingClass=idle IOSchedulingClass=idle

View File

@ -4,6 +4,6 @@ Description=Test for IOSchedulingClass=none
[Service] [Service]
# Old kernels might report "none" here, new kernels "best-effort". # Old kernels might report "none" here, new kernels "best-effort".
ExecStart=bash -x -c 'c=$$(LC_ALL=C ionice); test "$${c%%:*}" = "none" -o "$${c%%:*}" = "best-effort"' ExecStart=sh -x -c 'c=$$(LC_ALL=C ionice); test "$${c%%:*}" = "none" -o "$${c%%:*}" = "best-effort"'
Type=oneshot Type=oneshot
IOSchedulingClass=none IOSchedulingClass=none

View File

@ -3,6 +3,6 @@
Description=Test for IOSchedulingClass=realtime Description=Test for IOSchedulingClass=realtime
[Service] [Service]
ExecStart=bash -x -c 'c=$$(LC_ALL=C ionice); test "$${c%%:*}" = "realtime"' ExecStart=sh -x -c 'c=$$(LC_ALL=C ionice); test "$${c%%:*}" = "realtime"'
Type=oneshot Type=oneshot
IOSchedulingClass=realtime IOSchedulingClass=realtime

View File

@ -3,9 +3,9 @@
Description=Test for LoadCredential= Description=Test for LoadCredential=
[Service] [Service]
ExecStart=bash -x -c 'test "$$(cat %d/test-execute.load-credential)" = "foo"' ExecStart=sh -x -c 'test "$$(cat %d/test-execute.load-credential)" = "foo"'
ExecStartPost=bash -x -c 'test "$$(cat %d/test-execute.load-credential)" = "foo"' ExecStartPost=sh -x -c 'test "$$(cat %d/test-execute.load-credential)" = "foo"'
ExecStop=bash -x -c 'test "$$(cat %d/test-execute.load-credential)" = "foo"' ExecStop=sh -x -c 'test "$$(cat %d/test-execute.load-credential)" = "foo"'
ExecStopPost=bash -x -c 'test "$$(cat %d/test-execute.load-credential)" = "foo"' ExecStopPost=sh -x -c 'test "$$(cat %d/test-execute.load-credential)" = "foo"'
Type=oneshot Type=oneshot
LoadCredential=test-execute.load-credential LoadCredential=test-execute.load-credential

View File

@ -3,14 +3,14 @@
Description=Test for NetworkNamespacePath= without mount namespacing Description=Test for NetworkNamespacePath= without mount namespacing
[Service] [Service]
ExecStart=bash -x -c '! ip link show dummy-test-exec' ExecStart=sh -x -c '! ip link show dummy-test-exec'
ExecStart=bash -x -c 'test ! -e /proc/sys/net/ipv4/conf/dummy-test-exec' ExecStart=sh -x -c 'test ! -e /proc/sys/net/ipv4/conf/dummy-test-exec'
# Without mount namespacing, we can access the dummy-test-exec interface through sysfs. # Without mount namespacing, we can access the dummy-test-exec interface through sysfs.
ExecStart=bash -x -c 'test -e /sys/class/net/dummy-test-exec' ExecStart=sh -x -c 'test -e /sys/class/net/dummy-test-exec'
ExecStart=bash -x -c 'ip link show dummy-test-ns' ExecStart=sh -x -c 'ip link show dummy-test-ns'
ExecStart=bash -x -c 'test -e /proc/sys/net/ipv4/conf/dummy-test-ns' ExecStart=sh -x -c 'test -e /proc/sys/net/ipv4/conf/dummy-test-ns'
# Without mount namespacing, we cannot access the dummy-test-ns interface through sysfs. # Without mount namespacing, we cannot access the dummy-test-ns interface through sysfs.
ExecStart=bash -x -c 'test ! -e /sys/class/net/dummy-test-ns' ExecStart=sh -x -c 'test ! -e /sys/class/net/dummy-test-ns'
Type=oneshot Type=oneshot
NetworkNamespacePath=/run/netns/test-execute-netns NetworkNamespacePath=/run/netns/test-execute-netns
PrivateMounts=no PrivateMounts=no

View File

@ -3,14 +3,14 @@
Description=Test for NetworkNamespacePath= with mount namespacing Description=Test for NetworkNamespacePath= with mount namespacing
[Service] [Service]
ExecStart=bash -x -c '! ip link show dummy-test-exec' ExecStart=sh -x -c '! ip link show dummy-test-exec'
ExecStart=bash -x -c 'test ! -e /proc/sys/net/ipv4/conf/dummy-test-exec' ExecStart=sh -x -c 'test ! -e /proc/sys/net/ipv4/conf/dummy-test-exec'
# With mount namespacing, we cannot access the dummy-test-exec interface through sysfs. # With mount namespacing, we cannot access the dummy-test-exec interface through sysfs.
ExecStart=bash -x -c 'test ! -e /sys/class/net/dummy-test-exec' ExecStart=sh -x -c 'test ! -e /sys/class/net/dummy-test-exec'
ExecStart=bash -x -c 'ip link show dummy-test-ns' ExecStart=sh -x -c 'ip link show dummy-test-ns'
ExecStart=bash -x -c 'test -e /proc/sys/net/ipv4/conf/dummy-test-ns' ExecStart=sh -x -c 'test -e /proc/sys/net/ipv4/conf/dummy-test-ns'
# With mount namespacing, we can access the dummy-test-ns interface through sysfs. # With mount namespacing, we can access the dummy-test-ns interface through sysfs.
ExecStart=bash -x -c 'test -e /sys/class/net/dummy-test-ns' ExecStart=sh -x -c 'test -e /sys/class/net/dummy-test-ns'
Type=oneshot Type=oneshot
NetworkNamespacePath=/run/netns/test-execute-netns NetworkNamespacePath=/run/netns/test-execute-netns
# NetworkNamespacePath= implies PrivateMounts=yes # NetworkNamespacePath= implies PrivateMounts=yes

View File

@ -5,7 +5,7 @@ Description=Test for NoExecPaths=
[Service] [Service]
Type=oneshot Type=oneshot
# This should work, as we explicitly disable the effect of NoExecPaths= # This should work, as we explicitly disable the effect of NoExecPaths=
ExecStart=+bash -c '/bin/cat /dev/null' ExecStart=+/bin/sh -c '/bin/cat /dev/null'
# This should also work, as we do not disable the effect of NoExecPaths= but invert the exit code # This should also work, as we do not disable the effect of NoExecPaths= but invert the exit code
ExecStart=bash -x -c '! /bin/cat /dev/null' ExecStart=sh -x -c '! /bin/cat /dev/null'
NoExecPaths=/bin/cat NoExecPaths=/bin/cat

View File

@ -3,6 +3,6 @@
Description=Test for OOMScoreAdjust Description=Test for OOMScoreAdjust
[Service] [Service]
ExecStart=bash -x -c 'c=$$(cat /proc/self/oom_score_adj); test "$$c" -eq -100' ExecStart=sh -x -c 'c=$$(cat /proc/self/oom_score_adj); test "$$c" -eq -100'
Type=oneshot Type=oneshot
OOMScoreAdjust=-100 OOMScoreAdjust=-100

View File

@ -3,6 +3,6 @@
Description=Test for OOMScoreAdjust Description=Test for OOMScoreAdjust
[Service] [Service]
ExecStart=bash -x -c 'c=$$(cat /proc/self/oom_score_adj); test "$$c" -eq 100' ExecStart=sh -x -c 'c=$$(cat /proc/self/oom_score_adj); test "$$c" -eq 100'
Type=oneshot Type=oneshot
OOMScoreAdjust=100 OOMScoreAdjust=100

View File

@ -3,6 +3,6 @@
Description=Test for PassEnvironment with variables absent from the execution environment Description=Test for PassEnvironment with variables absent from the execution environment
[Service] [Service]
ExecStart=bash -x -c 'test "$${VAR1-unset}" = "unset" && test "$${VAR2-unset}" = "unset" && test "$${VAR3-unset}" = "unset" && test "$${VAR4-unset}" = "unset" && test "$${VAR5-unset}" = "unset"' ExecStart=sh -x -c 'test "$${VAR1-unset}" = "unset" && test "$${VAR2-unset}" = "unset" && test "$${VAR3-unset}" = "unset" && test "$${VAR4-unset}" = "unset" && test "$${VAR5-unset}" = "unset"'
Type=oneshot Type=oneshot
PassEnvironment=VAR1 VAR2 VAR3 VAR4 VAR5 PassEnvironment=VAR1 VAR2 VAR3 VAR4 VAR5

View File

@ -3,7 +3,7 @@
Description=Test for PassEnvironment and erasing the variable list Description=Test for PassEnvironment and erasing the variable list
[Service] [Service]
ExecStart=bash -x -c 'test "$${VAR1-unset}" = "unset" && test "$${VAR2-unset}" = "unset" && test "$${VAR3-unset}" = "unset" && test "$${VAR4-unset}" = "unset" && test "$${VAR5-unset}" = "unset"' ExecStart=sh -x -c 'test "$${VAR1-unset}" = "unset" && test "$${VAR2-unset}" = "unset" && test "$${VAR3-unset}" = "unset" && test "$${VAR4-unset}" = "unset" && test "$${VAR5-unset}" = "unset"'
Type=oneshot Type=oneshot
PassEnvironment=VAR1 VAR2 VAR3 VAR4 VAR5 PassEnvironment=VAR1 VAR2 VAR3 VAR4 VAR5
PassEnvironment= PassEnvironment=

View File

@ -3,7 +3,7 @@
Description=Test for PassEnvironment with a variable name repeated Description=Test for PassEnvironment with a variable name repeated
[Service] [Service]
ExecStart=bash -x -c 'test "$$VAR1" = "word1 word2" && test "$$VAR2" = word3 && test "$$VAR3" = "\\$$word 5 6" && test "$$VAR4" = "new\nline" && test "$$VAR5" = passwordwithbackslashes' ExecStart=sh -x -c 'test "$$VAR1" = "word1 word2" && test "$$VAR2" = word3 && test "$$VAR3" = "\\$$word 5 6" && test "$$VAR4" = "new\nline" && test "$$VAR5" = passwordwithbackslashes'
Type=oneshot Type=oneshot
PassEnvironment=VAR1 VAR2 PassEnvironment=VAR1 VAR2
PassEnvironment=VAR1 VAR3 PassEnvironment=VAR1 VAR3

View File

@ -3,6 +3,6 @@
Description=Test for PassEnvironment Description=Test for PassEnvironment
[Service] [Service]
ExecStart=bash -x -c 'test "$$VAR1" = "word1 word2" && test "$$VAR2" = word3 && test "$$VAR3" = "\\$$word 5 6" && test "$$VAR4" = "new\nline" && test "$$VAR5" = passwordwithbackslashes' ExecStart=sh -x -c 'test "$$VAR1" = "word1 word2" && test "$$VAR2" = word3 && test "$$VAR3" = "\\$$word 5 6" && test "$$VAR4" = "new\nline" && test "$$VAR5" = passwordwithbackslashes'
Type=oneshot Type=oneshot
PassEnvironment=VAR1 VAR2 VAR3 VAR4 VAR5 PassEnvironment=VAR1 VAR2 VAR3 VAR4 VAR5

View File

@ -3,6 +3,6 @@
Description=Test for Personality=aarch64 Description=Test for Personality=aarch64
[Service] [Service]
ExecStart=bash -c 'echo $(uname -m); exit $(test $(uname -m) = "aarch64")' ExecStart=sh -c 'echo $(uname -m); exit $(test $(uname -m) = "aarch64")'
Type=oneshot Type=oneshot
Personality=aarch64 Personality=aarch64

View File

@ -2,6 +2,6 @@
Description=Test for Personality=loongarch64 Description=Test for Personality=loongarch64
[Service] [Service]
ExecStart=bash -c 'echo $(uname -m); exit $(test $(uname -m) = "loongarch64")' ExecStart=sh -c 'echo $(uname -m); exit $(test $(uname -m) = "loongarch64")'
Type=oneshot Type=oneshot
Personality=loongarch64 Personality=loongarch64

View File

@ -3,6 +3,6 @@
Description=Test for Personality=ppc64 Description=Test for Personality=ppc64
[Service] [Service]
ExecStart=bash -c 'echo $(uname -m); exit $(test $(uname -m) = "ppc64")' ExecStart=sh -c 'echo $(uname -m); exit $(test $(uname -m) = "ppc64")'
Type=oneshot Type=oneshot
Personality=ppc64 Personality=ppc64

View File

@ -3,6 +3,6 @@
Description=Test for Personality=ppc64le Description=Test for Personality=ppc64le
[Service] [Service]
ExecStart=bash -c 'echo $(uname -m); exit $(test $(uname -m) = "ppc64le")' ExecStart=sh -c 'echo $(uname -m); exit $(test $(uname -m) = "ppc64le")'
Type=oneshot Type=oneshot
Personality=ppc64le Personality=ppc64le

View File

@ -3,6 +3,6 @@
Description=Test for Personality=s390 Description=Test for Personality=s390
[Service] [Service]
ExecStart=bash -x -c 'c=$$(uname -m); test "$$c" = "s390"' ExecStart=sh -x -c 'c=$$(uname -m); test "$$c" = "s390"'
Type=oneshot Type=oneshot
Personality=s390 Personality=s390

View File

@ -3,6 +3,6 @@
Description=Test for Personality=s390x Description=Test for Personality=s390x
[Service] [Service]
ExecStart=bash -x -c 'c=$$(uname -m); test "$$c" = "s390x"' ExecStart=sh -x -c 'c=$$(uname -m); test "$$c" = "s390x"'
Type=oneshot Type=oneshot
Personality=s390x Personality=s390x

View File

@ -3,6 +3,6 @@
Description=Test for Personality=x86-64 Description=Test for Personality=x86-64
[Service] [Service]
ExecStart=bash -x -c 'c=$$(uname -m); test "$$c" = "x86_64"' ExecStart=sh -x -c 'c=$$(uname -m); test "$$c" = "x86_64"'
Type=oneshot Type=oneshot
Personality=x86-64 Personality=x86-64

View File

@ -3,6 +3,6 @@
Description=Test for Personality=x86 Description=Test for Personality=x86
[Service] [Service]
ExecStart=bash -x -c 'c=$$(uname -m); test "$$c" = "i686" -o "$$c" = "x86_64"' ExecStart=sh -x -c 'c=$$(uname -m); test "$$c" = "i686" -o "$$c" = "x86_64"'
Type=oneshot Type=oneshot
Personality=x86 Personality=x86

View File

@ -3,8 +3,8 @@
Description=Test for PrivateDevices=yes with a bind mounted device Description=Test for PrivateDevices=yes with a bind mounted device
[Service] [Service]
ExecStart=bash -c 'test -c /dev/kmsg' ExecStart=sh -c 'test -c /dev/kmsg'
ExecStart=bash -c 'test ! -w /dev/' ExecStart=sh -c 'test ! -w /dev/'
Type=oneshot Type=oneshot
PrivateDevices=yes PrivateDevices=yes
BindPaths=/dev/kmsg BindPaths=/dev/kmsg

View File

@ -3,7 +3,7 @@
Description=Test for PrivateDevices=yes with prefix Description=Test for PrivateDevices=yes with prefix
[Service] [Service]
ExecStart=bash -x -c '! test -c /dev/kmsg' ExecStart=sh -x -c '! test -c /dev/kmsg'
ExecStart=+bash -x -c 'test -c /dev/kmsg' ExecStart=+/bin/sh -x -c 'test -c /dev/kmsg'
Type=oneshot Type=oneshot
PrivateDevices=yes PrivateDevices=yes

View File

@ -5,5 +5,5 @@ Description=Test CAP_MKNOD capability for PrivateDevices=no
[Service] [Service]
PrivateDevices=no PrivateDevices=no
# sed: remove dropped (cap_xxx-[epi]) and IAB capabilities from the output # sed: remove dropped (cap_xxx-[epi]) and IAB capabilities from the output
ExecStart=bash -x -c 'capsh --print | sed -re "s/[^ ]+?\-[epi]+//g" -e '/IAB/d' | grep cap_mknod' ExecStart=sh -x -c 'capsh --print | sed -re "s/[^ ]+?\-[epi]+//g" -e '/IAB/d' | grep cap_mknod'
Type=oneshot Type=oneshot

Some files were not shown because too many files have changed in this diff Show More