diff options
| author | Doug Barton <dougb@FreeBSD.org> | 2012-08-05 23:19:36 +0000 |
|---|---|---|
| committer | Doug Barton <dougb@FreeBSD.org> | 2012-08-05 23:19:36 +0000 |
| commit | 9aac569eaa031e27191a3f4165b389a17f467ad2 (patch) | |
| tree | 1ed78841e1757014ccc09581c61c3683992d3f77 /databases/frontbase/files/frontbase.in | |
| parent | When installing in the base, USE_RCORDER does the right thing without (diff) | |
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
Notes
Notes:
svn path=/head/; revision=302141
Diffstat (limited to 'databases/frontbase/files/frontbase.in')
| -rw-r--r-- | databases/frontbase/files/frontbase.in | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/databases/frontbase/files/frontbase.in b/databases/frontbase/files/frontbase.in new file mode 100644 index 000000000000..b11a623a3d49 --- /dev/null +++ b/databases/frontbase/files/frontbase.in @@ -0,0 +1,57 @@ +#!/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" |
