freebsd-ports/net/benthos/files/benthos.in
Jimmy Olgeni 1704312129 net/benthos: Add new port
Benthos solves common data engineering tasks such as transformations,
integrations, and multiplexing with declarative and unit testable
configuration. This allows you to easily and incrementally adapt your data
pipelines as requirements change, letting you focus on the more exciting stuff.

Benthos is able to glue a wide range of sources and sinks together and hook
into a variety of databases, caches, HTTP APIs, lambdas and more, enabling you
to seamlessly drop it into your existing infrastructure.
2024-05-05 16:43:31 +02:00

60 lines
1.5 KiB
Bash

#!/bin/sh
#
# PROVIDE: benthos
# REQUIRE: DAEMON
# KEYWORD: shutdown
#
# Add the following lines to /etc/rc.conf to run NATS:
#
# benthos_enable (bool): Set it to "YES" to enable benthos.
# Default is "NO".
# benthos_user: User name to run as. default "benthos"
# benthos_group: Group name to run as. default "benthos"
# benthos_resources: Path to benthos resources files (glob).
# benthos_config: Path to benthos configuration file.
# benthos_watcher (bool): Set it to "YES" to enable benthos watcher mode.
# Default is "NO".
# benthos_options: Options to pass benthos
# (e.g. 'streams' for streams mode).
#
. /etc/rc.subr
name=benthos
rcvar=`set_rcvar`
load_rc_config ${name}
: ${benthos_enable:=NO}
: ${benthos_user:=benthos}
: ${benthos_group:=benthos}
: ${benthos_resources:=""}
: ${benthos_config:="%%PREFIX%%/etc/benthos/config.yaml"}
: ${benthos_watcher:=NO}
: ${benthos_options=""}
if [ -n "${benthos_resources}" ]; then
benthos_options="--resources '${benthos_resources}' ${benthos_options}"
fi
if [ -n "${benthos_config}" ]; then
benthos_options="--config ${benthos_config} ${benthos_options}"
fi
if checkyesno benthos_watcher; then
benthos_options="--watcher ${benthos_options}"
fi
start_precmd=benthos_start_precmd
pidfile="/var/run/${name}.pid"
procname=%%PREFIX%%/bin/benthos
command=/usr/sbin/daemon
command_args="-p ${pidfile} ${procname} ${benthos_options}"
benthos_start_precmd()
{
install -o ${benthos_user} -g ${benthos_group} /dev/null ${pidfile}
}
run_rc_command "$1"