ports/databases/frontbase/files/frontbase.in
Doug Barton 9aac569eaa Move the rc.d scripts of the form *.sh.in to *.in
Where necessary add $FreeBSD$ to the file

No PORTREVISION bump necessary because this is a no-op
2012-08-05 23:19:36 +00:00

57 lines
1.3 KiB
Bash

#!/bin/sh
# $FreeBSD$
# PROVIDE: frontbase
# REQUIRE: DAEMON
# BEFORE: LOGIN
# KEYWORD: shutdown
# Define these frontbase_* variables in one of these files:
# /etc/rc.conf
# /etc/rc.conf.local
#
# DO NOT CHANGE THESE DEFAULT VALUES HERE
. /etc/rc.subr
name="frontbase"
rcvar=frontbase_enable
frontbase_enable="${frontbase_enable-NO}"
frontbase_user="${frontbase_user-frontbase}"
frontbase_flags="${frontbase_flags--autostart}"
frontbase_pidfile="${frontbase_pidfile-/var/run/frontbase.pid}"
frontbase_logfile="${frontbase_logfile-/var/log/frontbase.log}"
logfile=${frontbase_logfile}
runuser=${frontbase_user}
procname1="%%PREFIX%%/FrontBase/bin/FBExec"
procname2="%%PREFIX%%/FrontBase/bin/FrontBase"
logargs=">>${logfile} 2>&1"
command="%%PREFIX%%/FrontBase/bin/FBExec"
command_args="-daemon ${logargs}"
load_rc_config $name
start_precmd="start_precmd"
stop_cmd="stop_cmd"
start_precmd() {
touch ${logfile} && chown ${runuser} ${logfile}
}
stop_cmd() {
rc_pid="$(check_process ${procname1}) $(check_process ${procname2})"
echo "Stopping ${name}."
_doit="kill -${sig_stop:-TERM} $rc_pid"
if [ -n "$_user" ]; then
_doit="su -m $_user -c 'sh -c \"$_doit\"'"
fi
eval $_doit
_return=$?
[ $_return -ne 0 ] && [ -z "$rc_force" ] && return 1
wait_for_pids $rc_pid
}
run_rc_command "$1"