Hello all!

Hopefully, not everybody is on the vacation :)

1) Corosync
In debian packages, until now, we had semi working init scripts.
Starting of corosync was fine, but stoping corosync killed corosync,
leaving children (when used with pacemaker) hanging. Solution for that
problem is attached in debdiff (upstream sends QUIT signal to corosync,
effectively killing the children, while we used TERM until now). Review
of this solution is welcome (and needed :).

I've also extended debian/rules so that it patches before it configures
the package and that it cleans the source before the (re)build. Some
workarounds were needed for that, but nothing special.

2) OpenAIS
OpenAIS needs to be cleaned after the build. As with corosync, I added
some changes to debian/rules so that we don't upload architecture
depended files within the source tarball or during rebuild of packages :/

Both diffs are based on latest git snapshots:

git://git.debian.org/users/agx/redhat-cluster/corosync.git
git://git.debian.org/users/agx/redhat-cluster/openais.git

As you may know, we've successfully compiled and tested pacemaker with
corosync/openais 1.0. Only thing left to sort out is creation of
/var/run/heartbeat and /var/run/crm directories. These directories get
created when pacemaker's service are started from corosync. Permissions
on them are faulty and render whole cluster unusable. If those
directories exist before services are started, permissions aren't changed.

In Ubuntu we use tmpfs for /var/run, so creating those directories
during installation isn't the solution. I've looked if this could
somehow be defined in corosync.conf (pre-start command or something like
that) and couldn't find a quick solution. So, I'm suggesting a init
script for pacemaker, which would start before corosync. That script
would create directories in question and set up correct permissions.
Does anyone has a better suggestion?

If we fix this remaining issue (which is trivial), we could base rhcs
and pacemaker on the corosync/openais 1.0 and leave out openais-legacy
both in Debian and Ubuntu.

Thanks,

Ante Karamatić
diff -Nru corosync-1.0.0/debian/changelog corosync-1.0.0/debian/changelog
--- corosync-1.0.0/debian/changelog	2009-07-29 15:42:00.000000000 +0200
+++ corosync-1.0.0/debian/changelog	2009-07-29 16:17:37.000000000 +0200
@@ -1,3 +1,11 @@
+corosync (1.0.0-4ubuntu0ivoks1) karmic; urgency=low
+
+  * Clean up the source on rebuild
+  * Fix init file
+  * Minor fixes in debian/rules
+
+ -- Ante Karamatic <[email protected]>  Wed, 29 Jul 2009 15:19:23 +0200
+
 corosync (1.0.0-4) experimental; urgency=low
 
   * [5b1180a] fix debian-ha address
diff -Nru corosync-1.0.0/debian/corosync.init corosync-1.0.0/debian/corosync.init
--- corosync-1.0.0/debian/corosync.init	2009-07-29 15:42:00.000000000 +0200
+++ corosync-1.0.0/debian/corosync.init	2009-07-29 17:06:39.000000000 +0200
@@ -32,9 +32,6 @@
 	exit 0
 fi
 
-# Load the VERBOSE setting and other rcS variables
-[ -f /etc/default/rcS ] && . /etc/default/rcS
-
 # Define LSB log_* functions.
 # Depend on lsb-base (>= 3.0-6) to ensure that this file is present.
 . /lib/lsb/init-functions
@@ -55,6 +52,7 @@
 	# 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 corosync > $PIDFILE
 }
 
 #
@@ -67,7 +65,7 @@
 	#   1 if daemon was already stopped
 	#   2 if daemon could not be stopped
 	#   other if a failure occurred
-	start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --name $NAME
+	start-stop-daemon --stop --quiet --signal QUIT --retry=5/QUIT/5/QUIT --pidfile $PIDFILE
 	RETVAL="$?"
 	[ "$RETVAL" = 2 ] && return 2
 	# Wait for children to finish too if this is a daemon that forks
@@ -76,7 +74,7 @@
 	# that waits for the process to drop all resources that could be
 	# needed by services started subsequently.  A last resort is to
 	# sleep for some time.
-	start-stop-daemon --stop --quiet --oknodo --retry=0/30/KILL/5 --exec $DAEMON
+	start-stop-daemon --stop --quiet --oknodo --signal QUIT --retry=5/QUIT/15/KILL --pidfile $PIDFILE
 	[ "$?" = 2 ] && return 2
 	# Many daemons don't delete their pidfiles when they exit.
 	rm -f $PIDFILE
@@ -85,19 +83,19 @@
 
 case "$1" in
   start)
-	[ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME"
+	log_daemon_msg "Starting $DESC" "$NAME"
 	do_start
 	case "$?" in
-		0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
-		2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
+		0|1) log_end_msg 0 ;;
+		2) log_end_msg 1 ;;
 	esac
 	;;
   stop)
-	[ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME"
+	log_daemon_msg "Stopping $DESC" "$NAME"
 	do_stop
 	case "$?" in
-		0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
-		2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
+		0|1) log_end_msg 0 ;;
+		2) log_end_msg 1 ;;
 	esac
 	;;
   restart|force-reload)
diff -Nru corosync-1.0.0/debian/rules corosync-1.0.0/debian/rules
--- corosync-1.0.0/debian/rules	2009-07-29 15:42:00.000000000 +0200
+++ corosync-1.0.0/debian/rules	2009-07-29 15:56:56.000000000 +0200
@@ -14,8 +14,9 @@
 
 setup: $(STAMPS_DIR)/setup
 
-configure-stamp:
+configure-stamp: patch
 	dh_testdir
+	cp include/corosync/cs_config.h debian/backup/
 	./configure --prefix=/usr \
 		    --libexecdir=/usr/lib/ \
 		    --localstatedir=/var \
@@ -24,13 +25,15 @@
 		    --with-socket-dir=/var/run/corosync
 	touch configure-stamp
 
-build: patch configure-stamp
+build: configure-stamp
 	$(MAKE)
 
 clean: unpatch
 	dh_testdir
 	-$(MAKE) clean
 	dh_clean configure-stamp
+	rm -rf config.log config.status exec/.deps exec/Makefile include/corosync/config.h include/Makefile init/Makefile lcr/.deps lcr/Makefile lib/.deps lib/Makefile Makefile man/Makefile pkgconfig/Makefile services/Makefile test/.deps test/Makefile tools/.deps tools/Makefile include/corosync/stamp-h*
+	mv debian/backup/cs_config.h include/corosync/cs_config.h || true
 
 maintainerclean:
 	rm -rf $(filter-out .svn debian, $(wildcard * .[^.]*))
diff -Nru openais-1.0.0/debian/changelog openais-1.0.0/debian/changelog
--- openais-1.0.0/debian/changelog	2009-07-29 17:10:55.000000000 +0200
+++ openais-1.0.0/debian/changelog	2009-07-29 17:17:35.000000000 +0200
@@ -1,3 +1,9 @@
+openais (1.0.0-3ubuntu0ivoks1) karmic; urgency=low
+
+  * Clean up the source before building binary
+
+ -- Ante Karamatic <[email protected]>  Wed, 29 Jul 2009 17:17:05 +0200
+
 openais (1.0.0-3) experimental; urgency=low
 
   * [f9492e6] fix debian-ha address
diff -Nru openais-1.0.0/debian/rules openais-1.0.0/debian/rules
--- openais-1.0.0/debian/rules	2009-07-29 17:10:55.000000000 +0200
+++ openais-1.0.0/debian/rules	2009-07-29 17:20:28.000000000 +0200
@@ -20,6 +20,8 @@
 
 clean:
 	dh_testdir
+	$(MAKE) clean || true
+	rm -rf config.log config.status include/config.h include/Makefile include/oa_config.h include/stamp-h* init/Makefile lib/.deps lib/Makefile Makefile man/Makefile pkgconfig/Makefile services/.deps services/Makefile test/.deps test/Makefile 
 	dh_clean configure-stamp
 
 install: build
_______________________________________________
Mailing list: https://launchpad.net/~ubuntu-ha
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~ubuntu-ha
More help   : https://help.launchpad.net/ListHelp

Reply via email to