fix init and systemd service properly

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
This commit is contained in:
Fabio M. Di Nitto 2012-02-13 06:19:35 +01:00
parent c2aae11531
commit a3710f70c5
2 changed files with 45 additions and 1 deletions

View File

@ -1,6 +1,6 @@
Name: dlm Name: dlm
Version: 3.99.0 Version: 3.99.0
Release: 5%{?dist} Release: 6%{?dist}
License: GPLv2 and GPLv2+ and LGPLv2+ License: GPLv2 and GPLv2+ and LGPLv2+
# For a breakdown of the licensing, see README.license # For a breakdown of the licensing, see README.license
Group: System Environment/Kernel Group: System Environment/Kernel
@ -15,6 +15,7 @@ Source0: http://people.redhat.com/teigland/%{name}-%{version}.tar.gz
Patch0: fix_udev_rules.patch Patch0: fix_udev_rules.patch
Patch1: fix_systemd_service.patch Patch1: fix_systemd_service.patch
Patch2: fix_systemd_service_part2.patch Patch2: fix_systemd_service_part2.patch
Patch3: fix_init_bits.patch
Requires(post): systemd-units Requires(post): systemd-units
Requires(preun): systemd-units Requires(preun): systemd-units
@ -29,6 +30,7 @@ The kernel dlm requires a user daemon to control cluster membership.
%patch0 -p1 %patch0 -p1
%patch1 -p1 %patch1 -p1
%patch2 -p1 %patch2 -p1
%patch3 -p1
%build %build
# upstream does not require configure # upstream does not require configure
@ -102,6 +104,9 @@ developing applications that use %{name}.
%{_libdir}/pkgconfig/*.pc %{_libdir}/pkgconfig/*.pc
%changelog %changelog
* Mon Feb 13 2012 Fabio M. Di Nitto <fdinitto@redhat.com> - 3.99.0-6
- Fix init/systemd service to use /etc/sysconfig/dlm
* Mon Feb 6 2012 Fabio M. Di Nitto <fdinitto@redhat.com> - 3.99.0-5 * Mon Feb 6 2012 Fabio M. Di Nitto <fdinitto@redhat.com> - 3.99.0-5
- Fix systemd service to recognize /etc/sysconfig/dlm_controld - Fix systemd service to recognize /etc/sysconfig/dlm_controld

39
fix_init_bits.patch Normal file
View File

@ -0,0 +1,39 @@
commit 0f19d2e7fb331ba3aedc69c6bd3eb5a75cf631c5
Author: Fabio M. Di Nitto <fdinitto@redhat.com>
Date: Mon Feb 13 06:15:32 2012 +0100
init/service scripts: make environment filename consistent with service name
Generally speaking if a service is called foo, users expects to pass
options to the script via /etc/sysconfig/foo and not foo_something.
This fix an oversight on my side in the previous round of init fixes.
Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
diff --git a/init/dlm.init b/init/dlm.init
index db8f17f..7f3da2d 100644
--- a/init/dlm.init
+++ b/init/dlm.init
@@ -26,7 +26,7 @@ progdir="cluster"
lockfile="/var/run/$progdir/$prog.pid"
exec="/usr/sbin/$prog"
-[ -f /etc/sysconfig/$prog ] && . /etc/sysconfig/$prog
+[ -f /etc/sysconfig/dlm ] && . /etc/sysconfig/dlm
setup() {
modprobe dlm > /dev/null 2>&1
diff --git a/init/dlm.service b/init/dlm.service
index 7be2ffd..d7cf9c7 100644
--- a/init/dlm.service
+++ b/init/dlm.service
@@ -4,7 +4,7 @@ After=syslog.target network.target corosync.service
[Service]
Type=forking
-EnvironmentFile=/etc/sysconfig/dlm_controld
+EnvironmentFile=/etc/sysconfig/dlm
ExecStartPre=/sbin/modprobe dlm
ExecStart=/usr/sbin/dlm_controld $DLM_CONTROLD_OPTS
#ExecStopPost=/sbin/modprobe -r dlm