From e57027f2f85dcef6f5bd0e7ed141f04704c092f9 Mon Sep 17 00:00:00 2001 From: PHO Date: Thu, 18 Feb 2010 22:16:31 +0900 Subject: [PATCH] rc.d/NetBSD/rakka: proper daemonization --- rc.d/NetBSD/rakka.in | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) 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" -- 2.40.0