summarylogtreecommitdiffstats
path: root/rsyslog
blob: 20c584fe2bbf6da0e429472324f7fd9b4021667a (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
#!/sbin/openrc-run

extra_commands="checkconfig"
extra_started_commands="reload"

description_reload="Reload the configuration and re-open log files"

# CONFIGFILE is deprecated and for backward compatibility only.
: ${cfgfile:=${CONFIGFILE:="/etc/rsyslog.conf"}}

pidfile="/run/$RC_SVCNAME.pid"
command="/usr/sbin/rsyslogd"
command_args="-i $pidfile -f $cfgfile ${command_args:-$RSYSLOG_OPTS}"

required_files="$cfgfile"

depend() {
	need hostname localmount
	use clock
	before net
	provide logger
}

start_pre() {
	$command -f "$cfgfile" -N1 2>/dev/null || $command -f "$cfgfile" -N1
}

checkconfig() {
	ebegin "Checking $RC_SVCNAME configuration"
	start_pre
	eend $?
}

reload() {
	ebegin "Reloading configuration and re-opening log files"
	start_pre && start-stop-daemon --signal HUP --pidfile "$pidfile"
	eend $?
}