Bug #95140 mysqld_safe appends --log-syslog-xxx arguments causing super long command line
Submitted: 26 Apr 2019 2:30 Modified: 28 Jun 2019 5:19
Reporter: chiang nigel Email Updates:
Status: No Feedback Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:5.7.24 OS:Ubuntu
Assigned to: MySQL Verification Team CPU Architecture:x86

[26 Apr 2019 2:30] chiang nigel
Description:
mysqld_safe calls `eval_log_error "$cmd"` repeatedly in a while loop when lauching mysqld failed, but `eval_log_error` appends "--log-syslog-xxx" arguments uncondiontionaly, which causing the started mysqld with a super long command line arguments.

```sh
eval_log_error () {
  cmd="$1"
  case $logging in
    file)
      if [ -w / -o "$USER" = "root" ]; then
        cmd="$cmd > /dev/null 2>&1"
      else
        cmd="$cmd >> "`shell_quote_string "$err_log"`" 2>&1"
      fi
      ;;
    syslog)
      cmd="$cmd --log-syslog=1 --log-syslog-facility=$syslog_facility '--log-syslog-tag=$syslog_tag' > /dev/null 2>&1"
      ;;
    both)
      if [ -w / -o "$USER" = "root" ]; then
        cmd="$cmd --log-syslog=1 --log-syslog-facility=$syslog_facility '--log-syslog-tag=$syslog_tag' > /dev/null 2>&1"
      else
        cmd="$cmd --log-syslog=1 --log-syslog-facility=$syslog_facility '--log-syslog-tag=$syslog_tag' >> "`shell_quote_string "$err_log"`" 2>&1"
      fi
      ;;
    *)
      echo "Internal program error (non-fatal):" \
           " unknown logging method '$logging'" >&2
      ;;
  esac

  #echo "Running mysqld: [$cmd]"
  cmd="env MYSQLD_PARENT_PID=$$ $cmd"
  eval "$cmd"
}
```

How to repeat:
When mysqld cannot start due to some reason, the mysqld_safe problem will appear.
[28 May 2019 5:19] MySQL Verification Team
Hi,

I'm not sure I follow how's this a problem. When does this prevent mysqld from starting? Can you give me example?

thanks
Bogdan
[29 Jun 2019 1:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".