Created
November 7, 2022 13:06
-
-
Save WGH-/b9bcf1087e17c2cb1414a0ee2a16dc1b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Started /bin/sh -c echo $JOURNAL_STREAM; stat -L -c '%n dev=%d ino=%i' /proc/self/fd/{0,1,2}. | |
test-7daa95055a8c4c89b72528a3c38df2cf.service: Deactivated successfully. | |
8:306630 | |
/proc/self/fd/0 dev=5 ino=5 | |
/proc/self/fd/1 dev=8 ino=306630 | |
/proc/self/fd/2 dev=8 ino=306630 | |
Started /bin/sh -c echo $JOURNAL_STREAM; stat -L -c '%n dev=%d ino=%i' /proc/self/fd/{0,1,2}. | |
8:312524 | |
/proc/self/fd/0 dev=5 ino=5 | |
/proc/self/fd/1 dev=8 ino=312524 | |
/proc/self/fd/2 dev=8 ino=312524 | |
test-7daa95055a8c4c89b72528a3c38df2cf.service: Deactivated successfully. | |
Started /bin/sh -c echo $JOURNAL_STREAM; stat -L -c '%n dev=%d ino=%i' /proc/self/fd/{0,1,2}. | |
8:314453 | |
/proc/self/fd/0 dev=5 ino=5 | |
/proc/self/fd/1 dev=8 ino=314452 | |
/proc/self/fd/2 dev=8 ino=314453 | |
test-7daa95055a8c4c89b72528a3c38df2cf.service: Deactivated successfully. | |
Started /bin/sh -c echo $JOURNAL_STREAM; stat -L -c '%n dev=%d ino=%i' /proc/self/fd/{0,1,2}. | |
8:304775 | |
/proc/self/fd/0 dev=5 ino=5 | |
/proc/self/fd/1 dev=8 ino=304774 | |
/proc/self/fd/2 dev=8 ino=304775 | |
test-7daa95055a8c4c89b72528a3c38df2cf.service: Deactivated successfully. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -e | |
cmd="echo \$JOURNAL_STREAM; stat -L -c '%n dev=%d ino=%i' /proc/self/fd/{0,1,2}" | |
if [[ $UID != 0 ]]; then | |
user="--user" | |
fi | |
unit=test-$(systemd-id128 new) | |
systemd-run $user --quiet --unit "$unit" --wait -G sh -c "$cmd" | |
systemd-run $user --quiet --unit "$unit" --wait -G --property=StandardOutput=journal --property=StandardError=journal sh -c "$cmd" | |
systemd-run $user --quiet --unit "$unit" --wait -G --property=StandardOutput=journal --property=StandardError=journal+console sh -c "$cmd" | |
systemd-run $user --quiet --unit "$unit" --wait -G --property=StandardOutput=journal+console --property=StandardError=journal sh -c "$cmd" | |
journalctl --sync || sleep 1 | |
journalctl $user -o cat -u "$unit" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment