source: trunk/packages/invirt-dev/debian/invirt-dev.postinst @ 2790

Last change on this file since 2790 was 2636, checked in by broder, 14 years ago

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.

  • Property svn:executable set to *
File size: 1.3 KB
Line 
1#!/bin/sh
2set -e
3
4#DEBHELPER#
5
6case "$1" in
7    configure)
8        if ! getent passwd repository >/dev/null 2>&1; then
9            adduser --system repository
10        fi
11        if ! getent group repo >/dev/null 2>&1; then
12            addgroup --system repo
13        fi
14
15        if ! getent passwd git >/dev/null 2>&1; then
16            adduser --system --home /srv/git --shell /usr/bin/git-shell git
17        fi
18
19        if ! [ -d /srv/git ]; then
20            mkdir -p /srv/git
21        fi
22
23        cat >>/etc/sudoers <<EOF
24### BEGIN invirt-dev
25%repo   ALL=(repository)        ALWAYS_SET_HOME,NOPASSWD: /usr/bin/reprepro
26### END invirt-dev
27EOF
28
29        update-inetd --add \
30            'git\tstream\ttcp\tnowait\tgit\t/usr/bin/git\tgit daemon --inetd --syslog --verbose --export-all --base-path=/srv/git /srv/git'
31
32        echo "-----"
33        echo "invirt-dev: run"
34        echo "  adduser --disabled-password \$user"
35        echo "  adduser \$user repo"
36        echo "  adduser \$user sbuild"
37        echo "to make individual users that will build packages."
38        echo "-----"
39    ;;
40
41    abort-upgrade|abort-remove|abort-deconfigure)
42    ;;
43
44    *)
45        echo "postinst called with unknown argument \`$1'" >&2
46        exit 1
47    ;;
48esac
49
50if [ -x /etc/init.d/invirt-dev ]; then
51    if hash invoke-rc.d 2>/dev/null; then
52        invoke-rc.d invirt-dev start
53    else
54        /etc/init.d/invirt-dev start
55    fi
56fi
Note: See TracBrowser for help on using the repository browser.