Sync mysql.init with community-mysql
This commit is contained in:
parent
fef8a6b54d
commit
d352dbd5ad
@ -1464,6 +1464,7 @@ fi
|
|||||||
- Allow 4567 port for tcp as well
|
- Allow 4567 port for tcp as well
|
||||||
- Install mysql-wait-ready on RHEL-6 for the SysV init
|
- Install mysql-wait-ready on RHEL-6 for the SysV init
|
||||||
- Run mysql-prepare-db-dir as non-root
|
- Run mysql-prepare-db-dir as non-root
|
||||||
|
- Sync mysql.init with community-mysql
|
||||||
|
|
||||||
* Sun Aug 20 2017 Honza Horak <hhorak@redhat.com> - 3:10.2.8-1
|
* Sun Aug 20 2017 Honza Horak <hhorak@redhat.com> - 3:10.2.8-1
|
||||||
- Rebase to 10.2.8
|
- Rebase to 10.2.8
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
# description: MySQL database server.
|
# description: MySQL database server.
|
||||||
# processname: mysqld
|
# processname: mysqld
|
||||||
# config: @sysconfdir@/my.cnf
|
# config: @sysconfdir@/my.cnf
|
||||||
# pidfile: /run/@DAEMON_NAME@/@DAEMON_NAME@.pid
|
# pidfile: /var/run/@DAEMON_NAME@/@DAEMON_NO_PREFIX@.pid
|
||||||
### BEGIN INIT INFO
|
### BEGIN INIT INFO
|
||||||
# Provides: mysqld
|
# Provides: mysqld
|
||||||
# Required-Start: $local_fs $remote_fs $network $named $syslog $time
|
# Required-Start: $local_fs $remote_fs $network $named $syslog $time
|
||||||
@ -60,14 +60,16 @@ start(){
|
|||||||
MYSQLDRUNNING=1
|
MYSQLDRUNNING=1
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
RESPONSE=`@bindir@/mysqladmin --socket="$socketfile" --user=UNKNOWN_MYSQL_USER ping 2>&1`
|
RESPONSE=`@bindir@/mysqladmin --no-defaults --socket="$socketfile" --user=UNKNOWN_MYSQL_USER ping 2>&1`
|
||||||
if [ $MYSQLDRUNNING = 1 ] && [ $? = 0 ]; then
|
if [ $MYSQLDRUNNING = 1 ] && [ $? = 0 ]; then
|
||||||
# already running, do nothing
|
# already running, do nothing
|
||||||
action $"Starting $prog: " /bin/true
|
action $"Starting $prog: " /bin/true
|
||||||
|
ret=0
|
||||||
elif [ $MYSQLDRUNNING = 1 ] && echo "$RESPONSE" | grep -q "Access denied for user"
|
elif [ $MYSQLDRUNNING = 1 ] && echo "$RESPONSE" | grep -q "Access denied for user"
|
||||||
then
|
then
|
||||||
# already running, do nothing
|
# already running, do nothing
|
||||||
action $"Starting $prog: " /bin/true
|
action $"Starting $prog: " /bin/true
|
||||||
|
ret=0
|
||||||
else
|
else
|
||||||
@libexecdir@/mysql-check-socket || return 1
|
@libexecdir@/mysql-check-socket || return 1
|
||||||
su - $MYUSER -s /bin/bash -c "@libexecdir@/mysql-prepare-db-dir $MYUSER $MYGROUP" || return 4
|
su - $MYUSER -s /bin/bash -c "@libexecdir@/mysql-prepare-db-dir $MYUSER $MYGROUP" || return 4
|
||||||
@ -79,16 +81,24 @@ start(){
|
|||||||
# and some users might prefer to configure logging to syslog.)
|
# and some users might prefer to configure logging to syslog.)
|
||||||
# Note: set --basedir to prevent probes that might trigger SELinux
|
# Note: set --basedir to prevent probes that might trigger SELinux
|
||||||
# alarms, per bug #547485
|
# alarms, per bug #547485
|
||||||
$exec --datadir="$datadir" --socket="$socketfile" \
|
su - $MYUSER -s /bin/bash -c "$exec --datadir='$datadir' --socket='$socketfile' \
|
||||||
--pid-file="$pidfile" \
|
--pid-file='$pidfile' \
|
||||||
--basedir=@prefix@ --user=$MYUSER >/dev/null 2>&1 &
|
--basedir=@prefix@ --user=$MYUSER" >/dev/null 2>&1 &
|
||||||
safe_pid=$!
|
safe_pid=$!
|
||||||
|
|
||||||
action $"Starting $prog: " /bin/true
|
# Wait until the daemon is up
|
||||||
chmod o+r $pidfile >/dev/null 2>&1
|
su - $MYUSER -s /bin/bash -c "@libexecdir@/mysql-wait-ready '$safe_pid'"
|
||||||
touch $lockfile
|
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
|
fi
|
||||||
return 0
|
return $ret
|
||||||
}
|
}
|
||||||
|
|
||||||
stop(){
|
stop(){
|
||||||
|
Loading…
Reference in New Issue
Block a user