2020-03-04 09:35:06 +00:00
|
|
|
#!/usr/bin/env bash
|
2021-10-17 16:13:06 +00:00
|
|
|
# SPDX-License-Identifier: LGPL-2.1-or-later
|
2021-04-09 17:39:41 +00:00
|
|
|
set -eux
|
2019-11-27 16:57:51 +00:00
|
|
|
|
|
|
|
systemd-analyze log-level debug
|
|
|
|
|
2021-04-14 20:26:50 +00:00
|
|
|
systemd-run --wait -p LogNamespace=foobar echo "hello world"
|
2019-11-27 16:57:51 +00:00
|
|
|
|
|
|
|
journalctl --namespace=foobar --sync
|
2021-04-08 07:47:04 +00:00
|
|
|
journalctl -o cat --namespace=foobar >/tmp/hello-world
|
|
|
|
journalctl -o cat >/tmp/no-hello-world
|
2019-11-27 16:57:51 +00:00
|
|
|
|
2021-04-08 07:47:04 +00:00
|
|
|
grep "^hello world$" /tmp/hello-world
|
|
|
|
grep "^hello world$" /tmp/no-hello-world && { echo 'unexpected success'; exit 1; }
|
2019-11-27 16:57:51 +00:00
|
|
|
|
|
|
|
systemd-analyze log-level info
|
|
|
|
|
2021-04-07 22:09:55 +00:00
|
|
|
echo OK >/testok
|
2019-11-27 16:57:51 +00:00
|
|
|
|
|
|
|
exit 0
|