summaryrefslogtreecommitdiff
path: root/etc
diff options
context:
space:
mode:
Diffstat (limited to 'etc')
-rw-r--r--etc/Makefile.am1
-rw-r--r--etc/init/couchdb.tpl.in3
2 files changed, 4 insertions, 0 deletions
diff --git a/etc/Makefile.am b/etc/Makefile.am
index 3655cd45..737230b8 100644
--- a/etc/Makefile.am
+++ b/etc/Makefile.am
@@ -44,6 +44,7 @@ init/couchdb: init/couchdb.tpl
-e "s|%bindir%|$(bindir)|" \
-e "s|%sysconfdir%|$(sysconfdir)|" \
-e "s|%localerlangbindir%|$(localerlangbindir)|" \
+ -e "s|%localstaterundir%|$(localstaterundir)|" \
-e "s|%couchdb_command_name%|$(couchdb_command_name)|" \
< $< > $@
diff --git a/etc/init/couchdb.tpl.in b/etc/init/couchdb.tpl.in
index c6dca764..358cf87d 100644
--- a/etc/init/couchdb.tpl.in
+++ b/etc/init/couchdb.tpl.in
@@ -30,6 +30,7 @@ NAME=couchdb
SCRIPT_NAME=`basename $0`
COUCHDB=%bindir%/%couchdb_command_name%
CONFIGURATION_FILE=%sysconfdir%/default/couchdb
+RUN_DIR=%localstaterundir%
LSB_LIBRARY=/lib/lsb/init-functions
if test ! -x $COUCHDB; then
@@ -75,7 +76,9 @@ start_couchdb () {
if test -n "$COUCHDB_OPTIONS"; then
command="$command $COUCHDB_OPTIONS"
fi
+ mkdir -p "$RUN_DIR"
if test -n "$COUCHDB_USER"; then
+ chown $COUCHDB_USER "$RUN_DIR"
if su $COUCHDB_USER -c "$command" > /dev/null; then
return $SCRIPT_OK
else