# -----------------------------------------------------
# PROVIDE: rakka
-# REQUIRE: DAEMON
+# REQUIRE: NETWORKING
. /etc/rc.subr
name="rakka"
rcvar=$name
-command="@RAKKA_BINDIR@/rakka"
+command="/tmp/launch_rakka.$$"
+procname="@RAKKA_BINDIR@/rakka"
pidfile="@RAKKA_LOCALSTATEDIR@/pid"
+# Dirty hack: rakka can't daemonize itself because of Haskell's
+# forkProcess limitation.
+trap "unlink '$command'" EXIT
+cat <<'EOF' >"$command"
+#!/bin/sh
+@RAKKA_BINDIR@/rakka $@ &
+EOF
+chmod +x "$command"
+
load_rc_config $name
run_rc_command "$1"