-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

reassign 692295 couchdb 1.2.0-2
found 692295 1.2.0-1
retitle 692295 Uses SIGHUP instead of SIGTERM for graceful shutdown
tags 692295 + patch
tags 692295 + upstream
severity 692295 serious
kthxbye

After a bit of discussion with various parties and thinking a lot about 
the issue, I came to the conclusion that using SIGHUP for graceful 
shutdown is not acceptable. I tested that using SIGTERM also triggers a 
graceful shutdown (well, it has to, because simpler init systems, like on 
many BSD flavours, simply sends SIGTERM to all processes upon shutdown 
...) and patched the wrapper script accordingly.

Attached is a trivial patch that repaces SIGHUP with SIGTERM and it solves 
the problem. This should be reported upstream and discussed with the 
developers.

However, I think the patch should be applied in Debian, probably by 
sponsoring the NMU published at 
http://mentors.debian.net/debian/pool/main/c/couchdb/couchdb_1.2.0-2.1.dsc 
.

Cheers,
Nik
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.19 (GNU/Linux)

iQFOBAEBAgA4BQJQs2F9MRpodHRwczovL3d3dy5kb21pbmlrLWdlb3JnZS5kZS9n
cGctcG9saWN5LnR4dC5hc2MACgkQWfyOHW8qgAGJEQf/R/Eosdwnx1JIuCAjUy6T
HNfRY2DDub0+b2SWUWe/PsrsI5IcLorZcIDk7GdeEO0LvtQ/RQjKcTDKos/teKqn
RPGbq4cIKa6L3aLLbnO8KgWfqLBf4C/vxPmNOWOTocJxTWOcic8AHyJesD34elti
i6iQp6lbKvEistMSTGaxxBcbWQqyEftsghn2tL1Z4O9vqzEuddCGgtfTiDk20XDX
roMqkygWlENk/POP2L7m4QZGGaJGgIVICDEpVArGxUIU+5U15T4A33CDZNduKETL
MsVnhbXAiuNVjWDeT32CivIrNb27MgBFCOMOyhACmfq204yYirfAdIyWdzPigfpC
iQ==
=qv0V
-----END PGP SIGNATURE-----
diff -Nru couchdb-1.2.0/debian/changelog couchdb-1.2.0/debian/changelog
--- couchdb-1.2.0/debian/changelog	2012-11-26 12:55:21.000000000 +0100
+++ couchdb-1.2.0/debian/changelog	2012-07-19 20:35:03.000000000 +0200
@@ -1,11 +1,3 @@
-couchdb (1.2.0-2.1) unstable; urgency=low
-
-  * Non-maintainer upload.
-  * Use SIGTERM instead of SIGHUP for graceful shutdown
-    (Closes: #692295) [varacanero]
-
- -- Dominik George <[email protected]>  Mon, 26 Nov 2012 12:54:05 +0100
-
 couchdb (1.2.0-2) unstable; urgency=low
 
   * Make couchdb user own its run directory (closes: #681549).
diff -Nru couchdb-1.2.0/debian/patches/couchdb_sighup.patch couchdb-1.2.0/debian/patches/couchdb_sighup.patch
--- couchdb-1.2.0/debian/patches/couchdb_sighup.patch	2012-11-26 12:57:45.000000000 +0100
+++ couchdb-1.2.0/debian/patches/couchdb_sighup.patch	1970-01-01 01:00:00.000000000 +0100
@@ -1,22 +0,0 @@
-Description: Use SIGTERM instead of SIGHUP for graceful shutdown
- The SIGHUP couchdb uses by default for a graceful shutdown does not
- work reliably in Debian as apt, when installing the package, SigIgn
- masks SIGHUP for all its child processes. This is intentional and hard
- to work around, and CouchDB does a graceful shutdown with SIGTERM as
- well so there is no reason to use SIGHUP.
-Author: Dominik George <[email protected]>
-Bug-Debian: http://bugs.debian.org/692295
-
----
-
---- couchdb-1.2.0.orig/bin/couchdb.tpl.in
-+++ couchdb-1.2.0/bin/couchdb.tpl.in
-@@ -272,7 +272,7 @@ stop_couchdb () {
-             echo > $PID_FILE
-         fi
-         if kill -0 $PID 2> /dev/null; then
--            if kill -1 $PID 2> /dev/null; then
-+            if kill -15 $PID 2> /dev/null; then
-                 if test "$1" = "false"; then
-                     echo "Apache CouchDB has been shutdown."
-                 else
diff -Nru couchdb-1.2.0/debian/patches/series couchdb-1.2.0/debian/patches/series
--- couchdb-1.2.0/debian/patches/series	2012-11-26 12:55:43.000000000 +0100
+++ couchdb-1.2.0/debian/patches/series	2012-07-19 20:46:55.000000000 +0200
@@ -1,3 +1,2 @@
 force-reload.patch
 couchdb_own_rundir.patch
-couchdb_sighup.patch
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

diff -Nru couchdb-1.2.0/debian/changelog couchdb-1.2.0/debian/changelog
- --- couchdb-1.2.0/debian/changelog    2012-11-26 12:55:21.000000000 +0100
+++ couchdb-1.2.0/debian/changelog      2012-07-19 20:35:03.000000000 +0200
@@ -1,11 +1,3 @@
- -couchdb (1.2.0-2.1) unstable; urgency=low
- -
- -  * Non-maintainer upload.
- -  * Use SIGTERM instead of SIGHUP for graceful shutdown
- -    (Closes: #692295) [varacanero]
- -
- - -- Dominik George <[email protected]>  Mon, 26 Nov 2012 12:54:05 +0100
- -
 couchdb (1.2.0-2) unstable; urgency=low
 
   * Make couchdb user own its run directory (closes: #681549).
diff -Nru couchdb-1.2.0/debian/patches/couchdb_sighup.patch 
couchdb-1.2.0/debian/patches/couchdb_sighup.patch
- --- couchdb-1.2.0/debian/patches/couchdb_sighup.patch 2012-11-26 
12:57:45.000000000 +0100
+++ couchdb-1.2.0/debian/patches/couchdb_sighup.patch   1970-01-01 
01:00:00.000000000 +0100
@@ -1,22 +0,0 @@
- -Description: Use SIGTERM instead of SIGHUP for graceful shutdown
- - The SIGHUP couchdb uses by default for a graceful shutdown does not
- - work reliably in Debian as apt, when installing the package, SigIgn
- - masks SIGHUP for all its child processes. This is intentional and hard
- - to work around, and CouchDB does a graceful shutdown with SIGTERM as
- - well so there is no reason to use SIGHUP.
- -Author: Dominik George <[email protected]>
- -Bug-Debian: http://bugs.debian.org/692295
- -
- ----
- -
- ---- couchdb-1.2.0.orig/bin/couchdb.tpl.in
- -+++ couchdb-1.2.0/bin/couchdb.tpl.in
- -@@ -272,7 +272,7 @@ stop_couchdb () {
- -             echo > $PID_FILE
- -         fi
- -         if kill -0 $PID 2> /dev/null; then
- --            if kill -1 $PID 2> /dev/null; then
- -+            if kill -15 $PID 2> /dev/null; then
- -                 if test "$1" = "false"; then
- -                     echo "Apache CouchDB has been shutdown."
- -                 else
diff -Nru couchdb-1.2.0/debian/patches/series 
couchdb-1.2.0/debian/patches/series
- --- couchdb-1.2.0/debian/patches/series       2012-11-26 12:55:43.000000000 
+0100
+++ couchdb-1.2.0/debian/patches/series 2012-07-19 20:46:55.000000000 +0200
@@ -1,3 +1,2 @@
 force-reload.patch
 couchdb_own_rundir.patch
- -couchdb_sighup.patch
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.19 (GNU/Linux)

iQFOBAEBAgA4BQJQs2EeMRpodHRwczovL3d3dy5kb21pbmlrLWdlb3JnZS5kZS9n
cGctcG9saWN5LnR4dC5hc2MACgkQWfyOHW8qgAFL1wf8CR7dSBjynVM7t4g8dAY1
f+lzHbVwuBWHLhRQ2DU+yMqj/WAXCMwObwxcWlhN8PRMrMrVo5UGUGJOlJ/8FqbV
eGlZVCjMkbkVEwUNup3E4/POoy58b7y5Quf4yYDPspOpxe/F6Qd2s4l45acE87rR
CiVc2KW0QeNwq4w+jRdaCfgvnsa66vppCKsq4YNC6sdlnDhPNlX0jkFOinLDVCV+
YTQqx66SBCaglo2gTc3aDHj4l4fHH+9a52VwRGOeogmhJtA3ma2cujVFNHOwid0J
dVcZEFvI9sBW5nC0YVJXnMdTD+PBF66nDRENEP2FJrUzihtYTm77uZNx0faUr74u
1A==
=UZOP
-----END PGP SIGNATURE-----

Reply via email to