summaryrefslogtreecommitdiffstats
path: root/modules.d/98syslog/syslog-cleanup.sh
diff options
context:
space:
mode:
Diffstat (limited to '')
-rwxr-xr-xmodules.d/98syslog/syslog-cleanup.sh14
1 files changed, 14 insertions, 0 deletions
diff --git a/modules.d/98syslog/syslog-cleanup.sh b/modules.d/98syslog/syslog-cleanup.sh
new file mode 100755
index 0000000..2d08d8a
--- /dev/null
+++ b/modules.d/98syslog/syslog-cleanup.sh
@@ -0,0 +1,14 @@
+#!/bin/sh
+
+# Just cleans up a previously started syslogd
+
+type getarg > /dev/null 2>&1 || . /lib/dracut-lib.sh
+
+if [ -f /tmp/syslog.server ]; then
+ read -r syslogtype < /tmp/syslog.type
+ if command -v "${syslogtype}-stop" > /dev/null; then
+ "${syslogtype}"-stop
+ else
+ warn "syslog-cleanup: Could not find script to stop syslog of type \"$syslogtype\". Syslog will not be stopped."
+ fi
+fi