On Mon, 2012-11-12 at 21:28 +0000, Adam D. Barratt wrote:
> On Fri, 2012-10-12 at 05:22 +0000, Laszlo Boszormenyi (GCS) wrote:
> > On Thu, 2012-10-11 at 23:18 +0200, Julien Cristau wrote:
> > [ about CouchDB storing its PID file as root ]
> > > Ping.  Is this getting fixed?
> >  Upstream knows about this issue, promised a fix which won't be easy as
> > I can remember. Now they are busy with releasing 1.3.0 and a bugfix
> > branch of 1.2.0 . Don't know exactly if it's included, but will ping
> > them.
> 
> Any news on that?
 Nope. :( Upstream is still busy on how 1.3.0 should be released. I
don't get any answer as of yet.

Asking about upload permission of -3 targeting Wheezy with the attached
changes.
Fixes four RC bugs. The first one is that couchdb needs some time to
stop. Added three seconds wait time to stop in initscript and to postrm
(the latter comes from Ubuntu). Otherwise couchdb can't be restarted and
can't be purged.
The rundir is now created with the help of 'install', only if it doesn't
existed before.
Last, but not least the logrotate configuration is fixed. Now creates
and rotates logfiles as couchdb.

Regards,
Laszlo/GCS
diff -Nur couchdb-1.2.0-1/debian/changelog couchdb-1.2.0-3/debian/changelog
--- couchdb-1.2.0-1/debian/changelog	2012-06-29 20:31:16.000000000 +0200
+++ couchdb-1.2.0-3/debian/changelog	2012-11-18 21:11:08.000000000 +0100
@@ -1,3 +1,22 @@
+couchdb (1.2.0-3) unstable; urgency=low
+
+  * Rework couchdb own run directory (updates: #652172).
+  * Wait a bit for complete stop of service (closes: #692295).
+  * Use couchdb user for logrotate (closes: #652172).
+
+  [ Jason Gerard DeRose ]
+  * Added a short sleep delay in couchdb.postrm so couchdb is more likely to
+    have actually terminated by the time we `deluser couchdb`, which is needed
+    for `sudo apt-get purge couchdb` to work when couchdb is running
+
+ -- Laszlo Boszormenyi (GCS) <g...@debian.hu>  Sun, 18 Nov 2012 12:24:24 +0100
+
+couchdb (1.2.0-2) unstable; urgency=low
+
+  * Make couchdb user own its run directory (closes: #681549).
+
+ -- Laszlo Boszormenyi (GCS) <g...@debian.hu>  Thu, 19 Jul 2012 20:13:25 +0200
+
 couchdb (1.2.0-1) unstable; urgency=low
 
   * New major upstream release (closes: #672141).
diff -Nur couchdb-1.2.0-1/debian/patches/couchdb_own_rundir.patch couchdb-1.2.0-3/debian/patches/couchdb_own_rundir.patch
--- couchdb-1.2.0-1/debian/patches/couchdb_own_rundir.patch	1970-01-01 01:00:00.000000000 +0100
+++ couchdb-1.2.0-3/debian/patches/couchdb_own_rundir.patch	2012-11-18 21:32:47.696128156 +0100
@@ -0,0 +1,20 @@
+Description: Initscript creates RUN_DIR , make sure it's owned by couchdb
+ Use install to make COUCHDB_USER own the RUN_DIR being created.
+Author: Laszlo Boszormenyi (GCS) <g...@debian.hu>
+Bug-Debian: http://bugs.debian.org/681549
+Last-Update: 2012-11-18
+
+---
+
+--- couchdb-1.2.0.orig/etc/init/couchdb.tpl.in
++++ couchdb-1.2.0/etc/init/couchdb.tpl.in
+@@ -83,7 +83,8 @@ run_command () {
+ start_couchdb () {
+     # Start Apache CouchDB as a background process.
+ 
+-    mkdir -p "$RUN_DIR"
++    test -e "$RUN_DIR" || \
++        install -m 755 -o "$COUCHDB_USER" -g "$COUCHDB_USER" -d "$RUN_DIR"
+     command="$COUCHDB -b"
+     if test -n "$COUCHDB_STDOUT_FILE"; then
+         command="$command -o $COUCHDB_STDOUT_FILE"
diff -Nur couchdb-1.2.0-1/debian/patches/logrotate_as_couchdb.patch couchdb-1.2.0-3/debian/patches/logrotate_as_couchdb.patch
--- couchdb-1.2.0-1/debian/patches/logrotate_as_couchdb.patch	1970-01-01 01:00:00.000000000 +0100
+++ couchdb-1.2.0-3/debian/patches/logrotate_as_couchdb.patch	2012-11-18 21:31:42.084124771 +0100
@@ -0,0 +1,16 @@
+Description: Use logrotate as couchdb user
+ Use su and create to make logfiles owned by couchdb
+Author: Laszlo Boszormenyi (GCS) <g...@debian.hu>
+Bug-Debian: http://bugs.debian.org/652172
+Last-Update: 2012-11-18
+---
+
+--- couchdb-1.2.0.orig/etc/logrotate.d/couchdb.tpl.in
++++ couchdb-1.2.0/etc/logrotate.d/couchdb.tpl.in
+@@ -6,4 +6,6 @@
+        compress
+        notifempty
+        missingok
++       su couchdb couchdb
++       create 0640 couchdb couchdb
+ }
diff -Nur couchdb-1.2.0-1/debian/patches/series couchdb-1.2.0-3/debian/patches/series
--- couchdb-1.2.0-1/debian/patches/series	2011-11-27 09:19:17.000000000 +0100
+++ couchdb-1.2.0-3/debian/patches/series	2012-11-18 21:16:56.000000000 +0100
@@ -1 +1,4 @@
 force-reload.patch
+couchdb_own_rundir.patch
+logrotate_as_couchdb.patch
+wait_for_couchdb_stop.patch
diff -Nur couchdb-1.2.0-1/debian/patches/wait_for_couchdb_stop.patch couchdb-1.2.0-3/debian/patches/wait_for_couchdb_stop.patch
--- couchdb-1.2.0-1/debian/patches/wait_for_couchdb_stop.patch	1970-01-01 01:00:00.000000000 +0100
+++ couchdb-1.2.0-3/debian/patches/wait_for_couchdb_stop.patch	2012-11-18 21:20:05.000000000 +0100
@@ -0,0 +1,17 @@
+Description: Wait three seconds to let couchdb really stop
+ As couchdb needs some time to stop, wait a bit for that.
+Author: Laszlo Boszormenyi (GCS) <g...@debian.hu>
+Bug-Debian: http://bugs.debian.org/692295
+Last-Update: 2012-11-18
+---
+
+--- couchdb-1.2.0.orig/etc/init/couchdb.tpl.in
++++ couchdb-1.2.0/etc/init/couchdb.tpl.in
+@@ -102,6 +102,7 @@ stop_couchdb () {
+     # Stop the running Apache CouchDB process.
+ 
+     run_command "$COUCHDB -d" > /dev/null
++    sleep 3  # Time for couchdb to actually terminate
+ }
+ 
+ display_status () {
diff -Nur couchdb-1.2.0-1/debian/postrm couchdb-1.2.0-3/debian/postrm
--- couchdb-1.2.0-1/debian/postrm	2012-07-19 19:48:59.000000000 +0200
+++ couchdb-1.2.0-3/debian/postrm	2012-11-18 21:20:10.000000000 +0100
@@ -10,6 +10,7 @@
 
 case $1 in
     purge)
+        sleep 3  # Time for couchdb to actually terminate, so we can deluser
         if test -d "/etc/couchdb"; then
             rm -r -f "/etc/couchdb" 
         fi

Reply via email to