[Debian-ha-commits] [pcs] 03/03: Reenable the upstream init script

Valentin Vidic vvidic-guest at moszumanska.debian.org
Thu Jul 14 08:30:54 UTC 2016


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

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

commit b2ab68cfc40227a3a1c7a4ac233dd81a1bf17fd1
Author: Valentin Vidic <Valentin.Vidic at CARNet.hr>
Date:   Thu Jul 14 10:18:28 2016 +0200

    Reenable the upstream init script
---
 debian/pcs.install           |   1 +
 debian/pcs.lintian-overrides |   3 -
 debian/pcsd.init             | 141 -------------------------------------------
 debian/rules                 |   6 +-
 4 files changed, 6 insertions(+), 145 deletions(-)

diff --git a/debian/pcs.install b/debian/pcs.install
index 52cc710..8a9a271 100644
--- a/debian/pcs.install
+++ b/debian/pcs.install
@@ -1,5 +1,6 @@
 etc/bash_completion.d/* usr/share/bash-completion/completions/
 etc/default/*
+etc/init.d/*
 etc/logrotate.d/*
 etc/pam.d/*
 lib/systemd/system/*
diff --git a/debian/pcs.lintian-overrides b/debian/pcs.lintian-overrides
deleted file mode 100644
index 041fca4..0000000
--- a/debian/pcs.lintian-overrides
+++ /dev/null
@@ -1,3 +0,0 @@
-# PCS/PCSD ships with a service file which does not
-# need the init script
-script-in-etc-init.d-not-registered-via-update-rc.d
diff --git a/debian/pcsd.init b/debian/pcsd.init
deleted file mode 100644
index 1d63ea5..0000000
--- a/debian/pcsd.init
+++ /dev/null
@@ -1,141 +0,0 @@
-#!/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"
-NAME=pcsd
-EXEC=ruby
-SUB_EXEC=/usr/share/pcsd/ssl.rb
-DAEMON_USER=root
-DAEMON=/usr/bin/ruby
-DAEMON_ARGS="-C/var/lib/pcsd -I/usr/share/pcsd -- /usr/share/pcsd/ssl.rb"
-PIDFILE=/var/run/$NAME.pid
-SCRIPTNAME=/etc/init.d/$NAME
-LOGFILE=/var/log/$NAME/$NAME.log
-SLEEP_DURATION=2
-
-# 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 ] && . /etc/default/$NAME
-
-# Source lsb init functions
-. /lib/lsb/init-functions
-
-is_running()
-{
-  # Test whether pid file exists or not
-  test -f $PIDFILE || return 1
-
-  # Test whether process is running or not
-  read PID < "$PIDFILE"
-  ps -p $PID >/dev/null 2>&1 || return 1
-
-  # Is running
-  return 0
-}
-
-root_only()
-{
-  if [ "$(id -u)" != "0" ]; then
-    echo "Only root should run this operation"
-    exit 1
-  fi
-}
-
-run()
-{
-  if is_running; then
-    PID="$(cat $PIDFILE)"
-    echo "Daemon is already running as PID $PID"
-    return 1
-  fi
-
-  nohup $DAEMON $DAEMON_ARGS > /dev/null 2>&1
-  echo $! > $PIDFILE
-  read PID < "$PIDFILE"
-
-  echo "PID is $PID"
-
-  sleep $SLEEP_DURATION
-  if ! is_running; then
-    echo "Daemon died immediately after starting. Please check your logs and configurations."
-    return 1
-  fi
-
-  echo "Daemon is running as PID $PID"
-  return 0
-}
-
-stop()
-{
-  if is_running; then
-    read PID < "$PIDFILE"
-    kill -9 $PID
-  fi
-
-  sleep $SLEEP_DURATION
-  if is_running; then
-    while is_running; do
-      echo "waiting for daemon to die (PID $PID)"
-      sleep $SLEEP_DURATION
-    done
-  fi
-
-  # Be sure to remove the pid file
-  rm -f "$PIDFILE"
-  return 0
-}
-
-case "$1" in
-  start)
-    root_only
-    log_daemon_msg "Starting $DESC"  "$NAME"
-    run
-    log_end_msg $?
-    ;;
-  stop)
-    root_only
-    log_daemon_msg "Stopping $DESC" "$NAME"
-    stop
-    log_end_msg $?
-    ;;
-  restart|force-reload)
-    log_daemon_msg "Restarting $DESC" "$NAME"
-    root_only
-    $0 stop && $0 start
-    ;;
-  status|monitor)
-    status_of_proc \
-      -p "$PIDFILE" \
-      "$SUB_EXEC" \
-      "$NAME" \
-      && exit 0 \
-      || exit $?
-    ;;
-  *)
-    echo "Usage: $0 {start|stop|restart|reload|force-reload|status|monitor}"
-    exit 1
-  ;;
-esac
-
-:
diff --git a/debian/rules b/debian/rules
index 60fc243..403147b 100755
--- a/debian/rules
+++ b/debian/rules
@@ -36,6 +36,10 @@ override_dh_auto_install:
 		BUILD_GEMS=false \
 		systemddir=/lib/systemd \
 		SYSTEMCTL_OVERRIDE=true
+
+	# Always install the init script
+	install -m 755 -D pcsd/pcsd.debian $(CURDIR)/debian/tmp/etc/init.d/pcsd
+
 	# remove embedded fonts
 	set -e && cd $(CURDIR)/debian/tmp/usr/share/pcsd/public/css && \
 	for ttf in Liberation*.ttf; do \
@@ -47,7 +51,7 @@ override_dh_python2:
 	dh_python2 -p pcs /usr/share/pcsd
 
 override_dh_installinit:
-	dh_installinit -n --name=pcsd --
+	dh_installinit --onlyscripts --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