From c9847645db98d1ad2a791c2a805e60e053f654d0 Mon Sep 17 00:00:00 2001 From: rek Date: Fri, 23 Feb 2024 15:58:23 -0500 Subject: [PATCH] don't display errors --- .../files/usr/lib/systemd/system/rpm-ostreed-deployed.service | 3 +++ .../files/usr/lib/systemd/system/rpm-ostreed-firstboot.service | 3 +++ 2 files changed, 6 insertions(+) diff --git a/config/files/usr/lib/systemd/system/rpm-ostreed-deployed.service b/config/files/usr/lib/systemd/system/rpm-ostreed-deployed.service index fe1706d..751195f 100644 --- a/config/files/usr/lib/systemd/system/rpm-ostreed-deployed.service +++ b/config/files/usr/lib/systemd/system/rpm-ostreed-deployed.service @@ -4,6 +4,9 @@ Wants=rpm-ostreed-deployed.timer [Service] Type=simple +# Do not log an error if it is not run +# Make sure your own process writes to journal for debugging it's errors +StandardError=null ExecStartPre=/usr/bin/env bash -c 'journalctl --boot=-1 -u ostree-finalize-staged.service | grep "Finalizing staged deployment"' #return 0 if there was a deployment and 1 if there was no deployment ExecStart=/usr/bin/env bash -c 'echo "There was a deployment and this is the firstboot!" > /tmp/firstboot_post_deployment.txt' diff --git a/config/files/usr/lib/systemd/system/rpm-ostreed-firstboot.service b/config/files/usr/lib/systemd/system/rpm-ostreed-firstboot.service index 0b562a8..8c305c6 100644 --- a/config/files/usr/lib/systemd/system/rpm-ostreed-firstboot.service +++ b/config/files/usr/lib/systemd/system/rpm-ostreed-firstboot.service @@ -4,6 +4,9 @@ Wants=rpm-ostreed-firstboot.timer [Service] Type=simple +# Do not log an error if it is not run +# Make sure your own process writes to journal for debugging it's errors +StandardError=null ExecStartPre=/usr/bin/env bash -c "journalctl --list-boots | wc -l | awk '$1>2{exit 1}" #return 0 if there is no more than 2 lines, 1 if more than 2 lines ExecStart=/usr/bin/env bash -c 'echo "This is the firstboot of the system !" > /tmp/firstboot_post_freshinstall.txt'