Compare commits
No commits in common. 'c9' and 'c8-stream-8.0' have entirely different histories.
c9
...
c8-stream-
@ -0,0 +1,43 @@
|
||||
#!/bin/sh
|
||||
|
||||
# This helper script is necessary for having proper SELinux context of daemon
|
||||
# process run in SCL environment via systemd unit file.
|
||||
# Without this script the process looses SELinux type because /usr/bin/scl
|
||||
# has context bin_t and unit_t -> bin_t results in unconfined process running.
|
||||
# If this helper script has the same SELinux context as the original binary,
|
||||
# the process will have proper SELinux context.
|
||||
#
|
||||
# This script was designed to be usable the same as the scl command is used,
|
||||
# including the collections given as more arguments, separated from binary
|
||||
# itself by -- separator.
|
||||
# So it is possible to use the list of collections to be enabled via
|
||||
# environment file.
|
||||
# Thus, instead of:
|
||||
# /usr/bin/scl enable scl1 scl2 -- /path/to/bin arg1 arg2
|
||||
# you can use:
|
||||
# /usr/bin/this-script enable scl1 scl2 -- /path/to/bin arg1 arg2
|
||||
#
|
||||
# Notice: do not forget to set proper SELinux context for this file.
|
||||
# The context should be the same as the binary running has.
|
||||
#
|
||||
# More information at http://bugzilla.redhat.com/show_bug.cgi?id=1172683
|
||||
|
||||
action="$1"
|
||||
shift
|
||||
|
||||
while [ -n "$1" ] && [ "$1" != "--" ] ; do
|
||||
source scl_source "$action" "$1"
|
||||
shift
|
||||
done
|
||||
|
||||
if [ $# -le 2 ] ; then
|
||||
echo "Usage `basename $0` enable sclname [sclname ...] -- /path/to/bin [arg ...]" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
shift
|
||||
|
||||
exec "$@"
|
||||
|
||||
|
||||
|
@ -0,0 +1,12 @@
|
||||
#
|
||||
# MySQL 8.0.4 introduced 'caching_sha2_password' as its default authentication plugin.
|
||||
# It is faster and provides better security then the previous default authentication plugin.
|
||||
#
|
||||
# Until now (09/2018), it does not work with some other software (eg. MariaDB client, MariaDB connectors, ...)
|
||||
#
|
||||
# This configuration file changes MySQL default server configuration, so it behaves the same way as in MySQL 5.7.
|
||||
#
|
||||
# To change the behaviour back to the upstream default, comment out the following lines:
|
||||
|
||||
[mysqld]
|
||||
default_authentication_plugin=mysql_native_password
|
@ -0,0 +1,48 @@
|
||||
# Filtered out until upstream fixes them
|
||||
# Upstream bug: http://bugs.mysql.com/68518
|
||||
addFilter("incorrect-fsf-address")
|
||||
|
||||
# Done to avoid _prefix/lib64/tmpfiles.d
|
||||
addFilter("E: hardcoded-library-path in %\{_prefix\}/lib/tmpfiles.d")
|
||||
|
||||
# Keeping the old summary for now
|
||||
addFilter("W: name-repeated-in-summary C MySQL")
|
||||
|
||||
# Spellchecked
|
||||
addFilter("W: spelling-error %description -l en_US multi -> mulch, mufti")
|
||||
addFilter("W: spelling-error %description -l en_US benchmarking -> bench marking, bench-marking, benchmark")
|
||||
addFilter("W: spelling-error Summary(en_US) embeddable -> embedded")
|
||||
addFilter("W: spelling-error.*embeddable -> embedded")
|
||||
|
||||
# As long as the manual is part of the original tarball, we have do to
|
||||
# this
|
||||
addFilter("mysql.src: W: invalid-url Source0: mysql-5.6.[0-9]+-nodocs.tar.gz")
|
||||
|
||||
# Leave the logfile where it is for now
|
||||
addFilter("E: non-root-user-log-file /var/log/mysqld.log mysql")
|
||||
addFilter("E: non-root-group-log-file /var/log/mysqld.log mysql")
|
||||
addFilter("E: non-ghost-file /var/log/mysqld.log")
|
||||
addFilter("E: zero-length /var/log/mysqld.log")
|
||||
|
||||
addFilter("E: incoherent-logrotate-file /etc/logrotate.d/mysqld")
|
||||
|
||||
# Hidden files and zero lenght files is normal for some tests
|
||||
addFilter("W: hidden-file-or-dir /usr/share/mysql-test/std_data/.mylogin.cnf")
|
||||
addFilter("E: zero-length /usr/share/mysql-test/suite/parts/t/disabled.def")
|
||||
addFilter("E: zero-length /usr/share/mysql-test/std_data/bug37631.MYD")
|
||||
addFilter("E: zero-length /usr/share/mysql-test/std_data/cluster_7022_table.MYD")
|
||||
addFilter("E: zero-length /usr/share/mysql-test/collections/disabled-weekly.list")
|
||||
addFilter("E: zero-length /usr/share/mysql-test/collections/disabled-daily.list")
|
||||
|
||||
# debuginfo bug?
|
||||
addFilter("E: non-standard-dir-perm /usr/src/debug/tmp 01777")
|
||||
|
||||
# mysql-config *script* in lib
|
||||
addFilter("W: only-non-binary-in-usr-lib")
|
||||
|
||||
# missing
|
||||
addFilter("W: no-manual-page-for-binary my_safe_process")
|
||||
|
||||
# cluster is gone
|
||||
addFilter("W: obsolete-not-provided mysql-cluster")
|
||||
|
@ -0,0 +1,39 @@
|
||||
#!/bin/sh
|
||||
|
||||
source "`dirname ${BASH_SOURCE[0]}`/mysql-scripts-common"
|
||||
|
||||
upgrade_info_file="$datadir/mysql_upgrade_info"
|
||||
version=0
|
||||
# get version as integer from mysql_upgrade_info file
|
||||
if [ -f "$upgrade_info_file" ] && [ -r "$upgrade_info_file" ] ; then
|
||||
version_major=$(cat "$upgrade_info_file" | head -n 1 | sed -e 's/\([0-9]*\)\.\([0-9]*\)\..*$/\1/')
|
||||
version_minor=$(cat "$upgrade_info_file" | head -n 1 | sed -e 's/\([0-9]*\)\.\([0-9]*\)\..*$/\2/')
|
||||
if [[ $version_major =~ ^[0-9]+$ ]] && [[ $version_minor =~ ^[0-9]+$ ]] ; then
|
||||
version=$((version_major*100+version_minor))
|
||||
fi
|
||||
fi
|
||||
|
||||
# compute current version as integer
|
||||
thisversion=$((@MAJOR_VERSION@*100+@MINOR_VERSION@))
|
||||
|
||||
# provide warning in cases we should run mysql_upgrade
|
||||
if [ $version -ne $thisversion ] ; then
|
||||
|
||||
# give extra warning if some version seems to be skipped
|
||||
if [ $version -gt 0 ] && [ $version -lt 505 ] ; then
|
||||
echo "The datadir located at $datadir seems to be older than of a version 5.5. Please, mind that as a general rule, to upgrade from one release series to another, go to the next series rather than skipping a series." >&2
|
||||
fi
|
||||
|
||||
cat <<EOF >&2
|
||||
The datadir located at $datadir needs to be upgraded using 'mysql_upgrade' tool. This can be done using the following steps:
|
||||
|
||||
1. Back-up your data before with 'mysql_upgrade'
|
||||
2. Start the database daemon using 'service @DAEMON_NAME@ start'
|
||||
3. Run 'mysql_upgrade' with a database user that has sufficient privileges
|
||||
|
||||
Read more about 'mysql_upgrade' usage at:
|
||||
http://dev.mysql.com/doc/refman/5.6/en/mysql-upgrade.html
|
||||
EOF
|
||||
fi
|
||||
|
||||
exit 0
|
@ -0,0 +1,11 @@
|
||||
--- mysql-8.0.11/support-files/mysql-log-rotate.in.old 2018-09-13 18:43:03.595891364 +0200
|
||||
+++ mysql-8.0.11/support-files/mysql-log-rotate.in 2018-09-13 18:43:36.774236649 +0200
|
||||
@@ -41,7 +41,7 @@
|
||||
# ATTENTION: The /root/.my.cnf file should be readable
|
||||
# _ONLY_ by root !
|
||||
|
||||
-@localstatedir@/mysqld.log {
|
||||
+@LOG_LOCATION@ {
|
||||
# create 600 mysql mysql
|
||||
notifempty
|
||||
daily
|
@ -0,0 +1,144 @@
|
||||
diff -up mysql-8.0.11/scripts/mysqld_safe.sh.p90 mysql-8.0.11/scripts/mysqld_safe.sh
|
||||
--- mysql-8.0.11/scripts/mysqld_safe.sh.p90 2018-04-08 08:44:49.000000000 +0200
|
||||
+++ mysql-8.0.11/scripts/mysqld_safe.sh 2018-06-23 21:28:20.533825845 +0200
|
||||
@@ -11,6 +11,12 @@
|
||||
# mysql.server works by first doing a cd to the base directory and from there
|
||||
# executing mysqld_safe
|
||||
|
||||
+# we want start daemon only inside "scl enable" invocation
|
||||
+if ! scl_enabled @SCL_NAME@ ; then
|
||||
+ echo "Use \"scl enable @SCL_NAME@ 'service ...'\" invocation"
|
||||
+ exit 1
|
||||
+fi
|
||||
+
|
||||
# Initialize script globals
|
||||
KILL_MYSQLD=1;
|
||||
MYSQLD=
|
||||
diff -up mysql-8.0.11/scripts/mysql.init.in.p90 mysql-8.0.11/scripts/mysql.init.in
|
||||
--- mysql-8.0.11/scripts/mysql.init.in.p90 2018-06-23 21:28:20.531825833 +0200
|
||||
+++ mysql-8.0.11/scripts/mysql.init.in 2018-06-23 21:28:20.533825845 +0200
|
||||
@@ -71,8 +71,8 @@ start(){
|
||||
action $"Starting $prog: " /bin/true
|
||||
ret=0
|
||||
else
|
||||
- @libexecdir@/mysql-check-socket || return 1
|
||||
- su - $MYUSER -s /bin/bash -c "@libexecdir@/mysql-prepare-db-dir $MYUSER $MYGROUP" || return 4
|
||||
+ scl enable $@SCL_NAME_UPPER@_SCLS_ENABLED -- @libexecdir@/mysql-check-socket || return 1
|
||||
+ su - $MYUSER -s /bin/bash -c "scl enable $@SCL_NAME_UPPER@_SCLS_ENABLED -- @libexecdir@/mysql-prepare-db-dir $MYUSER $MYGROUP" || return 4
|
||||
|
||||
# Pass all the options determined above, to ensure consistent behavior.
|
||||
# In many cases mysqld_safe would arrive at the same conclusions anyway
|
||||
@@ -81,13 +81,13 @@ start(){
|
||||
# and some users might prefer to configure logging to syslog.)
|
||||
# Note: set --basedir to prevent probes that might trigger SELinux
|
||||
# alarms, per bug #547485
|
||||
- su - $MYUSER -s /bin/bash -c "$exec --datadir='$datadir' --socket='$socketfile' \
|
||||
+ su - $MYUSER -s /bin/bash -c "scl enable $@SCL_NAME_UPPER@_SCLS_ENABLED -- $exec --datadir='$datadir' --socket='$socketfile' \
|
||||
--pid-file='$pidfile' \
|
||||
--basedir=@prefix@ --user=$MYUSER" >/dev/null 2>&1 &
|
||||
safe_pid=$!
|
||||
|
||||
# Wait until the daemon is up
|
||||
- su - $MYUSER -s /bin/bash -c "@libexecdir@/mysql-wait-ready '$safe_pid'"
|
||||
+ su - $MYUSER -s /bin/bash -c "scl enable $@SCL_NAME_UPPER@_SCLS_ENABLED -- @libexecdir@/mysql-wait-ready '$safe_pid'"
|
||||
ret=$?
|
||||
|
||||
if [ $ret -eq 0 ]; then
|
||||
@@ -154,6 +154,18 @@ condrestart(){
|
||||
[ -e $lockfile ] && restart || :
|
||||
}
|
||||
|
||||
+# We have to re-enable SCL environment, because /sbin/service
|
||||
+# clears almost all environment variables.
|
||||
+# Since X_SCLS is cleared as well, we lose information about other
|
||||
+# collections enabled.
|
||||
+source @SCL_SCRIPTS@/service-environment
|
||||
+source scl_source enable $@SCL_NAME_UPPER@_SCLS_ENABLED
|
||||
+
|
||||
+# we want start daemon only inside "scl enable" invocation
|
||||
+if ! scl_enabled @SCL_NAME@ ; then
|
||||
+ echo "Collection @SCL_NAME@ has to be listed in @SCL_SCRIPTS@/service-environment"
|
||||
+ exit 1
|
||||
+fi
|
||||
|
||||
# See how we were called.
|
||||
case "$1" in
|
||||
diff -up mysql-8.0.11/scripts/mysql.service.in.p90 mysql-8.0.11/scripts/mysql.service.in
|
||||
--- mysql-8.0.11/scripts/mysql.service.in.p90 2018-06-23 21:28:20.531825833 +0200
|
||||
+++ mysql-8.0.11/scripts/mysql.service.in 2018-06-23 21:34:19.940881913 +0200
|
||||
@@ -32,16 +32,23 @@ After=network.target
|
||||
|
||||
[Service]
|
||||
Type=notify
|
||||
+NotifyAccess=all
|
||||
User=mysql
|
||||
Group=mysql
|
||||
|
||||
-ExecStartPre=@libexecdir@/mysql-check-socket
|
||||
-ExecStartPre=@libexecdir@/mysql-prepare-db-dir %n
|
||||
+# Load collections set to enabled for this service
|
||||
+EnvironmentFile=@SCL_SCRIPTS@/service-environment
|
||||
+
|
||||
+# We want to start server only inside "scl enable" invocation
|
||||
+ExecStartPre=/usr/bin/scl enable $@SCL_NAME_UPPER@_SCLS_ENABLED -- /usr/bin/scl_enabled @SCL_NAME@
|
||||
+
|
||||
+ExecStartPre=/usr/bin/scl enable $@SCL_NAME_UPPER@_SCLS_ENABLED -- @libexecdir@/mysql-check-socket
|
||||
+ExecStartPre=/usr/bin/scl enable $@SCL_NAME_UPPER@_SCLS_ENABLED -- @libexecdir@/mysql-prepare-db-dir %n
|
||||
# Note: we set --basedir to prevent probes that might trigger SELinux alarms,
|
||||
# per bug #547485
|
||||
-ExecStart=@libexecdir@/mysqld --basedir=@prefix@
|
||||
-ExecStartPost=@libexecdir@/mysql-check-upgrade
|
||||
-ExecStopPost=@libexecdir@/mysql-wait-stop
|
||||
+ExecStart=@libexecdir@/mysqld-scl-helper enable $@SCL_NAME_UPPER@_SCLS_ENABLED -- @libexecdir@/mysqld --basedir=@prefix@
|
||||
+ExecStartPost=/usr/bin/scl enable $@SCL_NAME_UPPER@_SCLS_ENABLED -- @libexecdir@/mysql-check-upgrade
|
||||
+ExecStopPost=/usr/bin/scl enable $@SCL_NAME_UPPER@_SCLS_ENABLED -- @libexecdir@/mysql-wait-stop
|
||||
|
||||
# Give a reasonable amount of time for the server to start up/shut down
|
||||
TimeoutSec=300
|
||||
diff -up mysql-8.0.11/scripts/mysql@.service.in.p90 mysql-8.0.11/scripts/mysql@.service.in
|
||||
--- mysql-8.0.11/scripts/mysql@.service.in.p90 2018-06-23 21:28:20.531825833 +0200
|
||||
+++ mysql-8.0.11/scripts/mysql@.service.in 2018-06-23 21:34:30.583942800 +0200
|
||||
@@ -32,16 +32,23 @@ After=network.target
|
||||
|
||||
[Service]
|
||||
Type=notify
|
||||
+NotifyAccess=all
|
||||
User=mysql
|
||||
Group=mysql
|
||||
|
||||
-ExecStartPre=@libexecdir@/mysql-check-socket --defaults-group-suffix=.%I
|
||||
-ExecStartPre=@libexecdir@/mysql-prepare-db-dir --defaults-group-suffix=.%I %n
|
||||
+# Load collections set to enabled for this service
|
||||
+EnvironmentFile=@SCL_SCRIPTS@/service-environment
|
||||
+
|
||||
+# We want to start server only inside "scl enable" invocation
|
||||
+ExecStartPre=/usr/bin/scl enable $@SCL_NAME_UPPER@_SCLS_ENABLED -- /usr/bin/scl_enabled @SCL_NAME@
|
||||
+
|
||||
+ExecStartPre=/usr/bin/scl enable $@SCL_NAME_UPPER@_SCLS_ENABLED -- @libexecdir@/mysql-check-socket --defaults-group-suffix=.%I
|
||||
+ExecStartPre=/usr/bin/scl enable $@SCL_NAME_UPPER@_SCLS_ENABLED -- @libexecdir@/mysql-prepare-db-dir --defaults-group-suffix=.%I %n
|
||||
# Note: we set --basedir to prevent probes that might trigger SELinux alarms,
|
||||
# per bug #547485
|
||||
-ExecStart=@libexecdir@/mysqld --defaults-group-suffix=.%I --basedir=@prefix@
|
||||
-ExecStartPost=@libexecdir@/mysql-check-upgrade --defaults-group-suffix=.%I
|
||||
-ExecStopPost=@libexecdir@/mysql-wait-stop --defaults-group-suffix=.%I
|
||||
+ExecStart=@libexecdir@/mysqld-scl-helper enable $@SCL_NAME_UPPER@_SCLS_ENABLED -- @libexecdir@/mysqld --defaults-group-suffix=.%I --basedir=@prefix@
|
||||
+ExecStartPost=/usr/bin/scl enable $@SCL_NAME_UPPER@_SCLS_ENABLED -- @libexecdir@/mysql-check-upgrade --defaults-group-suffix=.%I
|
||||
+ExecStopPost=/usr/bin/scl enable $@SCL_NAME_UPPER@_SCLS_ENABLED -- @libexecdir@/mysql-wait-stop --defaults-group-suffix=.%I
|
||||
|
||||
# Give a reasonable amount of time for the server to start up/shut down
|
||||
TimeoutSec=300
|
||||
diff -up mysql-8.0.11/support-files/mysql-log-rotate.sh.p90 mysql-8.0.11/support-files/mysql-log-rotate.sh
|
||||
--- mysql-8.0.11/support-files/mysql-log-rotate.sh.p90 2018-04-08 08:44:49.000000000 +0200
|
||||
+++ mysql-8.0.11/support-files/mysql-log-rotate.sh 2018-06-23 21:28:20.533825845 +0200
|
||||
@@ -51,9 +51,9 @@
|
||||
postrotate
|
||||
# just if mysqld is really running
|
||||
if test -x @bindir@/mysqladmin && \
|
||||
- @bindir@/mysqladmin ping &>/dev/null
|
||||
+ /usr/bin/scl enable @SCL_NAME@ -- @bindir@/mysqladmin ping &>/dev/null
|
||||
then
|
||||
- @bindir@/mysqladmin flush-logs
|
||||
+ /usr/bin/scl enable @SCL_NAME@ -- @bindir@/mysqladmin flush-logs
|
||||
fi
|
||||
endscript
|
||||
}
|
@ -0,0 +1,10 @@
|
||||
|
||||
module mysql-sysnice 1.0;
|
||||
|
||||
require {
|
||||
type mysqld_t;
|
||||
class capability sys_nice;
|
||||
}
|
||||
|
||||
#============= mysqld_t ==============
|
||||
allow mysqld_t self:capability sys_nice;
|
@ -0,0 +1,45 @@
|
||||
#!/bin/sh
|
||||
|
||||
source "`dirname ${BASH_SOURCE[0]}`/mysql-scripts-common"
|
||||
|
||||
# This script waits for mysqld to be ready to accept connections
|
||||
# (which can be many seconds or even minutes after launch, if there's
|
||||
# a lot of crash-recovery work to do).
|
||||
# Running this as ExecStartPost is useful so that services declared as
|
||||
# "After mysqld" won't be started until the database is really ready.
|
||||
|
||||
if [ $# -ne 1 ] ; then
|
||||
echo "You need to pass daemon pid as an argument for this script."
|
||||
exit 20
|
||||
fi
|
||||
|
||||
# Service file passes us the daemon's PID (actually, mysqld_safe's PID)
|
||||
daemon_pid="$1"
|
||||
|
||||
# Wait for the server to come up or for the mysqld process to disappear
|
||||
ret=0
|
||||
while /bin/true; do
|
||||
# Check process still exists
|
||||
if ! [ -d "/proc/${daemon_pid}" ] ; then
|
||||
ret=1
|
||||
break
|
||||
fi
|
||||
RESPONSE=`@bindir@/mysqladmin --no-defaults --socket="$socketfile" --user=UNKNOWN_MYSQL_USER ping 2>&1`
|
||||
mret=$?
|
||||
if [ $mret -eq 0 ] ; then
|
||||
break
|
||||
fi
|
||||
# exit codes 1, 11 (EXIT_CANNOT_CONNECT_TO_SERVICE) are expected,
|
||||
# anything else suggests a configuration error
|
||||
if [ $mret -ne 1 -a $mret -ne 11 ]; then
|
||||
echo "Cannot check for @NICE_PROJECT_NAME@ Daemon startup because of mysqladmin failure." >&2
|
||||
ret=$mret
|
||||
break
|
||||
fi
|
||||
# "Access denied" also means the server is alive
|
||||
echo "$RESPONSE" | grep -q "Access denied for user" && break
|
||||
|
||||
sleep 1
|
||||
done
|
||||
|
||||
exit $ret
|
@ -0,0 +1,186 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# @DAEMON_NAME@ This shell script takes care of starting and stopping
|
||||
# the MySQL subsystem (mysqld).
|
||||
#
|
||||
# chkconfig: - 64 36
|
||||
# description: MySQL database server.
|
||||
# processname: mysqld
|
||||
# config: @sysconfdir@/my.cnf
|
||||
# pidfile: /var/run/@DAEMON_NAME@/@DAEMON_NO_PREFIX@.pid
|
||||
### BEGIN INIT INFO
|
||||
# Provides: mysqld
|
||||
# Required-Start: $local_fs $remote_fs $network $named $syslog $time
|
||||
# Required-Stop: $local_fs $remote_fs $network $named $syslog $time
|
||||
# Short-Description: start and stop MySQL server
|
||||
# Description: MySQL database server
|
||||
### END INIT INFO
|
||||
|
||||
# Source function library.
|
||||
. /etc/rc.d/init.d/functions
|
||||
|
||||
# Source networking configuration.
|
||||
. /etc/sysconfig/network
|
||||
|
||||
|
||||
exec="@bindir@/mysqld_safe"
|
||||
prog="@DAEMON_NAME@"
|
||||
|
||||
# Set timeouts here so they can be overridden from @sysconfdir@/sysconfig/@DAEMON_NO_PREFIX@
|
||||
STARTTIMEOUT=300
|
||||
STOPTIMEOUT=60
|
||||
|
||||
# User and group the daemon will run under
|
||||
MYUSER=mysql
|
||||
MYGROUP=mysql
|
||||
|
||||
# Edit the following file in order to re-write some of the environment
|
||||
# variables defined above, like $STARTTIMEOUT, $STOPTIMEOUT, $exec
|
||||
[ -e @sysconfdir@/sysconfig/@DAEMON_NO_PREFIX@ ] && . @sysconfdir@/sysconfig/@DAEMON_NO_PREFIX@
|
||||
|
||||
lockfile=/var/lock/subsys/$prog
|
||||
|
||||
# get options from my.cnf
|
||||
source "@libexecdir@/mysql-scripts-common"
|
||||
|
||||
start(){
|
||||
[ -x $exec ] || exit 5
|
||||
|
||||
# check permissions
|
||||
if ! touch $(dirname $socketfile) &>/dev/null ; then
|
||||
action $"Starting $prog: " /bin/false
|
||||
return 4
|
||||
fi
|
||||
|
||||
# check to see if it's already running
|
||||
MYSQLDRUNNING=0
|
||||
if [ -f "$pidfile" ]; then
|
||||
MYSQLPID=`cat "$pidfile" 2>/dev/null`
|
||||
if [ -n "$MYSQLPID" ] && [ -d "/proc/$MYSQLPID" ] ; then
|
||||
MYSQLDRUNNING=1
|
||||
fi
|
||||
fi
|
||||
RESPONSE=`@bindir@/mysqladmin --no-defaults --socket="$socketfile" --user=UNKNOWN_MYSQL_USER ping 2>&1`
|
||||
if [ $MYSQLDRUNNING = 1 ] && [ $? = 0 ]; then
|
||||
# already running, do nothing
|
||||
action $"Starting $prog: " /bin/true
|
||||
ret=0
|
||||
elif [ $MYSQLDRUNNING = 1 ] && echo "$RESPONSE" | grep -q "Access denied for user"
|
||||
then
|
||||
# already running, do nothing
|
||||
action $"Starting $prog: " /bin/true
|
||||
ret=0
|
||||
else
|
||||
@libexecdir@/mysql-check-socket || return 1
|
||||
su - $MYUSER -s /bin/bash -c "@libexecdir@/mysql-prepare-db-dir $MYUSER $MYGROUP" || return 4
|
||||
|
||||
# Pass all the options determined above, to ensure consistent behavior.
|
||||
# In many cases mysqld_safe would arrive at the same conclusions anyway
|
||||
# but we need to be sure. (An exception is that we don't force the
|
||||
# log-error setting, since this script doesn't really depend on that,
|
||||
# and some users might prefer to configure logging to syslog.)
|
||||
# Note: set --basedir to prevent probes that might trigger SELinux
|
||||
# alarms, per bug #547485
|
||||
su - $MYUSER -s /bin/bash -c "$exec --datadir='$datadir' --socket='$socketfile' \
|
||||
--pid-file='$pidfile' \
|
||||
--basedir=@prefix@ --user=$MYUSER" >/dev/null 2>&1 &
|
||||
safe_pid=$!
|
||||
|
||||
# Wait until the daemon is up
|
||||
su - $MYUSER -s /bin/bash -c "@libexecdir@/mysql-wait-ready '$safe_pid'"
|
||||
ret=$?
|
||||
|
||||
if [ $ret -eq 0 ]; then
|
||||
action $"Starting $prog: " /bin/true
|
||||
chmod o+r $pidfile >/dev/null 2>&1
|
||||
touch $lockfile
|
||||
else
|
||||
action $"Starting $prog: " /bin/false
|
||||
fi
|
||||
fi
|
||||
return $ret
|
||||
}
|
||||
|
||||
stop(){
|
||||
if [ ! -f "$pidfile" ]; then
|
||||
# not running; per LSB standards this is "ok"
|
||||
action $"Stopping $prog: " /bin/true
|
||||
return 0
|
||||
fi
|
||||
MYSQLPID=`cat "$pidfile" 2>/dev/null`
|
||||
if [ -n "$MYSQLPID" ]; then
|
||||
if ! [ -d "/proc/$MYSQLPID" ] ; then
|
||||
# process doesn't run anymore
|
||||
action $"Stopping $prog: " /bin/true
|
||||
return 0
|
||||
fi
|
||||
/bin/kill "$MYSQLPID" >/dev/null 2>&1
|
||||
ret=$?
|
||||
if [ $ret -eq 0 ]; then
|
||||
TIMEOUT="$STOPTIMEOUT"
|
||||
while [ $TIMEOUT -gt 0 ]; do
|
||||
/bin/kill -0 "$MYSQLPID" >/dev/null 2>&1 || break
|
||||
sleep 1
|
||||
let TIMEOUT=${TIMEOUT}-1
|
||||
done
|
||||
if [ $TIMEOUT -eq 0 ]; then
|
||||
echo "Timeout error occurred trying to stop MySQL Daemon."
|
||||
ret=1
|
||||
action $"Stopping $prog: " /bin/false
|
||||
else
|
||||
rm -f $lockfile
|
||||
rm -f "$socketfile"
|
||||
action $"Stopping $prog: " /bin/true
|
||||
fi
|
||||
else
|
||||
# kill command failed, probably insufficient permissions
|
||||
action $"Stopping $prog: " /bin/false
|
||||
ret=4
|
||||
fi
|
||||
else
|
||||
# failed to read pidfile, probably insufficient permissions
|
||||
action $"Stopping $prog: " /bin/false
|
||||
ret=4
|
||||
fi
|
||||
return $ret
|
||||
}
|
||||
|
||||
restart(){
|
||||
stop
|
||||
start
|
||||
}
|
||||
|
||||
condrestart(){
|
||||
[ -e $lockfile ] && restart || :
|
||||
}
|
||||
|
||||
|
||||
# See how we were called.
|
||||
case "$1" in
|
||||
start)
|
||||
start
|
||||
;;
|
||||
stop)
|
||||
stop
|
||||
;;
|
||||
status)
|
||||
status -p "$pidfile" $prog
|
||||
;;
|
||||
restart)
|
||||
restart
|
||||
;;
|
||||
condrestart|try-restart)
|
||||
condrestart
|
||||
;;
|
||||
reload)
|
||||
exit 3
|
||||
;;
|
||||
force-reload)
|
||||
restart
|
||||
;;
|
||||
*)
|
||||
echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload}"
|
||||
exit 2
|
||||
esac
|
||||
|
||||
exit $?
|
@ -1,37 +0,0 @@
|
||||
# THIS FILE SERVES FOR WHITELISTING RPMLINT ERRORS AND WARNINGS IN TASKOTRON
|
||||
# https://fedoraproject.org/wiki/Taskotron/Tasks/dist.rpmlint#Whitelisting_errors
|
||||
|
||||
# (same file in python3 package served as a great example)
|
||||
|
||||
|
||||
|
||||
# Spelling errors
|
||||
addFilter(r'spelling-error .* en_US (cnf|mysqld|subpackage) ')
|
||||
|
||||
# Debug symlinks
|
||||
addFilter(r'dangling-relative-symlink /usr/lib/.build-id')
|
||||
|
||||
# Testsuite
|
||||
# Some expected tests results are zero-length files
|
||||
addFilter(r'(zero-length|pem-certificate|hidden-file-or-dir) /usr/share/mysql-test/*')
|
||||
|
||||
# Chroot function
|
||||
# False positive; checked by upstream
|
||||
addFilter(r'missing-call-to-chdir-with-chroot')
|
||||
|
||||
# Missing documentation
|
||||
# I don't think that's on the upstream priority list
|
||||
addFilter(r'no-documentation')
|
||||
addFilter(r'no-manual-page-for-binary')
|
||||
|
||||
# Cluster is gone
|
||||
addFilter("W: obsolete-not-provided mysql-cluster")
|
||||
addFilter("W: obsolete-not-provided mysql-bench")
|
||||
addFilter("W: obsolete-not-provided community-mysql-bench")
|
||||
|
||||
# Config file without noreplace flag
|
||||
# Don't replace logs that may contain old entries
|
||||
addFilter(r'conffile-without-noreplace-flag /var/log/mariadb/mariadb.log')
|
||||
|
||||
# Seems pretty standard to me ...
|
||||
addFilter(r'non-standard-dir-perm /var/log/mysql 750')
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in new issue