[Debian-ha-commits] [corosync] 01/01: Revise sysV init / systemd.

Adrian Vondendriesch discostu-guest at moszumanska.debian.org
Wed May 6 17:33:45 UTC 2015


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

discostu-guest pushed a commit to branch master
in repository corosync.

commit 0cded0046a2699f03fe02822699a5ad540c69bc0
Author: Adrian Vondendriesch <adrian.vondendriesch at credativ.de>
Date:   Wed May 6 19:24:20 2015 +0200

    Revise sysV init / systemd.
    
    Before this commit $START was evaluated on startup. Because thats not possible
    within corosync.service (Condition...) we check the existence of
    /etc/corosync/corosync.conf now. Moreover corsync.conf is now installed as
    corosync.conf.example. So any user has to edit this file before first start of
    corosync.
    
    Signed-off-by: Adrian Vondendriesch <adrian.vondendriesch at credativ.de>
---
 debian/changelog                                   |  6 +++++
 ...rosync.example-config => corosync.conf.example} |  0
 debian/corosync.init                               |  7 +++---
 debian/corosync.service                            | 26 ++++++++++++++++++++++
 debian/rules                                       |  4 +++-
 5 files changed, 39 insertions(+), 4 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index d8030be..8a4e3ad 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -82,6 +82,12 @@ corosync (2.3.4-1) UNRELEASED; urgency=medium
   * Add OPTIONS within /etc/default/corosync-notifyd
   * debian/corosync.example-config: create a new example-config based on
     current upstream version (Closes: #682532, #739730)
+  * Install debian/corosync.conf.example as example configuration
+  * Install our own corosync.service file. The our new service file now calls
+    corosync directly.
+  * Ged rid of START=[yes|no] within /etc/default/corosync. Instead check the
+    existence of /etc/corosync/corosync.conf. So corosync.service and
+    corosync.init uses the same start condition.
 
  -- Richard B Winters <rik at mmogp.com>  Wed, 22 Apr 2015 15:51:34 -0400
 
diff --git a/debian/corosync.example-config b/debian/corosync.conf.example
similarity index 100%
rename from debian/corosync.example-config
rename to debian/corosync.conf.example
diff --git a/debian/corosync.init b/debian/corosync.init
index 9fab7ca..ad9d37a 100644
--- a/debian/corosync.init
+++ b/debian/corosync.init
@@ -21,6 +21,7 @@ PIDFILE=/var/run/$NAME.pid
 SCRIPTNAME=/etc/init.d/$NAME
 PIDFILE=/var/run/corosync.pid
 RARUNDIR=/var/run/resource-agents
+CONFIGFILE=/etc/corosync/corosync.conf
 
 # Exit if the package is not installed
 [ -x "$DAEMON" ] || exit 0
@@ -31,9 +32,9 @@ RARUNDIR=/var/run/resource-agents
 # Make sure the Resource Agents run dir exists. Otherwise create it.
 [ -d "$RARUNDIR" ] || mkdir -p $RARUNDIR
 
-if [ "$START" != "yes" ]; then
-	exit 0
-fi
+# Instead of checking the START=... parameter, we check if our config file
+# exists.
+[ -f $CONFIGFILE ] || exit 0
 
 # Define LSB log_* functions.
 # Depend on lsb-base (>= 3.0-6) to ensure that this file is present.
diff --git a/debian/corosync.service b/debian/corosync.service
new file mode 100644
index 0000000..f4640ec
--- /dev/null
+++ b/debian/corosync.service
@@ -0,0 +1,26 @@
+[Unit]
+Description=Corosync Cluster Engine
+ConditionKernelCommandLine=!nocluster
+ConditionPathExists=/etc/corosync/corosync.conf
+Requires=network-online.target
+After=network-online.target
+
+[Service]
+EnvironmentFile=-/etc/defaul/corosync
+ExecStart=/usr/sbin/corosync -f
+Type=simple
+
+# The following config is for corosync with enabled watchdog service.
+#
+#  When corosync watchdog service is being enabled and using with
+#  pacemaker.service, and if you want to exert the watchdog when a
+#  corosync process is terminated abnormally,
+#  uncomment the line of the following Restart= and RestartSec=.
+#Restart=on-failure
+#  Specify a period longer than soft_margin as RestartSec.
+#RestartSec=70
+#  rewrite according to environment.
+#ExecStartPre=/sbin/modprobe softdog soft_margin=60
+
+[Install]
+WantedBy=multi-user.target
diff --git a/debian/rules b/debian/rules
index a7ba9d9..307bf4b 100755
--- a/debian/rules
+++ b/debian/rules
@@ -51,9 +51,11 @@ override_dh_auto_install:
 	dh_auto_install
 # remove .la files
 	rm -v debian/tmp/usr/lib/lib*.la
+# remove corosync.service file
+	rm -v $(CURDIR)/debian/tmp/lib/systemd/system/corosync.service
 # install example configuration file
 	mkdir -p $(CURDIR)/debian/corosync/etc/corosync/
-	cp -ax $(CURDIR)/debian/corosync.example-config $(CURDIR)/debian/corosync/etc/corosync/corosync.conf
+	cp -ax $(CURDIR)/debian/corosync.conf.example $(CURDIR)/debian/corosync/etc/corosync/corosync.conf.example
 	rm "$(DOC)/LICENSE" "$(DOC)/INSTALL"
 
 override_dh_installinit:

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



More information about the Debian-HA-Commits mailing list