aboutsummaryrefslogtreecommitdiffstats
path: root/testing/inetutils-syslogd/inetutils-syslogd.initd
blob: 6baad86dd75fd94a1c28ea55be99224559d16081 (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
46
47
48
49
50
#!/sbin/runscript

# This file is part of inetutils-syslogd
# Created for Alpine Linux by IT Offshore <developer@it-offshore.co.uk>

name=syslogd
daemon=/usr/sbin/$name
config_file="/etc/syslog.conf"

depend() {
	need clock hostname localmount
        provide logger
}

check_config() {
        [ -f "$config_file" ] || error "$config_file is missing"
}

start_pre() {
        check_config || return 1
}

start() {
	ebegin "Starting ${name}"
		start-stop-daemon --start --quiet \
			--pidfile /var/run/${name}.pid \
			--exec ${daemon} -- ${SYSLOGD_OPTS}
	eend $?
}

stop() {
	ebegin "Stopping ${name}"
		start-stop-daemon --stop --quiet \
			--pidfile /var/run/$name.pid \
			--exec ${daemon}
	eend $?
}

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

        ebegin "Re-opening intetutils-syslogd log files"
        start-stop-daemon --stop --signal HUP \
                --pidfile /var/run/$name.pid
        eend $?
}