Index: databases/kyototycoon/Makefile =================================================================== --- databases/kyototycoon/Makefile +++ databases/kyototycoon/Makefile @@ -25,9 +25,9 @@ MAKE_ARGS= PCDIR=${PREFIX}/libdata/pkgconfig REINPLACE_ARGS= -i '' TEST_TARGET= check +USES= gmake pkgconfig USE_LDCONFIG= yes USE_RC_SUBR= ${PORTNAME} -USES= gmake pkgconfig PLIST_SUB= KYOTOTYCOON_USER=${KYOTOTYCOON_USER} \ KYOTOTYCOON_GROUP=${KYOTOTYCOON_GROUP} \ Index: databases/kyototycoon/files/kyototycoon.in =================================================================== --- databases/kyototycoon/files/kyototycoon.in +++ databases/kyototycoon/files/kyototycoon.in @@ -5,7 +5,7 @@ # PROVIDE: kyototycoon # REQUIRE: LOGIN NETWORKING SERVERS # KEYWORD: shutdown -# + # Add the following lines to /etc/rc.conf.local or /etc/rc.conf # to enable this service: # @@ -19,22 +19,30 @@ # kyototycoon_sid (int): ServerID - 0-65535 # kyototycoon_opts (args): Additional command-line arguments. -. /etc/rc.subr +# ERROR:root:[54]: Order of rc file incorrect +# ==> Order of the rc file should be shebang/header/$FreeBSD$/sourcing +# rc_subr/name/rcvar/load_rc_config/setting defaults/setting other +# definitions/defining functions. Do not include unassociated shell +# commands, and blocks must be separated by single blank lines. +# Single blank lines may appear inside the defaults, definitions and +# functions blocks -name="kyototycoon" +. /etc/rc.subr +name=kyototycoon rcvar=kyototycoon_enable +desc="Replicating key-value datastore with HTTP and binary API" load_rc_config $name -: ${kyototycoon_enable="NO"} -: ${kyototycoon_user:="%%KYOTOTYCOON_USER%%"} -: ${kyototycoon_group:="%%KYOTOTYCOON_GROUP%%"} -: ${kyototycoon_dbdir="%%KYOTOTYCOON_DBDIR%%"} -: ${kyototycoon_log="%%KYOTOTYCOON_LOGDIR%%/kyoto.log"} -: ${kyototycoon_sid="1"} -: ${kyototycoon_opts:=" -li"} +: ${kyototycoon_enable:=NO} +: ${kyototycoon_user:=%%KYOTOTYCOON_USER%%} +: ${kyototycoon_group:=%%KYOTOTYCOON_GROUP%%} +: ${kyototycoon_dbdir=%%KYOTOTYCOON_DBDIR%%} +: ${kyototycoon_log=%%KYOTOTYCOON_LOGDIR%%/kyoto.log} +: ${kyototycoon_sid:=1} +: ${kyototycoon_opts=" -li"} -command="/usr/sbin/daemon" +command=/usr/sbin/daemon command_args="-f -c -r -t ${name} -P ${pidfile} \ %%PREFIX%%/bin/ktserver \ -bgs ${kyototycoon_dbdir}/snapshots \ @@ -42,15 +50,11 @@ -log ${kyototycoon_log} \ -sid ${kyototycoon_sid} \ ${kyototycoon_opts}" -pidfile="%%KYOTOTYCOON_PIDFILE%%" +pidfile=%%KYOTOTYCOON_PIDFILE%% required_dirs="${kyototycoon_dbdir}/snapshots ${kyototycoon_dbdir}/updates" -required_files="${kyototycoon_log}" +required_files=${kyototycoon_log} -kyototycoon_prestart() -{ - install -o ${kyototycoon_user} /dev/null ${pidfile} -} -start_precmd=${name}_prestart +start_precmd="install -o ${kyototycoon_user} /dev/null ${pidfile}" run_rc_command "$1"