-
Notifications
You must be signed in to change notification settings - Fork 37.7k
Improve systemd service file #19513
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 file #19513
Conversation
The replacement of deprecated |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree on "init: remove Group= as it will default to the user's default group" commit.
https://www.freedesktop.org/software/systemd/man/systemd.exec.html#Credentials:
If no group is set, the default group of the user is used.
As ExecStart=+
syntax is used since v231, and basing on discussion in #16994, I suggest to follow @laanwj's comment until CentOS 7 EOL at least as it ships systemd
v219 only.
I'd argue that (upstream) software's contributed configuration files should contain best-practices, and not worry about compatibility with arcane third-party software. I'd expect the CentOS/RedHat 7 bitcoind packager to test the package and fix any compatibility issues. |
The init files are only there as example / documentation of how to use bitcoind as a service, there is no strict requirement for compatibility with everything under the sun, but also no reason to break compatibility for no good reason. It's there as a convenience to people, not as a display of systemd best practices. That said I'm neutral on this. |
Setting Group=bitcoin is redundant. It is typically the default group of the user and if not explicitly specified, systemd will run the service with the default group of the user.
PermissionsStartOnly is deprecated [1]. This removes the directives and instead we prefixes the value of the ExecStartPre directive with '+', which means the executable, 'chgrp' in this case, is run with full privileges and able to change the group of /etc/bitcoin. 1: https://github.com/systemd/systemd/blob/60b45a80c1f98bad000bd902d97ecf6c4e3fc315/NEWS#L2434
Rebased on the latest master, please consider for inclusion. |
Closing this as it has not had any activity in a while. If you are interested in continuing work on this, please leave a comment so that it can be reopened. |
PIcked up in #33044. |
This removes the redundant 'Group=' directive and replaces the deprecated 'PermissionsStartOnly' directive.