summaryrefslogtreecommitdiff
path: root/scripts
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'github/10.0-galera' into 10.1Sergei Golubchik2017-11-101-4/+4
|\
| * Merge tag 'mariadb-10.0.33' into bb-10.0-galerabb-10.0-sachin-galeraSachin Setiya2017-11-032-23/+30
| |\
| * | MDEV-13909 Fix wsrep_sst_rsync fails on debianVincent Milum Jr2017-10-021-4/+4
| | | | | | | | | | | | | | | | | | Fix for the following error messages during SST: /usr/local/mysql/bin/wsrep_sst_rsync: 258: /usr/local/mysql/bin/wsrep_sst_rsync: [[: not found /usr/local/mysql/bin/wsrep_sst_rsync: 263: /usr/local/mysql/bin/wsrep_sst_rsync: [[: not found /usr/local/mysql/bin/wsrep_sst_rsync: 268: /usr/local/mysql/bin/wsrep_sst_rsync: [[: not found
* | | Merge branch '10.0' into 10.1Sergei Golubchik2017-10-222-23/+30
|\ \ \ | | |/ | |/|
| * | Merge branch '5.5' into 10.0Sergei Golubchik2017-10-182-23/+30
| |\ \
| | * | MDEV-13440 mysql_install_db fails with hard-coded langdirSergei Golubchik2017-10-171-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | always search in compile-time specified paths INSTALL_BINDIR, INSTALL_SBINDIR, INSTALL_MYSQLSHAREDIR. User can set them to arbitrary values, it's not enough to search only in their usual values of bin, sbin and libexec, share and share/mysql.
| | * | cleanup mysql_install_dbSergei Golubchik2017-10-172-23/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1. detect resolveip location, don' assume it's in $basedir/bin 2. don't guess $scriptdir to (incorrectly) construct the $0 path 3. rename find_in_basedir -> find_in_dirs, don't prepend $basedir automatically. This allows to use identical path lists in find_in_dirs and in cannot_find_file. 4. move search path lists to CMakeLists.txt to avoid specifying the same path list twice (in find_in_dirs and in cannot_find_file).
* | | | MDEV-14010 merge issue in wsrep_sst_xtrabackup-v2Andrii Nikitin2017-10-091-3/+1
| | | |
* | | | MDEV-13950 mysqld_safe could not start Galera node after upgrade ...sachin2017-10-021-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is regression caused by patch of mdev-10767. 1st problem :- mktmp is invoked without '-t' or specifing tmp directory. 2nd problem :- Since eval_log_error redirect stderr to stdout '2>' will return nothing. and hence $wr_logfile will be empty. Patch Credit:- Andrii Nikitin
* | | | MDEV-10767 /tmp/wsrep_recovery.${RANDOM} file created in unallowed SELinux ↵sachin2017-09-212-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | context Problem:- To create file in /tmp dir mysqld require permission initrc_tmp_t. And mysqld does not have his permission. Solution:- Instead of giving mysqld permission of initrc_tmp_t , we redirected log to file in /tmp dir through shell. I also removed a earlier workarround in mysqld_safe.sh , which create tmp log file in datadir.
* | | | Merge remote-tracking branch 'origin/10.0-galera' into 10.1Jan Lindström2017-08-214-115/+376
|\ \ \ \ | | |_|/ | |/| |
| * | | MW-366 Improved support for IPv6 networks - made mysqld and SST scripts to ↵Alexey Yurchenko2017-08-114-111/+382
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | recognize []-escaped IPv6 addresses - pulled in latest Percona and MariaDB updates to SST scripts - instruct netcat and socat in wsrep_sst_xtrabackup-v2 to listen on IPv6 socket via sockopt parameter in the [sst] section of my.cnf In summary, wsrep_node_address and wsrep_sst_receive_address can now be set to IPv6 addresses escaped by []. Rsync SST works out ouf the box thanks to rsync daemon listening on both IPv4 and IPv6 sockets by default. For xtrabackup SST onver IPv6 one needs to set sockopt in the [sst] section of joiner's configuration file to ",pf=ip6" if using socat as a streamer or to "-6" if using netcat.
| * | | Merge tag 'mariadb-10.0.32' into 10.0-galeraJan Lindström2017-08-0915-63/+55
| |\ \ \ | | |/ /
| * | | Merge tag 'mariadb-10.0.31' into 10.0-galeraSachin Setiya2017-05-302-20/+48
| |\ \ \ | | | | | | | | | | | | | | | Signed-off-by: Sachin Setiya <sachin.setiya@mariadb.com>
* | \ \ \ Merge branch '10.0' into 10.1Sergei Golubchik2017-08-0815-63/+55
|\ \ \ \ \ | | |_|/ / | |/| | |
| * | | | Merge remote-tracking branch 'origin/5.5' into 10.0Vicențiu Ciorbaru2017-07-2514-63/+46
| |\ \ \ \ | | | |_|/ | | |/| |
| | * | | Merge remote-tracking branch 'mysql/5.5' into 5.5Sergei Golubchik2017-07-1814-63/+46
| | |\ \ \
| | | * | | Bug #25436469: BUILDS ARE NOT REPRODUCIBLETor Didriksen2017-05-161-0/+95
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Backport to 5.5 Current MySQL builds, even on Pushbuild, are not reproducible; they return different results depending on which directory they are built from (and Pushbuild uses several different directories). This is because absolute paths leak into debug information, and even worse, __FILE__. The latter moves code around enough that we've actually seen sysbench changes on the order of 4% in some tests. CMake seemingly insists on using absolute paths, but we can insert our own layer between CMake and GCC to relativize all paths. Also give the right flags to get debug information reproducible and turn off build stamping. This makes the mysqld build 100% bit-for-bit reproducible between runs on my machine, even when run from different directories.
| | | * | | Bug#25043674 - MYSQLACCESS SCRIPT LOADS AND EXECUTES CODEShishir Jaiswal2017-04-171-4/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | FROM THE CURRENT DIRECTORY DESCRIPTION =========== When 'mysqlaccess' tool is run, it reads (and executes) the content of its configuration file 'mysqlaccess.conf' from the current directory. This is not a recommended behaviour as someone with ill intentions can insert malicious instructions into this file which could be executed whenever this tool is run. ANALYSIS ======== The configuration file is presently looked for, in the following folders (in given order): 1. Current directory 2. SYSCONFDIR //This gets expanded 3. /etc/ Owing to the reasons mentioned above, we should not permit the file to be in the current directory. Since the other two folders are assumed to be accessible only to authorized people, the config file is safe to be read from there. FIX === Modified the script so that it looks for the config file now in the following two folders (in the given order): 1. SYSCONFDIR 2. /etc/ If it's absent from above locations but present in current directory, an error is thrown asking the user to move the file to one of the above locations and retry. NOTE ==== The location paths and their precedence are not documented for this tool. It needs to be noted as part of the associated documentation.
| | | * | | BUG#25719975 SHEBANG HARD CODED AS /USR/BIN/PERL IN SCRIPTS, BREAKS ON FREEBSDTerje Rosten2017-03-2815-38/+33
| | | | | | | | | | | | | | | | | | | | | | | | Use cmake variable to adjust shebang to platform.
| | | * | | BUG#25364806 MYSQLD_SAFE FAILING TO START IF DATADIR GIVEN IS NOT ABSOLUTE PATHTerje Rosten2017-03-091-2/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | mysqld_safe is working on real files, however passing these file paths as is to mysqld as options gives different meaning when paths are relative. mysqld_safe uses current working directory as basedir for relative paths, while mysqld uses $datadir as basedir.
| * | | | | MDEV-13274 mysql_upgrade fails if dbname+tablename+partioname > 64 charsSergei Golubchik2017-07-201-0/+9
| | |_|_|/ | |/| | | | | | | | | | | | | | | | | | | | | | | InnoDB fix will come in MDEV-13360. Here I just fix upgrades from old unfixed InnoDBs - bad data makes the following copying ALTER TABLE to fail.
* | | | | MDEV-11963 RPM Lint: script-without-shebang /usr/bin/wsrep_sst_common.Alexey Botchkov2017-08-011-1/+22
| | | | | | | | | | | | | | | | | | | | Don't set the +x on /bin/wsrep_sst_common when installing.
* | | | | MDEV-13032: fix galera_new_cluster to be POSIXDaniel Black2017-06-081-1/+1
| | | | | | | | | | | | | | | | | | | | Signed-off-by: Daniel Black <daniel.black@au.ibm.com>
* | | | | galera_new_cluster man page and sh typo=Ian Gilfillan2017-05-091-1/+1
| | | | |
* | | | | wsrep_new_cluster: Add -h and --help optionsJakub Dorňák2017-04-301-0/+16
| | | | | | | | | | | | | | | | | | | | From: https://github.com/devexp-db/mariadb/blob/f27/mariadb-galera-new-cluster-help.patch
* | | | | Merge branch '10.0' 10.1Sergei Golubchik2017-04-282-20/+48
|\ \ \ \ \ | |/ / / /
| * | | | Merge branch '5.5' into 10.0Sergei Golubchik2017-04-212-20/+48
| |\ \ \ \ | | |/ / /
| | * | | Merge remote-tracking branch 'mysql/5.5' into 5.5mariadb-5.5.55Sergei Golubchik2017-04-112-20/+48
| | |\ \ \ | | | |/ /
| | | * | Bug#25144379 MYSQLD PROCESS DOES NOT INCLUDE FULL PATH WHEN STARTING MYSQL ↵Terje Rosten2017-02-131-66/+68
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| | | * | Bug#11751149 - TRYING TO START MYSQL WHILE ANOTHER INSTANCEShishir Jaiswal2016-12-221-14/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | IS STARTING: CONFUSING ERROR DESCRIPTION =========== When mysql server processes transactions but has not yet committed and shuts down abnormally (due to crash, external killing etc.), a recovery is due from Storage engine side which takes place the next time mysql server (either through mysqld or mysqld_safe) is run. While the 1st server is in mid of recovery, if another instance of mysqld_safe is made to run, it may result into 2nd instance killing the 1st one after a moment. ANALYSIS ======== In the "while true" loop, we've a check (which is done after the server stops) for the existence of pid file to enquire if it was a normal shutdown or not. If the file is absent, it means that the graceful exit of server had removed this file. However if the file is present, the scripts makes a plain assumption that this file is leftover of the "current" server. It misses to consider that it could be a valid pid file belonging to another running mysql server. We need to add more checks in the latter case. The script should extract the PID from this existing file and check if its running or not. If yes, it means an older instance of mysql server is running and hence the script should abort. FIX === Checking the status of process (alive or not) by adding a @CHECK_PID@ in such a case. Aborting if its alive. Detailed logic is as follows: - The mysqld_safe script would quit at start only as soon as it finds that there is an active PID i.e. a mysql server is already running. - The PID file creation takes place after InnoDb recovery, which means in rare case (when PID file isn't created yet) it may happen that more than 1 server can come up but even in that case others will have to wait till the 1st server has released the acquired InnoDb lock. In this case all these servers will either TIMEOUT waiting for InnoDb lock or after this they would find that the 1st server is already running (by reading $pid_file) and would abort. - Our core fix is that we now check the status of mysql server process (alive or not) after the server stops running within the loop of "run -> shutdown/kill/abort -> run ... ", so that only the script who owns the mysql server would be able to bring it down if required. NOTE ==== Removed the deletion of pid file and socket file from entry of the loop, as it may result in 2nd instance deleting these files created by 1st instance in RACE condition. Compensated this by deleting these files at end of the loop Reverted the changes made in patch to Bug#16776528. So after this patch is pushed, the concept of mysqld_safe.pid would go altogether. This was required as the script was deleting other instance's mysqld_safe.pid allowing multiple mysqld_safe instances to run in parallel. This patch would fix Bug#16776528 as well as the resources would be guarded anyway by InnoDb lock + our planned 5.7 patch.
| | | * | Bug#13344753 MYSQL_SECURE_INSTALLATION SCRIPT DOES NOT CHECK USER INPUTTerje Rosten2016-12-191-19/+48
| | | | | | | | | | | | | | | | | | | | | | | | | Loop until valid answer is given. Variants of y,yes and n,no and blank (meaning default) are considered valid.
| | | * | Bug#25088048 ADDITIONAL ISSUES IN MYSQLD_SAFETerje Rosten2016-11-161-2/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Don't read --ledir option from config file. Ignore current working for finding location of mysqld Remove use of chown/chmod in scripts. Be helpful only when basedir is /var/log or /var/lib. Removed unused systemd files for SLES. Set explicit basedir in scripts.
| | | * | Bug#24483092 UNSAFE USE OF VARIOUS SHELL UTILITIESTerje Rosten2016-10-062-27/+92
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Remove use of touch and chmod. - Restrict usage of chown to cases where target directory is /var/log. - Due to limited feature set in /bin/sh on Solaris, /bin/bash will be used on this platform. - Give error if directory for UNIX socket file is missing. - Privileged user should not log to files owned by different user (mysqld will log as before).
| | | * | Bug#24464380 PRIVILEGE ESCALATION USING MYSQLD_SAFETerje Rosten2016-08-261-2/+2
| | | | | | | | | | | | | | | | | | | | Post push fix: Solaris 10 /bin/sh don't understand $().
| | | * | Bug#24464380 PRIVILEGE ESCALATION USING MYSQLD_SAFETerje Rosten2016-08-181-32/+47
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | | | SST script for mariabackup.Nirbhay Choubey2017-04-272-0/+1041
| | | | | | | | | | | | | | | | | | | | Execute mariabackup in innobackupex mode to avoid "unknown argument" error.
* | | | | don't generate wsrep_sst_common in-placeSergei Golubchik2017-04-272-2/+0
| | | | | | | | | | | | | | | | | | | | rename the source to wsrep_sst_common.sh
* | | | | Fix Galera tests failures on 10.1 and 10.2Sachin Setiya2017-04-251-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When we build server out of git directory , we did not copy wsrep_sst_common into build-dir. This causes galera/wsrep tests to fail
* | | | | MDEV-11941 - Lintian complains about executable bitsSergey Vojtovich2017-03-072-26/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Revoked executable bit from files that are not supposed to be executed directly. Removed interpreted from files that are not supposed to be executed directly. Added interpreter to files that are supposed to be executed directly.
* | | | | Minor typoiangilfillan2017-01-261-1/+1
| | | | |
* | | | | mysql_install_db enhancements to facilitate Debian bug#848616 fixKristian Nielsen2017-01-172-10/+57
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In Debian, the default install is made more secure by omitting the anonymous user and by making the root account authenticate by unix socket authentication instead of the default password-less root. However, Debian hard-codes this change in mysql_install_db, which breaks that program for other users. This commit instead implements new general options for mysql_install_db that can be used by anyone to similarly perform a more secure install: --skip-auth-anonymous-user: omits the anonymous user. --auth-root-authentication-method=normal: Keeps the existing behaviour with a password-less root account. Currently on by default. --auth-root-socket-user=USER --auth-root-authentication-method=socket: creates the MariaDB root user with the name USER (defaults to 'root') and using unix socket authentication. This way, only that user has MariaDB root access after install. The idea with --auth-root-authentication-method=normal is that applications that need this behaviour can give that option explicitly. Then eventually we could make --auth-root-authentication-method=socket the default, giving a more secure default installation. Note that it is perfectly possible to do a secure install with --auth-root-authentication-method=normal. For example, installing a private server just for local access by a single OS-level user, by using --skip-networking and putting the connection socket in a location without public access. So it is important to preserve this API for backwards compatibility.
* | | | | Post merge review fixesVicențiu Ciorbaru2017-01-171-4/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Remove duplicate lines from tests * Use thd instead of current_thd * Remove extra wsrep_binlog_format_names * Correctly merge union patch from 5.5 wrt duplicate rows. * Correctly merge SELinux changes into 10.1
* | | | | Merge remote-tracking branch '10.0-galera' into 10.1Vicențiu Ciorbaru2017-01-161-8/+7
|\ \ \ \ \ | | |_|_|/ | |/| | |
| * | | | Merge tag 'mariadb-10.0.29' into 10.0-galeraNirbhay Choubey2017-01-132-66/+51
| |\ \ \ \ | | |/ / /
| * | | | Merge tag 'mariadb-10.0.28' into 10.0-galeraNirbhay Choubey2016-10-281-1/+5
| |\ \ \ \
* | \ \ \ \ Merge branch '10.0' into 10.1Vicențiu Ciorbaru2017-01-161-59/+50
|\ \ \ \ \ \ | | |_|/ / / | |/| | | |
| * | | | | Merge branch '5.5' into 10.0Vicențiu Ciorbaru2017-01-121-2/+7
| |\ \ \ \ \ | | | |_|/ / | | |/| | |
| | * | | | mysqld_safe: don't close stdout if set -xSergei Golubchik2017-01-101-2/+7
| | | | | |
| * | | | | Fix problems from 5.5 mergeVicențiu Ciorbaru2017-01-101-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Update mysqld_safe script to remove duplicated parameter --crash-script * Make --core-file-size accept underscores as well as dashes correctly. * Add mysqld_safe_helper to Debian and Ubuntu files. * Update innodb minor version to 35