summaryrefslogtreecommitdiff
path: root/server-tools
diff options
context:
space:
mode:
authorpetr@mysql.com <>2004-11-15 14:53:30 +0300
committerpetr@mysql.com <>2004-11-15 14:53:30 +0300
commitd2115d133db498ee80943e66e5f4d715d9586a83 (patch)
tree4f67353d223119e5cffbf410803e0fb99d8d7d94 /server-tools
parent4f62e8b9d6cc27da9836aa4e03ddb54b9f2fb984 (diff)
downloadmariadb-git-d2115d133db498ee80943e66e5f4d715d9586a83.tar.gz
Some minor IM fixes
Diffstat (limited to 'server-tools')
-rw-r--r--server-tools/instance-manager/Makefile.am17
-rw-r--r--server-tools/instance-manager/commands.cc2
-rw-r--r--server-tools/instance-manager/instance_map.cc2
-rw-r--r--server-tools/instance-manager/listener.cc1
-rw-r--r--server-tools/instance-manager/manager.cc3
-rw-r--r--server-tools/instance-manager/mysqlmanager.cc2
-rw-r--r--server-tools/instance-manager/options.cc10
7 files changed, 17 insertions, 20 deletions
diff --git a/server-tools/instance-manager/Makefile.am b/server-tools/instance-manager/Makefile.am
index d3702ba9464..050f9b9bfd2 100644
--- a/server-tools/instance-manager/Makefile.am
+++ b/server-tools/instance-manager/Makefile.am
@@ -42,25 +42,19 @@ liboptions_a_SOURCES= options.h options.cc priv.h priv.cc
# MySQL sometimes uses symlinks to reuse code
# All symlinked files are grouped in libnet.a
-nodist_libnet_a_SOURCES= net_serv.cc client_settings.h client.c errmsg.c
+nodist_libnet_a_SOURCES= net_serv.cc client_settings.h
libnet_a_LIBADD= $(top_builddir)/sql/password.$(OBJEXT) \
$(top_builddir)/sql/pack.$(OBJEXT) \
- $(top_builddir)/sql/sql_state.$(OBJEXT)
+ $(top_builddir)/sql/sql_state.$(OBJEXT) \
+ $(top_builddir)/sql/mini_client_errors.$(OBJEXT)\
+ $(top_builddir)/sql/client.$(OBJEXT)
-CLEANFILES= net_serv.cc client.c client_settings.h errmsg.c
+CLEANFILES= net_serv.cc client_settings.h
net_serv.cc: Makefile
rm -f $(srcdir)/net_serv.cc
@LN_CP_F@ $(top_srcdir)/sql/net_serv.cc $(srcdir)/net_serv.cc
-client.c: Makefile
- rm -f $(srcdir)/client.c
- @LN_CP_F@ $(top_srcdir)/sql-common/client.c $(srcdir)/client.c
-
-errmsg.c: Makefile
- rm -f $(srcdir)/errmsg.c
- @LN_CP_F@ $(top_srcdir)/libmysql/errmsg.c $(srcdir)/errmsg.c
-
client_settings.h: Makefile
rm -f $(srcdir)/client_settings.h
@LN_CP_F@ $(top_srcdir)/sql/client_settings.h $(srcdir)/client_settings.h
@@ -74,7 +68,6 @@ mysqlmanager_SOURCES= command.cc command.h mysqlmanager.cc \
mysql_connection.h mysql_connection.cc \
user_map.h user_map.cc \
messages.h messages.cc \
- $(top_srcdir)/sql/sql_string.cc \
commands.h commands.cc \
factory.h factory.cc \
instance.h instance.cc \
diff --git a/server-tools/instance-manager/commands.cc b/server-tools/instance-manager/commands.cc
index 50f7bea7daf..2ac97382aa8 100644
--- a/server-tools/instance-manager/commands.cc
+++ b/server-tools/instance-manager/commands.cc
@@ -408,7 +408,7 @@ int Stop_instance::execute(struct st_net *net, ulong connection_id)
stop_guard(instance);
if (err_code= instance->stop())
return err_code;
-
+ printf("instance was stopped\n");
net_send_ok(net, connection_id);
return 0;
}
diff --git a/server-tools/instance-manager/instance_map.cc b/server-tools/instance-manager/instance_map.cc
index 41b23c5dd00..355b51269d5 100644
--- a/server-tools/instance-manager/instance_map.cc
+++ b/server-tools/instance-manager/instance_map.cc
@@ -158,8 +158,8 @@ int Instance_map::flush_instances()
hash_free(&hash);
hash_init(&hash, default_charset_info, START_HASH_SIZE, 0, 0,
get_instance_key, delete_instance, 0);
- rc= load();
pthread_mutex_unlock(&LOCK_instance_map);
+ rc= load();
return rc;
}
diff --git a/server-tools/instance-manager/listener.cc b/server-tools/instance-manager/listener.cc
index cb650e7cf9d..15f57e7e595 100644
--- a/server-tools/instance-manager/listener.cc
+++ b/server-tools/instance-manager/listener.cc
@@ -24,6 +24,7 @@
#include <mysql.h>
#include <violite.h>
#include <sys/un.h>
+#include <sys/stat.h>
#include "thread_registry.h"
#include "options.h"
diff --git a/server-tools/instance-manager/manager.cc b/server-tools/instance-manager/manager.cc
index 60b233bdaac..07d4f1ed33e 100644
--- a/server-tools/instance-manager/manager.cc
+++ b/server-tools/instance-manager/manager.cc
@@ -90,6 +90,7 @@ void manager(const Options &options)
sigemptyset(&mask);
sigaddset(&mask, SIGINT);
sigaddset(&mask, SIGTERM);
+ sigaddset(&mask, SIGPIPE);
sigaddset(&mask, SIGHUP);
/*
We want this signal to be blocked in all theads but the signal
@@ -159,6 +160,8 @@ void manager(const Options &options)
*/
guardian_thread.start();
+ signal(SIGPIPE, SIG_IGN);
+
while (!shutdown_complete)
{
sigwait(&mask, &signo);
diff --git a/server-tools/instance-manager/mysqlmanager.cc b/server-tools/instance-manager/mysqlmanager.cc
index bd8f3c6b870..78fa3ac565b 100644
--- a/server-tools/instance-manager/mysqlmanager.cc
+++ b/server-tools/instance-manager/mysqlmanager.cc
@@ -179,7 +179,7 @@ static volatile sig_atomic_t is_terminated= 0;
void terminate(int signo)
{
- is_terminated= signo;
+ is_terminated= signo;
}
diff --git a/server-tools/instance-manager/options.cc b/server-tools/instance-manager/options.cc
index 01d83e2d994..05493e10ad8 100644
--- a/server-tools/instance-manager/options.cc
+++ b/server-tools/instance-manager/options.cc
@@ -79,7 +79,7 @@ static struct my_option my_long_options[] =
(gptr *) &Options::socket_file_name, (gptr *) &Options::socket_file_name,
0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 },
- { "bind_address", OPT_BIND_ADDRESS, "Bind address to use for connection.",
+ { "bind-address", OPT_BIND_ADDRESS, "Bind address to use for connection.",
(gptr *) &Options::bind_address, (gptr *) &Options::bind_address,
0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 },
@@ -93,24 +93,24 @@ static struct my_option my_long_options[] =
(gptr *) &Options::password_file_name,
0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 },
- { "default_mysqld_path", OPT_MYSQLD_PATH, "Where to look for MySQL"
+ { "default-mysqld-path", OPT_MYSQLD_PATH, "Where to look for MySQL"
" Server binary.",
(gptr *) &Options::default_mysqld_path, (gptr *) &Options::default_mysqld_path,
0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 },
- { "default_admin_user", OPT_DEFAULT_ADMIN_USER, "Username to shutdown MySQL"
+ { "default-admin-user", OPT_DEFAULT_ADMIN_USER, "Username to shutdown MySQL"
" instances.",
(gptr *) &Options::default_admin_user,
(gptr *) &Options::default_admin_user,
0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 },
- { "default_admin_password", OPT_DEFAULT_ADMIN_PASSWORD, "Password to"
+ { "default-admin-password", OPT_DEFAULT_ADMIN_PASSWORD, "Password to"
"shutdown MySQL instances.",
(gptr *) &Options::default_admin_password,
(gptr *) &Options::default_admin_password,
0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 },
- { "monitoring_interval", OPT_MONITORING_INTERVAL, "Interval to monitor instances"
+ { "monitoring-interval", OPT_MONITORING_INTERVAL, "Interval to monitor instances"
" in seconds.",
(gptr *) &Options::monitoring_interval,
(gptr *) &Options::monitoring_interval,