It turns out the "sv force-shutdown" command does not aggressively take down the log service; instead, ever since runit 0.7.2 (2003) it only closes a pipe connected to the log service's standard input as a hint that logging is not needed any more. In the case of git-daemon-run, this means as long as there are active connections remaining, the log service stays open, since the corresponding git-daemon or update-pack processes serving that connection remain alive and keep the pipe open.
Normally that behavior makes sense --- any active connections will finish soon, and it is nice to keep the logs. When purging the git-daemon-run package, though, the plan is to remove all logs and to remove or lock out the gitlog user (which the log process prevents, provoking the message "userdel: user gitlog is currently logged in"). So let's send the log service a TERM signal (using "sv down"), followed by a KILL signal a few seconds later (using "sv force-stop") to make sure the log service exits. There still can be outstanding forked copies of git-daemon (or backend commands like upload-pack) after a purge with this change; their error messages just won't be available. Continuing to serve active connections when easy seems like good behavior anyway, analogous to allowing applications to continue to run after their binaries have been removed. Fixes: http://bugs.debian.org/627314 Reported-by: Daniel Kahn Gillmor <d...@fifthhorseman.net> Signed-off-by: Jonathan Nieder <jrnie...@gmail.com> --- Hi Daniel, Daniel Kahn Gillmor wrote: > sorry to be the bearer of bad tidings. Thanks again. How about something like this patch? (Untested.) debian/changelog | 4 ++++ debian/git-daemon-run.postrm | 3 +++ 2 files changed, 7 insertions(+), 0 deletions(-) diff --git a/debian/changelog b/debian/changelog index 0bbb42e..c94b822 100644 --- a/debian/changelog +++ b/debian/changelog @@ -3,6 +3,10 @@ git (1:1.7.2.5-2.1) stable; urgency=low * debian/git-daemon/run: pass --reuseaddr to git-daemon so the server can restart without waiting for old connections to time out (thx Daniel Kahn Gillmor; closes: #609405). + * debian/git-daemon-run.postrm purge: terminate git-daemon/log + by sending signals instead of just closing its standard input, + so the git-daemon-run package can be purged even if there is a + connection active (thx Daniel Kahn Gillmor; closes: #627314). -- Jonathan Nieder <jrnie...@gmail.com> Fri, 20 May 2011 21:21:53 -0500 diff --git a/debian/git-daemon-run.postrm b/debian/git-daemon-run.postrm index 5e77e4d..09c9bfd 100644 --- a/debian/git-daemon-run.postrm +++ b/debian/git-daemon-run.postrm @@ -3,7 +3,10 @@ set -e test "$1" = 'purge' || exit 0 +sv down /etc/sv/git-daemon 2>/dev/null || : +sv down /etc/sv/git-daemon/log 2>/dev/null || : sv force-shutdown /etc/sv/git-daemon 2>/dev/null || : +sv force-stop /etc/sv/git-daemon/log 2>/dev/null || : rm -rf /etc/sv/git-daemon/supervise /etc/sv/git-daemon/log/supervise rm -rf /var/lib/supervise/git-daemon /var/lib/supervise/git-daemon.log -- 1.7.5.1 -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org