aboutsummaryrefslogtreecommitdiffstats
path: root/databases
diff options
context:
space:
mode:
authormiwi <miwi@FreeBSD.org>2011-11-14 21:55:29 +0800
committermiwi <miwi@FreeBSD.org>2011-11-14 21:55:29 +0800
commit6ac28d23d8402ca2fb216bacfda226d63405a0a9 (patch)
treece8e9576c06e055d1d97035be9cdb8ebff67cc03 /databases
parent6bd0ec0714527ff5146eebc5405bacb64b7c2085 (diff)
downloadfreebsd-ports-gnome-6ac28d23d8402ca2fb216bacfda226d63405a0a9.tar.gz
freebsd-ports-gnome-6ac28d23d8402ca2fb216bacfda226d63405a0a9.tar.zst
freebsd-ports-gnome-6ac28d23d8402ca2fb216bacfda226d63405a0a9.zip
- Update rc.d script
Submitted by: dougb Approved by: maintainer via irc Feature safe: yes
Diffstat (limited to 'databases')
-rw-r--r--databases/couchdb/Makefile2
-rw-r--r--databases/couchdb/files/couchdb.in56
2 files changed, 29 insertions, 29 deletions
diff --git a/databases/couchdb/Makefile b/databases/couchdb/Makefile
index dc7f85842cd2..f7f7aa95e036 100644
--- a/databases/couchdb/Makefile
+++ b/databases/couchdb/Makefile
@@ -7,8 +7,8 @@
PORTNAME= couchdb
PORTVERSION= 1.1.0
+PORTREVISION= 2
PORTEPOCH= 1
-PORTREVISION= 1
CATEGORIES= databases
MASTER_SITES= ${MASTER_SITE_APACHE}
MASTER_SITE_SUBDIR= couchdb/${PORTVERSION}
diff --git a/databases/couchdb/files/couchdb.in b/databases/couchdb/files/couchdb.in
index c27647e52b95..0bdf41fd6436 100644
--- a/databases/couchdb/files/couchdb.in
+++ b/databases/couchdb/files/couchdb.in
@@ -1,7 +1,10 @@
#!/bin/sh
+# $FreeBSD$
+#
# PROVIDE: couchdb
# REQUIRE: LOGIN
+# KEYWORD: shutdown
#
# Add the following lines to /etc/rc.conf.local or /etc/rc.conf
# to enable this service:
@@ -16,12 +19,6 @@
#
# couchdb_respawn (int): Set to none by default. If CouchDB crashes,
# respawn after this many seconds.
-#
-
-couchdb_user="${couchdb_user:-"couchdb"}"
-couchdb_enablelogs="${couchdb_enablelogs:-"YES"}"
-couchdb_etcdir="${couchdb_etcdir:-"%%PREFIX%%/etc/couchdb"}"
-couchdb_respawn="${couchdb_respawn:-"0"}"
. /etc/rc.subr
@@ -30,35 +27,38 @@ rcvar=${name}_enable
load_rc_config $name
+: ${couchdb_enable="NO"}
+couchdb_user="${couchdb_user:-"couchdb"}"
+couchdb_enablelogs="${couchdb_enablelogs:-"YES"}"
+couchdb_etcdir="${couchdb_etcdir:-"%%PREFIX%%/etc/couchdb"}"
+couchdb_respawn="${couchdb_respawn:-"0"}"
+
command="%%PREFIX%%/bin/${name}"
pidfile="/var/run/${name}/${name}.pid"
-etcdir="%%PREFIX%%/etc/${name}"
-if [ "$couchdb_respawn" -gt 0 ]
- then
- respawn="-r ${couchdb_respawn} "
-fi
+couchdb_prestart()
+{
+ install -o $couchdb_user /dev/null $pidfile
-if [ "$couchdb_enablelogs" = "YES" ]
- then
- logfile=/var/log/${name}/couch.log
- errfile=/var/log/${name}/err.log
- else
- logfile=/dev/null
- errfile=/dev/null
-fi
+ [ -n "$couchdb_flags" ] && return 0
-: ${couchdb_enable="NO"}
-: ${couchdb_flags="-b -a ${etcdir}/default.ini -a ${etcdir}/local.ini ${respawn}-o ${logfile} -e ${errfile} -p ${pidfile}"}
+ if [ $couchdb_respawn -gt 0 ]; then
+ respawn="-r ${couchdb_respawn}"
+ fi
-start_precmd=pid_touch
-stop_cmd="${command} -d"
-status_cmd="${command} -s"
+ if checkyesno couchdb_enablelogs; then
+ logfile=/var/log/${name}/couch.log
+ errfile=/var/log/${name}/err.log
+ else
+ logfile=/dev/null
+ errfile=/dev/null
+ fi
-pid_touch ()
-{
- touch $pidfile
- chown $couchdb_user $pidfile
+ couchdb_flags="-b -a ${couchdb_etcdir}/default.ini -a ${couchdb_etcdir}/local.ini ${respawn} -o ${logfile} -e ${errfile} -p ${pidfile}"
}
+start_precmd=${name}_prestart
+stop_cmd="${command} -d"
+status_cmd="${command} -s"
+
run_rc_command "$1"