summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Black <dragonheart@gentoo.org>2008-08-30 01:23:31 +0000
committerDaniel Black <dragonheart@gentoo.org>2008-08-30 01:23:31 +0000
commit55923460649463a2a6455461743823b2d26a26d8 (patch)
tree6293daed965b4db5e1a30646afcaa4388de0efb3
parentdepricating elist-comp as per bug #235879. thanks Ulrich for the patch (diff)
downloadgentoo-2-55923460649463a2a6455461743823b2d26a26d8.tar.gz
gentoo-2-55923460649463a2a6455461743823b2d26a26d8.tar.bz2
gentoo-2-55923460649463a2a6455461743823b2d26a26d8.zip
added default values to init script. patch thanks to Dennis Schridde - bug #235037
(Portage version: 2.2_rc8/cvs/Linux 2.6.22-vs2.2.0.7-gentoo x86_64)
-rw-r--r--dev-util/monotone/ChangeLog7
-rw-r--r--dev-util/monotone/files/monotone-0.36.initd13
2 files changed, 13 insertions, 7 deletions
diff --git a/dev-util/monotone/ChangeLog b/dev-util/monotone/ChangeLog
index 7db502aef8c5..0be1ca3765f9 100644
--- a/dev-util/monotone/ChangeLog
+++ b/dev-util/monotone/ChangeLog
@@ -1,6 +1,11 @@
# ChangeLog for dev-util/monotone
# Copyright 1999-2008 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/dev-util/monotone/ChangeLog,v 1.55 2008/08/30 01:18:26 dragonheart Exp $
+# $Header: /var/cvsroot/gentoo-x86/dev-util/monotone/ChangeLog,v 1.56 2008/08/30 01:23:30 dragonheart Exp $
+
+ 30 Aug 2008; Daniel Black <dragonheart@gentoo.org>
+ files/monotone-0.36.initd:
+ added default values to init script. patch thanks to Dennis Schridde - bug
+ #235037
30 Aug 2008; Daniel Black <dragonheart@gentoo.org> monotone-0.39.ebuild,
monotone-0.40.ebuild:
diff --git a/dev-util/monotone/files/monotone-0.36.initd b/dev-util/monotone/files/monotone-0.36.initd
index d4e81ac79404..a8be7da63bcf 100644
--- a/dev-util/monotone/files/monotone-0.36.initd
+++ b/dev-util/monotone/files/monotone-0.36.initd
@@ -1,7 +1,7 @@
#!/sbin/runscript
# Copyright 2006 Gentoo Foundation
# Distributed under the terms of the GNU General Public License, v2 or later
-# $Header: /var/cvsroot/gentoo-x86/dev-util/monotone/files/monotone-0.36.initd,v 1.1 2007/10/07 12:34:03 opfer Exp $
+# $Header: /var/cvsroot/gentoo-x86/dev-util/monotone/files/monotone-0.36.initd,v 1.2 2008/08/30 01:23:31 dragonheart Exp $
opts="import"
@@ -10,6 +10,8 @@ depend() {
}
# Substitute common default values
+MTN_USER=${MTN_USER:-monotone}
+MTN_GROUP=${MTN_GROUP:-monotone}
MTN_KEY=${MTN_KEY:-monotone@`hostname --fqdn`}
MTN_CONFDIR=${MTN_CONFDIR:-/etc/monotone}
MTN_COMMON="--norc --confdir=${MTN_CONFDIR} \
@@ -18,14 +20,14 @@ MTN_COMMON="--norc --confdir=${MTN_CONFDIR} \
--rcfile=${MTN_CONFDIR}/hooks.lua --log=/var/log/monotone/monotone.log"
#--dump=$ERRORLOG
MTN_PIDFILE="/var/run/monotone/monotone.pid"
-MTN_HOME=$(awk -F: -vuid=$MTN_USER -vuser=$MTN_USER '$3 == uid || $1 == user { print $6 }' </etc/passwd)
+MTN_HOME=$(awk -F: -vuid=$MTN_USER -vuser=$MTN_USER '$3 == uid || $1 == user { print $6 }' < /etc/passwd)
dbexists() {
# Create the database if it doesn't exist
if [ ! -e ${MTN_DB:-/var/lib/monotone/default.mtn} ]; then
ebegin "Creating monotone database"
start-stop-daemon --start \
- --chuid ${MTN_USER:-monotone}:${MTN_GROUP:-monotone} \
+ --chuid ${MTN_USER}:${MTN_GROUP} \
--exec /usr/bin/mtn -- ${MTN_COMMON} db init
eend $?
fi
@@ -34,7 +36,7 @@ dbexists() {
export MTN_PWD=${RANDOM}
yes "${MTN_PWD}" | \
start-stop-daemon --start \
- --chuid ${MTN_USER:-monotone}:${MTN_GROUP:-monotone} \
+ --chuid ${MTN_USER}:${MTN_GROUP} \
--exec /usr/bin/mtn -- ${MTN_COMMON} genkey ${MTN_KEY}
eend $?
@@ -60,7 +62,7 @@ start() {
ebegin "Starting monotone server"
start-stop-daemon --start --background \
- --chuid ${MTN_USER:-monotone}:${MTN_GROUP:-monotone} \
+ --chuid ${MTN_USER}:${MTN_GROUP} \
--exec /usr/bin/mtn -- ${MTN_COMMON} --pid-file=${MTN_PIDFILE} \
--key=${MTN_KEY} --bind=${MTN_ADDRESS:-0.0.0.0} serve
eend $?
@@ -74,7 +76,6 @@ stop() {
import() {
cd ${MTN_HOME}
-
dbexists
# Read packets into the database