[Pkg-erlang-commits] r1177 - in couchdb/trunk/debian: . patches
sbisbee-guest at alioth.debian.org
sbisbee-guest at alioth.debian.org
Wed Feb 3 04:18:25 UTC 2010
Author: sbisbee-guest
Date: 2010-02-03 04:18:25 +0000 (Wed, 03 Feb 2010)
New Revision: 1177
Removed:
couchdb/trunk/debian/preinst
Modified:
couchdb/trunk/debian/changelog
couchdb/trunk/debian/patches/init.patch
Log:
replacing the killall patch with a grace period patch to the init file
Modified: couchdb/trunk/debian/changelog
===================================================================
--- couchdb/trunk/debian/changelog 2010-01-22 05:23:35 UTC (rev 1176)
+++ couchdb/trunk/debian/changelog 2010-02-03 04:18:25 UTC (rev 1177)
@@ -4,8 +4,16 @@
* Updated debian/control, added Elliot to Uploaders
* Dropped $ENABLE_SERVER portion of debian/patches/init.patch
- -- Elliot Murphy <elliot at ubuntu.com> Mon, 18 Jan 2010 23:30:25 -0500
+ [ Sam Bisbee ]
+ * Updated debian/patches/init.patch, adding a grace period to the init
+ script's stop task to allow couchdb's child processes (beam, heart, etc.) a
+ chance to exit before deciding whether the task was successful or not.
+ * Removed debian/preinst, undoing killall preinst patch from 0.10.0-1 that is
+ no longer needed due to the grace period init patch in this release.
+ (closes: #562901)
+ -- Sam Bisbee <sbisbee at computervip.com> Tue, 02 Feb 2010 23:10:21 -0500
+
couchdb (0.10.1-1) unstable; urgency=low
* New upstream release (closes: #550782).
Modified: couchdb/trunk/debian/patches/init.patch
===================================================================
--- couchdb/trunk/debian/patches/init.patch 2010-01-22 05:23:35 UTC (rev 1176)
+++ couchdb/trunk/debian/patches/init.patch 2010-02-03 04:18:25 UTC (rev 1177)
@@ -1,15 +1,28 @@
---- apache-couchdb-0.9.1/etc/init/couchdb.tpl.in
-+++ apache-couchdb-0.9.1.new/etc/init/couchdb.tpl.in
-@@ -34,7 +34,7 @@
+--- couchdb-0.10.1/etc/init/couchdb.tpl.in 2009-07-14 16:21:39.000000000 -0400
++++ couchdb-0.10.1.new/etc/init/couchdb.tpl.in 2010-01-25 20:49:25.000000000 -0500
+@@ -28,13 +28,17 @@
+ DESCRIPTION="database server"
+ NAME=couchdb
+ SCRIPT_NAME=`basename $0`
+-COUCHDB=%bindir%/%couchdb_command_name%
+-CONFIGURATION_FILE=%sysconfdir%/default/couchdb
+-RUN_DIR=%localstaterundir%
++COUCHDB=/usr/bin/couchdb
++CONFIGURATION_FILE=/etc/default/couchdb
++RUN_DIR=/var/run/couchdb
LSB_LIBRARY=/lib/lsb/init-functions
++# Grace time in seconds to give the beam process to stop when we're running the
++# stop target. Will end before grace time ends if the process ends sooner.
++STOP_GRACE_TIME=5
++
if test ! -x $COUCHDB; then
- exit $SCRIPT_ERROR
+ exit $SCRIPT_OK
fi
if test -r $CONFIGURATION_FILE; then
-@@ -77,6 +77,7 @@
+@@ -77,6 +81,7 @@
command="$command $COUCHDB_OPTIONS"
fi
mkdir -p "$RUN_DIR"
@@ -17,3 +30,43 @@
if test -n "$COUCHDB_USER"; then
chown $COUCHDB_USER "$RUN_DIR"
if su $COUCHDB_USER -c "$command" > /dev/null; then
+@@ -100,19 +105,33 @@
+ if test -n "$COUCHDB_OPTIONS"; then
+ command="$command $COUCHDB_OPTIONS"
+ fi
++
++ # Need to record here, before the file gets wiped.
++ pid=`cat /var/run/couchdb/couchdb.pid`
++
+ if test -n "$COUCHDB_USER"; then
+- if su $COUCHDB_USER -c "$command" > /dev/null; then
+- return $SCRIPT_OK
+- else
++ if ! su $COUCHDB_USER -c "$command" > /dev/null; then
+ return $SCRIPT_ERROR
+ fi
+ else
+- if $command > /dev/null; then
+- return $SCRIPT_OK
+- else
++ if ! $command > /dev/null; then
+ return $SCRIPT_ERROR
+ fi
+ fi
++
++ i=0
++ while ps -f -p $pid --ppid $pid > /dev/null
++ do
++ i=`expr $i + 1`
++ if [ $i -ge $STOP_GRACE_TIME ]
++ then
++ return $SCRIPT_ERROR
++ fi
++
++ sleep 1
++ done
++
++ return $SCRIPT_OK
+ }
+
+ display_status () {
Deleted: couchdb/trunk/debian/preinst
===================================================================
--- couchdb/trunk/debian/preinst 2010-01-22 05:23:35 UTC (rev 1176)
+++ couchdb/trunk/debian/preinst 2010-02-03 04:18:25 UTC (rev 1177)
@@ -1,29 +0,0 @@
-#!/bin/sh -e
-# by Sam Bisbee <sbisbee at computervip.com> Copyright 2009
-# The right to copy, distribute, and modify this file in any medium is released
-# to anyone without royalty, provided that this notice and the copyright notice
-# is preserved.
-
-case "$1" in
- install)
- ;;
-
- upgrade)
- #Prevent old couchdb code from running in a couchdb process and surviving
- #through to our new version. Assumes that it's running as the default
- #couchdb user.
- killall -q -u couchdb beam > /dev/null || true
- ;;
-
- abort-upgrade)
- ;;
-
- *)
- echo "preinst called with unknown argument $1" >&2
- exit 1
- ;;
-esac
-
-#DEBHELPER#
-
-exit 0
More information about the Pkg-erlang-commits
mailing list