Support --defaults-group-suffix option in systemd unit file
Related: #1400702
This commit is contained in:
parent
84ceb88ce7
commit
7df1bd6b07
@ -962,6 +962,8 @@ fi
|
|||||||
%changelog
|
%changelog
|
||||||
* Mon Aug 28 2017 Honza Horak <hhorak@redhat.com> - 5.7.19-6
|
* Mon Aug 28 2017 Honza Horak <hhorak@redhat.com> - 5.7.19-6
|
||||||
- Add bundled(boost) virtual provide
|
- Add bundled(boost) virtual provide
|
||||||
|
- Support --defaults-group-suffix option in systemd unit file
|
||||||
|
Related: #1400702
|
||||||
|
|
||||||
* Fri Aug 04 2017 Honza Horak <hhorak@redhat.com> - 5.7.19-5
|
* Fri Aug 04 2017 Honza Horak <hhorak@redhat.com> - 5.7.19-5
|
||||||
- Allow to use MD5 in FIPS mode
|
- Allow to use MD5 in FIPS mode
|
||||||
|
@ -18,13 +18,23 @@ get_mysql_option(){
|
|||||||
sections="$1"
|
sections="$1"
|
||||||
option_name="$2"
|
option_name="$2"
|
||||||
default_value="$3"
|
default_value="$3"
|
||||||
result=`@bindir@/my_print_defaults $sections | sed -n "s/^--${option_name}=//p" | tail -n 1`
|
result=`@bindir@/my_print_defaults $my_print_defaults_extra_args $sections | sed -n "s/^--${option_name}=//p" | tail -n 1`
|
||||||
if [ -z "$result" ]; then
|
if [ -z "$result" ]; then
|
||||||
# not found, use default
|
# not found, use default
|
||||||
result="${default_value}"
|
result="${default_value}"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# For the case of running more instances via systemd, scrits that source
|
||||||
|
# this file can get --default-group-suffix or similar option as the first
|
||||||
|
# argument. The utility my_print_defaults needs to use it as well, so the
|
||||||
|
# scripts sourcing this file work with the same options as the daemon.
|
||||||
|
my_print_defaults_extra_args=''
|
||||||
|
while echo "$1" | grep -q '^--defaults' ; do
|
||||||
|
my_print_defaults_extra_args="${my_print_defaults_extra_args} $1"
|
||||||
|
shift
|
||||||
|
done
|
||||||
|
|
||||||
# Defaults here had better match what mysqld_safe will default to
|
# Defaults here had better match what mysqld_safe will default to
|
||||||
# The option values are generally defined on three important places
|
# The option values are generally defined on three important places
|
||||||
# on the default installation:
|
# on the default installation:
|
||||||
|
@ -34,15 +34,14 @@ After=network.target
|
|||||||
Type=forking
|
Type=forking
|
||||||
User=mysql
|
User=mysql
|
||||||
Group=mysql
|
Group=mysql
|
||||||
PIDFile=@PID_FILE_DIR@/@DAEMON_NO_PREFIX@.pid
|
|
||||||
|
|
||||||
ExecStartPre=@libexecdir@/mysql-check-socket
|
ExecStartPre=@libexecdir@/mysql-check-socket --defaults-group-suffix=.%I
|
||||||
ExecStartPre=@libexecdir@/mysql-prepare-db-dir %n
|
ExecStartPre=@libexecdir@/mysql-prepare-db-dir --defaults-group-suffix=.%I %n
|
||||||
# Note: we set --basedir to prevent probes that might trigger SELinux alarms,
|
# Note: we set --basedir to prevent probes that might trigger SELinux alarms,
|
||||||
# per bug #547485
|
# per bug #547485
|
||||||
ExecStart=@libexecdir@/mysqld --defaults-group-suffix=.%I --daemonize --basedir=@prefix@ --pid-file=@PID_FILE_DIR@/@DAEMON_NO_PREFIX@.pid
|
ExecStart=@libexecdir@/mysqld --defaults-group-suffix=.%I --daemonize --basedir=@prefix@ --pid-file=@PID_FILE_DIR@/@DAEMON_NO_PREFIX@.pid
|
||||||
ExecStartPost=@libexecdir@/mysql-check-upgrade
|
ExecStartPost=@libexecdir@/mysql-check-upgrade --defaults-group-suffix=.%I
|
||||||
ExecStopPost=@libexecdir@/mysql-wait-stop
|
ExecStopPost=@libexecdir@/mysql-wait-stop --defaults-group-suffix=.%I
|
||||||
|
|
||||||
# Give a reasonable amount of time for the server to start up/shut down
|
# Give a reasonable amount of time for the server to start up/shut down
|
||||||
TimeoutSec=300
|
TimeoutSec=300
|
||||||
|
Loading…
Reference in New Issue
Block a user