From 61e02642cf0c2d3a41673b19d0e37be7c9cbbebc Mon Sep 17 00:00:00 2001 From: Evan Broder Date: Thu, 17 Dec 2009 22:07:05 -0500 Subject: [PATCH] Run git-daemon as an inetd service instead of a separate daemon. git-daemon doesn't run well under daemon(1), because it forks a child (without detaching) that does all of its work, and killing the parent doesn't kill the child. svn path=/trunk/packages/invirt-dev/; revision=2636 --- debian/control | 2 +- debian/invirt-dev.init | 13 +------------ debian/invirt-dev.postinst | 3 +++ debian/invirt-dev.prerm | 4 +++- 4 files changed, 8 insertions(+), 14 deletions(-) diff --git a/debian/control b/debian/control index b0fd8be..a805ef9 100644 --- a/debian/control +++ b/debian/control @@ -7,6 +7,6 @@ Standards-Version: 3.7.2 Package: invirt-dev Architecture: all -Depends: ${shlibs:Depends}, ${misc:Depends}, dpkg-dev-el, emacs21, reprepro, apache2, postfix, screen, dh-make, fakeroot, quilt, patchutils, config-package-dev, pbuilder, equivs, invirt-base, invirt-database, remctl-server +Depends: ${shlibs:Depends}, ${misc:Depends}, dpkg-dev-el, emacs21, reprepro, apache2, postfix, screen, dh-make, fakeroot, quilt, patchutils, config-package-dev, pbuilder, equivs, invirt-base, invirt-database, remctl-server, update-inetd, openbsd-inetd | inet-superserver Description: Invirt build and apt server This packages the build scripts and apt-repository configuration for Invirt. diff --git a/debian/invirt-dev.init b/debian/invirt-dev.init index a12cac3..372d8f2 100755 --- a/debian/invirt-dev.init +++ b/debian/invirt-dev.init @@ -37,23 +37,12 @@ do_start() invirt-build-conf || ret=2 - daemon -n invirt-dev-git-daemon -- git daemon \ - --user=git \ - --group=nogroup \ - --syslog \ - --verbose \ - --reuseaddr \ - --export-all \ - --base-path=/srv/git \ - /srv/git || ret=$? - return $ret } do_stop() { - daemon -n invirt-dev-git-daemon --stop - return $? + : } do_reload() diff --git a/debian/invirt-dev.postinst b/debian/invirt-dev.postinst index 7427c1f..49fe62c 100755 --- a/debian/invirt-dev.postinst +++ b/debian/invirt-dev.postinst @@ -26,6 +26,9 @@ case "$1" in ### END invirt-dev EOF + update-inetd --add \ + 'git\tstream\ttcp\tnowait\tgit\t/usr/bin/git\tgit daemon --inetd --syslog --verbose --export-all --base-path=/srv/git /srv/git' + echo "-----" echo "invirt-dev: run" echo " adduser --disabled-password \$user" diff --git a/debian/invirt-dev.prerm b/debian/invirt-dev.prerm index c86e7d3..80d7817 100755 --- a/debian/invirt-dev.prerm +++ b/debian/invirt-dev.prerm @@ -19,7 +19,9 @@ set -e case "$1" in remove|upgrade|deconfigure) - perl -i.bak -ne 's%^### (BEGIN|END) invirt-dev\s*$%%m && ($skip = ($1 eq "BEGIN")); print unless $skip;' /etc/sudoers + [ "$1" = "remove" ] && update-inetd --disable git + + perl -i.bak -ne 's%^### (BEGIN|END) invirt-dev\s*$%%m && ($skip = ($1 eq "BEGIN")); print unless $skip;' /etc/sudoers ;; failed-upgrade) -- 1.7.9.5