Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
86221c15
Commit
86221c15
authored
Oct 21, 2014
by
Balasubramanian Kandasamy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug#19775856: When the socket option is relative, mysqld startup script fails on CentOS 6
parent
38e582aa
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
5 deletions
+25
-5
packaging/rpm-oel/mysql-systemd-start
packaging/rpm-oel/mysql-systemd-start
+19
-3
packaging/rpm-oel/mysql.init
packaging/rpm-oel/mysql.init
+6
-2
No files found.
packaging/rpm-oel/mysql-systemd-start
View file @
86221c15
...
@@ -8,10 +8,19 @@
...
@@ -8,10 +8,19 @@
# post mode : ping server until answer is received
# post mode : ping server until answer is received
#
#
get_option
()
{
local
section
=
$1
local
option
=
$2
local
default
=
$3
ret
=
$(
/usr/bin/my_print_defaults
$section
|
grep
'^--'
${
option
}
'='
|
cut
-d
=
-f2-
)
[
-z
$ret
]
&&
ret
=
$default
echo
$ret
}
install_db
()
{
install_db
()
{
# Note: something different than datadir=/var/lib/mysql requires SELinux policy changes (in enforcing mode)
# Note: something different than datadir=/var/lib/mysql requires SELinux policy changes (in enforcing mode)
datadir
=
$(
/usr/bin/my_print_defaults server mysqld |
grep
'^--datadir='
|
sed
-n
's/--datadir=//p'
)
datadir
=
$(
get_option mysqld datadir
"/var/lib/mysql"
)
# Restore log, dir, perms and SELinux contexts
# Restore log, dir, perms and SELinux contexts
[
-d
"
$datadir
"
]
||
install
-d
-m
0755
-omysql
-gmysql
"
$datadir
"
||
exit
1
[
-d
"
$datadir
"
]
||
install
-d
-m
0755
-omysql
-gmysql
"
$datadir
"
||
exit
1
log
=
/var/log/mysqld.log
log
=
/var/log/mysqld.log
...
@@ -35,9 +44,16 @@ pinger () {
...
@@ -35,9 +44,16 @@ pinger () {
# Wait for ping to answer to signal startup completed,
# Wait for ping to answer to signal startup completed,
# might take a while in case of e.g. crash recovery
# might take a while in case of e.g. crash recovery
# MySQL systemd service will timeout script if no answer
# MySQL systemd service will timeout script if no answer
datadir
=
$(
get_option mysqld datadir
"/var/lib/mysql"
)
socket
=
$(
get_option mysqld socket
"
$datadir
/mysql.sock"
)
case
$socket
in
/
*
)
adminsocket
=
"
$socket
"
;;
*
)
adminsocket
=
"
$datadir
/
$socket
"
;;
esac
while
/bin/true
;
do
while
/bin/true
;
do
sleep
1
sleep
1
mysqladmin ping
>
/dev/null 2>&1
&&
break
mysqladmin
--no-defaults
--socket
=
"
$adminsocket
"
--user
=
UNKNOWN_MYSQL_USER
ping
>
/dev/null 2>&1
&&
break
done
done
exit
0
exit
0
}
}
...
...
packaging/rpm-oel/mysql.init
View file @
86221c15
...
@@ -50,11 +50,15 @@ errlogfile="$result"
...
@@ -50,11 +50,15 @@ errlogfile="$result"
get_mysql_option mysqld_safe pid-file
"/var/run/mysqld/mysqld.pid"
get_mysql_option mysqld_safe pid-file
"/var/run/mysqld/mysqld.pid"
mypidfile
=
"
$result
"
mypidfile
=
"
$result
"
case
$socketfile
in
/
*
)
adminsocket
=
"
$socketfile
"
;;
*
)
adminsocket
=
"
$datadir
/
$socketfile
"
;;
esac
start
(){
start
(){
[
-x
$exec
]
||
exit
5
[
-x
$exec
]
||
exit
5
# check to see if it's already running
# check to see if it's already running
RESPONSE
=
`
/usr/bin/mysqladmin
--socket
=
"
$socketfile
"
--user
=
UNKNOWN_MYSQL_USER ping 2>&1
`
RESPONSE
=
$(
/usr/bin/mysqladmin
--no-defaults
--socket
=
"
$adminsocket
"
--user
=
UNKNOWN_MYSQL_USER ping 2>&1
)
if
[
$?
=
0
]
;
then
if
[
$?
=
0
]
;
then
# already running, do nothing
# already running, do nothing
action
$"Starting
$prog
: "
/bin/true
action
$"Starting
$prog
: "
/bin/true
...
@@ -107,7 +111,7 @@ start(){
...
@@ -107,7 +111,7 @@ start(){
ret
=
0
ret
=
0
TIMEOUT
=
"
$STARTTIMEOUT
"
TIMEOUT
=
"
$STARTTIMEOUT
"
while
[
$TIMEOUT
-gt
0
]
;
do
while
[
$TIMEOUT
-gt
0
]
;
do
RESPONSE
=
`
/usr/bin/mysqladmin
--socket
=
"
$socketfile
"
--user
=
UNKNOWN_MYSQL_USER ping 2>&1
`
&&
break
RESPONSE
=
$(
/usr/bin/mysqladmin
--no-defaults
--socket
=
"
$adminsocket
"
--user
=
UNKNOWN_MYSQL_USER ping 2>&1
)
&&
break
echo
"
$RESPONSE
"
|
grep
-q
"Access denied for user"
&&
break
echo
"
$RESPONSE
"
|
grep
-q
"Access denied for user"
&&
break
if
!
/bin/kill
-0
$safe_pid
2>/dev/null
;
then
if
!
/bin/kill
-0
$safe_pid
2>/dev/null
;
then
echo
"MySQL Daemon failed to start."
echo
"MySQL Daemon failed to start."
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment