Преглед изворни кода

fix(bin/emqx): fix boot log

prior to this fix the logger message (syslog) has the name and pid
missing.
with this change, the programe name, and its boot command is logged
to syslog, so the console boot is cleaner
Zaiming Shi пре 4 година
родитељ
комит
2e3c98dd55
1 измењених фајлова са 3 додато и 9 уклоњено
  1. 3 9
      bin/emqx

+ 3 - 9
bin/emqx

@@ -598,13 +598,8 @@ case "$1" in
             -mnesia dir "\"${MNESIA_DATA_DIR}\"" \
             $RELX_CONFIG_PATH $CONFIG_ARGS $EPMD_ARG
 
-        # Dump environment info for logging purposes
-        echo "Exec: $*" -- ${1+$ARGS}
-        echo "Root: $ROOTDIR"
-
         # Log the startup
-        echo "$RUNNER_ROOT_DIR"
-        logger -t "${REL_NAME[$$]}" "Starting up"
+        logger -t "${REL_NAME}[$$]" "$* -- ${1+$ARGS}"
 
         # Start the VM
         exec "$@" -- ${1+$ARGS}
@@ -644,9 +639,8 @@ case "$1" in
             -mnesia dir "\"${MNESIA_DATA_DIR}\"" \
             $RELX_CONFIG_PATH $CONFIG_ARGS $EPMD_ARG
 
-        # Dump environment info for logging purposes
-        echo "Exec: $*" -- ${1+$ARGS}
-        echo "Root: $ROOTDIR"
+        # Log the startup
+        logger -t "${REL_NAME}[$$]" "$* -- ${1+$ARGS}"
 
         # Start the VM
         exec "$@" -- ${1+$ARGS}