Use RuntimeDirectory instead of tmpfiles.d

This reverts part of commit 32123f6bb2.

A simple directive is a much lighter solution to the same problem, and
automatically follows the specified User.  I copied the 0770 modes from
the corresponding init scripts; they could use a little documentation.

Signed-off-by: Ferenc Wágner <wferi@debian.org>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
This commit is contained in:
Ferenc Wágner 2016-11-28 14:47:05 +01:00 committed by Jan Friesse
parent cf339c20c3
commit c733e9417e
7 changed files with 7 additions and 56 deletions

View File

@ -70,4 +70,4 @@ dbusdir = $(sysconfdir)/dbus-1/system.d
dbus_DATA = corosync-signals.conf
endif
SUBDIRS = logrotate tmpfiles.d
SUBDIRS = logrotate

View File

@ -1,40 +0,0 @@
# Copyright (c) 2016 Red Hat, Inc.
#
# Authors:Jan Friesse (jfriesse@redhat.com)
#
# This software licensed under BSD license, the text of which follows:
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# - Redistributions of source code must retain the above copyright notice,
# this list of conditions and the following disclaimer.
# - Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation
# and/or other materials provided with the distribution.
# - Neither the name of the MontaVista Software, Inc. nor the names of its
# contributors may be used to endorse or promote products derived from this
# software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
# THE POSSIBILITY OF SUCH DAMAGE.
MAINTAINERCLEANFILES = Makefile.in
EXTRA_DIST = corosync-qnetd.conf
if BUILD_QNETD
if INSTALL_SYSTEMD
tmpfilesdirdir = ${TMPFILESDIR}
tmpfilesdir_DATA = corosync-qnetd.conf
endif
endif

View File

@ -1 +0,0 @@
d /var/run/corosync-qnetd 0770 root root -

View File

@ -210,8 +210,7 @@ AC_CONFIG_FILES([Makefile
qdevices/Makefile
vqsim/Makefile
Doxyfile
conf/logrotate/Makefile
conf/tmpfiles.d/Makefile])
conf/logrotate/Makefile])
### Local business
@ -402,11 +401,6 @@ AC_ARG_WITH([logrotatedir],
[ LOGROTATEDIR="$withval" ],
[ LOGROTATEDIR="$sysconfdir/logrotate.d" ])
AC_ARG_WITH([tmpfilesdir],
[ --with-tmpfilesdir=DIR : path to tmpfiles.d configuration files directory. ],
[ TMPFILESDIR="$withval" ],
[ TMPFILESDIR="/lib/tmpfiles.d" ])
AC_ARG_ENABLE([snmp],
[ --enable-snmp : SNMP protocol support ],
[ default="no" ])
@ -737,7 +731,6 @@ INITWRAPPERSDIR=$(eval echo ${INITWRAPPERSDIR})
AC_SUBST([INITWRAPPERSDIR])
AC_SUBST([LOGDIR])
AC_SUBST([LOGROTATEDIR])
AC_SUBST([TMPFILESDIR])
AC_SUBST([SOMAJOR])
AC_SUBST([SOMINOR])
@ -780,7 +773,6 @@ AC_MSG_RESULT([ System init.d directory = ${INITDDIR}])
AC_MSG_RESULT([ System systemd directory = ${SYSTEMDDIR}])
AC_MSG_RESULT([ System upstart directory = ${UPSTARTDIR}])
AC_MSG_RESULT([ System init wraps dir = ${INITWRAPPERSDIR}])
AC_MSG_RESULT([ System tmpfiles.d = ${TMPFILESDIR}])
AC_MSG_RESULT([ Log directory = ${LOGDIR}])
AC_MSG_RESULT([ Log rotate directory = ${LOGROTATEDIR}])
AC_MSG_RESULT([ corosync config dir = ${COROSYSCONFDIR}])

View File

@ -135,8 +135,7 @@ export rdmacm_LIBS=-lrdmacm \
%endif
--with-initddir=%{_initrddir} \
--with-systemddir=%{_unitdir} \
--with-upstartdir=%{_sysconfdir}/init \
--with-tmpfilesdir=%{_tmpfilesdir}
--with-upstartdir=%{_sysconfdir}/init
make %{_smp_mflags}
@ -177,8 +176,6 @@ install -m 644 init/corosync-qnetd.sysconfig.example \
%if %{with systemd}
sed -i -e 's/^#User=/User=/' \
%{buildroot}%{_unitdir}/corosync-qnetd.service
sed -i -e 's/root/coroqnetd/g' \
%{buildroot}%{_tmpfilesdir}/corosync-qnetd.conf
%else
sed -i -e 's/^COROSYNC_QNETD_RUNAS=""$/COROSYNC_QNETD_RUNAS="coroqnetd"/' \
%{buildroot}%{_sysconfdir}/sysconfig/corosync-qnetd
@ -504,7 +501,6 @@ fi
%{_unitdir}/corosync-qnetd.service
%dir %{_datadir}/corosync
%{_datadir}/corosync/corosync-qnetd
%{_tmpfilesdir}/corosync-qnetd.conf
%else
%{_initrddir}/corosync-qnetd
%endif

View File

@ -9,6 +9,8 @@ After=corosync.service
ExecStart=@INITWRAPPERSDIR@/corosync-qdevice start
ExecStop=@INITWRAPPERSDIR@/corosync-qdevice stop
Type=forking
RuntimeDirectory=corosync-qdevice
RuntimeDirectoryMode=0770
[Install]
WantedBy=multi-user.target

View File

@ -12,6 +12,8 @@ Type=simple
Restart=on-abnormal
# Uncomment and set user who should be used for executing qnetd
#User=coroqnetd
RuntimeDirectory=corosync-qnetd
RuntimeDirectoryMode=0770
[Install]
WantedBy=multi-user.target