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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
a1ac1b7d
Commit
a1ac1b7d
authored
Oct 19, 2009
by
Alexander Nozdrin
Browse files
Options
Browse Files
Download
Plain Diff
Automerge from mysql-trunk.
parents
03bf73de
df129b74
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
164 additions
and
1 deletion
+164
-1
scripts/make_binary_distribution.sh
scripts/make_binary_distribution.sh
+8
-0
scripts/mysql_config.sh
scripts/mysql_config.sh
+13
-0
scripts/mysqld_safe.sh
scripts/mysqld_safe.sh
+132
-1
support-files/mysql.spec.sh
support-files/mysql.spec.sh
+11
-0
No files found.
scripts/make_binary_distribution.sh
View file @
a1ac1b7d
...
@@ -64,6 +64,7 @@ cflags="@CFLAGS@"
...
@@ -64,6 +64,7 @@ cflags="@CFLAGS@"
STRIP
=
1
# Option ignored
STRIP
=
1
# Option ignored
SILENT
=
0
SILENT
=
0
MALLOC_LIB
=
PLATFORM
=
""
PLATFORM
=
""
TMP
=
/tmp
TMP
=
/tmp
NEW_NAME
=
""
# Final top directory and TAR package name
NEW_NAME
=
""
# Final top directory and TAR package name
...
@@ -76,6 +77,7 @@ for arg do
...
@@ -76,6 +77,7 @@ for arg do
--tmp
=
*
)
TMP
=
`
echo
"
$arg
"
|
sed
-e
"s;--tmp=;;"
`
;;
--tmp
=
*
)
TMP
=
`
echo
"
$arg
"
|
sed
-e
"s;--tmp=;;"
`
;;
--suffix
=
*
)
SUFFIX
=
`
echo
"
$arg
"
|
sed
-e
"s;--suffix=;;"
`
;;
--suffix
=
*
)
SUFFIX
=
`
echo
"
$arg
"
|
sed
-e
"s;--suffix=;;"
`
;;
--short-product-tag
=
*
)
SHORT_PRODUCT_TAG
=
`
echo
"
$arg
"
|
sed
-e
"s;--short-product-tag=;;"
`
;;
--short-product-tag
=
*
)
SHORT_PRODUCT_TAG
=
`
echo
"
$arg
"
|
sed
-e
"s;--short-product-tag=;;"
`
;;
--inject-malloc-lib
=
*
)
MALLOC_LIB
=
`
echo
"
$arg
"
|
sed
-e
's;^[^=]*=;;'
`
;;
--no-strip
)
STRIP
=
0
;;
--no-strip
)
STRIP
=
0
;;
--machine
=
*
)
machine
=
`
echo
"
$arg
"
|
sed
-e
"s;--machine=;;"
`
;;
--machine
=
*
)
machine
=
`
echo
"
$arg
"
|
sed
-e
"s;--machine=;;"
`
;;
--platform
=
*
)
PLATFORM
=
`
echo
"
$arg
"
|
sed
-e
"s;--platform=;;"
`
;;
--platform
=
*
)
PLATFORM
=
`
echo
"
$arg
"
|
sed
-e
"s;--platform=;;"
`
;;
...
@@ -293,6 +295,12 @@ if [ x"$BASE_SYSTEM" != x"netware" ] ; then
...
@@ -293,6 +295,12 @@ if [ x"$BASE_SYSTEM" != x"netware" ] ; then
fi
fi
fi
fi
# If requested, add a malloc library .so into pkglibdir for use
# by mysqld_safe
if
[
-n
"
$MALLOC_LIB
"
]
;
then
cp
"
$MALLOC_LIB
"
"
$DEST
/lib/"
fi
# FIXME let this script be in "bin/", where it is in the RPMs?
# FIXME let this script be in "bin/", where it is in the RPMs?
# http://dev.mysql.com/doc/refman/5.1/en/mysql-install-db-problems.html
# http://dev.mysql.com/doc/refman/5.1/en/mysql-install-db-problems.html
mkdir
$DEST
/scripts
mkdir
$DEST
/scripts
...
...
scripts/mysql_config.sh
View file @
a1ac1b7d
...
@@ -167,6 +167,10 @@ Options:
...
@@ -167,6 +167,10 @@ Options:
--port [
$port
]
--port [
$port
]
--version [
$version
]
--version [
$version
]
--libmysqld-libs [
$embedded_libs
]
--libmysqld-libs [
$embedded_libs
]
--variable=VAR VAR is one of:
pkgincludedir [
$pkgincludedir
]
pkglibdir [
$pkglibdir
]
plugindir [
$plugindir
]
EOF
EOF
exit
1
exit
1
}
}
...
@@ -184,6 +188,15 @@ while test $# -gt 0; do
...
@@ -184,6 +188,15 @@ while test $# -gt 0; do
--port
)
echo
"
$port
"
;;
--port
)
echo
"
$port
"
;;
--version
)
echo
"
$version
"
;;
--version
)
echo
"
$version
"
;;
--embedded-libs
|
--embedded
|
--libmysqld-libs
)
echo
"
$embedded_libs
"
;;
--embedded-libs
|
--embedded
|
--libmysqld-libs
)
echo
"
$embedded_libs
"
;;
--variable
=
*
)
var
=
`
echo
"
$1
"
|
sed
's,^[^=]*=,,'
`
case
"
$var
"
in
pkgincludedir
)
echo
"
$pkgincludedir
"
;;
pkglibdir
)
echo
"
$pkglibdir
"
;;
plugindir
)
echo
"
$plugindir
"
;;
*
)
usage
;;
esac
;;
*
)
usage
;;
*
)
usage
;;
esac
esac
...
...
scripts/mysqld_safe.sh
View file @
a1ac1b7d
...
@@ -11,9 +11,13 @@
...
@@ -11,9 +11,13 @@
# mysql.server works by first doing a cd to the base directory and from there
# mysql.server works by first doing a cd to the base directory and from there
# executing mysqld_safe
# executing mysqld_safe
# Initialize script globals
KILL_MYSQLD
=
1
;
KILL_MYSQLD
=
1
;
MYSQLD
=
MYSQLD
=
niceness
=
0
niceness
=
0
mysqld_ld_preload
=
mysqld_ld_library_path
=
# Initial logging status: error log is not open, and not using syslog
# Initial logging status: error log is not open, and not using syslog
logging
=
init
logging
=
init
want_syslog
=
0
want_syslog
=
0
...
@@ -46,6 +50,7 @@ Usage: $0 [OPTIONS]
...
@@ -46,6 +50,7 @@ Usage: $0 [OPTIONS]
--open-files-limit=LIMIT Limit the number of open files
--open-files-limit=LIMIT Limit the number of open files
--core-file-size=LIMIT Limit core files to the specified size
--core-file-size=LIMIT Limit core files to the specified size
--timezone=TZ Set the system timezone
--timezone=TZ Set the system timezone
--malloc-lib=LIB Preload shared library LIB if available
--mysqld=FILE Use the specified file as mysqld
--mysqld=FILE Use the specified file as mysqld
--mysqld-version=VERSION Use "mysqld-VERSION" as mysqld
--mysqld-version=VERSION Use "mysqld-VERSION" as mysqld
--nice=NICE Set the scheduling priority of mysqld
--nice=NICE Set the scheduling priority of mysqld
...
@@ -172,6 +177,7 @@ parse_arguments() {
...
@@ -172,6 +177,7 @@ parse_arguments() {
# mysqld_safe-specific options - must be set in my.cnf ([mysqld_safe])!
# mysqld_safe-specific options - must be set in my.cnf ([mysqld_safe])!
--core-file-size
=
*
)
core_file_size
=
"
$val
"
;;
--core-file-size
=
*
)
core_file_size
=
"
$val
"
;;
--ledir
=
*
)
ledir
=
"
$val
"
;;
--ledir
=
*
)
ledir
=
"
$val
"
;;
--malloc-lib
=
*
)
set_malloc_lib
"
$val
"
;;
--mysqld
=
*
)
MYSQLD
=
"
$val
"
;;
--mysqld
=
*
)
MYSQLD
=
"
$val
"
;;
--mysqld-version
=
*
)
--mysqld-version
=
*
)
if
test
-n
"
$val
"
if
test
-n
"
$val
"
...
@@ -202,6 +208,131 @@ parse_arguments() {
...
@@ -202,6 +208,131 @@ parse_arguments() {
}
}
# Add a single shared library to the list of libraries which will be added to
# LD_PRELOAD for mysqld
#
# Since LD_PRELOAD is a space-separated value (for historical reasons), if a
# shared lib's path contains spaces, that path will be prepended to
# LD_LIBRARY_PATH and stripped from the lib value.
add_mysqld_ld_preload
()
{
lib_to_add
=
"
$1
"
log_notice
"Adding '
$lib_to_add
' to LD_PRELOAD for mysqld"
case
"
$lib_to_add
"
in
*
' '
*
)
# Must strip path from lib, and add it to LD_LIBRARY_PATH
lib_file
=
`
basename
"
$lib_to_add
"
`
case
"
$lib_file
"
in
*
' '
*
)
# The lib file itself has a space in its name, and can't
# be used in LD_PRELOAD
log_error
"library name '
$lib_to_add
' contains spaces and can not be used with LD_PRELOAD"
exit
1
;;
esac
lib_path
=
`
dirname
"
$lib_to_add
"
`
lib_to_add
=
"
$lib_file
"
[
-n
"
$mysqld_ld_library_path
"
]
&&
mysqld_ld_library_path
=
"
$mysqld_ld_library_path
:"
mysqld_ld_library_path
=
"
$mysqld_ld_library_path$lib_path
"
;;
esac
# LD_PRELOAD is a space-separated
[
-n
"
$mysqld_ld_preload
"
]
&&
mysqld_ld_preload
=
"
$mysqld_ld_preload
"
mysqld_ld_preload
=
"
${
mysqld_ld_preload
}
$lib_to_add
"
}
# Returns LD_PRELOAD (and LD_LIBRARY_PATH, if needed) text, quoted to be
# suitable for use in the eval that calls mysqld.
#
# All values in mysqld_ld_preload are prepended to LD_PRELOAD.
mysqld_ld_preload_text
()
{
text
=
if
[
-n
"
$mysqld_ld_preload
"
]
;
then
new_text
=
"
$mysqld_ld_preload
"
[
-n
"
$LD_PRELOAD
"
]
&&
new_text
=
"
$new_text
$LD_PRELOAD
"
text
=
"
${
text
}
LD_PRELOAD="
`
shell_quote_string
"
$new_text
"
`
' '
fi
if
[
-n
"
$mysqld_ld_library_path
"
]
;
then
new_text
=
"
$mysqld_ld_library_path
"
[
-n
"
$LD_LIBRARY_PATH
"
]
&&
new_text
=
"
$new_text
:
$LD_LIBRARY_PATH
"
text
=
"
${
text
}
LD_LIBRARY_PATH="
`
shell_quote_string
"
$new_text
"
`
' '
fi
echo
"
$text
"
}
mysql_config
=
get_mysql_config
()
{
if
[
-z
"
$mysql_config
"
]
;
then
mysql_config
=
`
echo
"
$0
"
|
sed
's,/[^/][^/]*$,/mysql_config,'
`
if
[
!
-x
"
$mysql_config
"
]
;
then
log_error
"Can not run mysql_config
$@
from '
$mysql_config
'"
exit
1
fi
fi
"
$mysql_config
"
"
$@
"
}
# set_malloc_lib LIB
# - If LIB is empty, do nothing and return
# - If LIB is 'tcmalloc', look for tcmalloc shared library in /usr/lib
# then pkglibdir. tcmalloc is part of the Google perftools project.
# - If LIB is an absolute path, assume it is a malloc shared library
#
# Put LIB in mysqld_ld_preload, which will be added to LD_PRELOAD when
# running mysqld. See ld.so for details.
set_malloc_lib
()
{
malloc_lib
=
"
$1
"
if
[
"
$malloc_lib
"
=
tcmalloc
]
;
then
pkglibdir
=
`
get_mysql_config
--variable
=
pkglibdir
`
malloc_lib
=
# This list is kept intentionally simple. Simply set --malloc-lib
# to a full path if another location is desired.
for
libdir
in
/usr/lib
"
$pkglibdir
"
;
do
for
flavor
in
_minimal
''
_and_profiler _debug
;
do
tmp
=
"
$libdir
/libtcmalloc
$flavor
.so"
#log_notice "DEBUG: Checking for malloc lib '$tmp'"
[
-r
"
$tmp
"
]
||
continue
malloc_lib
=
"
$tmp
"
break
2
done
done
if
[
-z
"
$malloc_lib
"
]
;
then
log_error
"no shared library for --malloc-lib=tcmalloc found in /usr/lib or
$pkglibdir
"
exit
1
fi
fi
# Allow --malloc-lib='' to override other settings
[
-z
"
$malloc_lib
"
]
&&
return
case
"
$malloc_lib
"
in
/
*
)
if
[
!
-r
"
$malloc_lib
"
]
;
then
log_error
"--malloc-lib '
$malloc_lib
' can not be read and will not be used"
exit
1
fi
;;
*
)
log_error
"--malloc-lib must be an absolute path or 'tcmalloc'; "
\
"ignoring value '
$malloc_lib
'"
exit
1
;;
esac
add_mysqld_ld_preload
"
$malloc_lib
"
}
#
#
# First, try to find BASEDIR and ledir (where mysqld is)
# First, try to find BASEDIR and ledir (where mysqld is)
#
#
...
@@ -549,7 +680,7 @@ fi
...
@@ -549,7 +680,7 @@ fi
# ulimit -n 256 > /dev/null 2>&1 # Fix for BSD and FreeBSD systems
# ulimit -n 256 > /dev/null 2>&1 # Fix for BSD and FreeBSD systems
#fi
#fi
cmd
=
"
$NOHUP_NICENESS
"
cmd
=
"
`
mysqld_ld_preload_text
`
$NOHUP_NICENESS
"
for
i
in
"
$ledir
/
$MYSQLD
"
"
$defaults
"
"--basedir=
$MY_BASEDIR_VERSION
"
\
for
i
in
"
$ledir
/
$MYSQLD
"
"
$defaults
"
"--basedir=
$MY_BASEDIR_VERSION
"
\
"--datadir=
$DATADIR
"
"
$USER_OPTION
"
"--datadir=
$DATADIR
"
"
$USER_OPTION
"
...
...
support-files/mysql.spec.sh
View file @
a1ac1b7d
...
@@ -448,6 +448,13 @@ $MBD/libtool --mode=execute install -m 755 \
...
@@ -448,6 +448,13 @@ $MBD/libtool --mode=execute install -m 755 \
$RPM_BUILD_DIR
/mysql-%
{
mysql_version
}
/mysql-debug-%
{
mysql_version
}
/sql/mysqld
\
$RPM_BUILD_DIR
/mysql-%
{
mysql_version
}
/mysql-debug-%
{
mysql_version
}
/sql/mysqld
\
$RBR
%
{
_sbindir
}
/mysqld-debug
$RBR
%
{
_sbindir
}
/mysqld-debug
%if %
{
?malloc_lib_target:1
}
%
{!
?malloc_lib_target:0
}
# Even though this is a shared library, put it under /usr/lib/mysql, so it
# doesn't conflict with possible shared lib by the same name in /usr/lib. See
# `mysql_config --variable=pkglibdir` and mysqld_safe for how this is used.
install
-m
644
"%{malloc_lib_source}"
"
$RBR
%{_libdir}/mysql/%{malloc_lib_target}"
%endif
# install saved perror binary with NDB support (BUG#13740)
# install saved perror binary with NDB support (BUG#13740)
install
-m
755
$MBD
/extra/perror
$RBR
%
{
_bindir
}
/perror
install
-m
755
$MBD
/extra/perror
$RBR
%
{
_bindir
}
/perror
...
@@ -707,6 +714,10 @@ fi
...
@@ -707,6 +714,10 @@ fi
%attr
(
755, root, root
)
%
{
_libdir
}
/mysql/plugin/ha_innodb_plugin.so
*
%attr
(
755, root, root
)
%
{
_libdir
}
/mysql/plugin/ha_innodb_plugin.so
*
%endif
%endif
%if %
{
?malloc_lib_target:1
}
%
{!
?malloc_lib_target:0
}
%attr
(
755, root, root
)
%
{
_libdir
}
/mysql/%
{
malloc_lib_target
}
%endif
%attr
(
755, root, root
)
%
{
_sbindir
}
/mysqld
%attr
(
755, root, root
)
%
{
_sbindir
}
/mysqld
%attr
(
755, root, root
)
%
{
_sbindir
}
/mysqld-debug
%attr
(
755, root, root
)
%
{
_sbindir
}
/mysqld-debug
%attr
(
755, root, root
)
%
{
_sbindir
}
/rcmysql
%attr
(
755, root, root
)
%
{
_sbindir
}
/rcmysql
...
...
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