[Debian-ha-commits] [pcs] 05/09: Add patch for fixing check for systemctl on Debian

Richard Winters devrik-guest at moszumanska.debian.org
Mon May 4 19:55:46 UTC 2015


This is an automated email from the git hooks/post-receive script.

devrik-guest pushed a commit to branch master
in repository pcs.

commit 31f2d1c0a1893ab1853d65cbf520b86490e15805
Author: Richard B Winters <rik at mmogp.com>
Date:   Sun May 3 21:58:44 2015 -0400

    Add patch for fixing check for systemctl on Debian
    
     - Rules updated so that postinst is not updated to register
       the init script via update-rc.d
    
    Change-Id: I5f4744fb3367743e3c6dba2e561ab502aac46e74
    Signed-off-by: Richard B Winters <rik at mmogp.com>
---
 .../0012-Fix-check-for-systemctl-on-Debian.patch   | 47 ++++++++++++++++++++++
 debian/patches/series                              |  1 +
 debian/rules                                       |  2 +-
 3 files changed, 49 insertions(+), 1 deletion(-)

diff --git a/debian/patches/0012-Fix-check-for-systemctl-on-Debian.patch b/debian/patches/0012-Fix-check-for-systemctl-on-Debian.patch
new file mode 100644
index 0000000..7f44c4b
--- /dev/null
+++ b/debian/patches/0012-Fix-check-for-systemctl-on-Debian.patch
@@ -0,0 +1,47 @@
+From: Richard B Winters <rik at mmogp.com>
+Date: Sun, 3 May 2015 21:57:53 -0400
+Subject: Fix check for systemctl on Debian
+
+ - On debian systemctl is not usually in /usr/bin, but rather 
+   in /bin. Well test for systemd using a different means.
+ - If systemd is detected, we'll still put the init script 
+   into the proper installation directory, we just won't 
+   register it with update-rc.d
+
+Change-Id: I3db2cc133bbe8401fc7c43ccc0bd9735b79a3788
+Signed-off-by: Richard B Winters <rik at mmogp.com>
+---
+ Makefile | 12 ++----------
+ 1 file changed, 2 insertions(+), 10 deletions(-)
+
+diff --git a/Makefile b/Makefile
+index 5768e62..0e1a7ec 100644
+--- a/Makefile
++++ b/Makefile
+@@ -8,14 +8,7 @@ ifeq ($(PYTHON_SITELIB), /usr/lib/python2.7/dist-packages)
+   EXTRA_SETUP_OPTS="--install-layout=deb"
+ endif
+ 
+-IS_SYSTEMCTL=false
+-ifeq ("$(wildcard /usr/bin/systemctl)","/usr/bin/systemctl")
+-  IS_SYSTEMCTL=true
+-else
+-  ifeq ("$(wildcard /bin/systemctl)","/usr/bin/systemctl")
+-    IS_SYSTEMCTL=true
+-  endif
+-endif
++IS_SYSTEMCTL = $(shell if ps -p 1 -o comm= | grep -q -i "systemd" ; then echo true; else echo false; fi)
+ 
+ MANDIR=/usr/share/man
+ 
+@@ -47,9 +40,8 @@ install_pcsd:
+ ifeq ($(IS_SYSTEMCTL),true)
+ 	install -d ${DESTDIR}/lib/systemd/system
+ 	install -m 644 pcsd/pcsd.service ${DESTDIR}/lib/systemd/system/
+-else
+-	install -m 755 -D pcsd/pcsd ${DESTDIR}/${initdir}/pcsd
+ endif
++	install -m 755 -D pcsd/pcsd ${DESTDIR}/${initdir}/pcsd
+ 
+ uninstall:
+ 	rm -f ${DESTDIR}${PREFIX}/sbin/pcs
diff --git a/debian/patches/series b/debian/patches/series
index d194e3a..743a1c8 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -9,3 +9,4 @@
 0009-Fix-file-locations-in-pcsd.service.patch
 0010-Fix-pcsd.service-destination-in-Makefile.patch
 0011-Change-pcsd-destination-to-usr-share.patch
+0012-Fix-check-for-systemctl-on-Debian.patch
diff --git a/debian/rules b/debian/rules
index d7fb2f8..132fb47 100755
--- a/debian/rules
+++ b/debian/rules
@@ -42,7 +42,7 @@ override_dh_python2:
 	dh_python2 -p pcs /usr/share/pcsd
 	
 override_dh_installinit:
-	dh_installinit --onlyscripts --name=pcsd --
+	dh_installinit -n --name=pcsd --
 	
 override_dh_compress:
 # make non-scripts non-executable

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-ha/pcs.git



More information about the Debian-HA-Commits mailing list