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
21916790
Commit
21916790
authored
Oct 06, 2009
by
Alexander Nozdrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Backport WL#4085: Merge revno:2617.56.29 from 6.0.
parent
682eb07a
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
60 additions
and
124 deletions
+60
-124
netware/BUILD/compile-netware-START
netware/BUILD/compile-netware-START
+0
-1
sql/mysqld.cc
sql/mysqld.cc
+1
-4
support-files/mysql.server.sh
support-files/mysql.server.sh
+59
-119
No files found.
netware/BUILD/compile-netware-START
View file @
21916790
...
@@ -22,6 +22,5 @@ base_configs=" \
...
@@ -22,6 +22,5 @@ base_configs=" \
--enable-local-infile
\
--enable-local-infile
\
--with-extra-charsets=all
\
--with-extra-charsets=all
\
--prefix=N:/mysql
\
--prefix=N:/mysql
\
--without-mysqlmanager
\
--without-man
\
--without-man
\
"
"
sql/mysqld.cc
View file @
21916790
...
@@ -7499,10 +7499,7 @@ SHOW_VAR status_vars[]= {
...
@@ -7499,10 +7499,7 @@ SHOW_VAR status_vars[]= {
static
void
print_version
(
void
)
static
void
print_version
(
void
)
{
{
set_server_version
();
set_server_version
();
/*
Note: the instance manager keys off the string 'Ver' so it can find the
version from the output of 'mysqld --version', so don't change it!
*/
printf
(
"%s Ver %s for %s on %s (%s)
\n
"
,
my_progname
,
printf
(
"%s Ver %s for %s on %s (%s)
\n
"
,
my_progname
,
server_version
,
SYSTEM_TYPE
,
MACHINE_TYPE
,
MYSQL_COMPILATION_COMMENT
);
server_version
,
SYSTEM_TYPE
,
MACHINE_TYPE
,
MYSQL_COMPILATION_COMMENT
);
}
}
...
...
support-files/mysql.server.sh
View file @
21916790
...
@@ -53,13 +53,14 @@ datadir=
...
@@ -53,13 +53,14 @@ datadir=
# Negative numbers mean to wait indefinitely
# Negative numbers mean to wait indefinitely
service_startup_timeout
=
900
service_startup_timeout
=
900
# Lock directory for RedHat / SuSE.
lockdir
=
'/var/lock/subsys'
lock_file_path
=
"
$lockdir
/mysql"
# The following variables are only set for letting mysql.server find things.
# The following variables are only set for letting mysql.server find things.
# Set some defaults
# Set some defaults
pid_file
=
mysqld_pid_file_path
=
server_pid_file
=
use_mysqld_safe
=
1
user
=
@MYSQLD_USER@
if
test
-z
"
$basedir
"
if
test
-z
"
$basedir
"
then
then
basedir
=
@prefix@
basedir
=
@prefix@
...
@@ -101,11 +102,14 @@ else
...
@@ -101,11 +102,14 @@ else
}
}
fi
fi
PATH
=
/sbin:/usr/sbin:/bin:/usr/bin:
$basedir
/bin
PATH
=
"/sbin:/usr/sbin:/bin:/usr/bin:
$basedir
/bin"
export
PATH
export
PATH
mode
=
$1
# start or stop
mode
=
$1
# start or stop
shift
[
$#
-ge
1
]
&&
shift
other_args
=
"
$*
"
# uncommon, but needed when called from an RPM upgrade action
other_args
=
"
$*
"
# uncommon, but needed when called from an RPM upgrade action
# Expected: "--skip-networking --skip-grant-tables"
# Expected: "--skip-networking --skip-grant-tables"
# They are not checked here, intentionally, as it is the resposibility
# They are not checked here, intentionally, as it is the resposibility
...
@@ -131,59 +135,50 @@ parse_server_arguments() {
...
@@ -131,59 +135,50 @@ parse_server_arguments() {
--datadir
=
*
)
datadir
=
`
echo
"
$arg
"
|
sed
-e
's/^[^=]*=//'
`
--datadir
=
*
)
datadir
=
`
echo
"
$arg
"
|
sed
-e
's/^[^=]*=//'
`
datadir_set
=
1
datadir_set
=
1
;;
;;
--user
=
*
)
user
=
`
echo
"
$arg
"
|
sed
-e
's/^[^=]*=//'
`
;;
--pid-file
=
*
)
mysqld_pid_file_path
=
`
echo
"
$arg
"
|
sed
-e
's/^[^=]*=//'
`
;;
--pid-file
=
*
)
server_pid_file
=
`
echo
"
$arg
"
|
sed
-e
's/^[^=]*=//'
`
;;
--service-startup-timeout
=
*
)
service_startup_timeout
=
`
echo
"
$arg
"
|
sed
-e
's/^[^=]*=//'
`
;;
--service-startup-timeout
=
*
)
service_startup_timeout
=
`
echo
"
$arg
"
|
sed
-e
's/^[^=]*=//'
`
;;
--use-mysqld_safe
)
use_mysqld_safe
=
1
;;
--use-manager
)
use_mysqld_safe
=
0
;;
esac
done
}
parse_manager_arguments
()
{
for
arg
do
case
"
$arg
"
in
--pid-file
=
*
)
pid_file
=
`
echo
"
$arg
"
|
sed
-e
's/^[^=]*=//'
`
;;
--user
=
*
)
user
=
`
echo
"
$arg
"
|
sed
-e
's/^[^=]*=//'
`
;;
esac
esac
done
done
}
}
wait_for_pid
()
{
wait_for_pid
()
{
verb
=
"
$1
"
verb
=
"
$1
"
# created | removed
manager_pid
=
"
$2
"
# process ID of the program operating on the pid-file
pid
=
"
$2
"
# process ID of the program operating on the pid-file
pid_file_path
=
"
$3
"
# path to the PID file.
i
=
0
i
=
0
avoid_race_condition
=
"by checking again"
avoid_race_condition
=
"by checking again"
while
test
$i
-ne
$service_startup_timeout
;
do
while
test
$i
-ne
$service_startup_timeout
;
do
case
"
$verb
"
in
case
"
$verb
"
in
'created'
)
'created'
)
# wait for a PID-file to pop into existence.
# wait for a PID-file to pop into existence.
test
-s
$pid_file
&&
i
=
''
&&
break
test
-s
"
$pid_file_path
"
&&
i
=
''
&&
break
;;
;;
'removed'
)
'removed'
)
# wait for this PID-file to disappear
# wait for this PID-file to disappear
test
!
-s
$pid_file
&&
i
=
''
&&
break
test
!
-s
"
$pid_file_path
"
&&
i
=
''
&&
break
;;
;;
*
)
*
)
echo
"wait_for_pid () usage: wait_for_pid created|removed
manager_pid
"
echo
"wait_for_pid () usage: wait_for_pid created|removed
pid pid_file_path
"
exit
1
exit
1
;;
;;
esac
esac
# if
manag
er isn't running, then pid-file will never be updated
# if
serv
er isn't running, then pid-file will never be updated
if
test
-n
"
$
manager_
pid
"
;
then
if
test
-n
"
$pid
"
;
then
if
kill
-0
"
$
manager_
pid
"
2>/dev/null
;
then
if
kill
-0
"
$pid
"
2>/dev/null
;
then
:
# the
manag
er still runs
:
# the
serv
er still runs
else
else
# The
manag
er may have exited between the last pid-file check and now.
# The
serv
er may have exited between the last pid-file check and now.
if
test
-n
"
$avoid_race_condition
"
;
then
if
test
-n
"
$avoid_race_condition
"
;
then
avoid_race_condition
=
""
avoid_race_condition
=
""
continue
# Check again.
continue
# Check again.
fi
fi
# there's nothing that will affect the file.
# there's nothing that will affect the file.
log_failure_msg
"
Manager of pid-file quit without updating file
."
log_failure_msg
"
The server quit without updating PID file (
$pid_file_path
)
."
return
1
# not waiting any more.
return
1
# not waiting any more.
fi
fi
fi
fi
...
@@ -191,6 +186,7 @@ wait_for_pid () {
...
@@ -191,6 +186,7 @@ wait_for_pid () {
echo
$echo_n
".
$echo_c
"
echo
$echo_n
".
$echo_c
"
i
=
`
expr
$i
+ 1
`
i
=
`
expr
$i
+ 1
`
sleep
1
sleep
1
done
done
if
test
-z
"
$i
"
;
then
if
test
-z
"
$i
"
;
then
...
@@ -259,28 +255,16 @@ fi
...
@@ -259,28 +255,16 @@ fi
parse_server_arguments
`
$print_defaults
$extra_args
mysqld server mysql_server mysql.server
`
parse_server_arguments
`
$print_defaults
$extra_args
mysqld server mysql_server mysql.server
`
# Look for the pidfile
parse_manager_arguments
`
$print_defaults
$extra_args
manager
`
#
#
# Set pid file if not given
# Set pid file if not given
#
#
if
test
-z
"
$pid_file
"
if
test
-z
"
$mysqld_pid_file_path
"
then
pid_file
=
$datadir
/mysqlmanager-
`
@HOSTNAME@
`
.pid
else
case
"
$pid_file
"
in
/
*
)
;;
*
)
pid_file
=
"
$datadir
/
$pid_file
"
;;
esac
fi
if
test
-z
"
$server_pid_file
"
then
then
server_pid_file
=
$datadir
/
`
@HOSTNAME@
`
.pid
mysqld_pid_file_path
=
$datadir
/
`
@HOSTNAME@
`
.pid
else
else
case
"
$
server_pid_file
"
in
case
"
$
mysqld_pid_file_path
"
in
/
*
)
;;
/
*
)
;;
*
)
server_pid_file
=
"
$datadir
/
$server_pid_file
"
;;
*
)
mysqld_pid_file_path
=
"
$datadir
/
$mysqld_pid_file_path
"
;;
esac
esac
fi
fi
...
@@ -291,53 +275,23 @@ case "$mode" in
...
@@ -291,53 +275,23 @@ case "$mode" in
# Safeguard (relative paths, core dumps..)
# Safeguard (relative paths, core dumps..)
cd
$basedir
cd
$basedir
manager
=
$bindir
/mysqlmanager
if
test
-x
$libexecdir
/mysqlmanager
then
manager
=
$libexecdir
/mysqlmanager
elif
test
-x
$sbindir
/mysqlmanager
then
manager
=
$sbindir
/mysqlmanager
fi
echo
$echo_n
"Starting MySQL"
echo
$echo_n
"Starting MySQL"
if
test
-x
$manager
-a
"
$use_mysqld_safe
"
=
"0"
if
test
-x
$bindir
/mysqld_safe
then
if
test
-n
"
$other_args
"
then
log_failure_msg
"MySQL manager does not support options '
$other_args
'"
exit
1
fi
# Give extra arguments to mysqld with the my.cnf file. This script may
# be overwritten at next upgrade.
"
$manager
"
\
--mysqld-safe-compatible
\
--user
=
"
$user
"
\
--pid-file
=
"
$pid_file
"
>
/dev/null 2>&1 &
wait_for_pid created
$!
;
return_value
=
$?
# Make lock for RedHat / SuSE
if
test
-w
/var/lock/subsys
then
touch
/var/lock/subsys/mysqlmanager
fi
exit
$return_value
elif
test
-x
$bindir
/mysqld_safe
then
then
# Give extra arguments to mysqld with the my.cnf file. This script
# Give extra arguments to mysqld with the my.cnf file. This script
# may be overwritten at next upgrade.
# may be overwritten at next upgrade.
pid_file
=
$server_pid_file
$bindir
/mysqld_safe
--datadir
=
"
$datadir
"
--pid-file
=
"
$mysqld_pid_file_path
"
$other_args
>
/dev/null 2>&1 &
$bindir
/mysqld_safe
--datadir
=
$datadir
--pid-file
=
$server_pid_file
$other_args
>
/dev/null 2>&1 &
wait_for_pid created
"
$!
"
"
$mysqld_pid_file_path
"
;
return_value
=
$?
wait_for_pid created
$!
;
return_value
=
$?
# Make lock for RedHat / SuSE
# Make lock for RedHat / SuSE
if
test
-w
/var/lock/subsys
if
test
-w
"
$lockdir
"
then
then
touch
/var/lock/subsys/mysql
touch
"
$lock_file_path
"
fi
fi
exit
$return_value
exit
$return_value
else
else
log_failure_msg
"Couldn't find MySQL
manager (
$manager
) or
server (
$bindir
/mysqld_safe)"
log_failure_msg
"Couldn't find MySQL server (
$bindir
/mysqld_safe)"
fi
fi
;;
;;
...
@@ -345,39 +299,29 @@ case "$mode" in
...
@@ -345,39 +299,29 @@ case "$mode" in
# Stop daemon. We use a signal here to avoid having to know the
# Stop daemon. We use a signal here to avoid having to know the
# root password.
# root password.
# The RedHat / SuSE lock directory to remove
if
test
-s
"
$mysqld_pid_file_path
"
lock_dir
=
/var/lock/subsys/mysqlmanager
# If the manager pid_file doesn't exist, try the server's
if
test
!
-s
"
$pid_file
"
then
then
pid_file
=
$server_pid_file
mysqld_pid
=
`
cat
"
$mysqld_pid_file_path
"
`
lock_dir
=
/var/lock/subsys/mysql
fi
if
test
-s
"
$pid_file
"
if
(
kill
-9
$mysqld_pid
2>/dev/null
)
then
mysqlmanager_pid
=
`
cat
$pid_file
`
if
(
kill
-0
$mysqlmanager_pid
2>/dev/null
)
then
then
echo
$echo_n
"Shutting down MySQL"
echo
$echo_n
"Shutting down MySQL"
kill
$mysql
manager
_pid
kill
$mysql
d
_pid
# mysql
manager should remove the pid_
file when it exits, so wait for it.
# mysql
d should remove the pid
file when it exits, so wait for it.
wait_for_pid removed
"
$mysql
manager_pid
"
;
return_value
=
$?
wait_for_pid removed
"
$mysql
d_pid
"
"
$mysqld_pid_file_path
"
;
return_value
=
$?
else
else
log_failure_msg
"MySQL
manager or server process #
$mysqlmanager
_pid
is not running!"
log_failure_msg
"MySQL
server process #
$mysqld
_pid
is not running!"
rm
$pid_file
rm
"
$mysqld_pid_file_path
"
fi
fi
#
d
elete lock for RedHat / SuSE
#
D
elete lock for RedHat / SuSE
if
test
-f
$lock_dir
if
test
-f
"
$lock_file_path
"
then
then
rm
-f
$lock_dir
rm
-f
"
$lock_file_path
"
fi
fi
exit
$return_value
exit
$return_value
else
else
log_failure_msg
"MySQL
manager or
server PID file could not be found!"
log_failure_msg
"MySQL server PID file could not be found!"
fi
fi
;;
;;
...
@@ -393,10 +337,10 @@ case "$mode" in
...
@@ -393,10 +337,10 @@ case "$mode" in
;;
;;
'reload'
|
'force-reload'
)
'reload'
|
'force-reload'
)
if
test
-s
"
$
server_pid_file
"
;
then
if
test
-s
"
$
mysqld_pid_file_path
"
;
then
read
mysqld_pid <
$server_pid_file
read
mysqld_pid <
"
$mysqld_pid_file_path
"
kill
-HUP
$mysqld_pid
&&
log_success_msg
"Reloading service MySQL"
kill
-HUP
$mysqld_pid
&&
log_success_msg
"Reloading service MySQL"
touch
$server_pid_file
touch
"
$mysqld_pid_file_path
"
else
else
log_failure_msg
"MySQL PID file could not be found!"
log_failure_msg
"MySQL PID file could not be found!"
exit
1
exit
1
...
@@ -404,8 +348,8 @@ case "$mode" in
...
@@ -404,8 +348,8 @@ case "$mode" in
;;
;;
'status'
)
'status'
)
# First, check to see if pid file exists
# First, check to see if pid file exists
if
test
-s
"
$
server_pid_file
"
;
then
if
test
-s
"
$
mysqld_pid_file_path
"
;
then
read
mysqld_pid <
$server_pid_file
read
mysqld_pid <
"
$mysqld_pid_file_path
"
if
kill
-0
$mysqld_pid
2>/dev/null
;
then
if
kill
-0
$mysqld_pid
2>/dev/null
;
then
log_success_msg
"MySQL running (
$mysqld_pid
)"
log_success_msg
"MySQL running (
$mysqld_pid
)"
exit
0
exit
0
...
@@ -417,13 +361,8 @@ case "$mode" in
...
@@ -417,13 +361,8 @@ case "$mode" in
# Try to find appropriate mysqld process
# Try to find appropriate mysqld process
mysqld_pid
=
`
pidof
$libexecdir
/mysqld
`
mysqld_pid
=
`
pidof
$libexecdir
/mysqld
`
if
test
-z
$mysqld_pid
;
then
if
test
-z
$mysqld_pid
;
then
if
test
"
$use_mysqld_safe
"
=
"0"
;
then
if
test
-f
"
$lock_file_path
"
;
then
lockfile
=
/var/lock/subsys/mysqlmanager
log_failure_msg
"MySQL is not running, but lock file (
$lock_file_path
) exists"
else
lockfile
=
/var/lock/subsys/mysql
fi
if
test
-f
$lockfile
;
then
log_failure_msg
"MySQL is not running, but lock exists"
exit
2
exit
2
fi
fi
log_failure_msg
"MySQL is not running"
log_failure_msg
"MySQL is not running"
...
@@ -436,7 +375,8 @@ case "$mode" in
...
@@ -436,7 +375,8 @@ case "$mode" in
;;
;;
*
)
*
)
# usage
# usage
echo
"Usage:
$0
{start|stop|restart|reload|force-reload|status} [ MySQL server options ]"
basename
=
`
basename
"
$0
"
`
echo
"Usage:
$basename
{start|stop|restart|reload|force-reload|status} [ MySQL server options ]"
exit
1
exit
1
;;
;;
esac
esac
...
...
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