Skip to content

Commit

Permalink
feat(session): reset failed units before start
Browse files Browse the repository at this point in the history
Sometimes services can fail. Failed services will generally not be
restarted by systemd. To start previously failed services we can
just reset their failed state before starting our session target.
  • Loading branch information
Scrumplex committed Nov 24, 2021
1 parent cd7d0a8 commit 0e87499
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/session.sh
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,9 @@ if hash dbus-update-activation-environment 2>/dev/null; then
dbus-update-activation-environment --systemd ${VARIABLES:- --all}
fi

# reset failed state of all user units
systemctl --user reset-failed

# shellcheck disable=SC2086
systemctl --user import-environment $VARIABLES
systemctl --user start "$SESSION_TARGET"
Expand Down

0 comments on commit 0e87499

Please sign in to comment.