[packages/ganeti] - up to 2.8.1 - added initscripts for new daemons

baggins baggins at pld-linux.org
Fri Nov 1 12:57:52 CET 2013


commit 2b0c5c2595d1db9ea2e9b305fd54aef01f15f6cd
Author: Jan Rękorajski <baggins at pld-linux.org>
Date:   Fri Nov 1 12:57:34 2013 +0100

    - up to 2.8.1
    - added initscripts for new daemons

 ganeti-luxid.init | 109 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
 ganeti-mond.init  | 109 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
 ganeti.spec       |  39 +++++++++++++++----
 systemd.patch     |  48 +++++++++++++++++++++++-
 4 files changed, 296 insertions(+), 9 deletions(-)
---
diff --git a/ganeti.spec b/ganeti.spec
index 87fd57b..71909f7 100644
--- a/ganeti.spec
+++ b/ganeti.spec
@@ -1,16 +1,18 @@
 Summary:	Cluster-based virtualization management software
 Name:		ganeti
-Version:	2.7.1
+Version:	2.8.1
 Release:	0.1
 License:	GPL v2
 Group:		Applications/System
 Source0:	https://ganeti.googlecode.com/files/%{name}-%{version}.tar.gz
-# Source0-md5:	67f08692bca01d6d93b404ff83ae3a12
+# Source0-md5:	ade147740c2f630e0cdbb14a70e9c3ef
 Source1:	%{name}.tmpfiles
 Source2:	%{name}-confd.init
 Source3:	%{name}-masterd.init
 Source4:	%{name}-noded.init
 Source5:	%{name}-rapi.init
+Source6:	%{name}-luxid.init
+Source7:	%{name}-mond.init
 Patch0:		fix-no-kvm.patch
 Patch1:		systemd.patch
 Patch2:		daemon-util-use-service.patch
@@ -26,8 +28,9 @@ BuildRequires:	ghc-QuickCheck
 BuildRequires:	ghc-curl
 BuildRequires:	ghc-haskell-platform
 BuildRequires:	ghc-hinotify
-BuildRequires:	ghc-hslogger
+BuildRequires:	ghc-hslogger >= 1.2.3
 BuildRequires:	ghc-json
+BuildRequires:	ghc-snap-server
 BuildRequires:	ghc-regex-pcre
 BuildRequires:	ghc-utf8-string
 BuildRequires:	gmp-devel
@@ -146,6 +149,8 @@ install -p %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/ganeti-confd
 install -p %{SOURCE3} $RPM_BUILD_ROOT/etc/rc.d/init.d/ganeti-masterd
 install -p %{SOURCE4} $RPM_BUILD_ROOT/etc/rc.d/init.d/ganeti-noded
 install -p %{SOURCE5} $RPM_BUILD_ROOT/etc/rc.d/init.d/ganeti-rapi
+install -p %{SOURCE6} $RPM_BUILD_ROOT/etc/rc.d/init.d/ganeti-luxid
+install -p %{SOURCE7} $RPM_BUILD_ROOT/etc/rc.d/init.d/ganeti-mond
 
 %{__sed} -i -e 's|@LIBDIR@|%{_libdir}|g' $RPM_BUILD_ROOT/etc/rc.d/init.d/ganeti-*
 
@@ -154,7 +159,7 @@ cp -p doc/examples/ganeti.cron $RPM_BUILD_ROOT/etc/cron.d/ganeti
 cp -p doc/examples/ganeti.default $RPM_BUILD_ROOT/etc/sysconfig/ganeti
 cp -p doc/examples/ganeti.target $RPM_BUILD_ROOT%{systemdunitdir}
 cp -p doc/examples/ganeti.target $RPM_BUILD_ROOT%{systemdunitdir}
-cp -p doc/examples/ganeti-{noded,masterd,rapi,confd}.service $RPM_BUILD_ROOT%{systemdunitdir}
+cp -p doc/examples/ganeti-{noded,masterd,rapi,confd,luxid,mond}.service $RPM_BUILD_ROOT%{systemdunitdir}
 
 %py_postclean
 
@@ -170,7 +175,11 @@ rm -rf $RPM_BUILD_ROOT
 %service ganeti-rapi restart
 /sbin/chkconfig --add ganeti-confd
 %service ganeti-confd restart
-%systemd_post ganeti.target ganeti-noded.service ganeti-masterd.service ganeti-rapi.service ganeti-confd.service
+/sbin/chkconfig --add ganeti-luxid
+%service ganeti-luxid restart
+/sbin/chkconfig --add ganeti-mond
+%service ganeti-mond restart
+%systemd_post ganeti.target ganeti-noded.service ganeti-masterd.service ganeti-rapi.service ganeti-confd.service ganeti-luxid.service ganeti-mond.service
 
 %preun
 if [ "$1" = "0" ]; then
@@ -182,8 +191,12 @@ if [ "$1" = "0" ]; then
 	/sbin/chkconfig --del ganeti-masterd
 	%service -q ganeti-noded stop
 	/sbin/chkconfig --del ganeti-noded
+	%service -q ganeti-luxid stop
+	/sbin/chkconfig --del ganeti-luxid
+	%service -q ganeti-mond stop
+	/sbin/chkconfig --del ganeti-mond
 fi
-%systemd_preun ganeti.target ganeti-noded.service ganeti-masterd.service ganeti-rapi.service ganeti-confd.service
+%systemd_preun ganeti.target ganeti-noded.service ganeti-masterd.service ganeti-rapi.service ganeti-confd.service ganeti-luxid.service ganeti-mond.service
 
 %postun
 %systemd_reload
@@ -192,14 +205,18 @@ fi
 %defattr(644,root,root,755)
 %doc NEWS README UPGRADE
 %attr(754,root,root) /etc/rc.d/init.d/ganeti-confd
+%attr(754,root,root) /etc/rc.d/init.d/ganeti-luxid
 %attr(754,root,root) /etc/rc.d/init.d/ganeti-masterd
+%attr(754,root,root) /etc/rc.d/init.d/ganeti-mond
 %attr(754,root,root) /etc/rc.d/init.d/ganeti-noded
 %attr(754,root,root) /etc/rc.d/init.d/ganeti-rapi
 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/ganeti
 %dir %{_sysconfdir}/ganeti
 %{systemdunitdir}/ganeti.target
 %{systemdunitdir}/ganeti-confd.service
+%{systemdunitdir}/ganeti-luxid.service
 %{systemdunitdir}/ganeti-masterd.service
+%{systemdunitdir}/ganeti-mond.service
 %{systemdunitdir}/ganeti-noded.service
 %{systemdunitdir}/ganeti-rapi.service
 %{systemdtmpfilesdir}/ganeti.conf
@@ -235,7 +252,9 @@ fi
 %attr(755,root,root) %{_sbindir}/ganeti-cleaner
 %attr(755,root,root) %{_sbindir}/ganeti-confd
 %attr(755,root,root) %{_sbindir}/ganeti-listrunner
+%attr(755,root,root) %{_sbindir}/ganeti-luxid
 %attr(755,root,root) %{_sbindir}/ganeti-masterd
+%attr(755,root,root) %{_sbindir}/ganeti-mond
 %attr(755,root,root) %{_sbindir}/ganeti-noded
 %attr(755,root,root) %{_sbindir}/ganeti-rapi
 %attr(755,root,root) %{_sbindir}/ganeti-watcher
@@ -249,14 +268,16 @@ fi
 %attr(755,root,root) %{_sbindir}/gnt-node
 %attr(755,root,root) %{_sbindir}/gnt-os
 %attr(755,root,root) %{_sbindir}/gnt-storage
+%{_mandir}/man7/ganeti.7*
 %{_mandir}/man7/ganeti-extstorage-interface.7*
 %{_mandir}/man7/ganeti-os-interface.7*
-%{_mandir}/man7/ganeti.7*
 %{_mandir}/man7/mon-collector.7*
 %{_mandir}/man8/ganeti-cleaner.8*
 %{_mandir}/man8/ganeti-confd.8*
 %{_mandir}/man8/ganeti-listrunner.8*
+%{_mandir}/man8/ganeti-luxid.8*
 %{_mandir}/man8/ganeti-masterd.8*
+%{_mandir}/man8/ganeti-mond.8*
 %{_mandir}/man8/ganeti-noded.8*
 %{_mandir}/man8/ganeti-rapi.8*
 %{_mandir}/man8/ganeti-watcher.8*
@@ -274,6 +295,8 @@ fi
 %{py_sitescriptdir}/ganeti/*.py*
 %dir %{py_sitescriptdir}/ganeti/client
 %{py_sitescriptdir}/ganeti/client/*.py*
+%dir %{py_sitescriptdir}/ganeti/cmdlib
+%{py_sitescriptdir}/ganeti/cmdlib/*.py*
 %dir %{py_sitescriptdir}/ganeti/confd
 %{py_sitescriptdir}/ganeti/confd/*.py*
 %dir %{py_sitescriptdir}/ganeti/http
@@ -297,6 +320,7 @@ fi
 
 %files htools
 %defattr(644,root,root,755)
+%attr(755,root,root) %{_bindir}/harep
 %attr(755,root,root) %{_bindir}/hbal
 %attr(755,root,root) %{_bindir}/hcheck
 %attr(755,root,root) %{_bindir}/hinfo
@@ -306,6 +330,7 @@ fi
 %attr(755,root,root) %{_bindir}/htools
 %{_libdir}/ganeti/iallocators/hail
 %{_mandir}/man1/hail.1*
+%{_mandir}/man1/harep.1*
 %{_mandir}/man1/hbal.1*
 %{_mandir}/man1/hcheck.1*
 %{_mandir}/man1/hinfo.1*
diff --git a/ganeti-luxid.init b/ganeti-luxid.init
new file mode 100644
index 0000000..ddf4779
--- /dev/null
+++ b/ganeti-luxid.init
@@ -0,0 +1,109 @@
+#!/bin/sh
+#
+# ganeti-luxid	Start/Stop Ganeti Cluster query daemon
+#
+# chkconfig:	2345 99 01
+# description:	Ganeti Cluster query daemon.
+#
+# processname:	ganeti-luxid
+# pidfile:	/var/run/ganeti/ganeti-luxid.pid
+#
+### BEGIN INIT INFO
+# Provides:          ganeti-luxid
+# Required-Start:    $syslog $remote_fs
+# Required-Stop:     $syslog $remote_fs
+# Default-Start:     2 3 4 5
+# Default-Stop:      0 1 6
+# Short-Description: Ganeti Cluster query daemon
+# Description:       Ganeti Cluster query daemon
+### END INIT INFO
+
+# Source function library.
+. /etc/rc.d/init.d/functions
+
+# Get service config
+[ -f /etc/sysconfig/ganeti ] && . /etc/sysconfig/ganeti
+
+if [ ! -f /var/lib/ganeti/server.pem ]; then
+	echo "Missing configuration file /var/lib/ganeti/server.pem"
+	exit 1
+fi
+
+start() {
+	# Check if the service is already running?
+	if [ -f /var/lock/subsys/ganeti-luxid ]; then
+		msg_already_running "Ganeti Cluster query daemon"
+		return
+	fi
+
+	msg_starting "Ganeti Cluster query daemon"
+	@LIBDIR@/ganeti/ensure-dirs
+	daemon --pidfile /var/run/ganeti/ganeti-luxid.pid /usr/sbin/ganeti-luxid $LUXID_ARGS
+	RETVAL=$?
+	[ $RETVAL -eq 0 ] && touch /var/lock/subsys/ganeti-luxid
+}
+
+stop() {
+	if [ ! -f /var/lock/subsys/ganeti-luxid ]; then
+		msg_not_running "Ganeti Cluster query daemon"
+		return
+	fi
+
+	msg_stopping "Ganeti Cluster daemon"
+	killproc --pidfile /var/run/ganeti/ganeti-luxid.pid ganeti-luxid
+	rm -f /var/lock/subsys/ganeti-luxid
+}
+
+# HUP causes daemon to reopen logs only
+reload() {
+	if [ ! -f /var/lock/subsys/ganeti-luxid ]; then
+		msg_not_running "Ganeti Cluster query daemon"
+		RETVAL=7
+		return
+	fi
+
+	msg_reloading "Ganeti Cluster query daemon"
+	killproc ganeti-luxid -HUP
+	RETVAL=$?
+}
+
+condrestart() {
+	if [ ! -f /var/lock/subsys/ganeti-luxid ]; then
+		msg_not_running "Ganeti Cluster query daemon"
+		RETVAL=$1
+		return
+	fi
+
+	stop
+	start
+}
+
+RETVAL=0
+# See how we were called.
+case "$1" in
+  start)
+	start
+	;;
+  stop)
+	stop
+	;;
+  restart)
+	stop
+	start
+	;;
+  try-restart)
+	condrestart 0
+	;;
+  reload|force-reload|flush-logs)
+	reload
+	;;
+  status)
+	status --pidfile /var/run/ganeti/ganeti-luxid.pid ganeti-luxid
+	exit $?
+	;;
+  *)
+	msg_usage "$0 {start|stop|restart|try-restart|reload|force-reload|flush-logs|status}"
+	exit 3
+esac
+
+exit $RETVAL
diff --git a/ganeti-mond.init b/ganeti-mond.init
new file mode 100644
index 0000000..055fa7c
--- /dev/null
+++ b/ganeti-mond.init
@@ -0,0 +1,109 @@
+#!/bin/sh
+#
+# ganeti-mond	Start/Stop Ganeti Cluster monitoring daemon.
+#
+# chkconfig:	2345 99 01
+# description:	Ganeti Cluster monitoring daemon.
+#
+# processname:	ganeti-mond
+# pidfile:	/var/run/ganeti/ganeti-mond.pid
+#
+### BEGIN INIT INFO
+# Provides:          ganeti-mond
+# Required-Start:    $syslog $remote_fs
+# Required-Stop:     $syslog $remote_fs
+# Default-Start:     2 3 4 5
+# Default-Stop:      0 1 6
+# Short-Description: Ganeti Cluster monitoring daemon
+# Description:       Ganeti Cluster monitoring daemon
+### END INIT INFO
+
+# Source function library.
+. /etc/rc.d/init.d/functions
+
+# Get service config
+[ -f /etc/sysconfig/ganeti ] && . /etc/sysconfig/ganeti
+
+if [ ! -f /var/lib/ganeti/server.pem ]; then
+	echo "Missing configuration file /var/lib/ganeti/server.pem"
+	exit 1
+fi
+
+start() {
+	# Check if the service is already running?
+	if [ -f /var/lock/subsys/ganeti-mond ]; then
+		msg_already_running "Ganeti Cluster monitoring daemon"
+		return
+	fi
+
+	msg_starting "Ganeti Cluster monitoring daemon"
+	@LIBDIR@/ganeti/ensure-dirs
+	daemon --pidfile /var/run/ganeti/ganeti-mond.pid /usr/sbin/ganeti-mond $MOND_ARGS
+	RETVAL=$?
+	[ $RETVAL -eq 0 ] && touch /var/lock/subsys/ganeti-mond
+}
+
+stop() {
+	if [ ! -f /var/lock/subsys/ganeti-mond ]; then
+		msg_not_running "Ganeti Cluster monitoring daemon"
+		return
+	fi
+
+	msg_stopping "Ganeti Cluster daemon"
+	killproc --pidfile /var/run/ganeti/ganeti-mond.pid ganeti-mond
+	rm -f /var/lock/subsys/ganeti-mond
+}
+
+# HUP causes daemon to reopen logs only
+reload() {
+	if [ ! -f /var/lock/subsys/ganeti-mond ]; then
+		msg_not_running "Ganeti Cluster monitoring daemon"
+		RETVAL=7
+		return
+	fi
+
+	msg_reloading "Ganeti Cluster monitoring daemon"
+	killproc ganeti-mond -HUP
+	RETVAL=$?
+}
+
+condrestart() {
+	if [ ! -f /var/lock/subsys/ganeti-mond ]; then
+		msg_not_running "Ganeti Cluster monitoring daemon"
+		RETVAL=$1
+		return
+	fi
+
+	stop
+	start
+}
+
+RETVAL=0
+# See how we were called.
+case "$1" in
+  start)
+	start
+	;;
+  stop)
+	stop
+	;;
+  restart)
+	stop
+	start
+	;;
+  try-restart)
+	condrestart 0
+	;;
+  reload|force-reload|flush-logs)
+	reload
+	;;
+  status)
+	status --pidfile /var/run/ganeti/ganeti-mond.pid ganeti-mond
+	exit $?
+	;;
+  *)
+	msg_usage "$0 {start|stop|restart|try-restart|reload|force-reload|flush-logs|status}"
+	exit 3
+esac
+
+exit $RETVAL
diff --git a/systemd.patch b/systemd.patch
index 1b267a0..b2cf51f 100644
--- a/systemd.patch
+++ b/systemd.patch
@@ -7,10 +7,10 @@ http://code.google.com/p/ganeti/issues/detail?id=444
  	doc/examples/bash_completion \
  	doc/examples/bash_completion-debug \
 +	doc/examples/ganeti.target \
+ 	$(userspecs) \
  	lib/_generated_rpc.py \
  	$(man_MANS) \
- 	$(manhtml) \
-@@ -190,7 +190,11 @@
+@@ -190,7 +190,13 @@
  	doc/examples/ganeti.cron \
  	doc/examples/ganeti.initd \
  	doc/examples/gnt-config-backup \
@@ -19,6 +19,8 @@ http://code.google.com/p/ganeti/issues/detail?id=444
 +	doc/examples/ganeti-confd.service \
 +	doc/examples/ganeti-masterd.service \
 +	doc/examples/ganeti-noded.service \
++	doc/examples/ganeti-luxid.service \
++	doc/examples/ganeti-mond.service \
 +	doc/examples/ganeti-rapi.service
  
  nodist_pkgpython_PYTHON = \
@@ -106,6 +108,48 @@ http://code.google.com/p/ganeti/issues/detail?id=444
 +
 +[Install]
 +WantedBy=ganeti.target
+--- ganeti-2.6.2/doc/examples.orig/ganeti-luxid.service.in	1970-01-01 01:00:00.000000000 +0100
++++ ganeti-2.6.2/doc/examples/ganeti-luxid.service.in	2013-06-01 15:55:37.594893846 +0200
+@@ -0,0 +1,18 @@
++[Unit]
++Description=Ganeti luxid
++Requires=ganeti-noded.service ganeti-masterd.service ganeti-rapi.service
++After=ganeti-rapi.service
++
++[Service]
++Type=forking
++ConditionPathExists=@LOCALSTATEDIR@/lib/ganeti/server.pem
++EnvironmentFile=-/etc/sysconfig/ganeti
++ExecStartPre=@PKGLIBDIR@/ensure-dirs
++ExecStart=@PREFIX@/sbin/ganeti-luxid $LUXID_ARGS
++User=@GNTLUXIDUSER@
++Group=@GNTLUXIDGROUP@
++PIDFile=@LOCALSTATEDIR@/run/ganeti/ganeti-luxid.pid
++KillMode=process
++
++[Install]
++WantedBy=ganeti.target
+--- ganeti-2.6.2/doc/examples.orig/ganeti-mond.service.in	1970-01-01 01:00:00.000000000 +0100
++++ ganeti-2.6.2/doc/examples/ganeti-mond.service.in	2013-06-01 15:55:37.594893846 +0200
+@@ -0,0 +1,18 @@
++[Unit]
++Description=Ganeti mond
++Requires=ganeti-noded.service ganeti-masterd.service ganeti-rapi.service
++After=ganeti-rapi.service
++
++[Service]
++Type=forking
++ConditionPathExists=@LOCALSTATEDIR@/lib/ganeti/server.pem
++EnvironmentFile=-/etc/sysconfig/ganeti
++ExecStartPre=@PKGLIBDIR@/ensure-dirs
++ExecStart=@PREFIX@/sbin/ganeti-mond $MOND_ARGS
++User=@GNTMONDUSER@
++Group=@GNTMONDGROUP@
++PIDFile=@LOCALSTATEDIR@/run/ganeti/ganeti-mond.pid
++KillMode=process
++
++[Install]
++WantedBy=ganeti.target
 --- ganeti-2.6.2/doc/examples.orig/ganeti.target	1970-01-01 01:00:00.000000000 +0100
 +++ ganeti-2.6.2/doc/examples/ganeti.target	2013-06-01 15:55:37.661561129 +0200
 @@ -0,0 +1,5 @@
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/ganeti.git/commitdiff/2b0c5c2595d1db9ea2e9b305fd54aef01f15f6cd



More information about the pld-cvs-commit mailing list