aboutsummaryrefslogtreecommitdiffstats
path: root/community/inetutils-syslogd/inetutils-syslogd.initd
diff options
context:
space:
mode:
Diffstat (limited to 'community/inetutils-syslogd/inetutils-syslogd.initd')
-rw-r--r--community/inetutils-syslogd/inetutils-syslogd.initd36
1 files changed, 36 insertions, 0 deletions
diff --git a/community/inetutils-syslogd/inetutils-syslogd.initd b/community/inetutils-syslogd/inetutils-syslogd.initd
new file mode 100644
index 0000000000..a10caa738d
--- /dev/null
+++ b/community/inetutils-syslogd/inetutils-syslogd.initd
@@ -0,0 +1,36 @@
+#!/sbin/openrc-run
+# This file is part of inetutils-syslogd
+# Created for Alpine Linux by Stuart Cardall <developer@it-offshore.co.uk>
+# Distributed under the terms of the GNU General Public License v2
+
+name=syslogd
+config_file="/etc/syslog.conf"
+pid_file=/var/run/syslog.pid
+command=/usr/sbin/$name
+command_args=${SYSLOGD_OPTS}
+extra_started_commands="reload"
+
+depend() {
+ need clock hostname localmount
+ provide logger
+}
+
+check_config() {
+ [ -f "$config_file" ] || error "$config_file is missing"
+}
+
+start_pre() {
+ check_config || return 1
+}
+
+reload() {
+ if [ ! -f "${pid_file}" ]; then
+ eerror "inetutils-$name is not running"
+ return 1
+ fi
+
+ ebegin "Re-opening intetutils-$name log files"
+ pkill -HUP -f "$command $command_args"
+ eend $?
+}
+