source: trunk/packages/invirt-dev/debian/invirt-dev.init @ 2634

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

Make the apt repo directory structure exist if it doesn't already.

  • Property svn:executable set to *
File size: 1.3 KB
Line 
1#!/bin/bash
2### BEGIN INIT INFO
3# Provides:          invirt-dev
4# Required-Start:    $local_fs $remote_fs
5# Required-Stop:     $local_fs $remote_fs
6# Default-Start:     2 3 4 5
7# Default-Stop:      0 1 6
8# Short-Description: Invirt development configuration
9# Description:       
10### END INIT INFO
11
12# Author: Invirt project <invirt@mit.edu>
13
14# Do NOT "set -e"
15
16NAME=invirt-dev
17GEN_FILES=/srv/repository/conf/distributions
18
19. /lib/init/std-init.sh
20. /lib/init/gen-files.sh
21
22do_start()
23{
24    # Return
25    #  0 if daemon has been started
26    #  1 if daemon was already running
27    #  2 if daemon could not be started
28    ret=0
29
30    gen_files || ret=2
31    for d in db dists lists pool; do
32        dir="/srv/repository/$d"
33        if ! [ -e "$dir" ]; then
34            mkdir -p "$dir"
35        fi
36        chown -R repository:nogroup "$dir"
37    done
38    reprepro-env export || ret=2
39
40    invirt-build-conf || ret=2
41
42    daemon -n invirt-dev-git-daemon -- git daemon \
43        --user=git \
44        --group=nogroup \
45        --syslog \
46        --verbose \
47        --reuseaddr \
48        --export-all \
49        --base-path=/srv/git \
50        /srv/git || ret=$?
51
52    return $ret
53}
54
55do_stop()
56{
57    daemon -n invirt-dev-git-daemon --stop
58    return $?
59}
60
61do_reload()
62{
63    do_start
64}
65
66std_init "$@"
Note: See TracBrowser for help on using the repository browser.