scripts: Ensure even external scripts get tagged in logs as "ctdbd"
authorMartin Schwenke <martin@meltin.net>
Mon, 22 Apr 2013 03:48:06 +0000 (13:48 +1000)
committerAmitay Isaacs <amitay@gmail.com>
Mon, 22 Apr 2013 03:58:36 +0000 (13:58 +1000)
Our practice is to search logs for "ctdbd:".  We want to make sure we
find everything.

Signed-off-by: Martin Schwenke <martin@meltin.net>
(This used to be ctdb commit 5940a2494e9e43a83f2bca098bd04dfc1a8f2e93)

ctdb/config/ctdb-crash-cleanup.sh
ctdb/config/ctdb.init
ctdb/config/functions

index b62e3c3abb3455965d86c722566878cffa79d2dd..d26838e9c5e2d326693cc2cec2198c7e66ac1f62 100755 (executable)
@@ -22,8 +22,8 @@ loadconfig ctdb
 [ -f "$CTDB_PUBLIC_ADDRESSES" ] || \
     die "No public addresses file found. Can't clean up."
 
-drop_all_public_ips "ctdb-crash-cleanup"
+drop_all_public_ips "ctdb-crash-cleanup.sh"
 
 if [ -n "$CTDB_NATGW_PUBLIC_IP" ] ; then
-    drop_ip "$CTDB_NATGW_PUBLIC_IP" "ctdb-crash-cleanup"
+    drop_ip "$CTDB_NATGW_PUBLIC_IP" "ctdb-crash-cleanup.sh"
 fi
index d92fef05ae7c99d905f0644d1d5dd08b0e6da982..a76b76397668017be380e08fd0f0e3f9b90b500a 100755 (executable)
@@ -249,7 +249,7 @@ start() {
 
     # make sure we drop any ips that might still be held if previous
     # instance of ctdb got killed with -9 or similar
-    drop_all_public_ips
+    drop_all_public_ips "ctdb.init"
 
     if select_tdb_checker ; then
        check_persistent_databases || return $?
index b755e554134d8014fc23ed0b9cf4cff797a652ea..b4450c38b5e425081a6c981ab9b439f3c7c0158d 100755 (executable)
@@ -83,7 +83,7 @@ script_log ()
     esac
 
     if $_using_syslog ; then
-       logger -t "$_tag" "$*"
+       logger -t "ctdbd" "${_tag}: $*"
     else
        {
            if [ -n "$*" ] ; then
@@ -101,7 +101,7 @@ background_with_logging ()
 {
     (
        "$@" 2>&1 </dev/null |
-       script_log "ctdbd: ${script_name}&"
+       script_log "${script_name}&"
     )&
 
     return 0