diff options
author | unknown <greg@mysql.com[greg]> | 2003-03-10 18:32:38 -0500 |
---|---|---|
committer | unknown <greg@mysql.com[greg]> | 2003-03-10 18:32:38 -0500 |
commit | 3effb5c41639f88b8e4cbb0c2aae7bb660f2d92f (patch) | |
tree | 0d5507f5e97b308d6603d98dd62403ca244ed138 /netware | |
parent | 7a0cf2f3d2ac669669fbfca0422db520ec5451df (diff) | |
download | mariadb-git-3effb5c41639f88b8e4cbb0c2aae7bb660f2d92f.tar.gz |
novell40c.patch
netware/mysqld_safe.c:
Import patch novell40c.patch
Diffstat (limited to 'netware')
-rw-r--r-- | netware/mysqld_safe.c | 54 |
1 files changed, 52 insertions, 2 deletions
diff --git a/netware/mysqld_safe.c b/netware/mysqld_safe.c index 59c40eb61e6..1ab90775e02 100644 --- a/netware/mysqld_safe.c +++ b/netware/mysqld_safe.c @@ -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);
|