ports/sysutils/py-prometheus-zfs/files/zfsprom.in
Mateusz Piotrowski cfb42af2af sysutils/py-prometheus-zfs: Initialize rcvar
The rcvar (zfsprom_enable) must be initialized. Otherwise, rc(8)
complains with the following message:

    /etc/rc: WARNING: $zfsprom_enable is not set properly - see rc.conf(5).
2021-12-10 13:32:25 +01:00

32 lines
679 B
Bash

#! /bin/sh -
#
# SPDX-License-Identifier: (BSD-2-Clause or Unlicense)
#
# Copyright (c) 2021 Mateusz Piotrowski <0mp@FreeBSD.org>
#
# Add the following lines to rc.conf(5) to configure the zfsprom service:
#
# zfsprom_enable (bool): Set to "YES" to enable the service.
# Default: "NO".
# PROVIDE: zfsprom
# REQUIRE: DAEMON
# KEYWORD: shutdown
. /etc/rc.subr
name="zfsprom"
rcvar="zfsprom_enable"
load_rc_config "${name}"
: "${zfsprom_enable:=NO}"
pidfile="/var/run/${name}.pid"
procname="%%PREFIX%%/sbin/zfsprom.py"
command_interpreter="%%PYTHON_CMD%%"
command="/usr/sbin/daemon"
command_args="-o /var/log/${name}.log -p ${pidfile} -- ${procname}"
run_rc_command "$1"