From 45dd5fc9405de4f77e69ac2d711234886673a86e Mon Sep 17 00:00:00 2001 From: Sergey Matveev Date: Mon, 16 Jan 2017 12:31:02 +0300 Subject: [PATCH] nncp-toss startup script --- ports/nncp/Makefile | 2 +- ports/nncp/files/nncp-toss.in | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 ports/nncp/files/nncp-toss.in diff --git a/ports/nncp/Makefile b/ports/nncp/Makefile index 3f43dea..16ea618 100644 --- a/ports/nncp/Makefile +++ b/ports/nncp/Makefile @@ -17,7 +17,7 @@ BUILD_DEPENDS= go:lang/go USES= tar:xz MAKEFILE= BSDmakefile -USE_RC_SUBR= nncp-caller nncp-daemon +USE_RC_SUBR= nncp-caller nncp-daemon nncp-toss REQUIRE= DAEMON SUB_FILES= pkg-message pkg-deinstall nncp.newsyslog.conf diff --git a/ports/nncp/files/nncp-toss.in b/ports/nncp/files/nncp-toss.in new file mode 100644 index 0000000..1fa1142 --- /dev/null +++ b/ports/nncp/files/nncp-toss.in @@ -0,0 +1,32 @@ +#!/bin/sh +# +# $FreeBSD$ +# +# PROVIDE: nncp-toss +# REQUIRE: DAEMON NETWORKING FILESYSTEMS +# KEYWORD: shutdown +# +# Add these lines to /etc/rc.conf.local or /etc/rc.conf +# to enable this service: +# +# nncp_toss_enable (bool): Set to NO by default. +# Set it to YES to enable nncp-toss. +# nncp_toss_config (path): Set to %%PREFIX%%/etc/nncp.yaml by default. +# nncp_toss_cycle (int): Repeat tossing after that number of seconds. +# Default is "60". + +. /etc/rc.subr + +name=nncp_toss +rcvar=nncp_toss_enable + +load_rc_config $name + +: ${nncp_toss_enable:="NO"} +: ${nncp_toss_config="%%PREFIX%%/etc/nncp.yaml"} +: ${nncp_toss_cycle="60"} + +command=%%PREFIX%%/bin/nncp-toss +command_args="-quiet -cycle $nncp_toss_cycle -cfg $nncp_toss_config &" + +run_rc_command "$1" -- 2.44.0