[Debian-ha-commits] [pcs] 01/02: Dropped upstream pcsd init in favor of maintainer init

Richard Winters devrik-guest at moszumanska.debian.org
Tue May 5 20:07:33 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 3e760f6fb427c1320f3f2651481697426a30c489
Author: Richard B Winters <rik at mmogp.com>
Date:   Tue May 5 16:01:32 2015 -0400

    Dropped upstream pcsd init in favor of maintainer init
    
     - debian/pcs.install updated to remove reference to upstream
       init script.
     - debian/patches/*: several patches dropped which modified
       the upstream init, as they are no longer necessary.
       Remaining patches renamed to reflect proper serialization.
       Series file updated.
     - debian/pcs.init: Added to provide maintainer pcsd init
       script.
    
    Change-Id: I8fc4033bb6b33969a986e99cfa7850c86616bf65
    Signed-off-by: Richard B Winters <rik at mmogp.com>
---
 ...x-pcsd.conf-destination-in-pcsd-makefile.patch} |   0
 .../patches/0004-Source-lsb-init-functions.patch   |  29 -----
 ... 0005-Fix-file-locations-in-pcsd.service.patch} |   0
 ...e-rc.d-source-functions-in-pcsd-init-file.patch |  25 -----
 ...Fix-pcsd-location-and-args-in-init-script.patch |  48 --------
 ...Fix-pcsd.service-destination-in-Makefile.patch} |   0
 ...007-Change-pcsd-destination-to-usr-share.patch} |   0
 ...> 0008-Fix-check-for-systemctl-on-Debian.patch} |   0
 .../0008-Fix-conf-directory-in-pcsd-init.patch     |  38 -------
 debian/patches/series                              |  14 +--
 debian/pcs.install                                 |   5 +-
 debian/pcsd.init                                   | 122 +++++++++++++++++++++
 12 files changed, 131 insertions(+), 150 deletions(-)

diff --git a/debian/patches/0007-Fix-pcsd.conf-destination-in-pcsd-makefile.patch b/debian/patches/0004-Fix-pcsd.conf-destination-in-pcsd-makefile.patch
similarity index 100%
rename from debian/patches/0007-Fix-pcsd.conf-destination-in-pcsd-makefile.patch
rename to debian/patches/0004-Fix-pcsd.conf-destination-in-pcsd-makefile.patch
diff --git a/debian/patches/0004-Source-lsb-init-functions.patch b/debian/patches/0004-Source-lsb-init-functions.patch
deleted file mode 100644
index 19709f5..0000000
--- a/debian/patches/0004-Source-lsb-init-functions.patch
+++ /dev/null
@@ -1,29 +0,0 @@
-From: Richard B Winters <rik at mmogp.com>
-Date: Sat, 2 May 2015 03:45:28 -0400
-Subject: Source lsb init functions
-
- - The /etc/init.d script does not source 
-   /lib/lsb/init-functions. The systemd package provides 
-   /lib/lsb/init-functions.d/40-systemd to redirect 
-   /etc/init.d/$script calls to systemctl.
-
-Change-Id: I2b3e292d5453f21c4a879011faf8a4e2ff11b99d
-Signed-off-by: Richard B Winters <rik at mmogp.com>
----
- pcsd/pcsd | 3 +++
- 1 file changed, 3 insertions(+)
-
-diff --git a/pcsd/pcsd b/pcsd/pcsd
-index b47472a..29bacc3 100755
---- a/pcsd/pcsd
-+++ b/pcsd/pcsd
-@@ -20,6 +20,9 @@
- # Source function library.
- . /etc/rc.d/init.d/functions
- 
-+# Source lsb init functions
-+. /lib/lsb/init-functions
-+
- exec="/usr/bin/ruby"
- prog="pcsd"
- config="/var/lib/pcsd"
diff --git a/debian/patches/0009-Fix-file-locations-in-pcsd.service.patch b/debian/patches/0005-Fix-file-locations-in-pcsd.service.patch
similarity index 100%
rename from debian/patches/0009-Fix-file-locations-in-pcsd.service.patch
rename to debian/patches/0005-Fix-file-locations-in-pcsd.service.patch
diff --git a/debian/patches/0005-Remove-rc.d-source-functions-in-pcsd-init-file.patch b/debian/patches/0005-Remove-rc.d-source-functions-in-pcsd-init-file.patch
deleted file mode 100644
index e69c0d8..0000000
--- a/debian/patches/0005-Remove-rc.d-source-functions-in-pcsd-init-file.patch
+++ /dev/null
@@ -1,25 +0,0 @@
-From: Richard B Winters <rik at mmogp.com>
-Date: Sun, 3 May 2015 14:58:59 -0400
-Subject: Remove rc.d source functions in pcsd init file
-
- - It is replaced with
-
-Change-Id: I38b44e7c5366601bf2b62553e05a380d4e26a931
-Signed-off-by: Richard B Winters <rik at mmogp.com>
----
- pcsd/pcsd | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/pcsd/pcsd b/pcsd/pcsd
-index 29bacc3..b2c385d 100755
---- a/pcsd/pcsd
-+++ b/pcsd/pcsd
-@@ -18,7 +18,7 @@
- ### END INIT INFO
- 
- # Source function library.
--. /etc/rc.d/init.d/functions
-+#. /etc/rc.d/init.d/functions
- 
- # Source lsb init functions
- . /lib/lsb/init-functions
diff --git a/debian/patches/0006-Fix-pcsd-location-and-args-in-init-script.patch b/debian/patches/0006-Fix-pcsd-location-and-args-in-init-script.patch
deleted file mode 100644
index 5d8118c..0000000
--- a/debian/patches/0006-Fix-pcsd-location-and-args-in-init-script.patch
+++ /dev/null
@@ -1,48 +0,0 @@
-From: Richard B Winters <rik at mmogp.com>
-Date: Sun, 3 May 2015 15:11:35 -0400
-Subject: Fix pcsd location and args in init script
-
- - pcsd on debian lives at /usr/share/pcsd, not /usr/lib/pcsd
-
-Change-Id: I966db71f32256689a16310bbf0c6407a00abdf68
-Signed-off-by: Richard B Winters <rik at mmogp.com>
----
- pcsd/pcsd | 10 +++++-----
- 1 file changed, 5 insertions(+), 5 deletions(-)
-
-diff --git a/pcsd/pcsd b/pcsd/pcsd
-index b2c385d..226447a 100755
---- a/pcsd/pcsd
-+++ b/pcsd/pcsd
-@@ -7,8 +7,8 @@
- 
- ### BEGIN INIT INFO
- # Provides: pcsd
--# Required-Start: $network $syslog
--# Required-Stop: $network $syslog
-+# Required-Start: $remote_fs $network $syslog
-+# Required-Stop: $remote_fs $network $syslog
- # Should-Start: 
- # Should-Stop: 
- # Default-Start:
-@@ -25,7 +25,7 @@
- 
- exec="/usr/bin/ruby"
- prog="pcsd"
--config="/var/lib/pcsd"
-+config="/usr/share/pcsd"
- 
- [ -e /etc/sysconfig/$prog ] && . /etc/sysconfig/$prog
- 
-@@ -34,9 +34,9 @@ lockfile=/var/lock/subsys/$prog
- start() {
-     [ -x $exec ] || exit 5
-     echo -n $"Starting $prog: "
--    export GEM_HOME=/usr/lib/pcsd/vendor/bundle/ruby
-+    #export GEM_HOME=/usr/lib/pcsd/vendor/bundle/ruby
-     cd /var/lib/pcsd
--    daemon $exec -I/usr/lib/pcsd /usr/lib/pcsd/ssl.rb
-+    daemon --command='/usr/bin/ruby -I/usr/share/pcsd /usr/share/pcsd/ssl.rb'
-     # if not running, start it up here, usually something like "daemon $exec"
-     retval=$?
-     echo
diff --git a/debian/patches/0010-Fix-pcsd.service-destination-in-Makefile.patch b/debian/patches/0006-Fix-pcsd.service-destination-in-Makefile.patch
similarity index 100%
rename from debian/patches/0010-Fix-pcsd.service-destination-in-Makefile.patch
rename to debian/patches/0006-Fix-pcsd.service-destination-in-Makefile.patch
diff --git a/debian/patches/0011-Change-pcsd-destination-to-usr-share.patch b/debian/patches/0007-Change-pcsd-destination-to-usr-share.patch
similarity index 100%
rename from debian/patches/0011-Change-pcsd-destination-to-usr-share.patch
rename to debian/patches/0007-Change-pcsd-destination-to-usr-share.patch
diff --git a/debian/patches/0012-Fix-check-for-systemctl-on-Debian.patch b/debian/patches/0008-Fix-check-for-systemctl-on-Debian.patch
similarity index 100%
rename from debian/patches/0012-Fix-check-for-systemctl-on-Debian.patch
rename to debian/patches/0008-Fix-check-for-systemctl-on-Debian.patch
diff --git a/debian/patches/0008-Fix-conf-directory-in-pcsd-init.patch b/debian/patches/0008-Fix-conf-directory-in-pcsd-init.patch
deleted file mode 100644
index 9a2a2f4..0000000
--- a/debian/patches/0008-Fix-conf-directory-in-pcsd-init.patch
+++ /dev/null
@@ -1,38 +0,0 @@
-From: Richard B Winters <rik at mmogp.com>
-Date: Sun, 3 May 2015 16:39:55 -0400
-Subject: Fix conf directory in pcsd init
-
- - The conf file is set to be read from /etc/sysconfig/pcsd, 
-   we'll change that to be /etc/init/pcsd.conf instead
-
-Change-Id: I9a5fa9f40b5c470b35adabf4d718730a366d1a5c
-Signed-off-by: Richard B Winters <rik at mmogp.com>
----
- pcsd/pcsd | 5 +++--
- 1 file changed, 3 insertions(+), 2 deletions(-)
-
-diff --git a/pcsd/pcsd b/pcsd/pcsd
-index 226447a..64a35da 100755
---- a/pcsd/pcsd
-+++ b/pcsd/pcsd
-@@ -25,9 +25,10 @@
- 
- exec="/usr/bin/ruby"
- prog="pcsd"
-+extension=".conf"
- config="/usr/share/pcsd"
- 
--[ -e /etc/sysconfig/$prog ] && . /etc/sysconfig/$prog
-+[ -e /etc/init/$prog$extension ] && . /etc/init/$prog$extension
- 
- lockfile=/var/lock/subsys/$prog
- 
-@@ -36,7 +37,7 @@ start() {
-     echo -n $"Starting $prog: "
-     #export GEM_HOME=/usr/lib/pcsd/vendor/bundle/ruby
-     cd /var/lib/pcsd
--    daemon --command='/usr/bin/ruby -I/usr/share/pcsd /usr/share/pcsd/ssl.rb'
-+    daemon --name=pcsd --command='/usr/bin/ruby -I/usr/share/pcsd /usr/share/pcsd/ssl.rb'
-     # if not running, start it up here, usually something like "daemon $exec"
-     retval=$?
-     echo
diff --git a/debian/patches/series b/debian/patches/series
index 743a1c8..82c279f 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,12 +1,8 @@
 0001-Fix-pcsd-makefile-for-gnu-linux.patch
 0002-Remove-Gemfile.lock-for-debian.patch
 0003-Remove-build_gems-from-install_pcsd.patch
-0004-Source-lsb-init-functions.patch
-0005-Remove-rc.d-source-functions-in-pcsd-init-file.patch
-0006-Fix-pcsd-location-and-args-in-init-script.patch
-0007-Fix-pcsd.conf-destination-in-pcsd-makefile.patch
-0008-Fix-conf-directory-in-pcsd-init.patch
-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
+0004-Fix-pcsd.conf-destination-in-pcsd-makefile.patch
+0005-Fix-file-locations-in-pcsd.service.patch
+0006-Fix-pcsd.service-destination-in-Makefile.patch
+0007-Change-pcsd-destination-to-usr-share.patch
+0008-Fix-check-for-systemctl-on-Debian.patch
diff --git a/debian/pcs.install b/debian/pcs.install
index 8709955..ea80b15 100644
--- a/debian/pcs.install
+++ b/debian/pcs.install
@@ -1,4 +1,7 @@
-etc/*
+etc/bash_completion.d/*
+etc/default/*
+etc/logrotate.d/*
+etc/pam.d/*
 lib/systemd/system/*
 usr/sbin/*
 usr/share/*
diff --git a/debian/pcsd.init b/debian/pcsd.init
new file mode 100644
index 0000000..068cfe9
--- /dev/null
+++ b/debian/pcsd.init
@@ -0,0 +1,122 @@
+#!/bin/sh
+##
+# pcsd Pacemaker & Corosync configuration daemon
+#
+# chkconfig:   - 21 81 
+# description: Pacemaker & Corosync configuration daemon
+
+### BEGIN INIT INFO
+# Provides: pcsd
+# Required-Start: $remote_fs $network $syslog
+# Required-Stop: $remote_fs $network $syslog
+# Should-Start: 
+# Should-Stop: 
+# Default-Start: 2 3 4 5
+# Default-Stop: 0 1 6
+# Short-Description: Starts and stops Pacemaker & Corosync daemon
+# Description: Starts and stops Pacemaker & Corosync daemon
+### END INIT INFO
+
+# PATH
+PATH=/usr/sbin:/usr/bin:/sbin:/bin
+DESC="pcs daemon"
+PARENT_NAME=pcs
+NAME=pcsd
+EXEC=ruby
+SUB_EXEC=/usr/share/pcsd/ssl.rb
+DAEMON=/usr/bin/ruby
+DAEMON_ARGS="-I/usr/share/pcsd /usr/share/pcsd/ssl.rb"
+PIDFILE=/var/run/$NAME.pid
+SCRIPTNAME=/etc/init.d/$NAME
+
+# Exit if ruby is not installed
+[ -x $(which $EXEC) ] || echo "$EXEC was not found. Is it installed?"
+[ -x $(which $SUB_EXEC) ] || echo "$SUB_EXEC not found. Is pcs installed?"
+
+# Read configuration variable file if it is present
+[ -r /etc/default/$NAME.conf ] && . /etc/default/$NAME.conf
+
+# Source lsb init functions
+. /lib/lsb/init-functions
+
+do_start() 
+{
+    cd /var/lib/pcsd
+    # Return
+    # 0 if daemon has been started
+    # 1 if daemon was already running
+    # 2 if daemon could not be started
+    start-stop-daemon --start --quiet --test --exec $DAEMON -- test \
+      ||  return 1
+    start-stop-daemon --start --quiet --exec $DAEMON -- $DAEMON_ARGS \
+      || return 2
+    # Add code here, if necessary, that waits for the process to be ready
+    # to handle requests from services started subsequently which depend
+    # on this one.  As a last resort, sleep for some time.
+    pidof pcsd > $PIDFILE
+}
+
+do_stop()
+{
+    # Return
+    # 0 if daemon has been stopped
+    # 1 if daemon was already stopped
+    # 2 if daemon could not be stopped
+    # other if a failure occurred
+    start-stop-daemon --stop --quiet --retry forever/QUIT/1 --pidfile $PIDFILE
+    RETVAL="$?"
+    [ "$RETVAL" = 2 ] && return 2
+    # Many daemons don't delete their pidfiles when they exit.
+    rm -f $PIDFILE
+    return "$RETVAL"
+}
+
+
+
+case "$1" in
+  start)
+	log_daemon_msg "Starting $DESC" "$NAME"
+	do_start
+	case "$?" in
+		0|1) log_end_msg 0 ;;
+		2) log_end_msg 1 ;;
+	esac
+	;;
+  stop)
+	log_daemon_msg "Stopping $DESC" "$NAME"
+	do_stop
+	case "$?" in
+		0|1) log_end_msg 0 ;;
+		2) log_end_msg 1 ;;
+	esac
+	;;
+  restart|force-reload)
+	log_daemon_msg "Restarting $DESC" "$NAME"
+	do_stop
+	case "$?" in
+	  0|1)
+		do_start
+		case "$?" in
+			0) log_end_msg 0 ;;
+			1) log_end_msg 1 ;; # Old process is still running
+			*) log_end_msg 1 ;; # Failed to start
+		esac
+		;;
+	  *)
+	  	# Failed to stop
+		log_end_msg 1
+		;;
+	esac
+	;;
+  status|monitor)
+	status_of_proc -p $PIDFILE $DAEMON $NAME && exit 0 || exit $?
+	;;
+  *)
+	#echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload}" >&2
+	echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload}" >&2
+	exit 3
+	;;
+esac
+
+:
+

-- 
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