Created
May 7, 2019 21:35
-
-
Save click0/b0f68f7c0362f708a1310bb629159b71 to your computer and use it in GitHub Desktop.
fix log warning
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- cbsdd.orig 2019-05-07 01:58:50.410050000 +0300 | |
+++ cbsdd 2019-05-07 02:01:56.420224000 +0300 | |
@@ -6,6 +6,12 @@ | |
CBSDMODULE="taskd" | |
EXTHELP="wf_taskd.html" | |
+file_log=/var/log/cbsd/cbsd.log | |
+ | |
+log123() { | |
+ echo "[$(date +'%Y-%m-%dT%H:%M:%S%z')]: $@" >> ${file_log} | |
+} | |
+ | |
. ${subr} | |
. ${cbsdinit} | |
@@ -130,7 +136,7 @@ | |
queue=$( cbsdsqlro cbsdtaskd 'SELECT COUNT(id) FROM taskd WHERE status="0"' 2>/dev/null ) | |
if [ -z "${queue}" -o "${queue}" = "0" ]; then | |
- echo "cbsdd: empty taskd queue, sleep for 15 sec.." | |
+ log123 "cbsdd: empty taskd queue, sleep for 15 sec.." | |
sleep 15 | |
continue | |
fi | |
@@ -142,7 +148,7 @@ | |
fi | |
if [ -z "${max}" ]; then | |
- echo "cbsdd: wrong max variable" | |
+ log123 "cbsdd: wrong max variable" | |
exit 1 | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment