File disable-cron-logging-only-on-sles11-systems-not-on-r.patch of Package salt
From db6214ca1ff0c77f0d895c0edf5812b1708f4d6b Mon Sep 17 00:00:00 2001
From: Hubert Mantel <mantel@suse.de>
Date: Thu, 12 Apr 2018 17:36:23 +0200
Subject: [PATCH] disable cron logging only on SLES11 systems, not on
RHEL6 (bsc#1088423)
---
pkg/suse/salt-minion | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/pkg/suse/salt-minion b/pkg/suse/salt-minion
index 73a91ebd62..5567b55884 100755
--- a/pkg/suse/salt-minion
+++ b/pkg/suse/salt-minion
@@ -53,9 +53,18 @@ PROCESS=salt-minion
RETVAL=0
WATCHDOG_CRON="/etc/cron.d/salt-minion"
+cleanup_watchdog() {
+ if [ -f $WATCHDOG_CRON ]; then
+ grep "^-\*" $WATCHDOG_CRON > /dev/null 2>&1
+ if [ $? -eq 0 ]; then
+ sed -i -e "s/^-//" $WATCHDOG_CRON
+ fi
+ fi
+}
+
set_watchdog() {
if [ ! -f $WATCHDOG_CRON ]; then
- echo -e '-* * * * * root /usr/bin/salt-daemon-watcher --with-init\n' > $WATCHDOG_CRON
+ echo -e '* * * * * root /usr/bin/salt-daemon-watcher --with-init\n' > $WATCHDOG_CRON
# Kick the watcher for 1 minute immediately, because cron will wake up only afterwards
/usr/bin/salt-daemon-watcher --with-init & disown
fi
@@ -67,6 +76,7 @@ remove_watchdog() {
}
start() {
+ cleanup_watchdog;
set_watchdog;
echo -n $"Starting salt-minion daemon: "
if [ -f $SUSE_RELEASE ]; then
--
2.13.6