Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

checkservices: honor -R flag #64

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

uggedal
Copy link

@uggedal uggedal commented Apr 21, 2023

Even though the -R flag were parsed it were not honored and there was no way to skip being asked for restart with the -R flag. Useful for putting checkservices in an alpm hook.

Even though the -R flag were parsed it were not honored and there was no way to
skip being asked for restart with the -R flag. Useful for putting checkservices
in an alpm hook.
@@ -298,7 +298,7 @@ main() {
echo "Found: ${#broken_services[@]}"
if (( ${#broken_services[@]} )); then
display_restart "${broken_services[@]}"
if confirm 'Execute?'; then
if (( $RESTART )) && confirm 'Execute?'; then
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Testing this out, I think this condition should be moved up as now the output is kinda confusing:

[jelle@t14s][~/projects/contrib]%sudo ./admin/checkservices -R -P
:: Reload systemd
:: Services with broken maps files
Error:: Unable to parse pid file for systemd-udevd.service.
Found: 6
-------8<-------------------------------8<---------
systemctl restart 'atop.service'
systemctl restart 'cups.service'
systemctl restart 'systemd-journald.service'
systemctl restart 'systemd-logind.service'
systemctl restart 'systemd-machined.service'
systemctl restart 'systemd-timesyncd.service'
-------8<-------------------------------8<---------
:: Services missing on the system bus

Would be better to merge the $RESTART with the if above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants