[Pkg-erlang-commits] r1247 - in couchdb/trunk/debian: . patches

sbisbee-guest at alioth.debian.org sbisbee-guest at alioth.debian.org
Sun May 30 02:56:04 UTC 2010


Author: sbisbee-guest
Date: 2010-05-30 02:56:03 +0000 (Sun, 30 May 2010)
New Revision: 1247

Modified:
   couchdb/trunk/debian/changelog
   couchdb/trunk/debian/patches/init.patch
Log:
adding reload to init file, per lintian

Modified: couchdb/trunk/debian/changelog
===================================================================
--- couchdb/trunk/debian/changelog	2010-05-18 03:19:40 UTC (rev 1246)
+++ couchdb/trunk/debian/changelog	2010-05-30 02:56:03 UTC (rev 1247)
@@ -3,8 +3,10 @@
   * Updated debian/control, removing mawk as a dependency per
     http://lists.debian.org/debian-release/2010/05/msg00176.html. Reverses
     addition of dependency in 0.10.1-1 (see #522051).
+  * Updated debian/patches/init.patch, added reload functionality to the init
+    file (displays a note and fails).
 
- -- Sam Bisbee <sbisbee at computervip.com>  Mon, 17 May 2010 22:40:03 -0400
+ -- Sam Bisbee <sbisbee at computervip.com>  Sat, 29 May 2010 22:54:37 -0400
 
 couchdb (0.11.0-1) unstable; urgency=medium (security fixes)
 

Modified: couchdb/trunk/debian/patches/init.patch
===================================================================
--- couchdb/trunk/debian/patches/init.patch	2010-05-18 03:19:40 UTC (rev 1246)
+++ couchdb/trunk/debian/patches/init.patch	2010-05-30 02:56:03 UTC (rev 1247)
@@ -1,81 +1,70 @@
---- 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-03-08 22:18:35.000000000 -0500
-@@ -33,8 +33,12 @@
- RUN_DIR=%localstaterundir%
- 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 +81,7 @@
-         command="$command $COUCHDB_OPTIONS"
-     fi
-     mkdir -p "$RUN_DIR"
-+    cd "$RUN_DIR"
-     if test -n "$COUCHDB_USER"; then
-         chown $COUCHDB_USER "$RUN_DIR"
-         if su $COUCHDB_USER -c "$command" > /dev/null; then
-@@ -96,23 +101,50 @@
- stop_couchdb () {
-     # Stop the running Apache CouchDB process.
- 
-+    pidFile="$RUN_DIR/couchdb.pid"
-+    if [ ! -r "$pidFile" ] 
-+    then
-+        #exists, but can't read it 
-+        [ -f "$pidFile" ] && return $SCRIPT_ERROR
-+
-+        #doesn't exist, so assume couchdb is already stopped
-+        return $SCRIPT_OK
-+    fi
-+
-+    pid=`cat $pidFile` 
-+    #unset $pidFile 
-+    [ -z "$pid" ] && return $SCRIPT_OK
-+
-     command="$COUCHDB -d"
-     if test -n "$COUCHDB_OPTIONS"; then
-         command="$command $COUCHDB_OPTIONS"
-     fi
-+
-+    # We need `heart`'s pid because its ppid is set to 1 when the beam proc
-+    # ends, thereby hiding itself from our `ps` check bellow.
-+    heart_pid=`ps -f --ppid $pid | grep "heart -pid $pid " | awk '{print $2}'`
-+    [ -n "$heart_pid" ] && heart_pid=",$heart_pid" #for `ps` call formatting
-+
-     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 -p $pid$heart_pid --ppid $pid$heart_pid > /dev/null 
-+    do
-+        [ $i -ge $STOP_GRACE_TIME ] && return $SCRIPT_ERROR
-+
-+        sleep 1
-+        i=`expr $i + 1`
-+    done
-+
-+    return $SCRIPT_OK
- }
- 
- display_status () {
+--- couchdb-0.11.0/etc/init/couchdb.tpl.in	2010-03-17 16:37:38.000000000 -0400
++++ couchdb-0.11.0.new/etc/init/couchdb.tpl.in	2010-05-29 22:35:36.000000000 -0400
+35a36,39
+> # 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
+> 
+37c41
+<     exit $SCRIPT_ERROR
+---
+>     exit $SCRIPT_OK
+79a84
+>     cd "$RUN_DIR"
+98a104,117
+>     pidFile="$RUN_DIR/couchdb.pid"
+>     if [ ! -r "$pidFile" ] 
+>     then
+>         #exists, but can't read it 
+>         [ -f "$pidFile" ] && return $SCRIPT_ERROR
+> 
+>         #doesn't exist, so assume couchdb is already stopped
+>         return $SCRIPT_OK
+>     fi
+> 
+>     pid=`cat $pidFile` 
+>     #unset $pidFile 
+>     [ -z "$pid" ] && return $SCRIPT_OK
+> 
+102a122,127
+> 
+>     # We need `heart`'s pid because its ppid is set to 1 when the beam proc
+>     # ends, thereby hiding itself from our `ps` check bellow.
+>     heart_pid=`ps -f --ppid $pid | grep "heart -pid $pid " | awk '{print $2}'`
+>     [ -n "$heart_pid" ] && heart_pid=",$heart_pid" #for `ps` call formatting
+> 
+104,106c129
+<         if su $COUCHDB_USER -c "$command" > /dev/null; then
+<             return $SCRIPT_OK
+<         else
+---
+>         if ! su $COUCHDB_USER -c "$command" > /dev/null; then
+110,112c133
+<         if $command > /dev/null; then
+<             return $SCRIPT_OK
+<         else
+---
+>         if ! $command > /dev/null; then
+115a137,147
+> 
+>     i=0
+>     while ps -p $pid$heart_pid --ppid $pid$heart_pid > /dev/null 
+>     do
+>         [ $i -ge $STOP_GRACE_TIME ] && return $SCRIPT_ERROR
+> 
+>         sleep 1
+>         i=`expr $i + 1`
+>     done
+> 
+>     return $SCRIPT_OK
+158a191,196
+> 
+>         reload)
+>             log_daemon_msg "You must restart $NAME to reload its config, or use its HTTP REST API at /_config"
+>             exit $SCRIPT_ERROR
+>             ;;
+> 
+161c199
+< Usage: $SCRIPT_NAME {start|stop|restart|status}
+---
+> Usage: $SCRIPT_NAME {start|stop|restart|reload|status}




More information about the Pkg-erlang-commits mailing list