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

19 views
Skip to first unread message

Thomas Elsgaard

unread,
Aug 25, 2012, 4:12:00 PM8/25/12
to erlang-q...@erlang.org
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.

Thomas

Steve Vinoski

unread,
Aug 25, 2012, 6:17:10 PM8/25/12
to Thomas Elsgaard, erlang-q...@erlang.org
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
_______________________________________________
erlang-questions mailing list
erlang-q...@erlang.org
http://erlang.org/mailman/listinfo/erlang-questions

Thomas Elsgaard

unread,
Aug 25, 2012, 7:37:49 PM8/25/12
to Steve Vinoski, erlang-q...@erlang.org
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"
yaws

Steve Vinoski

unread,
Aug 25, 2012, 8:08:05 PM8/25/12
to Thomas Elsgaard, erlang-q...@erlang.org
Thanks, I'll add this to the yaws repo on github.

--steve

On Sat, Aug 25, 2012 at 7:37 PM, Thomas Elsgaard

Kenji Rikitake

unread,
Aug 26, 2012, 12:54:45 AM8/26/12
to Steve Vinoski, erlang-q...@erlang.org
The Yaws 1.94 Port on the FreeBSD Ports tree works fine.
http://www.freshports.org/www/yaws/
And I'm using this:
https://github.com/jj1bdx/yaws-freebsd-port

FYI
Kenji Rikitake

++> Steve Vinoski <vin...@ieee.org> [2012-08-25 20:08:05 -0400]:
> Date: Sat, 25 Aug 2012 20:08:05 -0400
> From: Steve Vinoski <vin...@ieee.org>
> To: Thomas Elsgaard <thomas....@gmail.com>
> Cc: erlang-q...@erlang.org
> Subject: Re: [erlang-questions] Best way of automatic Yaws start on FreeBSD
> 9.0?
Reply all
Reply to author
Forward
0 new messages