Skip to content

Improve systemd service management - #789

Merged
AdnanHodzic merged 1 commit into
AdnanHodzic:masterfrom
geragio:master
Nov 4, 2024
Merged

AdnanHodzic merged 1 commit into
AdnanHodzic:masterfrom
geragio:master

Conversation

@geragio

@geragio geragio commented Nov 4, 2024

Copy link
Copy Markdown
Contributor

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
@AdnanHodzic

Copy link
Copy Markdown
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