Gentoo Archives: gentoo-commits

From: "Daniel Black (dragonheart)" <dragonheart@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in dev-util/monotone/files: monotone-0.36.initd
Date: Sat, 30 Aug 2008 01:23:34
Message-Id: E1KZFBb-0007Mp-Vp@stork.gentoo.org
1 dragonheart 08/08/30 01:23:31
2
3 Modified: monotone-0.36.initd
4 Log:
5 added default values to init script. patch thanks to Dennis Schridde - bug #235037
6 (Portage version: 2.2_rc8/cvs/Linux 2.6.22-vs2.2.0.7-gentoo x86_64)
7
8 Revision Changes Path
9 1.2 dev-util/monotone/files/monotone-0.36.initd
10
11 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/dev-util/monotone/files/monotone-0.36.initd?rev=1.2&view=markup
12 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/dev-util/monotone/files/monotone-0.36.initd?rev=1.2&content-type=text/plain
13 diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/dev-util/monotone/files/monotone-0.36.initd?r1=1.1&r2=1.2
14
15 Index: monotone-0.36.initd
16 ===================================================================
17 RCS file: /var/cvsroot/gentoo-x86/dev-util/monotone/files/monotone-0.36.initd,v
18 retrieving revision 1.1
19 retrieving revision 1.2
20 diff -u -r1.1 -r1.2
21 --- monotone-0.36.initd 7 Oct 2007 12:34:03 -0000 1.1
22 +++ monotone-0.36.initd 30 Aug 2008 01:23:31 -0000 1.2
23 @@ -1,7 +1,7 @@
24 #!/sbin/runscript
25 # Copyright 2006 Gentoo Foundation
26 # Distributed under the terms of the GNU General Public License, v2 or later
27 -# $Header: /var/cvsroot/gentoo-x86/dev-util/monotone/files/monotone-0.36.initd,v 1.1 2007/10/07 12:34:03 opfer Exp $
28 +# $Header: /var/cvsroot/gentoo-x86/dev-util/monotone/files/monotone-0.36.initd,v 1.2 2008/08/30 01:23:31 dragonheart Exp $
29
30 opts="import"
31
32 @@ -10,6 +10,8 @@
33 }
34
35 # Substitute common default values
36 +MTN_USER=${MTN_USER:-monotone}
37 +MTN_GROUP=${MTN_GROUP:-monotone}
38 MTN_KEY=${MTN_KEY:-monotone@`hostname --fqdn`}
39 MTN_CONFDIR=${MTN_CONFDIR:-/etc/monotone}
40 MTN_COMMON="--norc --confdir=${MTN_CONFDIR} \
41 @@ -18,14 +20,14 @@
42 --rcfile=${MTN_CONFDIR}/hooks.lua --log=/var/log/monotone/monotone.log"
43 #--dump=$ERRORLOG
44 MTN_PIDFILE="/var/run/monotone/monotone.pid"
45 -MTN_HOME=$(awk -F: -vuid=$MTN_USER -vuser=$MTN_USER '$3 == uid || $1 == user { print $6 }' </etc/passwd)
46 +MTN_HOME=$(awk -F: -vuid=$MTN_USER -vuser=$MTN_USER '$3 == uid || $1 == user { print $6 }' < /etc/passwd)
47
48 dbexists() {
49 # Create the database if it doesn't exist
50 if [ ! -e ${MTN_DB:-/var/lib/monotone/default.mtn} ]; then
51 ebegin "Creating monotone database"
52 start-stop-daemon --start \
53 - --chuid ${MTN_USER:-monotone}:${MTN_GROUP:-monotone} \
54 + --chuid ${MTN_USER}:${MTN_GROUP} \
55 --exec /usr/bin/mtn -- ${MTN_COMMON} db init
56 eend $?
57 fi
58 @@ -34,7 +36,7 @@
59 export MTN_PWD=${RANDOM}
60 yes "${MTN_PWD}" | \
61 start-stop-daemon --start \
62 - --chuid ${MTN_USER:-monotone}:${MTN_GROUP:-monotone} \
63 + --chuid ${MTN_USER}:${MTN_GROUP} \
64 --exec /usr/bin/mtn -- ${MTN_COMMON} genkey ${MTN_KEY}
65
66 eend $?
67 @@ -60,7 +62,7 @@
68
69 ebegin "Starting monotone server"
70 start-stop-daemon --start --background \
71 - --chuid ${MTN_USER:-monotone}:${MTN_GROUP:-monotone} \
72 + --chuid ${MTN_USER}:${MTN_GROUP} \
73 --exec /usr/bin/mtn -- ${MTN_COMMON} --pid-file=${MTN_PIDFILE} \
74 --key=${MTN_KEY} --bind=${MTN_ADDRESS:-0.0.0.0} serve
75 eend $?
76 @@ -74,7 +76,6 @@
77
78 import() {
79 cd ${MTN_HOME}
80 -
81 dbexists
82
83 # Read packets into the database