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

Improve systemd service management #789

Merged
merged 1 commit into from
Nov 4, 2024
Merged

Conversation

geragio
Copy link
Contributor

@geragio geragio commented Nov 4, 2024

systemd 220(released in 2015) supports the "--now" switch.

When this switch is present, the units that are enabled will also be started, and the ones disabled also stopped.

This is a good opportunity to remove some unnecessary lines of code and improve code readability.
We can start and stop services with just one single command:

systemctl enable/disable --now <service-name>

Also, systemctl daemon-reload is not really necessary when disabling/enabling a service.

Let me know if you notice any unintended side effects or if you have any feedback in general!

@AdnanHodzic AdnanHodzic merged commit 18a3a93 into AdnanHodzic:master Nov 4, 2024
2 checks passed
@AdnanHodzic
Copy link
Owner

Good catch! LGTM & thank you for your contribution, you will be credited for your work as part of future release.

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.

2 participants