6b13f9598e
- daemon(8) mistakenly consumes the usual prepended rc.subr fiche_flags - wrap command_args for line length Approved by: zi Sponsored by: SkunkWerks, GmbH Differential Revision: https://reviews.freebsd.org/D23438
50 lines
1.1 KiB
Bash
50 lines
1.1 KiB
Bash
#!/bin/sh
|
|
#
|
|
# $FreeBSD$
|
|
#
|
|
|
|
# PROVIDE: fiche
|
|
# REQUIRE: NETWORKING SERVERS
|
|
# BEFORE: DAEMON
|
|
# KEYWORD: shutdown
|
|
|
|
#
|
|
# Add some of the following variables to /etc/rc.conf to configure fiche:
|
|
# fiche_enable (bool): Set to "NO" by default.
|
|
# Set it to "YES" to enable fiche.
|
|
# fiche_domain (str): Default "localhost"
|
|
# fiche_options (str): Additional flags Default ""
|
|
# fiche_output (str): Default "/usr/local/www/fiche"
|
|
# fiche_logfile (str): Default "/var/log/fiche/fiche.log"
|
|
|
|
. /etc/rc.subr
|
|
|
|
name="fiche"
|
|
rcvar=fiche_enable
|
|
|
|
load_rc_config $name
|
|
|
|
: ${fiche_enable="NO"}
|
|
: ${fiche_pidfile="/var/run/${name}.pid"}
|
|
: ${fiche_options=""}
|
|
: ${fiche_output="%%WWWDIR%%"}
|
|
: ${fiche_domain="localhost"}
|
|
: ${fiche_logfile="/var/log/${name}/${name}.log"}
|
|
|
|
start_precmd="${name}_prestart"
|
|
pidfile="${fiche_pidfile}"
|
|
procname="%%PREFIX%%/sbin/fiche"
|
|
|
|
command="/usr/sbin/daemon"
|
|
command_args="-fp ${pidfile} %%PREFIX%%/sbin/fiche \
|
|
-o ${fiche_output} \
|
|
-d ${fiche_domain} \
|
|
-l ${fiche_logfile} \
|
|
${fiche_options}"
|
|
|
|
fiche_prestart() {
|
|
install -d -o 477 -g 477 -m 755 /var/log/${name}
|
|
}
|
|
|
|
run_rc_command "$1"
|