systemd-analyze log-level debug
-# Trigger testservice-failure-exit-handler-68.service
cat >/run/systemd/system/testservice-failure-68.service <<EOF
[Unit]
-Description=TEST-68-PROPAGATE-EXIT-STATUS with OnFailure= trigger
OnFailure=testservice-failure-exit-handler-68.service
[Service]
cat >/run/systemd/system/testservice-failure-68-template.service <<EOF
[Unit]
-Description=TEST-68-PROPAGATE-EXIT-STATUS with OnFailure= trigger (template)
OnFailure=testservice-failure-exit-handler-68-template@%n.service
[Service]
ExecStart=sh -c "exit 1"
EOF
-# Trigger testservice-success-exit-handler-68.service
cat >/run/systemd/system/testservice-success-68.service <<EOF
[Unit]
-Description=TEST-68-PROPAGATE-EXIT-STATUS with OnSuccess= trigger
OnSuccess=testservice-success-exit-handler-68.service
[Service]
cat >/run/systemd/system/testservice-success-68-template.service <<EOF
[Unit]
-Description=TEST-68-PROPAGATE-EXIT-STATUS with OnSuccess= trigger (template)
OnSuccess=testservice-success-exit-handler-68-template@%n.service
[Service]
EOF
chmod +x /tmp/check_on_success.sh
-# Handle testservice-failure-exit-handler-68.service exiting with success.
cat >/run/systemd/system/testservice-success-exit-handler-68.service <<EOF
-[Unit]
-Description=TEST-68-PROPAGATE-EXIT-STATUS handle service exiting in success
-
[Service]
ExecStartPre=/tmp/check_on_success.sh
ExecStart=/tmp/check_on_success.sh
# Template version.
cat >/run/systemd/system/testservice-success-exit-handler-68-template@.service <<EOF
-[Unit]
-Description=TEST-68-PROPAGATE-EXIT-STATUS handle service exiting in success (template)
-
[Service]
ExecStartPre=echo "triggered by %i"
ExecStartPre=/tmp/check_on_success.sh
chmod +x /tmp/check_on_failure.sh
-# Handle testservice-failure-exit-handler-68.service exiting with failure.
cat >/run/systemd/system/testservice-failure-exit-handler-68.service <<EOF
-[Unit]
-Description=TEST-68-PROPAGATE-EXIT-STATUS handle service exiting in failure
-
[Service]
# repeat the check to make sure that values are set correctly on repeated invocations
Type=oneshot
# Template version.
cat >/run/systemd/system/testservice-failure-exit-handler-68-template@.service <<EOF
-[Unit]
-Description=TEST-68-PROPAGATE-EXIT-STATUS handle service exiting in failure (template)
-
[Service]
Type=oneshot
ExecStartPre=echo "triggered by %i"