mirror of
https://github.com/MariaDB/server.git
synced 2025-01-16 03:52:35 +01:00
Merge gweir@bk-internal.mysql.com:/home/bk/mysql-4.0
into mysql.com:/home/greg/bk/mysql-4.0
This commit is contained in:
commit
ae9698cfd3
1 changed files with 52 additions and 2 deletions
|
@ -36,6 +36,7 @@
|
|||
******************************************************************************/
|
||||
char autoclose;
|
||||
char basedir[PATH_MAX];
|
||||
char checktables;
|
||||
char datadir[PATH_MAX];
|
||||
char pid_file[PATH_MAX];
|
||||
char address[PATH_MAX];
|
||||
|
@ -54,6 +55,7 @@ FILE *log_fd = NULL;
|
|||
|
||||
******************************************************************************/
|
||||
|
||||
void usage(void);
|
||||
void vlog(char *, va_list);
|
||||
void log(char *, ...);
|
||||
void start_defaults(int, char*[]);
|
||||
|
@ -74,6 +76,42 @@ void mysql_start(int, char*[]);
|
|||
|
||||
/******************************************************************************
|
||||
|
||||
usage()
|
||||
|
||||
Show usage.
|
||||
|
||||
******************************************************************************/
|
||||
void usage(void)
|
||||
{
|
||||
// keep the screen up
|
||||
setscreenmode(SCR_NO_MODE);
|
||||
|
||||
puts("\
|
||||
\n\
|
||||
usage: mysqld_safe [options]\n\
|
||||
\n\
|
||||
Program to start the MySQL daemon and restart it if it dies unexpectedly.\n\
|
||||
All options, besides those listed below, are passed on to the MySQL daemon.\n\
|
||||
\n\
|
||||
options:\n\
|
||||
\n\
|
||||
--autoclose Automatically close the mysqld_safe screen.\n\
|
||||
\n\
|
||||
--check-tables Check the tables before starting the MySQL daemon.\n\
|
||||
\n\
|
||||
--err-log=<file> Send the MySQL daemon error output to <file>.\n\
|
||||
\n\
|
||||
--help Show this help information.\n\
|
||||
\n\
|
||||
--mysqld=<file> Use the <file> MySQL daemon.\n\
|
||||
\n\
|
||||
");
|
||||
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
|
||||
vlog()
|
||||
|
||||
Log the message.
|
||||
|
@ -136,6 +174,9 @@ void start_defaults(int argc, char *argv[])
|
|||
// basedir
|
||||
get_basedir(argv[0], basedir);
|
||||
|
||||
// check-tables
|
||||
checktables = FALSE;
|
||||
|
||||
// hostname
|
||||
if (gethostname(hostname,PATH_MAX) < 0)
|
||||
{
|
||||
|
@ -279,13 +320,15 @@ void parse_args(int argc, char *argv[])
|
|||
OPT_PORT,
|
||||
OPT_ERR_LOG,
|
||||
OPT_SAFE_LOG,
|
||||
OPT_MYSQLD
|
||||
OPT_MYSQLD,
|
||||
OPT_HELP
|
||||
};
|
||||
|
||||
static struct option options[] =
|
||||
{
|
||||
{"autoclose", no_argument, &autoclose, TRUE},
|
||||
{"basedir", required_argument, 0, OPT_BASEDIR},
|
||||
{"check-tables", no_argument, &checktables, TRUE},
|
||||
{"datadir", required_argument, 0, OPT_DATADIR},
|
||||
{"pid-file", required_argument, 0, OPT_PID_FILE},
|
||||
{"bind-address", required_argument, 0, OPT_BIND_ADDRESS},
|
||||
|
@ -293,6 +336,7 @@ void parse_args(int argc, char *argv[])
|
|||
{"err-log", required_argument, 0, OPT_ERR_LOG},
|
||||
{"safe-log", required_argument, 0, OPT_SAFE_LOG},
|
||||
{"mysqld", required_argument, 0, OPT_MYSQLD},
|
||||
{"help", no_argument, 0, OPT_HELP},
|
||||
{0, 0, 0, 0}
|
||||
};
|
||||
|
||||
|
@ -341,6 +385,10 @@ void parse_args(int argc, char *argv[])
|
|||
strcpy(mysqld, optarg);
|
||||
break;
|
||||
|
||||
case OPT_HELP:
|
||||
usage();
|
||||
break;
|
||||
|
||||
default:
|
||||
// ignore
|
||||
break;
|
||||
|
@ -563,6 +611,8 @@ void mysql_start(int argc, char *argv[])
|
|||
static char *private_options[] =
|
||||
{
|
||||
"--autoclose",
|
||||
"--check-tables",
|
||||
"--help",
|
||||
"--err-log=",
|
||||
"--mysqld=",
|
||||
NULL
|
||||
|
@ -594,7 +644,7 @@ void mysql_start(int argc, char *argv[])
|
|||
do
|
||||
{
|
||||
// check the database tables
|
||||
check_tables();
|
||||
if (checktables) check_tables();
|
||||
|
||||
// status
|
||||
time(&cal);
|
||||
|
|
Loading…
Reference in a new issue