Skip to content

Commit

Permalink
Add systemd RuntimeDirectory & RuntimeDirectoryMode
Browse files Browse the repository at this point in the history
Create the "%{_runstatedir}/munge" directory using the systemd unit
configuration options RuntimeDirectory and RuntimeDirectoryMode.
These options were added in systemd 211.  Back in commit d034b3a,
tmpfiles.d was used instead since CentOS 7 at the time was running
systemd 208; but, CentOS 7.6.1810 is running systemd 219.

The creation of the "tmpfiles.d/munge.conf" file is being kept for
now in case it is still needed somewhere, but this file is no longer
being installed.

The RPM %ghost tag in munge.spec is once again added back to the
"%{_runstatedir}/munge" directory since this directory is now created
by systemd when the munge service is started, and removed by systemd
when the munge service is stopped.

Reference:
- https://www.freedesktop.org/software/systemd/man/systemd.exec.html

Tested:
- CentOS 7.6.1810 (systemd 219)
- Fedora 29 (systemd 239)

Signed-off-by: Chris Dunlap <cdunlap@llnl.gov>
  • Loading branch information
dun committed May 6, 2019
1 parent 676b2ad commit 3eed37e
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
3 changes: 1 addition & 2 deletions munge.spec
Original file line number Diff line number Diff line change
Expand Up @@ -123,12 +123,11 @@ fi
%attr(0600,munge,munge) %ghost %{_localstatedir}/lib/munge/munged.seed
%dir %attr(0700,munge,munge) %{_localstatedir}/log/munge
%attr(0640,munge,munge) %ghost %{_localstatedir}/log/munge/munged.log
%dir %attr(0755,munge,munge) %{_runstatedir}/munge
%dir %attr(0755,munge,munge) %ghost %{_runstatedir}/munge
%attr(0644,munge,munge) %ghost %{_runstatedir}/munge/munged.pid
%{_bindir}/*
%{_sbindir}/*
%{_mandir}/*[^3]/*
%{_tmpfilesdir}/munge.conf
%{_unitdir}/munge.service

%files devel
Expand Down
2 changes: 1 addition & 1 deletion src/etc/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ noinst_DATA = \
$(SUBSTITUTE_FILES) \
# End of noinst_DATA

install-data-hook: install-dirperms install-pkgconfig install-systemd install-sysvinit install-tmpfiles
install-data-hook: install-dirperms install-pkgconfig install-systemd install-sysvinit

install-dirperms:
$(MKDIR_P) -m 0700 "$(DESTDIR)$(sysconfdir)/munge"
Expand Down
2 changes: 2 additions & 0 deletions src/etc/munge.service.in
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ After=time-sync.target
Type=forking
ExecStart=@sbindir@/munged
PIDFile=@runstatedir@/munge/munged.pid
RuntimeDirectory=munge
RuntimeDirectoryMode=0755
User=munge
Group=munge
Restart=on-abort
Expand Down

0 comments on commit 3eed37e

Please sign in to comment.