mirror of
https://github.com/systemd/systemd
synced 2026-04-06 15:14:49 +02:00
Compare commits
2 Commits
977e68c71b
...
6401279fee
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6401279fee | ||
|
|
e7cef2a6ea |
@ -85,7 +85,7 @@
|
|||||||
#define ONCE __ONCE(UNIQ_T(_once_, UNIQ))
|
#define ONCE __ONCE(UNIQ_T(_once_, UNIQ))
|
||||||
#define __ONCE(o) \
|
#define __ONCE(o) \
|
||||||
({ \
|
({ \
|
||||||
static bool (o) = sd_false; \
|
static sd_bool (o) = sd_false; \
|
||||||
__sync_bool_compare_and_swap(&(o), sd_false, sd_true); \
|
__sync_bool_compare_and_swap(&(o), sd_false, sd_true); \
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
@ -143,6 +143,23 @@ systemd-run --unit=test20-mainpidsh3.service \
|
|||||||
# Test that this failed due to timeout, and not some other error
|
# Test that this failed due to timeout, and not some other error
|
||||||
test "$(systemctl show -P Result test20-mainpidsh3.service)" = timeout
|
test "$(systemctl show -P Result test20-mainpidsh3.service)" = timeout
|
||||||
|
|
||||||
|
# Test that scope units work
|
||||||
|
systemd-run --scope --unit test20-true.scope /bin/true
|
||||||
|
test "$(systemctl show -P Result test20-true.scope)" = success
|
||||||
|
|
||||||
|
# Test that user scope units work as well
|
||||||
|
|
||||||
|
runas() {
|
||||||
|
declare userid=$1
|
||||||
|
shift
|
||||||
|
# shellcheck disable=SC2016
|
||||||
|
su "$userid" -s /bin/sh -c 'XDG_RUNTIME_DIR=/run/user/$UID exec "$@"' -- sh "$@"
|
||||||
|
}
|
||||||
|
|
||||||
|
systemctl start user@4711.service
|
||||||
|
runas testuser systemd-run --scope --user --unit test20-true.scope /bin/true
|
||||||
|
test "$(systemctl show -P Result test20-true.scope)" = success
|
||||||
|
|
||||||
systemd-analyze log-level info
|
systemd-analyze log-level info
|
||||||
|
|
||||||
echo OK >/testok
|
echo OK >/testok
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user