-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
MDEV-19210: use environment file in systemd units #2726
Conversation
Ok I like nice adjustements with |
Currently the service file handles single server and Galera cluster. I do not change that, I just change the way to pass environment variables.
This is not about adding functionality, this is just about changing an implementation detail.
Only if there is any mechanism that adds more |
I pushed this to a bb branch to run through old buildbot to make sure it doesn't fail, results: https://buildbot.mariadb.net/buildbot/grid?category=main&branch=bb-10.4-linuxjedi-MDEV-19210 |
Requesting a review from @sysprg for this. |
Thanks a lot! Looks promising I think. |
Any news on this? I could not find failures related to service startup. So should be ok now? |
e94b397
to
7e748ae
Compare
7e748ae
to
ccd8585
Compare
Ping... Any news or is this going to stall mode for years again? |
ccd8585
to
c4cd0a7
Compare
pushed to bb-10.4-MDEV-19210-environment-file-pkgtest to create files for testing. A 11.3/11.4 might be a more realistic target. |
Well, this issue is that old... I think I started with 10.2. 😜 That's why it is stuck at 10.4 right now. But I am free to anything else... Let me know and I will change the target. On the other side - I would like to see it in a GA release any time soon. |
c4cd0a7
to
bd06bb3
Compare
bd06bb3
to
48486dc
Compare
Uh, 11.4 is a long way to go... Well, let's hope we will see some progress now at least. |
48486dc
to
88cf527
Compare
88cf527
to
e08eae4
Compare
@eworm-de hi, Started testing on https://github.com/MariaDB/mariadb.org-tools/blob/master/daniel/MDEV-19210 - so an alma linux I just want to make sure I've covered main test cases:
What else do I need to test? (I'll do the same of a few more distro types). As you may not have expected on Alma/RHEL - datadir is Aside: have you thought about https://systemd.io/FILE_DESCRIPTOR_STORE/ - would require much more server implementation. |
e08eae4
to
9025383
Compare
Rebased to drop last bits of support for instantiated services... |
9025383
to
ed92f24
Compare
Rebased to rename |
04e8035
to
3f365ad
Compare
3f365ad
to
9ae01fe
Compare
The next and last version from Should I rebase on |
Hi @eworm-de, it will need rebasing against 11.5 or 11.6 (depending on which one it will land it). We can do this after review if it helps. I'll take a look at the more recent changes shortly and see if I can push this along. |
9ae01fe
to
dc9fa6a
Compare
dc9fa6a
to
cd37253
Compare
Rebased and switched to |
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.
Looks like everything is addressed and it looks like a nice improvement to me.
Whilst I have approved this, the MTR is showing Galera failures in old Buildbot for the branch @grooverdan created for it (https://buildbot.mariadb.net/buildbot/grid?category=main&category=package&branch=bb-11.4-pr2726-MDEV-19210-environment-file-pkgtest). I don't know whether this is related or not. Someone with Galera knowledge would need to check. |
cd37253
to
e5f15a2
Compare
Any news on this? Perhaps pushing the current branch to the buildbot makes sense... |
Hi @eworm-de, 11.6 is open, so we will work towards getting it in there. I'll try to sort out a second reviewer for you. |
Oh, I had just rebased this on |
Sorry, I was wrong, there isn't an 11.6 just yet, but it should exist any day now. It will need rebasing to that once it exists. |
e5f15a2
to
eeeb9d4
Compare
…SITION We used to run `systemctl set-environment` to pass _WSREP_START_POSITION. This is bad because: * it clutter systemd's environment (yes, pid 1) * it requires root privileges * options (like LimitNOFILE=) are not applied Let's just create an environment file in ExecStartPre=, that is read before ExecStart= kicks in. We have _WSREP_START_POSITION around for the main process without any downsides.
Now that the systemd unit files use an environment file to pass _WSREP_START_POSITION we have to update galera_new_cluster as well.
…uster Support in service file was dropped in 91f1694 (systemd: multi-instance not for Galera, User/Group flexible).
Now that we do not pollute systemd's environment but write private environment files running these as root is not longer required. So let's drop `PermissionsStartOnly=true`. Debian adds extra `ExecStartPre=` and `ExecStartPost=`, though. Use special executable prefix for full privileges there. (See systemd.service(5) for details.)
eeeb9d4
to
2f456af
Compare
Rebased on |
There is a test failing (even after retriggers) which I don't think is related to your work, but I physically cannot merge it until it passes. We will look into this. |
All good, thanks again! |
🥳 🎈 . Thank you. |
Description
We used to run
systemctl set-environment
to pass_WSREP_START_POSITION
. This is bad because:systemd
's environment (yes, pid 1)LimitNOFILE=
) are not appliedLet's just create an environment file in
ExecStartPre=
, that is read beforeExecStart=
kicks in. We have_WSREP_START_POSITION
around for the main process without any downsides.How can this PR be tested?
Well, good question... This should not add new regressions and continue as expected.
Special care is to be taken for Debian, which adds extra commands to the systemd service file.
Basing the PR against the correct MariaDB version
PR quality check