[erlang-questions] Best way of automatic Yaws start on FreeBSD 9.0?

Thomas Elsgaard <>
Sun Aug 26 01:37:49 CEST 2012


Hi Steve

It seems like the format of the rc.d scripts has changed, i am not
sure in which FreeBSD version, but i am using latest stable (9.0)

I have just made below (and attached), which seems to work fine

Best regards

Thomas


#!/bin/sh
#
# Start up for the Yaws daemon.
#

# 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"





On Sun, Aug 26, 2012 at 12:17 AM, Steve Vinoski <> wrote:
> On Sat, Aug 25, 2012 at 4:12 PM, Thomas Elsgaard
> <> wrote:
>> Hi list
>>
>> Any real life exemples of automatic start of yaws on FreeBSD 9? Maybe a
>> working rc.d script?
>>
>> Currently i am via rc.d starting screen, which then starts yaws.
>
> The yaws sources include the following under scripts/freebsd:
>
> https://github.com/klacke/yaws/blob/master/scripts/freebsd/yaws.sh
>
> If that doesn't help or work, patches gladly accepted. :)
>
> --steve
-------------- next part --------------
A non-text attachment was scrubbed...
Name: yaws
Type: application/octet-stream
Size: 657 bytes
Desc: not available
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20120826/4aa7adf4/attachment.obj>


More information about the erlang-questions mailing list