Add logic for restarting services after package operations
Summary
Implement the missing service restart functionality in the PostSummary modal. Currently, pressing 's' only shows a toast message but doesn't actually restart the systemd services that are pending restart after package operations.
Files to modify
src/events/modals/common.rs (around line 295)
Expected behavior
When users press 's' in the PostSummary modal and there are services pending restart:
- Execute
systemctl restart <service> for each service in the services_pending list
- Show appropriate success/error messages for each service restart attempt
- Handle partial failures gracefully (some services might fail while others succeed)
- Update the UI state to reflect that services have been restarted
Testing
Additional context
The implementation should integrate with systemd service management using the existing run_command infrastructure from src/logic/services/command.rs. Follow the pattern used in src/logic/services/systemd.rs for executing systemctl commands.
Key considerations:
- Use
systemctl restart <service> for each service in services_pending
- Handle both success and failure cases gracefully
- Consider running restarts asynchronously to avoid blocking the UI
- Update the modal state after successful restarts
- Add proper error messages and logging
Add logic for restarting services after package operations
Summary
Implement the missing service restart functionality in the PostSummary modal. Currently, pressing 's' only shows a toast message but doesn't actually restart the systemd services that are pending restart after package operations.
Files to modify
src/events/modals/common.rs(around line 295)Expected behavior
When users press 's' in the PostSummary modal and there are services pending restart:
systemctl restart <service>for each service in theservices_pendinglistTesting
cargo checkpassescargo clippy --all-targets --all-features -- -D warningspassescargo test -- --test-threads=1passesAdditional context
The implementation should integrate with systemd service management using the existing
run_commandinfrastructure fromsrc/logic/services/command.rs. Follow the pattern used insrc/logic/services/systemd.rsfor executing systemctl commands.Key considerations:
systemctl restart <service>for each service inservices_pending