opnsense-ports/filesystems/py-prometheus-zfs/files/zfsprom.in
Franco Fichtner a2caadc357 */*: sync with upstream
Taken from: FreeBSD
2024-11-07 11:56:40 +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"