-
Notifications
You must be signed in to change notification settings - Fork 46
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
change spec file to use munge.service and tmpfiles.d for systemd #36
Comments
Why is systemd removing https://fedoraproject.org/wiki/Packaging:Tmpfiles.d http://www.freedesktop.org/software/systemd/man/tmpfiles.d.html I don't have access to a SLES 12 system. Would that be comparable to openSUSE 12.x? Original comment by |
Before this I was trying to create the directory with ansible run before systemd when the image is booted. Perhaps systemd can somehow tell that directory isn't in the image so it's removing it to have a clean state for this boot. I didn't know about tmpfiles.d, it looks like it would work better than my solution. SLES 12 is still in beta, I heard it's more comparable to openSUSE 13. Original comment by |
I tried installing the tmpfiles.d configuration file and it works fine. I guess my only request would be to add the munge.service and tmpfiles.d file to the spec file. Original comment by |
In 0.5.11, I tried installing munge.service & tmpfiles.d where appropriate but my attempts at autodetection caused other problems (cf. #27, #33, #34). I'm planning to make systemd the default in the next release. Most distributions now have chosen that as the path forward. I'm updating the issue summary to reflect this. I'm hoping to have the same spec file work on Red Hat and SUSE based distros. Original comment by
|
RPM specfile support for non-RedHat systems is being dropped since it has become a maintenance burden to maintain multiple distros in the same specfile, especially with the transition to systemd. Packaging details like this are best handled downstream. The specfile will target the latest CentOS release. RPM specfiles for other distros & releases will be placed in a contrib subdir if needed. Signed-off-by: Chris Dunlap <cdunlap@llnl.gov> Issue #27 Issue #36 Issue #39
This commit coverts the RPM specfile from sysvinit to systemd. The requisite Requires & BuildRequires tags for systemd are added. References to chkconfig and the sysvinit script are replaced with corresponding helper macros to handle systemd scriptlet operations. The sysvinit script and sysconfig file are replaced with the systemd unit file and tmpfiles.d configuration file. Furthermore, the %ghost tag is removed from the /var/run/munge directory. This tag was added back in commit 0f89429, at which point the sysvinit script created this directory when the service was started. By removing the %ghost tag, this directory will be created when the rpm is installed. Since /var/run is (likely) mounted as tmpfs, this directory will disappear on the next reboot, at which point it will be re-created by tmpfiles.d. The RuntimeDirectory and RuntimeDirectoryMode options in the service file were added in systemd 211. This is a clean and straightforward manner in which to create private runtime directories below /run. However, tmpfiles.d is being used instead since CentOS 7 ships with systemd 208. References: - https://fedoraproject.org/wiki/Packaging:Systemd - https://fedoraproject.org/wiki/Packaging:ScriptletSnippets - https://fedoraproject.org/wiki/Packaging:Tmpfiles.d Tested on: - CentOS 7 - Fedora 20-23 Signed-off-by: Chris Dunlap <cdunlap@llnl.gov> Closes #33 Closes #43 Issue #27 Issue #36 Issue #39
The systemd unit file and tmpfiles.d configuration file were added to the top-level specfile in commit d034b3a. But the specfile likely needs changes to work on SLES12. The top-level |
Hi @dun, the way to support this is to specify
According to systemd.exec(8),
This way, the tmpfiles.d file, currently packaged with the rpm, will not be needed. On the same point, An added, albeit probably a minor benefit here is that the unit automatically gets dependencies on filesystem mounts, i. e. won't start until respective /run and /var/lib are indeed mounted:
It may also be a good idea to add the start prerequisite condition
|
@kkm000: I don't see much benefit with I presume you mean |
@dun, thank you for the tip, I did not know the Oh, you reminded me how I had to drop Centos 7 as the platform for an internet-facing Google Cloud VM, because of a bug in systemd 219--and they support only the latest version and the one before that (and the bug I hit was reported, but was apparently in dbus, not even systemd itself). And it was the only base image with both secure boot and SELinux out of the box. I found a backport of a more recent systemd and dbus, but it required setting SELinux to permissive. Bummer! systemd is amazingly powerful, but their EOL cycle is shamefully short.
Oops, of course! I noticed there was a function in a Debian-packaged init.rc script that did exactly this, although it's not apparently in the current source. I cannot claim any credit for the idea. :) |
So I've looked into adding Without it, attempting to start the service before first creating a key results in systemd moving the service into a failed state -- as desired. The output from
Adding
While seeing the failed assertion in the |
Amen to that! Totally convincing, thanks for investigating. |
What steps will reproduce the problem?
Boot a SLES 12 system with the munge service file enabled.
What is the expected output? What do you see instead?
Expected output is the munge service starting successfully.
What we see is munge fails to come up with
What version of the software are you using? On what operating system?
Munge 0.5.11 on SLES 12.
Please provide any additional information below.
In our environment systemd removes
/var/run/munge
before starting services, so it's missing when munged tries to start. Using this as a guide:https://blog.hqcodeshop.fi/archives/93-Handling-varrun-with-systemd.html
I added a few lines to munge.service to fix the problem.
Original issue reported on code.google.com by
dcgloe
on 23 Oct 2014 at 8:23The text was updated successfully, but these errors were encountered: