Skip to content

Instantly share code, notes, and snippets.

@click0
Created May 7, 2019 21:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save click0/b0f68f7c0362f708a1310bb629159b71 to your computer and use it in GitHub Desktop.
Save click0/b0f68f7c0362f708a1310bb629159b71 to your computer and use it in GitHub Desktop.
fix log warning
--- 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