projects/aports·blob master · refs

36 lines · 834 B

1#!/sbin/openrc-run
2# This file is part of inetutils-syslogd
3# Created for Alpine Linux by Stuart Cardall <[email protected]>
4# Distributed under the terms of the GNU General Public License v2
5
6name=syslogd
7config_file="/etc/syslog.conf"
8pid_file=/var/run/syslog.pid
9command=/sbin/$name
10command_args=${SYSLOGD_OPTS}
11extra_started_commands="reload"
12
13depend() {
14 need clock hostname localmount
15 provide logger
16}
17
18check_config() {
19 [ -f "$config_file" ] || error "$config_file is missing"
20}
21
22start_pre() {
23 check_config || return 1
24}
25
26reload() {
27 if [ ! -f "${pid_file}" ]; then
28 eerror "inetutils-$name is not running"
29 return 1
30 fi
31
32 ebegin "Re-opening intetutils-$name log files"
33 pkill -HUP -f "$command $command_args"
34 eend $?
35}
36