From: PHO Date: Thu, 18 Feb 2010 13:16:31 +0000 (+0900) Subject: rc.d/NetBSD/rakka: proper daemonization X-Git-Url: https://git.cielonegro.org/gitweb.cgi?a=commitdiff_plain;h=e57027f2f85dcef6f5bd0e7ed141f04704c092f9;p=Rakka.git rc.d/NetBSD/rakka: proper daemonization --- diff --git a/rc.d/NetBSD/rakka.in b/rc.d/NetBSD/rakka.in index 444b824..437478f 100644 --- a/rc.d/NetBSD/rakka.in +++ b/rc.d/NetBSD/rakka.in @@ -7,14 +7,24 @@ # ----------------------------------------------------- # 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"