summaryrefslogtreecommitdiff
path: root/filesystems/py-prometheus-zfs/files/zfsprom.in
blob: f4e3fbfc2e49592a6b7c5bcdfcf655479cf1d0b0 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#! /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"