feat: Check for services that require a post upgrade restart on packages upgrade #203
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Check if any services need to be restarted after updating and offers to do so (if there are). The listing of the services is done via
checkservices
from archlinux/contrib (available in the [extra] archlinux-contrib package).Important notes:
arch-update
beforehand. This is because the listing of services viacheckservices
requires elevated privileges (as it needs to runsystemctl daemon reload/reexec
), and it would be unexpected to ask for asudo/doas/run0
password everytime arch-update is executed (even if there's no update available). Checking for this only if an actual package(s) upgrade has been performed beforehand means we already have elevated privileges (as this is required for the package update itself anyway), and such needs for post upgrade service restarts are triggered on package(s) updates anyway, so it kinda makes sense only checking at that moment.dbus-broker.service
andsystemd-logind.service
services are purposely excluded from the listing as they are known for creating issues on restart (see Support restarting dbus-broker bus1/dbus-broker#93 & https://askubuntu.com/questions/1057028/ubuntu-18-04-freezes-when-running-systemctl-restart-systemd-logind-service)Screenshots / Logs
Addressed feature request
Close #181