1. It's rc.d, not rcng 2. All new ports that use rc.d scripts need to use USE_RC_SUBR 3. The name of the script, PROVIDE, and $name should match the port name. 4. For the script itself: a. Added a $FreeBSD$ b. Added KEYWORD: shutdown since it starts a persistent service. c. Removed _flags from command=, it's spurious and will result in the flags being included twice. d. Moved the default variable assignment to after load_rc_config e. Made the conf file a required_file, and added it to command_args instead of _flags. Approved by: maintainer
28 lines
558 B
Bash
28 lines
558 B
Bash
#!/bin/sh
|
|
|
|
# $FreeBSD$
|
|
#
|
|
# PROVIDE: thundercache
|
|
# REQUIRE: LOGIN
|
|
# KEYWORD: shutdown
|
|
#
|
|
# Remember to thundercache_enable="YES" in /etc/rc.conf
|
|
# You can also add optional flags to thundercache_flags
|
|
#
|
|
# FreeBSD Brasil LTDA <consultoria@freebsdbrasil.com.br>
|
|
#
|
|
|
|
. /etc/rc.subr
|
|
|
|
name="thundercache"
|
|
rcvar=`set_rcvar`
|
|
|
|
command="%%PREFIX%%/thunder/sbin/thunder"
|
|
required_files="%%PREFIX%%/thunder/etc/thunder.conf"
|
|
command_args="-c $required_files"
|
|
pidfile="/var/run/thunder/thunder.pid"
|
|
|
|
load_rc_config $name
|
|
: ${thundercache_enable="NO"}
|
|
|
|
run_rc_command "$1"
|