summaryrefslogtreecommitdiff
blob: 65ed11bb2c342b9300dca8bf47fa805f204cf39c (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
#!/sbin/runscript
# Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/app-admin/rsyslog/files/7-stable/rsyslog.initd,v 1.1 2012/11/20 13:03:36 ultrabug Exp $

extra_started_commands="reload"

depend() {
	provide logger
}

start() {
	ebegin "Starting rsyslogd"
	start-stop-daemon \
		--start --quiet --exec /usr/sbin/rsyslogd --pidfile "${PIDFILE}" \
		-- ${RSYSLOG_OPTS} -i "${PIDFILE}" -f "${CONFIGFILE}"
	eend $?
}

stop() {
	ebegin "Stopping rsyslogd"
	start-stop-daemon \
		--stop --quiet \
		--pidfile "${PIDFILE}"
	eend $?
}

reload() {
	if [ ! -f "${PIDFILE}" ]; then
		eerror "rsyslogd not running"
		return 1
	fi

	# Baselayout-1 users still use --stop and --oknodo
	local USEROPT="--name rsyslogd"
	if [ ! -f /etc/init.d/sysfs ]; then
		USEROPT="--stop --oknodo"
	fi

	ebegin "Re-opening rsyslogd log files"
	start-stop-daemon --signal HUP --pidfile "${PIDFILE}" ${USEROPT}
	eend $?
}