Commit graph

194 commits

Author SHA1 Message Date
Sergei Golubchik
949559285e MDEV-18059 support-files/mysql.server.sh stop must run as root
don't run `su - mysql` is $USER is already mysql
2019-01-23 12:39:17 +01:00
Sergei Golubchik
73e1ffdc68 Bug#27919254 MYSQL USER ESCALATES ITS PRIVILEGE BY PLACING ARBITRARY PIDS INTO ITS PID FILES 2018-10-24 06:49:18 +02:00
Daniel Black
cc3155415e MDEV-5510: Replace MySQL -> MariaDB in init scripts 2018-01-23 15:44:31 +04:00
Sergei Golubchik
663068c6ee Merge remote-tracking branch 'mysql/5.5' into 5.5 2017-04-11 10:18:04 -04:00
Terje Rosten
b7f33d22d8 Bug#25144379 MYSQLD PROCESS DOES NOT INCLUDE FULL PATH WHEN STARTING MYSQL SERVER
Fix of Bug#25088048 caused paths to be relative, not absolute, this
proved to be problematic.

Fix is to still ignore current working directory, however switch to
using full path of basedir, which is set to parent directory of bin/
directory where mysqld_safe is located.

References to legacy tool mysql_print_defaults are removed, only
my_print_defaults is used these days.

This will also fix:
  Bug#11745176 (11192) MYSQLD_SAFE ONLY EVALUATES --DEFAULTS-FILE OPTION WHEN IT IS THE FIRST OP
  Bug#23013510 (80866) MYSQLD_SAFE SHOULD NOT SEARCH $MY_BASEDIR_VERSION/VAR AS DATADIR
  Bug#25244898 (84173) MYSQLD_SAFE --NO-DEFAULTS & SILENTLY DOES NOT WORK ANY MORE
  Bug#25261472 (84219) INITSCRIPT ERRORS WHEN LAUCHING MYSQLD_SAFE IN NON DEFAULT BASEDIR
  Bug#25319392 (84263) MYSQL.SERVER (MYSQL SERVER STARTUP SCRIPT) CAN NOT WORK,AND EXPORT SOME ERROR.
  Bug#25319457         MYSQLD_SAFE MIGHT FAIL IF $DATADIR HAS TRAILING /
  Bug#25341981         MYSQLD_SAFE ASSUMES INCORRECT BASEDIR WHEN EXECUTED WITH ABSOLUTE PATH
  Bug#25356221 (84427) MYSQLD_SAFE FAILS TO START WHEN USING A FIFO FOR LOG-ERROR (REGRESSION)
  Bug#25365194 (84447) MYSQLD_SAFE DOESN'T CHECK EXISTENCE OF GIVEN BASEDIR PARAMETER
  Bug#25377815         ERRORS WHILE STARTING MYSQLD_SAFE WITH SYM LINK ENABLED
2017-02-13 14:56:28 +01:00
Sergei Golubchik
8fcdd6b0ec Numerous issues in mysqld_safe 2016-12-22 12:25:10 +01:00
Terje Rosten
9ccd55466d BUG#13788154 INIT.D MYSQL SCRIPT CREATED BY MYSQL SOLARIS PACKAGE FAILS TO RUN DUE TO USE OF PIDOF
pidof is Linuxism, prefer pgrep on other UNIX systems.
2016-12-06 08:54:22 +01:00
Sergei Golubchik
7497ebf8a4 mysqld_safe: close stdout and stderr
when they're not needed anymore. Helps when
daemonizing it from mysql.init
2016-09-29 10:16:24 +02:00
Sergei Golubchik
7ae555c114 Merge branch 'mysql/5.5' into 5.5
80% reverted
2016-09-11 20:51:09 +02:00
Terje Rosten
684a165f28 Bug#24464380 PRIVILEGE ESCALATION USING MYSQLD_SAFE
Argument to malloc-lib must be included in restricted list of
directories, symlink guards added, and mysqld and mysqld-version
options restricted to command line only. Don't redirect errors to
stderr.
2016-08-25 13:32:25 +05:30
Terje Rosten
8b1f4d84ca Bug#24464380 PRIVILEGE ESCALATION USING MYSQLD_SAFE
Argument to malloc-lib must be included in restricted list of
directories, symlink guards added, and mysqld and mysqld-version
options restricted to command line only. Don't redirect errors to
stderr.
2016-08-18 12:19:15 +02:00
Sergei Golubchik
d1fe928c4f MDEV-8607 Init script doesn't check all applicable configuration groups
use --mysqld instead of naming all groups explicitly

https://github.com/MariaDB/server/pull/92
2015-12-07 15:20:23 +01:00
Sergei Golubchik
a34fd50ce1 MDEV-7478 log-basename unpredictable behavior in standalone mode
* fix /etc/init.d/mysql to use log-basename for pid-filename
* fix mysqld_safe not to force logging-to-file when log-basename is specified
2015-02-09 20:53:36 +01:00
Sergei Golubchik
1987819281 MDEV-6428 [PATCH] MariaDB start script doesn't realize failure of MariaDB startup
abort the wait loop if mysqld_safe is not running
2014-07-26 23:08:38 +02:00
Sergei Golubchik
81e6327e49 MDEV-5068 import file from init script 2014-04-10 10:34:28 +02:00
Sergei Golubchik
9950c5c7ba MDEV-5892 Centos startup script is broken
Don't try to be smart about --socket.
Assume that if user has set up a non-standard location for a socket,
she did it consistently for both a server and clients
(otherwise most clients won't work anyway).
2014-03-19 10:02:41 +01:00
Sergei Golubchik
b1966435c2 MDEV-5580 /etc/init.d/mysql exits too early
Wait until the server starts accepting connections, not until the pid file appears
2014-02-17 11:10:30 +01:00
Sergei Golubchik
005c7e5421 mysql-5.5.32 merge 2013-07-16 19:09:54 +02:00
Nirbhay Choubey
b350990a11 local merge. 2013-04-09 14:03:35 +05:30
Nirbhay Choubey
c60a9f740c local merge. 2013-04-09 14:03:35 +05:30
Nirbhay Choubey
4ad004c2b4 Backporting patch for bug#15852074. 2013-04-09 14:00:05 +05:30
Nirbhay Choubey
84b942d103 Backporting patch for bug#15852074. 2013-04-09 14:00:05 +05:30
Sergei Golubchik
65ca700def merge.
checkpoint.
does not compile.
2010-11-25 18:17:28 +01:00
Jonathan Perkin
ed02cca13a Fix previous merge: 'kill -0' (check PID exists) was changed to 'kill -9',
meaning a '/etc/init.d/mysql stop' would actually cause mysqld_safe to
relaunch mysqld rather than shut it down.
2009-12-16 10:27:56 +00:00
Jonathan Perkin
d456e4470d Fix previous merge: 'kill -0' (check PID exists) was changed to 'kill -9',
meaning a '/etc/init.d/mysql stop' would actually cause mysqld_safe to
relaunch mysqld rather than shut it down.
2009-12-16 10:27:56 +00:00
Michael Widenius
b9ea90b064 Automatic merge 2009-10-23 22:26:26 +03:00
Michael Widenius
afd0a45639 Fixes for binary distribution in tar file
- mysql_install_db doesn't require --basedir option anymore
- Fix that mysql_install_db mysqld_safe mysql_fix_privilege_tables has right paths for tar binary install
- Move some files from share/mysql to where they have always been (1.0 - 5.0)
- Move scripts used when installing MariaDB to the scripts directory (Added symlinks in old place for compatibility)
- Move man files to 'man' (from 'share/man')
- Ensure that all scripts are executable

mysql_secure_installation.sh
- Added support for --basedir flag
- Don't assume that the mysql binary is in the path

Other:
- Fixed crash when one got kill signal during bootstrap

Docs/INSTALL-BINARY:
  Change references from MySQL to MariaDB
Docs/mysql.info:
  Change references from MySQL to MariaDB
README:
  Removed duplicate row
configure.in:
  Change references from MySQL to MariaDB
libmysql/libmysql.c:
  Assume that if version string contains '-maria-' we are also using MariaDB
scripts/make_binary_distribution.sh:
  Fix that mysql_install_db mysqld_safe mysql_fix_privilege_tables has right paths for tar binary install
  Remove some files that should not be part of a MariaDB binary install
  Move some files from share/mysql to where they have always been (1.0 - 5.0)
  Move man files to 'man' (from 'share/man')
  Move scripts used when installing MariaDB to the scripts directory (Added symlinks in old place for compatibility)
  Removed generation of 'netware/init_db.sql', as it was never used
  Remove old reference to bk tree
scripts/mysql_secure_installation.sh:
  Added support for --basedir flag
  Don't assume that the mysql binary is in the path
  Use .my.cnf files
  Removed a lot of useless 'echo' rows
sql/mysqld.cc:
  Fixed crash when one got kill signal during bootstrap
storage/maria/Makefile.am:
  Don't add internal test files to binary distributions
storage/myisam/Makefile.am:
  Don't add internal test files to binary distributions
support-files/Makefile.am:
  Make scripts executable
support-files/config.huge.ini.sh:
  Removed execution bit
support-files/config.medium.ini.sh:
  Removed execution bit
support-files/config.small.ini.sh:
  Removed execution bit
support-files/mysql.server.sh:
  Ensure this works also mysqld is in the 'bin' directory
2009-10-23 19:48:54 +03:00
Peter Lieverdink
31ffbadb75 Add `configtest' option to the init script to check for a valid my.cnf file. 2009-10-16 17:15:30 +11:00
Alexander Nozdrin
21916790a1 Backport WL#4085: Merge revno:2617.56.29 from 6.0. 2009-10-06 14:57:07 +04:00
Alexander Nozdrin
50486457b1 Backport WL#4085: Merge revno:2617.56.29 from 6.0. 2009-10-06 14:57:07 +04:00
Daniel Fischer
69945c6169 merge patch for bug#31785 2009-07-02 15:18:12 +02:00
Daniel Fischer
e9691bdd4f merge patch for bug#31785 2009-07-02 15:18:12 +02:00
unknown
faf1d55c35 Merge zippy.cornsilk.net:/home/cmiller/work/mysql/mysql-5.0-build
into  zippy.cornsilk.net:/home/cmiller/work/mysql/mysql-5.1-build


support-files/mysql.server.sh:
  Auto merged
2008-03-26 12:39:22 -04:00
cmiller@zippy.cornsilk.net
cfb9c8458e Merge zippy.cornsilk.net:/home/cmiller/work/mysql/mysql-5.0-build
into  zippy.cornsilk.net:/home/cmiller/work/mysql/mysql-5.1-build
2008-03-26 12:39:22 -04:00
unknown
c10b1b3b7c Suggestion of Tim. Avoid unnecessary sleep. 2008-03-19 18:36:41 -04:00
cmiller@zippy.cornsilk.net
897f772c14 Suggestion of Tim. Avoid unnecessary sleep. 2008-03-19 18:36:41 -04:00
unknown
8dad72ee4c Bug#30378: mysql.server needs to skip wait_for_pid() when mysqld \
isn't running

Pass the process id of the manager as a parameter to "wait_for_pid"
and if the manager isn't running, then do not continue to wait.

Also, capture the error message of our process-existence test, 
"kill -0", as we expect errors and shouldn't pass them to the user.  
Additionally, be a bit more descriptive of what the problem is.


support-files/mysql.server.sh:
  Test that the PID-file's manager is running while we're waiting for
  something to happen with the pid-file.
  
  Capture the error message of our process-existence test, "kill -0",
  as we expect errors and shouldn't pass them to the user.
  Additionally, be a bit more descriptive of what the problem is.
2008-03-19 18:13:56 -04:00
cmiller@zippy.cornsilk.net
955983a154 Bug#30378: mysql.server needs to skip wait_for_pid() when mysqld \
isn't running

Pass the process id of the manager as a parameter to "wait_for_pid"
and if the manager isn't running, then do not continue to wait.

Also, capture the error message of our process-existence test, 
"kill -0", as we expect errors and shouldn't pass them to the user.  
Additionally, be a bit more descriptive of what the problem is.
2008-03-19 18:13:56 -04:00
unknown
4cc5d3c17c Merge production.mysql.com:/usersnfs/jperkin/bk/bug-27995/5.0
into  production.mysql.com:/usersnfs/jperkin/bk/build/5.1


support-files/mysql.server.sh:
  Auto merged
2007-11-05 18:01:45 +01:00
jperkin@production.mysql.com
56f6caaa13 Merge production.mysql.com:/usersnfs/jperkin/bk/bug-27995/5.0
into  production.mysql.com:/usersnfs/jperkin/bk/build/5.1
2007-11-05 18:01:45 +01:00
unknown
7bb7394545 Provide better feedback to the user when unable to find MySQL files
usually caused by a bad basedir setting.


support-files/mysql.server.sh:
  Be more verbose in error message.
2007-11-05 17:48:11 +01:00
jperkin@production.mysql.com
51be103e13 Provide better feedback to the user when unable to find MySQL files
usually caused by a bad basedir setting.
2007-11-05 17:48:11 +01:00
unknown
3e95b39882 Makefile.am, make_binary_distribution.sh:
Use custom 'pkgduppdir'
mysql.server.sh:
  The server is installed in 'libexecdir'


scripts/Makefile.am:
  Use custom 'pkgduppdir'
scripts/make_binary_distribution.sh:
  Use custom 'pkgduppdir'
support-files/mysql.server.sh:
  The server is installed in 'libexecdir'
2007-09-27 12:21:56 +02:00
kent@mysql.com/kent-amd64.(none)
e5ad2cdd58 Makefile.am, make_binary_distribution.sh:
Use custom 'pkgduppdir'
mysql.server.sh:
  The server is installed in 'libexecdir'
2007-09-27 12:21:56 +02:00
unknown
1ad9b99efb Merge qualinost.(none):/home/mtaylor/src/mysql/mysql-5.0-maint
into  qualinost.(none):/home/mtaylor/src/mysql/mysql-5.1-new-maint


support-files/mysql.server.sh:
  Auto merged
2007-04-12 11:35:16 -07:00
mtaylor@qualinost.(none)
729a6fd02a Merge qualinost.(none):/home/mtaylor/src/mysql/mysql-5.0-maint
into  qualinost.(none):/home/mtaylor/src/mysql/mysql-5.1-new-maint
2007-04-12 11:35:16 -07:00
unknown
44c001234d BUG#27367 mysql.server should be LSB init script compliant
Moved cd $basedir to live in the start section, as it only applies to the start
functionality and breaks the restart task
2007-04-12 11:16:07 -07:00
mtaylor@qualinost.(none)
99c5f418af BUG#27367 mysql.server should be LSB init script compliant
Moved cd $basedir to live in the start section, as it only applies to the start
functionality and breaks the restart task
2007-04-12 11:16:07 -07:00
unknown
428e4b0704 BUG#27367 mysql.server should be LSB init script compliant
support-files/mysql.server.sh:
  BUG#27367 Replaced [] with test syntax. Added test for locks on RedHat/SuSE systems
2007-03-21 21:21:32 -07:00
mtaylor@qualinost.(none)
837b5c983a BUG#27367 mysql.server should be LSB init script compliant 2007-03-21 21:21:32 -07:00