aboutsummaryrefslogtreecommitdiffstats
path: root/main/syslog-ng/syslog-ng.initd
blob: 38144142f8528aecb97679990b0bb2ff5398dafe (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
33
34
35
#!/sbin/openrc-run
# Copyright 1999-2007 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2

extra_commands="update"
extra_started_commands="reload"

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

start() {
	ebegin "Starting syslog-ng"
	start-stop-daemon --start --quiet --pidfile /run/syslog-ng.pid --exec /usr/sbin/syslog-ng -- --process-mode background
	eend $?
}

stop() {
	ebegin "Stopping syslog-ng"
	start-stop-daemon --stop --quiet --pidfile /run/syslog-ng.pid
	eend $?
}

reload() {
	if [ ! -f /run/syslog-ng.pid ]
	then
		eerror "syslog-ng not running!"
		return 1
	fi
	ebegin "Reloading syslog-ng"
	start-stop-daemon --signal HUP --pidfile /run/syslog-ng.pid --exec /usr/sbin/syslog-ng
	eend $?
}