/etc/rc.d/rc.rsyslogd: check status before reload

This commit is contained in:
desertwitch
2024-10-10 07:03:48 +02:00
parent bf6d5982be
commit 06b1c9a20f

View File

@@ -74,8 +74,12 @@ rsyslogd_restart(){
rsyslogd_reload(){
log "Reloading $DAEMON..."
local REPLY
REPLY="Reloaded"
run killall -HUP --ns $$ rsyslogd || REPLY="Failed"
if ! rsyslogd_running; then
REPLY="Not running"
else
REPLY="Reloaded"
run killall -HUP --ns $$ rsyslogd || REPLY="Failed"
fi
log "$DAEMON... $REPLY."
}