Please sync (sort of) couchdb 1.2.0-1 from Debian unstable

Bug #1022515 reported by Jason Gerard DeRose
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
couchdb (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

I'd like to see CouchDB 1.2.0 synced from Debian, but adding in a couchdb/couchdb-bin split similar to what was done by the desktopcouch folks for the current Ubuntu 1.0.1 package.

This split is critical for Novacut and Dmedia because otherwise our users have an unused system-wide CouchDB running for no reason. We've been maintaining our own newer CouchDB packages in our PPA, and I'd love to stop doing that.

For more background, I tried to do something similar for CouchDB 1.1.1 in Precise, but didn't make it in time:

https://bugs.launchpad.net/ubuntu/+source/couchdb/+bug/903098

== Current Status ==

I have a debdiff attached, ready for review, and I have test packages for Precise and Quantal in ppa:novacut/daily:
https://launchpad.net/~novacut/+archive/daily

I've found no regressions from the 1.0.1 Ubuntu package. There's still one nasty issue (also present in 1.0.1) that I hope to resolve, but haven't yet. The issue is you can't stop the daemon immediately after installation. For example, this doesn't work:

sudo apt-get install couchdb
sudo /etc/init.d/couchdb stop

But this does work:

sudo apt-get install couchdb
<reboot>
sudo /etc/init.d/couchdb stop

== What needs further testing ==

I don't use system-wide CouchDB on a regular basis, so I need help testing the `couchdb` side of the split.

In particular, if there is anyone running the 1.0.1 package in a production setting, I need feedback on whether the permission and ownership changes I made in /etc/couchdb cause any issues for you during/after an upgrade to my 1.2.0 package.

== debian/changelog ==

couchdb (1.2.0-1ubuntu1) quantal; urgency=low

  * Started with branch of 1.2.0-1 from Debian unstable
  * Split into `couchdb-bin` and `couchdb` binary packages as found in Ubuntu,
    with goal of keeping delta between Debian and Ubuntu as low as possible
  * Changes from how the split is done in Ubuntu:
    - /etc/couchdb/default.ini and /etc/couchdb/default.d are delivered in the
      `couchdb-bin` package and are owned by root
    - /etc/couchdb/local.ini and /etc/couchdb/local.d are delivered in the
      `couchdb` package and are owned by the "couchdb" user
    - The `couchdb-bin` package does not create nor require the "couchdb" user
      (this is now done in the `couchdb` package instead)
  * Changes from Debian:
    - After couchdb.postinst runs, only /etc/couchdb/local.ini and
      /etc/couchdb/local.d are owned by the "couchdb" user, while the rest of
      /etc/couchdb remains owned by root
    - Patched /etc/init.d/couchdb so /var/run/couchdb is owned by the "couchdb"
      user, needed for the init.d script to actually work (var-run.patch)
    - 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
    - Added couchdb-bin.postinst to fix permissions in /etc/couchdb after
      upgrading from the couchdb-bin 1.0.1 package

Tags: patch novacut
tags: added: novacut
Revision history for this message
Jason Gerard DeRose (jderose) wrote :

Okay, I fixed the /etc/init.d/couchdb script issue.

I also seemingly fixed the `apt-get purge couchdb` problem, but sometimes it still fails. The issue is `/etc/init.d/couchdb stop` is async, so when couchdb.postrm tries to deluser couchdb, that user still has processes running, making deluser and the couchdb.postrm script fail.

Revision history for this message
Jason Gerard DeRose (jderose) wrote :

More work on the init.d script...

The remaining, strange issue is for some reason you can't stop the daemon after the package install... but if you reboot, then it works. For example, this doesn't work:

sudo apt-get install couchdb
sudo /etc/init.d/couchdb stop

But this does work:

sudo apt-get install couchdb
<reboot>
sudo /etc/init.d/couchdb stop

The same issue exists in the current Ubuntu 1.0.1 package:

https://bugs.launchpad.net/ubuntu/+source/couchdb/+bug/1024924

Revision history for this message
Jason Gerard DeRose (jderose) wrote :

Also note that 1.2.0 test packages are available for Precise and Quantal in ppa:novacut/daily:

https://launchpad.net/~novacut/+archive/daily

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in couchdb (Ubuntu):
status: New → Confirmed
Revision history for this message
Jason Gerard DeRose (jderose) wrote :

After fixing a finial lintian warning (that I introduced), I think it's ready for review. Here's the debdiff.

Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "couchdb_1.2.0-1_to_couchdb_1.2.0-1ubuntu1.debdiff" of this bug report has been identified as being a patch in the form of a debdiff. The ubuntu-sponsors team has been subscribed to the bug report so that they can review and hopefully sponsor the debdiff. In the event that this is in fact not a patch you can resolve this situation by removing the tag 'patch' from the bug report and editing the attachment so that it is not flagged as a patch. Additionally, if you are member of the ubuntu-sponsors team please also unsubscribe the team from this bug report.

[This is an automated message performed by a Launchpad user owned by Brian Murray. Please contact him regarding any issues with the action taken in this bug report.]

tags: added: patch
description: updated
description: updated
description: updated
description: updated
description: updated
Revision history for this message
Steve Langasek (vorlon) wrote :

I'm preparing a merge of this package now; I have the following differences to your version:
 - based on 1.2.0-2 from Debian, not 1.2.0-1
 - uses the Debian+Ubuntu changelog history
 - Retains the Suggests: couchdb on couchdb-bin from Ubuntu (for now)
 - debian/couchdb-bin.postinst: guard the chown handling with a version check, so that we don't apply these changes on every package upgrade and further annoy users who are doing something custom with their permissions
 - retain debian/couchdb-bin.postrm. This package still needs to be responsible for trying to clean up the /etc/couchdb directory on purge.
 - debian/couchdb.postrm: don't rm /etc/couchdb/local.ini, this is a conffile so already taken care of for us; and don't remove the couchdb user/group on purge. See endless discussions on debian-devel about this.
 - debian/patches/var-run.patch is in Debian as debian/patches/couchdb_own_rundir.patch. Use the Debian name.
 - debian/rules:
   - erlang-depends doesn't need -pcouchdb-bin passed; it will dtrt without this delta from Debian (not your doing, this change was inherited from Ubuntu)
   - calling dh_fixperms is pointless (and this is so in the Debian package, too), because cdbs already calls it for us.

Everything else looks good. I'll be uploading to quantal shortly - thanks!

Changed in couchdb (Ubuntu):
status: Confirmed → In Progress
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package couchdb - 1.2.0-2ubuntu1

---------------
couchdb (1.2.0-2ubuntu1) quantal; urgency=low

  * Merge from Debian unstable (LP: #1022515, LP: #817656):
    - fixes ownership of /etc/couchdb. LP: #731272.
  * Remaining changes:
    - Use pkg-config instead of the js-config script shipped by libmozjs
    - debian/rules, debian/control: split couchdb and couchdb-bin
    - debian/postinst: renamed to couchdb-bin.postinst
    - debian/couchdb-bin.postrm: don't try to delete couchdb system
      user/group
  * Dropped changes, superseded upstream:
    - Backport svn r1039345 from 1.0.3
    - debian/patches/couchio-*: patchset from CouchIO to fix U1 replication
      over SSL. It's not clear if these were upstreamed, but most of the
      source files they applied to no longer exist at all upstream, so if
      these are still needed they will need to be redone.
    - debian/patches/fix-help2man.patch: dropped, no longer needed
    - debian/patches/jquery15-fix.patch: Make Futon work with jQuery 1.5
    - debian/patches/moz*.patch: Spidermonkey 1.8.54 patchset
  * Dropped changes, included in Debian:
    - debian/control - bump standards version
    - debian/control - fix lintian error not-binnmuable-all-depends-any
    - Build against a proper libmozjs
    - Update build-depends/depends/build config (we no longer need the
      --with-js build flags)
  * Dropped changes, superseded in Debian:
    - source/format - mark package as 1.0 format
    - change the default permissions on /etc/couchdb to 0775 and files to
      0664

  [ Jason Gerard DeRose ]
  * /etc/couchdb/default.ini and /etc/couchdb/default.d are delivered in the
    `couchdb-bin` package and are owned by root
  * /etc/couchdb/local.ini and /etc/couchdb/local.d are delivered in the
  * The `couchdb-bin` package does not create nor require the "couchdb" user
    (this is now done in the `couchdb` package instead). LP: #1007125.
  * 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
 -- Steve Langasek <email address hidden> Tue, 31 Jul 2012 02:04:48 +0000

Changed in couchdb (Ubuntu):
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.