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

Last change on this file since 2633 was 2630, checked in by broder, 15 years ago

Pass --no-start to dh_installinit in invirt-dev and run the initscript
by hand.

This works around a bug where init scripts are started before Python
modules have been fully installed.

  • Property svn:executable set to *
File size: 1.1 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        echo "-----"
30        echo "invirt-dev: run"
31        echo "  adduser --disabled-password \$user"
32        echo "  adduser \$user repo"
33        echo "  adduser \$user sbuild"
34        echo "to make individual users that will build packages."
35        echo "-----"
36    ;;
37
38    abort-upgrade|abort-remove|abort-deconfigure)
39    ;;
40
41    *)
42        echo "postinst called with unknown argument \`$1'" >&2
43        exit 1
44    ;;
45esac
46
47if [ -x /etc/init.d/invirt-dev ]; then
48    if hash invoke-rc.d 2>/dev/null; then
49        invoke-rc.d invirt-dev start
50    else
51        /etc/init.d/invirt-dev start
52    fi
53fi
Note: See TracBrowser for help on using the repository browser.