| Server IP : 82.208.35.60 / Your IP : 216.73.216.238 Web Server : Apache/2.4.55 (FreeBSD) OpenSSL/1.1.1q-freebsd PHP/7.3.31 System : FreeBSD server7.d2m.cz 12.4-RELEASE-p9 FreeBSD 12.4-RELEASE-p9 GENERIC amd64 User : studiokobylisy_cz ( 1008) PHP Version : 7.3.31 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /usr/ports/sysutils/loki/files/ |
Upload File : |
#!/bin/sh
# PROVIDE: loki
# REQUIRE: LOGIN
# KEYWORD: shutdown
# Add the following lines to /etc/rc.conf to enable loki
# loki_enable="YES"
#
# loki_enable (bool):
# Set it to YES to enable grafana
# Set to NO by default
# loki_user (string):
# Set user that grafana will run under
# Default is "%%LOKI_USER%%"
# loki_group (string):
# Set group that own grafana files
# Default is "%%LOKI_GROUP%%"
# loki_config (string)
# Set full path to config file
# Default is "%%PREFIX%%/etc/loki.yaml"
# loki_logfile (string)
# Set full path to log file
# Default is "/var/log/loki/loki.log"
# loki_args (string)
# Set additional command line arguments
# Default is ""
. /etc/rc.subr
name=loki
rcvar=loki_enable
load_rc_config $name
: ${loki_enable:="NO"}
: ${loki_user:="%%LOKI_USER%%"}
: ${loki_group:="%%LOKI_GROUP%%"}
: ${loki_config:="%%PREFIX%%/etc/loki.yaml"}
: ${loki_logfile:="/var/log/loki/loki.log"}
pidfile="/var/run/${name}/${name}.pid"
required_files="${loki_config}"
procname="%%PREFIX%%/bin/loki"
command="/usr/sbin/daemon"
command_args="-p ${pidfile} -t ${name} -o ${loki_logfile} \
${procname} \
--config.file=${loki_config} \
${loki_args}"
start_precmd="loki_start_precmd"
loki_start_precmd()
{
if [ ! -d "/var/run/${name}" ]; then
install -d -m 0750 -o ${loki_user} -g ${loki_group} "/var/run/${name}"
fi
if [ ! -d "/var/log/loki" ]; then
install -d -m 0750 -o ${loki_user} -g ${loki_group} "/var/log/loki"
fi
}
run_rc_command "$1"