summaryrefslogtreecommitdiff
path: root/community/couchdb/rc-script.patch
blob: d7fd105c4d2cf2e556dc5da3aaf407ad707c84e7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
--- couchdb.orig	2011-08-23 13:13:45.000000000 +0400
+++ couchdb	2011-08-23 13:34:20.000000000 +0400
@@ -1,4 +1,6 @@
-#!/bin/sh -e
+#!/bin/bash
+. /etc/rc.conf
+. /etc/rc.d/functions
 
 # Licensed under the Apache License, Version 2.0 (the "License"); you may not
 # use this file except in compliance with the License. You may obtain a copy of
@@ -29,7 +31,7 @@
 NAME=couchdb
 SCRIPT_NAME=`basename $0`
 COUCHDB=/usr/bin/couchdb
-CONFIGURATION_FILE=/etc/default/couchdb
+CONFIGURATION_FILE=/etc/conf.d/couchdb
 RUN_DIR=/var/run/couchdb
 LSB_LIBRARY=/lib/lsb/init-functions
 
@@ -42,16 +44,14 @@
 fi
 
 log_daemon_msg () {
-    # Dummy function to be replaced by LSB library.
-
-    echo $@
+    stat_busy $@
 }
 
 log_end_msg () {
-    # Dummy function to be replaced by LSB library.
-
     if test "$1" != "0"; then
-      echo "Error with $DESCRIPTION: $NAME"
+      stat_fail
+    else
+      stat_done
     fi
     return $1
 }
@@ -66,7 +66,7 @@
         command="$command $COUCHDB_OPTIONS"
     fi
     if test -n "$COUCHDB_USER"; then
-        if su $COUCHDB_USER -c "$command"; then
+        if su $COUCHDB_USER -s /bin/bash -c "$command"; then
             return $SCRIPT_OK
         else
             return $SCRIPT_ERROR