Skip to content

Commit

Permalink
add startup script for FreeBSD 9 (Thomas Elsgaard)
Browse files Browse the repository at this point in the history
Add scripts/freebsd/yaws for FreeBSD version 9 or later. The original
script at scripts/freebsd/yaws.sh is retained for use with FreeBSD versions
prior to 9.
  • Loading branch information
vinoski committed Aug 26, 2012
1 parent 66f50e6 commit d508c6b
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 1 deletion.
35 changes: 35 additions & 0 deletions scripts/freebsd/yaws
@@ -0,0 +1,35 @@
#!/bin/sh
#
# Start up for the Yaws daemon. Use this script for FreeBSD versions 9 or greater.
#

# PROVIDE: yaws
# BEFORE: DAEMON
# KEYWORD: shutdown

. /etc/rc.subr

name="yaws"
yaws_id="default" # By default we run with the default id
start_precmd="${name}_prestart"
stop_cmd="yaws_stop"
status_cmd="yaws_status"
command="/usr/local/bin/${name}"
rcvar="yaws_enable"
command_args=""
required_files="/etc/${name}/${name}.conf"

yaws_prestart() {
rc_flags="--id ${yaws_id} --daemon --heart --conf /etc/${name}/${name}.conf ${rc_flags}"
}

yaws_stop() {
/usr/local/bin/yaws --id ${yaws_id} --stop
}

yaws_status() {
/usr/local/bin/yaws --id ${yaws_id} --status
}

load_rc_config $name
run_rc_command "$1"
2 changes: 1 addition & 1 deletion scripts/freebsd/yaws.sh
@@ -1,6 +1,6 @@
#! /bin/sh
#
# Startup script for Yaws
# Startup script for Yaws. Use this scripts for FreeBSD versions prior to 9.


YAWS_BIN=%prefix%bin/yaws
Expand Down

0 comments on commit d508c6b

Please sign in to comment.