Permalink
Browse files

add startup script for FreeBSD 9 (Thomas Elsgaard)

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...
1 parent 66f50e6 commit d508c6b706c44e565e7f3a1ae146adc04ca6ad78 @vinoski vinoski committed Aug 26, 2012
Showing with 36 additions and 1 deletion.
  1. +35 −0 scripts/freebsd/yaws
  2. +1 −1 scripts/freebsd/yaws.sh
View
@@ -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"
View
@@ -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

0 comments on commit d508c6b

Please sign in to comment.