blob: 8cb71ba274faa7003c5393a7b8731043a406a90c (
plain)
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
33
34
35
36
37
38
39
40
41
42
43
44
45
|
#!/bin/sh
#
# $FreeBSD$
#
# PROVIDE: logsurfer
# REQUIRE: LOGIN
# KEYWORD: shutdown
#
# Add the following lines to /etc/rc.conf to enable logsurfer:
#
# logsurfer_enable (bool): Set it to "YES" to enable logsurfer
# Default to "NO"
#
# logsurfer_config (string): Configuration file,
# Default /usr/local/etc/logsurfer/logsurfer.conf
#
# logsurfer_user, logsurfer_group (string): User logsurfer will run as
# Default logsurfer
#
# logsurfer_logfile (string): Log file logsurfer will monitor
# Default /var/log/messages
#
# logsurfer_pid (string): Location of pid file
# Default /var/run/logsurfer.pid
#
. /etc/rc.subr
name=logsurfer
rcvar=logsurfer_enable
load_rc_config ${name}
: ${logsurfer_enable:=NO}
: ${logsurfer_config:=%%ETCDIR%%/logsurfer.conf}
: ${logsurfer_user:=logsurfer}
: ${logsurfer_group:=logsurfer}
: ${logsurfer_logfile:=/var/log/messages}
pidfile=${logsurfer_pidfile:="/var/run/logsurfer.pid"}
command=%%PREFIX%%/bin/logsurfer
command_args="-D -p ${pidfile} -c ${logsurfer_config} -F -s -e ${logsurfer_logfile}"
required_files="${logsurfer_config} ${logsurfer_logfile}"
run_rc_command "$1"
|