mariadb/server-tools/instance-manager/options.cc

337 lines
10 KiB
C++
Raw Normal View History

Intermediate commit - just to make new files visible to bk in the new tree server-tools/instance-manager/Makefile.am: Fixed IM linking to avoid using both mysys and libmysql as the define the same symbols and therefore conflict server-tools/instance-manager/listener.cc: Added ability to listen network ports server-tools/instance-manager/listener.h: Various additions to the Listener_thread_args server-tools/instance-manager/log.cc: merge server-tools/instance-manager/log.h: merge server-tools/instance-manager/manager.cc: Fixes and additions to enable guardian functionality server-tools/instance-manager/manager.h: Changed manager() signature server-tools/instance-manager/mysqlmanager.cc: Various fixes server-tools/instance-manager/options.cc: Added handling of default values for new options in the Options struct. (such as default_user, default_password, monitoring_interval e.t.c) server-tools/instance-manager/options.h: Added new options to the Options struct sql/net_serv.cc: Added MYSQL_INSTANCE_MANAGER defines to enable alarm handling in the IM server-tools/instance-manager/buffer.cc: Simple implementation of variable-length buffer server-tools/instance-manager/command.cc: Abstract command. All commands are derived from Command class server-tools/instance-manager/commands.h: Interfaces for all commands we have server-tools/instance-manager/factory.cc: Commands factory. This class hides command instantiation. The idea is to handle various protocols this way. (different commands for different protocols server-tools/instance-manager/guardian.cc: Guardian thread implementation (monitor and restart instances in case of a failure server-tools/instance-manager/guardian.h: Guardian_thread and Guardian_thread_args class interface. The Guardian_thread is responsible for monitoring and restarting instances server-tools/instance-manager/instance.cc: Instance class contains methods and data to manage a single instance server-tools/instance-manager/instance.h: This file contains class an instance class interface. The class is responsible for starting/stopping an instance server-tools/instance-manager/instance_map.cc: The instance repository. This class is also responsible for initialization of Instance class objects. server-tools/instance-manager/instance_options.cc: The Instance_options class contains all methods to get and handle options of an instance server-tools/instance-manager/mysql_connection.cc: The class responsible for handling MySQL client/server protocol connections server-tools/instance-manager/mysql_manager_error.h: The list of Instance Manger-specific errors server-tools/instance-manager/parse.cc: Simple query parser server-tools/instance-manager/parse.h: Parser interface server-tools/instance-manager/protocol.cc: Here implemented functions used to handle mysql client/server protocol server-tools/instance-manager/protocol.h: Interface for MySQL client/server protocol server-tools/instance-manager/thread_registry.cc: Thread registry stores information about every thread. It's main function is to provide graceful shutdown for all threads. server-tools/instance-manager/user_map.h: User map contains hash with user names and passwords
2004-10-23 09:32:52 +02:00
/* Copyright (C) 2003 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
#ifdef __GNUC__
Intermediate commit - just to make new files visible to bk in the new tree server-tools/instance-manager/Makefile.am: Fixed IM linking to avoid using both mysys and libmysql as the define the same symbols and therefore conflict server-tools/instance-manager/listener.cc: Added ability to listen network ports server-tools/instance-manager/listener.h: Various additions to the Listener_thread_args server-tools/instance-manager/log.cc: merge server-tools/instance-manager/log.h: merge server-tools/instance-manager/manager.cc: Fixes and additions to enable guardian functionality server-tools/instance-manager/manager.h: Changed manager() signature server-tools/instance-manager/mysqlmanager.cc: Various fixes server-tools/instance-manager/options.cc: Added handling of default values for new options in the Options struct. (such as default_user, default_password, monitoring_interval e.t.c) server-tools/instance-manager/options.h: Added new options to the Options struct sql/net_serv.cc: Added MYSQL_INSTANCE_MANAGER defines to enable alarm handling in the IM server-tools/instance-manager/buffer.cc: Simple implementation of variable-length buffer server-tools/instance-manager/command.cc: Abstract command. All commands are derived from Command class server-tools/instance-manager/commands.h: Interfaces for all commands we have server-tools/instance-manager/factory.cc: Commands factory. This class hides command instantiation. The idea is to handle various protocols this way. (different commands for different protocols server-tools/instance-manager/guardian.cc: Guardian thread implementation (monitor and restart instances in case of a failure server-tools/instance-manager/guardian.h: Guardian_thread and Guardian_thread_args class interface. The Guardian_thread is responsible for monitoring and restarting instances server-tools/instance-manager/instance.cc: Instance class contains methods and data to manage a single instance server-tools/instance-manager/instance.h: This file contains class an instance class interface. The class is responsible for starting/stopping an instance server-tools/instance-manager/instance_map.cc: The instance repository. This class is also responsible for initialization of Instance class objects. server-tools/instance-manager/instance_options.cc: The Instance_options class contains all methods to get and handle options of an instance server-tools/instance-manager/mysql_connection.cc: The class responsible for handling MySQL client/server protocol connections server-tools/instance-manager/mysql_manager_error.h: The list of Instance Manger-specific errors server-tools/instance-manager/parse.cc: Simple query parser server-tools/instance-manager/parse.h: Parser interface server-tools/instance-manager/protocol.cc: Here implemented functions used to handle mysql client/server protocol server-tools/instance-manager/protocol.h: Interface for MySQL client/server protocol server-tools/instance-manager/thread_registry.cc: Thread registry stores information about every thread. It's main function is to provide graceful shutdown for all threads. server-tools/instance-manager/user_map.h: User map contains hash with user names and passwords
2004-10-23 09:32:52 +02:00
#pragma implementation
#endif
#include "options.h"
Fix for AIX compilation failure: sacred knowledge of my_global.h nature (it should be included before any other include) was hidden from me. server-tools/instance-manager/commands.cc: Fix for AIX compilation failure & cleanup server-tools/instance-manager/commands.h: Fix for AIX compilation failure & cleanup server-tools/instance-manager/factory.cc: Fix for AIX compilation failure & cleanup server-tools/instance-manager/guardian.cc: Fix for AIX compilation failure & cleanup server-tools/instance-manager/guardian.h: Fix for AIX compilation failure & cleanup server-tools/instance-manager/instance.cc: Fix for AIX compilation failure & cleanup server-tools/instance-manager/instance.h: Fix for AIX compilation failure & cleanup server-tools/instance-manager/instance_map.cc: Fix for AIX compilation failure & cleanup server-tools/instance-manager/instance_map.h: Fix for AIX compilation failure & cleanup server-tools/instance-manager/instance_options.cc: Fix for AIX compilation failure & cleanup server-tools/instance-manager/log.cc: Fix for AIX compilation failure & cleanup server-tools/instance-manager/manager.cc: Fix for AIX compilation failure & cleanup server-tools/instance-manager/messages.cc: Fix for AIX compilation failure & cleanup server-tools/instance-manager/messages.h: Fix for AIX compilation failure & cleanup server-tools/instance-manager/mysql_connection.cc: Fix for AIX compilation failure & cleanup server-tools/instance-manager/mysqlmanager.cc: Fix for AIX compilation failure & cleanup server-tools/instance-manager/options.cc: Fix for AIX compilation failure & cleanup server-tools/instance-manager/parse.cc: Fix for AIX compilation failure & cleanup server-tools/instance-manager/parse_output.cc: Fix for AIX compilation failure & cleanup server-tools/instance-manager/protocol.cc: Fix for AIX compilation failure & cleanup server-tools/instance-manager/protocol.h: Fix for AIX compilation failure & cleanup server-tools/instance-manager/thread_registry.cc: Fix for AIX compilation failure & cleanup server-tools/instance-manager/user_map.h: Fix for AIX compilation failure & cleanup
2005-03-22 00:04:14 +01:00
#include "priv.h"
initial import of Windows port of IM. server-tools/instance-manager/commands.cc: type cleanups for compiling on Windows now using Options::config_file for the location of the single my.cnf file we are using server-tools/instance-manager/guardian.cc: pthread_mutex_lock and unlock do not return a value on Windows so we return 0 in all cases server-tools/instance-manager/instance.cc: big changes here. Had to implement Windows versions of launch_and_wait and kill() server-tools/instance-manager/instance.h: added some function defs server-tools/instance-manager/instance_map.cc: pthread_mutex_lock and unlock do not return a value on Windows Also, now using only the file named as Options::config_file server-tools/instance-manager/instance_options.h: added reference to port.h server-tools/instance-manager/listener.cc: reworked and simplified the socket handling code. Added windows versions of the code that sets the sockets to be non-blocking and non-inheritable server-tools/instance-manager/listener.h: change Options to always be a struct. Really surprised GCC was letting this go. Options was declared to be struct in some places and class in other places. server-tools/instance-manager/log.cc: added reference to port.h server-tools/instance-manager/manager.cc: moved all the signal code inside some #ifndef __WIN__ blocks server-tools/instance-manager/manager.h: change Options to always be a struct. Really surprised GCC was letting this go. Options was declared to be struct in some places and class in other places. server-tools/instance-manager/mysqlmanager.cc: added in the Windows service code. server-tools/instance-manager/options.cc: Added in the windows options for running as a service and the code for loading settings only from a single file server-tools/instance-manager/options.h: added definitions for the new Windows service vars and routines server-tools/instance-manager/parse_output.cc: added reference to port.h server-tools/instance-manager/priv.cc: added reference to port.h server-tools/instance-manager/priv.h: linuxthreads should not be visible on Windows server-tools/instance-manager/thread_registry.cc: more __WIN__ blocking server-tools/instance-manager/user_map.cc: fixed passwd file code to handle files with \r\n line endings server-tools/instance-manager/IMService.cpp: New BitKeeper file ``server-tools/instance-manager/IMService.cpp'' server-tools/instance-manager/IMService.h: New BitKeeper file ``server-tools/instance-manager/IMService.h'' server-tools/instance-manager/WindowsService.cpp: New BitKeeper file ``server-tools/instance-manager/WindowsService.cpp'' server-tools/instance-manager/WindowsService.h: New BitKeeper file ``server-tools/instance-manager/WindowsService.h'' server-tools/instance-manager/mysqlmanager.vcproj: New BitKeeper file ``server-tools/instance-manager/mysqlmanager.vcproj'' server-tools/instance-manager/port.h: New BitKeeper file ``server-tools/instance-manager/port.h''
2005-07-20 17:55:40 +02:00
#include "port.h"
#include <my_sys.h>
#include <my_getopt.h>
Post-review fixes + some bugs fixed + several minor features BitKeeper/deleted/.del-client_func.c~3476a8a85cbd3c29: Delete: server-tools/instance-manager/client_func.c server-tools/instance-manager/Makefile.am: clien_func removed server-tools/instance-manager/buffer.cc: several methods added server-tools/instance-manager/buffer.h: Some error-handling fixes. server-tools/instance-manager/commands.cc: check for Buffer errors server-tools/instance-manager/guardian.cc: Guardian rewiriten. Not it works in a finite state machine-way. server-tools/instance-manager/guardian.h: Appropriate (to .cc) changes in the header + some comment added server-tools/instance-manager/instance.cc: added proxy thread to monitor instance. Two kinds of stop() now -- stop() and kill_instance which only sends a signal server-tools/instance-manager/instance.h: appropriate changes server-tools/instance-manager/instance_map.cc: cleanup server-tools/instance-manager/instance_map.h: cleanup server-tools/instance-manager/instance_options.cc: Caching of the pid-file-name is added. some comments added server-tools/instance-manager/instance_options.h: cleanup server-tools/instance-manager/listener.cc: listener my_thread_init added (though it doesn't use any mysys functions). Just in case server-tools/instance-manager/manager.cc: SIGCHLD handler removed. now instance monitoring is implemented through proxy threads. This is to work nicely with LinuxThreads server-tools/instance-manager/options.cc: added option to create a password file entry (this was implemented by Sergei Vojtovich) server-tools/instance-manager/parse.cc: inline function get_word moved to the header server-tools/instance-manager/parse.h: get_word moved here to use form parse_output server-tools/instance-manager/parse_output.cc: get_word() clone removed. now looking through the output linewise server-tools/instance-manager/protocol.cc: Buffer error chech added server-tools/instance-manager/user_map.cc: typo fixed
2005-02-11 12:21:59 +01:00
#include <m_string.h>
#include <mysql_com.h>
#define QUOTE2(x) #x
#define QUOTE(x) QUOTE2(x)
Intermediate commit - just to make new files visible to bk in the new tree server-tools/instance-manager/Makefile.am: Fixed IM linking to avoid using both mysys and libmysql as the define the same symbols and therefore conflict server-tools/instance-manager/listener.cc: Added ability to listen network ports server-tools/instance-manager/listener.h: Various additions to the Listener_thread_args server-tools/instance-manager/log.cc: merge server-tools/instance-manager/log.h: merge server-tools/instance-manager/manager.cc: Fixes and additions to enable guardian functionality server-tools/instance-manager/manager.h: Changed manager() signature server-tools/instance-manager/mysqlmanager.cc: Various fixes server-tools/instance-manager/options.cc: Added handling of default values for new options in the Options struct. (such as default_user, default_password, monitoring_interval e.t.c) server-tools/instance-manager/options.h: Added new options to the Options struct sql/net_serv.cc: Added MYSQL_INSTANCE_MANAGER defines to enable alarm handling in the IM server-tools/instance-manager/buffer.cc: Simple implementation of variable-length buffer server-tools/instance-manager/command.cc: Abstract command. All commands are derived from Command class server-tools/instance-manager/commands.h: Interfaces for all commands we have server-tools/instance-manager/factory.cc: Commands factory. This class hides command instantiation. The idea is to handle various protocols this way. (different commands for different protocols server-tools/instance-manager/guardian.cc: Guardian thread implementation (monitor and restart instances in case of a failure server-tools/instance-manager/guardian.h: Guardian_thread and Guardian_thread_args class interface. The Guardian_thread is responsible for monitoring and restarting instances server-tools/instance-manager/instance.cc: Instance class contains methods and data to manage a single instance server-tools/instance-manager/instance.h: This file contains class an instance class interface. The class is responsible for starting/stopping an instance server-tools/instance-manager/instance_map.cc: The instance repository. This class is also responsible for initialization of Instance class objects. server-tools/instance-manager/instance_options.cc: The Instance_options class contains all methods to get and handle options of an instance server-tools/instance-manager/mysql_connection.cc: The class responsible for handling MySQL client/server protocol connections server-tools/instance-manager/mysql_manager_error.h: The list of Instance Manger-specific errors server-tools/instance-manager/parse.cc: Simple query parser server-tools/instance-manager/parse.h: Parser interface server-tools/instance-manager/protocol.cc: Here implemented functions used to handle mysql client/server protocol server-tools/instance-manager/protocol.h: Interface for MySQL client/server protocol server-tools/instance-manager/thread_registry.cc: Thread registry stores information about every thread. It's main function is to provide graceful shutdown for all threads. server-tools/instance-manager/user_map.h: User map contains hash with user names and passwords
2004-10-23 09:32:52 +02:00
const char *default_password_file_name= QUOTE(DEFAULT_PASSWORD_FILE_NAME);
const char *default_log_file_name= QUOTE(DEFAULT_LOG_FILE_NAME);
#ifdef __WIN__
char windows_config_file[FN_REFLEN];
initial import of Windows port of IM. server-tools/instance-manager/commands.cc: type cleanups for compiling on Windows now using Options::config_file for the location of the single my.cnf file we are using server-tools/instance-manager/guardian.cc: pthread_mutex_lock and unlock do not return a value on Windows so we return 0 in all cases server-tools/instance-manager/instance.cc: big changes here. Had to implement Windows versions of launch_and_wait and kill() server-tools/instance-manager/instance.h: added some function defs server-tools/instance-manager/instance_map.cc: pthread_mutex_lock and unlock do not return a value on Windows Also, now using only the file named as Options::config_file server-tools/instance-manager/instance_options.h: added reference to port.h server-tools/instance-manager/listener.cc: reworked and simplified the socket handling code. Added windows versions of the code that sets the sockets to be non-blocking and non-inheritable server-tools/instance-manager/listener.h: change Options to always be a struct. Really surprised GCC was letting this go. Options was declared to be struct in some places and class in other places. server-tools/instance-manager/log.cc: added reference to port.h server-tools/instance-manager/manager.cc: moved all the signal code inside some #ifndef __WIN__ blocks server-tools/instance-manager/manager.h: change Options to always be a struct. Really surprised GCC was letting this go. Options was declared to be struct in some places and class in other places. server-tools/instance-manager/mysqlmanager.cc: added in the Windows service code. server-tools/instance-manager/options.cc: Added in the windows options for running as a service and the code for loading settings only from a single file server-tools/instance-manager/options.h: added definitions for the new Windows service vars and routines server-tools/instance-manager/parse_output.cc: added reference to port.h server-tools/instance-manager/priv.cc: added reference to port.h server-tools/instance-manager/priv.h: linuxthreads should not be visible on Windows server-tools/instance-manager/thread_registry.cc: more __WIN__ blocking server-tools/instance-manager/user_map.cc: fixed passwd file code to handle files with \r\n line endings server-tools/instance-manager/IMService.cpp: New BitKeeper file ``server-tools/instance-manager/IMService.cpp'' server-tools/instance-manager/IMService.h: New BitKeeper file ``server-tools/instance-manager/IMService.h'' server-tools/instance-manager/WindowsService.cpp: New BitKeeper file ``server-tools/instance-manager/WindowsService.cpp'' server-tools/instance-manager/WindowsService.h: New BitKeeper file ``server-tools/instance-manager/WindowsService.h'' server-tools/instance-manager/mysqlmanager.vcproj: New BitKeeper file ``server-tools/instance-manager/mysqlmanager.vcproj'' server-tools/instance-manager/port.h: New BitKeeper file ``server-tools/instance-manager/port.h''
2005-07-20 17:55:40 +02:00
char Options::install_as_service;
char Options::remove_service;
#else
char Options::run_as_service;
const char *Options::user= 0; /* No default value */
initial import of Windows port of IM. server-tools/instance-manager/commands.cc: type cleanups for compiling on Windows now using Options::config_file for the location of the single my.cnf file we are using server-tools/instance-manager/guardian.cc: pthread_mutex_lock and unlock do not return a value on Windows so we return 0 in all cases server-tools/instance-manager/instance.cc: big changes here. Had to implement Windows versions of launch_and_wait and kill() server-tools/instance-manager/instance.h: added some function defs server-tools/instance-manager/instance_map.cc: pthread_mutex_lock and unlock do not return a value on Windows Also, now using only the file named as Options::config_file server-tools/instance-manager/instance_options.h: added reference to port.h server-tools/instance-manager/listener.cc: reworked and simplified the socket handling code. Added windows versions of the code that sets the sockets to be non-blocking and non-inheritable server-tools/instance-manager/listener.h: change Options to always be a struct. Really surprised GCC was letting this go. Options was declared to be struct in some places and class in other places. server-tools/instance-manager/log.cc: added reference to port.h server-tools/instance-manager/manager.cc: moved all the signal code inside some #ifndef __WIN__ blocks server-tools/instance-manager/manager.h: change Options to always be a struct. Really surprised GCC was letting this go. Options was declared to be struct in some places and class in other places. server-tools/instance-manager/mysqlmanager.cc: added in the Windows service code. server-tools/instance-manager/options.cc: Added in the windows options for running as a service and the code for loading settings only from a single file server-tools/instance-manager/options.h: added definitions for the new Windows service vars and routines server-tools/instance-manager/parse_output.cc: added reference to port.h server-tools/instance-manager/priv.cc: added reference to port.h server-tools/instance-manager/priv.h: linuxthreads should not be visible on Windows server-tools/instance-manager/thread_registry.cc: more __WIN__ blocking server-tools/instance-manager/user_map.cc: fixed passwd file code to handle files with \r\n line endings server-tools/instance-manager/IMService.cpp: New BitKeeper file ``server-tools/instance-manager/IMService.cpp'' server-tools/instance-manager/IMService.h: New BitKeeper file ``server-tools/instance-manager/IMService.h'' server-tools/instance-manager/WindowsService.cpp: New BitKeeper file ``server-tools/instance-manager/WindowsService.cpp'' server-tools/instance-manager/WindowsService.h: New BitKeeper file ``server-tools/instance-manager/WindowsService.h'' server-tools/instance-manager/mysqlmanager.vcproj: New BitKeeper file ``server-tools/instance-manager/mysqlmanager.vcproj'' server-tools/instance-manager/port.h: New BitKeeper file ``server-tools/instance-manager/port.h''
2005-07-20 17:55:40 +02:00
#endif
const char *Options::config_file= QUOTE(DEFAULT_CONFIG_FILE);
initial import of Windows port of IM. server-tools/instance-manager/commands.cc: type cleanups for compiling on Windows now using Options::config_file for the location of the single my.cnf file we are using server-tools/instance-manager/guardian.cc: pthread_mutex_lock and unlock do not return a value on Windows so we return 0 in all cases server-tools/instance-manager/instance.cc: big changes here. Had to implement Windows versions of launch_and_wait and kill() server-tools/instance-manager/instance.h: added some function defs server-tools/instance-manager/instance_map.cc: pthread_mutex_lock and unlock do not return a value on Windows Also, now using only the file named as Options::config_file server-tools/instance-manager/instance_options.h: added reference to port.h server-tools/instance-manager/listener.cc: reworked and simplified the socket handling code. Added windows versions of the code that sets the sockets to be non-blocking and non-inheritable server-tools/instance-manager/listener.h: change Options to always be a struct. Really surprised GCC was letting this go. Options was declared to be struct in some places and class in other places. server-tools/instance-manager/log.cc: added reference to port.h server-tools/instance-manager/manager.cc: moved all the signal code inside some #ifndef __WIN__ blocks server-tools/instance-manager/manager.h: change Options to always be a struct. Really surprised GCC was letting this go. Options was declared to be struct in some places and class in other places. server-tools/instance-manager/mysqlmanager.cc: added in the Windows service code. server-tools/instance-manager/options.cc: Added in the windows options for running as a service and the code for loading settings only from a single file server-tools/instance-manager/options.h: added definitions for the new Windows service vars and routines server-tools/instance-manager/parse_output.cc: added reference to port.h server-tools/instance-manager/priv.cc: added reference to port.h server-tools/instance-manager/priv.h: linuxthreads should not be visible on Windows server-tools/instance-manager/thread_registry.cc: more __WIN__ blocking server-tools/instance-manager/user_map.cc: fixed passwd file code to handle files with \r\n line endings server-tools/instance-manager/IMService.cpp: New BitKeeper file ``server-tools/instance-manager/IMService.cpp'' server-tools/instance-manager/IMService.h: New BitKeeper file ``server-tools/instance-manager/IMService.h'' server-tools/instance-manager/WindowsService.cpp: New BitKeeper file ``server-tools/instance-manager/WindowsService.cpp'' server-tools/instance-manager/WindowsService.h: New BitKeeper file ``server-tools/instance-manager/WindowsService.h'' server-tools/instance-manager/mysqlmanager.vcproj: New BitKeeper file ``server-tools/instance-manager/mysqlmanager.vcproj'' server-tools/instance-manager/port.h: New BitKeeper file ``server-tools/instance-manager/port.h''
2005-07-20 17:55:40 +02:00
const char *Options::log_file_name= default_log_file_name;
const char *Options::pid_file_name= QUOTE(DEFAULT_PID_FILE_NAME);
const char *Options::socket_file_name= QUOTE(DEFAULT_SOCKET_FILE_NAME);
initial import of Windows port of IM. server-tools/instance-manager/commands.cc: type cleanups for compiling on Windows now using Options::config_file for the location of the single my.cnf file we are using server-tools/instance-manager/guardian.cc: pthread_mutex_lock and unlock do not return a value on Windows so we return 0 in all cases server-tools/instance-manager/instance.cc: big changes here. Had to implement Windows versions of launch_and_wait and kill() server-tools/instance-manager/instance.h: added some function defs server-tools/instance-manager/instance_map.cc: pthread_mutex_lock and unlock do not return a value on Windows Also, now using only the file named as Options::config_file server-tools/instance-manager/instance_options.h: added reference to port.h server-tools/instance-manager/listener.cc: reworked and simplified the socket handling code. Added windows versions of the code that sets the sockets to be non-blocking and non-inheritable server-tools/instance-manager/listener.h: change Options to always be a struct. Really surprised GCC was letting this go. Options was declared to be struct in some places and class in other places. server-tools/instance-manager/log.cc: added reference to port.h server-tools/instance-manager/manager.cc: moved all the signal code inside some #ifndef __WIN__ blocks server-tools/instance-manager/manager.h: change Options to always be a struct. Really surprised GCC was letting this go. Options was declared to be struct in some places and class in other places. server-tools/instance-manager/mysqlmanager.cc: added in the Windows service code. server-tools/instance-manager/options.cc: Added in the windows options for running as a service and the code for loading settings only from a single file server-tools/instance-manager/options.h: added definitions for the new Windows service vars and routines server-tools/instance-manager/parse_output.cc: added reference to port.h server-tools/instance-manager/priv.cc: added reference to port.h server-tools/instance-manager/priv.h: linuxthreads should not be visible on Windows server-tools/instance-manager/thread_registry.cc: more __WIN__ blocking server-tools/instance-manager/user_map.cc: fixed passwd file code to handle files with \r\n line endings server-tools/instance-manager/IMService.cpp: New BitKeeper file ``server-tools/instance-manager/IMService.cpp'' server-tools/instance-manager/IMService.h: New BitKeeper file ``server-tools/instance-manager/IMService.h'' server-tools/instance-manager/WindowsService.cpp: New BitKeeper file ``server-tools/instance-manager/WindowsService.cpp'' server-tools/instance-manager/WindowsService.h: New BitKeeper file ``server-tools/instance-manager/WindowsService.h'' server-tools/instance-manager/mysqlmanager.vcproj: New BitKeeper file ``server-tools/instance-manager/mysqlmanager.vcproj'' server-tools/instance-manager/port.h: New BitKeeper file ``server-tools/instance-manager/port.h''
2005-07-20 17:55:40 +02:00
const char *Options::password_file_name= default_password_file_name;
Intermediate commit - just to make new files visible to bk in the new tree server-tools/instance-manager/Makefile.am: Fixed IM linking to avoid using both mysys and libmysql as the define the same symbols and therefore conflict server-tools/instance-manager/listener.cc: Added ability to listen network ports server-tools/instance-manager/listener.h: Various additions to the Listener_thread_args server-tools/instance-manager/log.cc: merge server-tools/instance-manager/log.h: merge server-tools/instance-manager/manager.cc: Fixes and additions to enable guardian functionality server-tools/instance-manager/manager.h: Changed manager() signature server-tools/instance-manager/mysqlmanager.cc: Various fixes server-tools/instance-manager/options.cc: Added handling of default values for new options in the Options struct. (such as default_user, default_password, monitoring_interval e.t.c) server-tools/instance-manager/options.h: Added new options to the Options struct sql/net_serv.cc: Added MYSQL_INSTANCE_MANAGER defines to enable alarm handling in the IM server-tools/instance-manager/buffer.cc: Simple implementation of variable-length buffer server-tools/instance-manager/command.cc: Abstract command. All commands are derived from Command class server-tools/instance-manager/commands.h: Interfaces for all commands we have server-tools/instance-manager/factory.cc: Commands factory. This class hides command instantiation. The idea is to handle various protocols this way. (different commands for different protocols server-tools/instance-manager/guardian.cc: Guardian thread implementation (monitor and restart instances in case of a failure server-tools/instance-manager/guardian.h: Guardian_thread and Guardian_thread_args class interface. The Guardian_thread is responsible for monitoring and restarting instances server-tools/instance-manager/instance.cc: Instance class contains methods and data to manage a single instance server-tools/instance-manager/instance.h: This file contains class an instance class interface. The class is responsible for starting/stopping an instance server-tools/instance-manager/instance_map.cc: The instance repository. This class is also responsible for initialization of Instance class objects. server-tools/instance-manager/instance_options.cc: The Instance_options class contains all methods to get and handle options of an instance server-tools/instance-manager/mysql_connection.cc: The class responsible for handling MySQL client/server protocol connections server-tools/instance-manager/mysql_manager_error.h: The list of Instance Manger-specific errors server-tools/instance-manager/parse.cc: Simple query parser server-tools/instance-manager/parse.h: Parser interface server-tools/instance-manager/protocol.cc: Here implemented functions used to handle mysql client/server protocol server-tools/instance-manager/protocol.h: Interface for MySQL client/server protocol server-tools/instance-manager/thread_registry.cc: Thread registry stores information about every thread. It's main function is to provide graceful shutdown for all threads. server-tools/instance-manager/user_map.h: User map contains hash with user names and passwords
2004-10-23 09:32:52 +02:00
const char *Options::default_mysqld_path= QUOTE(DEFAULT_MYSQLD_PATH);
const char *Options::bind_address= 0; /* No default value */
Intermediate commit - just to make new files visible to bk in the new tree server-tools/instance-manager/Makefile.am: Fixed IM linking to avoid using both mysys and libmysql as the define the same symbols and therefore conflict server-tools/instance-manager/listener.cc: Added ability to listen network ports server-tools/instance-manager/listener.h: Various additions to the Listener_thread_args server-tools/instance-manager/log.cc: merge server-tools/instance-manager/log.h: merge server-tools/instance-manager/manager.cc: Fixes and additions to enable guardian functionality server-tools/instance-manager/manager.h: Changed manager() signature server-tools/instance-manager/mysqlmanager.cc: Various fixes server-tools/instance-manager/options.cc: Added handling of default values for new options in the Options struct. (such as default_user, default_password, monitoring_interval e.t.c) server-tools/instance-manager/options.h: Added new options to the Options struct sql/net_serv.cc: Added MYSQL_INSTANCE_MANAGER defines to enable alarm handling in the IM server-tools/instance-manager/buffer.cc: Simple implementation of variable-length buffer server-tools/instance-manager/command.cc: Abstract command. All commands are derived from Command class server-tools/instance-manager/commands.h: Interfaces for all commands we have server-tools/instance-manager/factory.cc: Commands factory. This class hides command instantiation. The idea is to handle various protocols this way. (different commands for different protocols server-tools/instance-manager/guardian.cc: Guardian thread implementation (monitor and restart instances in case of a failure server-tools/instance-manager/guardian.h: Guardian_thread and Guardian_thread_args class interface. The Guardian_thread is responsible for monitoring and restarting instances server-tools/instance-manager/instance.cc: Instance class contains methods and data to manage a single instance server-tools/instance-manager/instance.h: This file contains class an instance class interface. The class is responsible for starting/stopping an instance server-tools/instance-manager/instance_map.cc: The instance repository. This class is also responsible for initialization of Instance class objects. server-tools/instance-manager/instance_options.cc: The Instance_options class contains all methods to get and handle options of an instance server-tools/instance-manager/mysql_connection.cc: The class responsible for handling MySQL client/server protocol connections server-tools/instance-manager/mysql_manager_error.h: The list of Instance Manger-specific errors server-tools/instance-manager/parse.cc: Simple query parser server-tools/instance-manager/parse.h: Parser interface server-tools/instance-manager/protocol.cc: Here implemented functions used to handle mysql client/server protocol server-tools/instance-manager/protocol.h: Interface for MySQL client/server protocol server-tools/instance-manager/thread_registry.cc: Thread registry stores information about every thread. It's main function is to provide graceful shutdown for all threads. server-tools/instance-manager/user_map.h: User map contains hash with user names and passwords
2004-10-23 09:32:52 +02:00
uint Options::monitoring_interval= DEFAULT_MONITORING_INTERVAL;
uint Options::port_number= DEFAULT_PORT;
Various fixes (cleanups, valgrind, makefiles, ...) server-tools/instance-manager/Makefile.am: increased default_monitoring interval server-tools/instance-manager/guardian.cc: some fixes for proper shutdown server-tools/instance-manager/guardian.h: removed init() prototype, as it was never used server-tools/instance-manager/instance.cc: cleanup() function removed server-tools/instance-manager/instance.h: cleanup() prototype removed server-tools/instance-manager/instance_map.cc: Instance_map::cleanup() removed, as instances have nothing to clean up server-tools/instance-manager/instance_map.h: Instance_map::cleanup() prototype removed server-tools/instance-manager/instance_options.cc: added print_argv() function for debug purposes server-tools/instance-manager/instance_options.h: declared print_argv() server-tools/instance-manager/listener.cc: some fixed in listener for proper shutdown server-tools/instance-manager/log.cc: cleanup server-tools/instance-manager/log.h: cleanup server-tools/instance-manager/manager.cc: some comments added server-tools/instance-manager/mysqlmanager.cc: we need to free memory in the very end server-tools/instance-manager/options.cc: fixed default options handling (as they were not working properly), added new method to cleanup Options server-tools/instance-manager/options.h: cleanup() declared server-tools/instance-manager/thread_registry.cc: cleanup server-tools/instance-manager/user_map.cc: missing password file is not a critical error anymore, as IM should be able to work as mysqld_safe only
2005-02-03 18:48:58 +01:00
/* just to declare */
char **Options::saved_argv;
/*
List of options, accepted by the instance manager.
List must be closed with empty option.
*/
enum options {
OPT_LOG= 256,
OPT_PID_FILE,
OPT_SOCKET,
Intermediate commit - just to make new files visible to bk in the new tree server-tools/instance-manager/Makefile.am: Fixed IM linking to avoid using both mysys and libmysql as the define the same symbols and therefore conflict server-tools/instance-manager/listener.cc: Added ability to listen network ports server-tools/instance-manager/listener.h: Various additions to the Listener_thread_args server-tools/instance-manager/log.cc: merge server-tools/instance-manager/log.h: merge server-tools/instance-manager/manager.cc: Fixes and additions to enable guardian functionality server-tools/instance-manager/manager.h: Changed manager() signature server-tools/instance-manager/mysqlmanager.cc: Various fixes server-tools/instance-manager/options.cc: Added handling of default values for new options in the Options struct. (such as default_user, default_password, monitoring_interval e.t.c) server-tools/instance-manager/options.h: Added new options to the Options struct sql/net_serv.cc: Added MYSQL_INSTANCE_MANAGER defines to enable alarm handling in the IM server-tools/instance-manager/buffer.cc: Simple implementation of variable-length buffer server-tools/instance-manager/command.cc: Abstract command. All commands are derived from Command class server-tools/instance-manager/commands.h: Interfaces for all commands we have server-tools/instance-manager/factory.cc: Commands factory. This class hides command instantiation. The idea is to handle various protocols this way. (different commands for different protocols server-tools/instance-manager/guardian.cc: Guardian thread implementation (monitor and restart instances in case of a failure server-tools/instance-manager/guardian.h: Guardian_thread and Guardian_thread_args class interface. The Guardian_thread is responsible for monitoring and restarting instances server-tools/instance-manager/instance.cc: Instance class contains methods and data to manage a single instance server-tools/instance-manager/instance.h: This file contains class an instance class interface. The class is responsible for starting/stopping an instance server-tools/instance-manager/instance_map.cc: The instance repository. This class is also responsible for initialization of Instance class objects. server-tools/instance-manager/instance_options.cc: The Instance_options class contains all methods to get and handle options of an instance server-tools/instance-manager/mysql_connection.cc: The class responsible for handling MySQL client/server protocol connections server-tools/instance-manager/mysql_manager_error.h: The list of Instance Manger-specific errors server-tools/instance-manager/parse.cc: Simple query parser server-tools/instance-manager/parse.h: Parser interface server-tools/instance-manager/protocol.cc: Here implemented functions used to handle mysql client/server protocol server-tools/instance-manager/protocol.h: Interface for MySQL client/server protocol server-tools/instance-manager/thread_registry.cc: Thread registry stores information about every thread. It's main function is to provide graceful shutdown for all threads. server-tools/instance-manager/user_map.h: User map contains hash with user names and passwords
2004-10-23 09:32:52 +02:00
OPT_PASSWORD_FILE,
OPT_MYSQLD_PATH,
initial import of Windows port of IM. server-tools/instance-manager/commands.cc: type cleanups for compiling on Windows now using Options::config_file for the location of the single my.cnf file we are using server-tools/instance-manager/guardian.cc: pthread_mutex_lock and unlock do not return a value on Windows so we return 0 in all cases server-tools/instance-manager/instance.cc: big changes here. Had to implement Windows versions of launch_and_wait and kill() server-tools/instance-manager/instance.h: added some function defs server-tools/instance-manager/instance_map.cc: pthread_mutex_lock and unlock do not return a value on Windows Also, now using only the file named as Options::config_file server-tools/instance-manager/instance_options.h: added reference to port.h server-tools/instance-manager/listener.cc: reworked and simplified the socket handling code. Added windows versions of the code that sets the sockets to be non-blocking and non-inheritable server-tools/instance-manager/listener.h: change Options to always be a struct. Really surprised GCC was letting this go. Options was declared to be struct in some places and class in other places. server-tools/instance-manager/log.cc: added reference to port.h server-tools/instance-manager/manager.cc: moved all the signal code inside some #ifndef __WIN__ blocks server-tools/instance-manager/manager.h: change Options to always be a struct. Really surprised GCC was letting this go. Options was declared to be struct in some places and class in other places. server-tools/instance-manager/mysqlmanager.cc: added in the Windows service code. server-tools/instance-manager/options.cc: Added in the windows options for running as a service and the code for loading settings only from a single file server-tools/instance-manager/options.h: added definitions for the new Windows service vars and routines server-tools/instance-manager/parse_output.cc: added reference to port.h server-tools/instance-manager/priv.cc: added reference to port.h server-tools/instance-manager/priv.h: linuxthreads should not be visible on Windows server-tools/instance-manager/thread_registry.cc: more __WIN__ blocking server-tools/instance-manager/user_map.cc: fixed passwd file code to handle files with \r\n line endings server-tools/instance-manager/IMService.cpp: New BitKeeper file ``server-tools/instance-manager/IMService.cpp'' server-tools/instance-manager/IMService.h: New BitKeeper file ``server-tools/instance-manager/IMService.h'' server-tools/instance-manager/WindowsService.cpp: New BitKeeper file ``server-tools/instance-manager/WindowsService.cpp'' server-tools/instance-manager/WindowsService.h: New BitKeeper file ``server-tools/instance-manager/WindowsService.h'' server-tools/instance-manager/mysqlmanager.vcproj: New BitKeeper file ``server-tools/instance-manager/mysqlmanager.vcproj'' server-tools/instance-manager/port.h: New BitKeeper file ``server-tools/instance-manager/port.h''
2005-07-20 17:55:40 +02:00
#ifndef __WIN__
Intermediate commit - just to make new files visible to bk in the new tree server-tools/instance-manager/Makefile.am: Fixed IM linking to avoid using both mysys and libmysql as the define the same symbols and therefore conflict server-tools/instance-manager/listener.cc: Added ability to listen network ports server-tools/instance-manager/listener.h: Various additions to the Listener_thread_args server-tools/instance-manager/log.cc: merge server-tools/instance-manager/log.h: merge server-tools/instance-manager/manager.cc: Fixes and additions to enable guardian functionality server-tools/instance-manager/manager.h: Changed manager() signature server-tools/instance-manager/mysqlmanager.cc: Various fixes server-tools/instance-manager/options.cc: Added handling of default values for new options in the Options struct. (such as default_user, default_password, monitoring_interval e.t.c) server-tools/instance-manager/options.h: Added new options to the Options struct sql/net_serv.cc: Added MYSQL_INSTANCE_MANAGER defines to enable alarm handling in the IM server-tools/instance-manager/buffer.cc: Simple implementation of variable-length buffer server-tools/instance-manager/command.cc: Abstract command. All commands are derived from Command class server-tools/instance-manager/commands.h: Interfaces for all commands we have server-tools/instance-manager/factory.cc: Commands factory. This class hides command instantiation. The idea is to handle various protocols this way. (different commands for different protocols server-tools/instance-manager/guardian.cc: Guardian thread implementation (monitor and restart instances in case of a failure server-tools/instance-manager/guardian.h: Guardian_thread and Guardian_thread_args class interface. The Guardian_thread is responsible for monitoring and restarting instances server-tools/instance-manager/instance.cc: Instance class contains methods and data to manage a single instance server-tools/instance-manager/instance.h: This file contains class an instance class interface. The class is responsible for starting/stopping an instance server-tools/instance-manager/instance_map.cc: The instance repository. This class is also responsible for initialization of Instance class objects. server-tools/instance-manager/instance_options.cc: The Instance_options class contains all methods to get and handle options of an instance server-tools/instance-manager/mysql_connection.cc: The class responsible for handling MySQL client/server protocol connections server-tools/instance-manager/mysql_manager_error.h: The list of Instance Manger-specific errors server-tools/instance-manager/parse.cc: Simple query parser server-tools/instance-manager/parse.h: Parser interface server-tools/instance-manager/protocol.cc: Here implemented functions used to handle mysql client/server protocol server-tools/instance-manager/protocol.h: Interface for MySQL client/server protocol server-tools/instance-manager/thread_registry.cc: Thread registry stores information about every thread. It's main function is to provide graceful shutdown for all threads. server-tools/instance-manager/user_map.h: User map contains hash with user names and passwords
2004-10-23 09:32:52 +02:00
OPT_RUN_AS_SERVICE,
OPT_USER,
initial import of Windows port of IM. server-tools/instance-manager/commands.cc: type cleanups for compiling on Windows now using Options::config_file for the location of the single my.cnf file we are using server-tools/instance-manager/guardian.cc: pthread_mutex_lock and unlock do not return a value on Windows so we return 0 in all cases server-tools/instance-manager/instance.cc: big changes here. Had to implement Windows versions of launch_and_wait and kill() server-tools/instance-manager/instance.h: added some function defs server-tools/instance-manager/instance_map.cc: pthread_mutex_lock and unlock do not return a value on Windows Also, now using only the file named as Options::config_file server-tools/instance-manager/instance_options.h: added reference to port.h server-tools/instance-manager/listener.cc: reworked and simplified the socket handling code. Added windows versions of the code that sets the sockets to be non-blocking and non-inheritable server-tools/instance-manager/listener.h: change Options to always be a struct. Really surprised GCC was letting this go. Options was declared to be struct in some places and class in other places. server-tools/instance-manager/log.cc: added reference to port.h server-tools/instance-manager/manager.cc: moved all the signal code inside some #ifndef __WIN__ blocks server-tools/instance-manager/manager.h: change Options to always be a struct. Really surprised GCC was letting this go. Options was declared to be struct in some places and class in other places. server-tools/instance-manager/mysqlmanager.cc: added in the Windows service code. server-tools/instance-manager/options.cc: Added in the windows options for running as a service and the code for loading settings only from a single file server-tools/instance-manager/options.h: added definitions for the new Windows service vars and routines server-tools/instance-manager/parse_output.cc: added reference to port.h server-tools/instance-manager/priv.cc: added reference to port.h server-tools/instance-manager/priv.h: linuxthreads should not be visible on Windows server-tools/instance-manager/thread_registry.cc: more __WIN__ blocking server-tools/instance-manager/user_map.cc: fixed passwd file code to handle files with \r\n line endings server-tools/instance-manager/IMService.cpp: New BitKeeper file ``server-tools/instance-manager/IMService.cpp'' server-tools/instance-manager/IMService.h: New BitKeeper file ``server-tools/instance-manager/IMService.h'' server-tools/instance-manager/WindowsService.cpp: New BitKeeper file ``server-tools/instance-manager/WindowsService.cpp'' server-tools/instance-manager/WindowsService.h: New BitKeeper file ``server-tools/instance-manager/WindowsService.h'' server-tools/instance-manager/mysqlmanager.vcproj: New BitKeeper file ``server-tools/instance-manager/mysqlmanager.vcproj'' server-tools/instance-manager/port.h: New BitKeeper file ``server-tools/instance-manager/port.h''
2005-07-20 17:55:40 +02:00
#else
OPT_INSTALL_SERVICE,
OPT_REMOVE_SERVICE,
#endif
Intermediate commit - just to make new files visible to bk in the new tree server-tools/instance-manager/Makefile.am: Fixed IM linking to avoid using both mysys and libmysql as the define the same symbols and therefore conflict server-tools/instance-manager/listener.cc: Added ability to listen network ports server-tools/instance-manager/listener.h: Various additions to the Listener_thread_args server-tools/instance-manager/log.cc: merge server-tools/instance-manager/log.h: merge server-tools/instance-manager/manager.cc: Fixes and additions to enable guardian functionality server-tools/instance-manager/manager.h: Changed manager() signature server-tools/instance-manager/mysqlmanager.cc: Various fixes server-tools/instance-manager/options.cc: Added handling of default values for new options in the Options struct. (such as default_user, default_password, monitoring_interval e.t.c) server-tools/instance-manager/options.h: Added new options to the Options struct sql/net_serv.cc: Added MYSQL_INSTANCE_MANAGER defines to enable alarm handling in the IM server-tools/instance-manager/buffer.cc: Simple implementation of variable-length buffer server-tools/instance-manager/command.cc: Abstract command. All commands are derived from Command class server-tools/instance-manager/commands.h: Interfaces for all commands we have server-tools/instance-manager/factory.cc: Commands factory. This class hides command instantiation. The idea is to handle various protocols this way. (different commands for different protocols server-tools/instance-manager/guardian.cc: Guardian thread implementation (monitor and restart instances in case of a failure server-tools/instance-manager/guardian.h: Guardian_thread and Guardian_thread_args class interface. The Guardian_thread is responsible for monitoring and restarting instances server-tools/instance-manager/instance.cc: Instance class contains methods and data to manage a single instance server-tools/instance-manager/instance.h: This file contains class an instance class interface. The class is responsible for starting/stopping an instance server-tools/instance-manager/instance_map.cc: The instance repository. This class is also responsible for initialization of Instance class objects. server-tools/instance-manager/instance_options.cc: The Instance_options class contains all methods to get and handle options of an instance server-tools/instance-manager/mysql_connection.cc: The class responsible for handling MySQL client/server protocol connections server-tools/instance-manager/mysql_manager_error.h: The list of Instance Manger-specific errors server-tools/instance-manager/parse.cc: Simple query parser server-tools/instance-manager/parse.h: Parser interface server-tools/instance-manager/protocol.cc: Here implemented functions used to handle mysql client/server protocol server-tools/instance-manager/protocol.h: Interface for MySQL client/server protocol server-tools/instance-manager/thread_registry.cc: Thread registry stores information about every thread. It's main function is to provide graceful shutdown for all threads. server-tools/instance-manager/user_map.h: User map contains hash with user names and passwords
2004-10-23 09:32:52 +02:00
OPT_MONITORING_INTERVAL,
OPT_PORT,
OPT_BIND_ADDRESS
};
Intermediate commit - just to make new files visible to bk in the new tree server-tools/instance-manager/Makefile.am: Fixed IM linking to avoid using both mysys and libmysql as the define the same symbols and therefore conflict server-tools/instance-manager/listener.cc: Added ability to listen network ports server-tools/instance-manager/listener.h: Various additions to the Listener_thread_args server-tools/instance-manager/log.cc: merge server-tools/instance-manager/log.h: merge server-tools/instance-manager/manager.cc: Fixes and additions to enable guardian functionality server-tools/instance-manager/manager.h: Changed manager() signature server-tools/instance-manager/mysqlmanager.cc: Various fixes server-tools/instance-manager/options.cc: Added handling of default values for new options in the Options struct. (such as default_user, default_password, monitoring_interval e.t.c) server-tools/instance-manager/options.h: Added new options to the Options struct sql/net_serv.cc: Added MYSQL_INSTANCE_MANAGER defines to enable alarm handling in the IM server-tools/instance-manager/buffer.cc: Simple implementation of variable-length buffer server-tools/instance-manager/command.cc: Abstract command. All commands are derived from Command class server-tools/instance-manager/commands.h: Interfaces for all commands we have server-tools/instance-manager/factory.cc: Commands factory. This class hides command instantiation. The idea is to handle various protocols this way. (different commands for different protocols server-tools/instance-manager/guardian.cc: Guardian thread implementation (monitor and restart instances in case of a failure server-tools/instance-manager/guardian.h: Guardian_thread and Guardian_thread_args class interface. The Guardian_thread is responsible for monitoring and restarting instances server-tools/instance-manager/instance.cc: Instance class contains methods and data to manage a single instance server-tools/instance-manager/instance.h: This file contains class an instance class interface. The class is responsible for starting/stopping an instance server-tools/instance-manager/instance_map.cc: The instance repository. This class is also responsible for initialization of Instance class objects. server-tools/instance-manager/instance_options.cc: The Instance_options class contains all methods to get and handle options of an instance server-tools/instance-manager/mysql_connection.cc: The class responsible for handling MySQL client/server protocol connections server-tools/instance-manager/mysql_manager_error.h: The list of Instance Manger-specific errors server-tools/instance-manager/parse.cc: Simple query parser server-tools/instance-manager/parse.h: Parser interface server-tools/instance-manager/protocol.cc: Here implemented functions used to handle mysql client/server protocol server-tools/instance-manager/protocol.h: Interface for MySQL client/server protocol server-tools/instance-manager/thread_registry.cc: Thread registry stores information about every thread. It's main function is to provide graceful shutdown for all threads. server-tools/instance-manager/user_map.h: User map contains hash with user names and passwords
2004-10-23 09:32:52 +02:00
static struct my_option my_long_options[] =
{
{ "help", '?', "Display this help and exit.",
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0 },
{ "log", OPT_LOG, "Path to log file. Used only with --run-as-service.",
(gptr *) &Options::log_file_name, (gptr *) &Options::log_file_name,
0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 },
{ "pid-file", OPT_PID_FILE, "Pid file to use.",
(gptr *) &Options::pid_file_name, (gptr *) &Options::pid_file_name,
0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 },
Intermediate commit - just to make new files visible to bk in the new tree server-tools/instance-manager/Makefile.am: Fixed IM linking to avoid using both mysys and libmysql as the define the same symbols and therefore conflict server-tools/instance-manager/listener.cc: Added ability to listen network ports server-tools/instance-manager/listener.h: Various additions to the Listener_thread_args server-tools/instance-manager/log.cc: merge server-tools/instance-manager/log.h: merge server-tools/instance-manager/manager.cc: Fixes and additions to enable guardian functionality server-tools/instance-manager/manager.h: Changed manager() signature server-tools/instance-manager/mysqlmanager.cc: Various fixes server-tools/instance-manager/options.cc: Added handling of default values for new options in the Options struct. (such as default_user, default_password, monitoring_interval e.t.c) server-tools/instance-manager/options.h: Added new options to the Options struct sql/net_serv.cc: Added MYSQL_INSTANCE_MANAGER defines to enable alarm handling in the IM server-tools/instance-manager/buffer.cc: Simple implementation of variable-length buffer server-tools/instance-manager/command.cc: Abstract command. All commands are derived from Command class server-tools/instance-manager/commands.h: Interfaces for all commands we have server-tools/instance-manager/factory.cc: Commands factory. This class hides command instantiation. The idea is to handle various protocols this way. (different commands for different protocols server-tools/instance-manager/guardian.cc: Guardian thread implementation (monitor and restart instances in case of a failure server-tools/instance-manager/guardian.h: Guardian_thread and Guardian_thread_args class interface. The Guardian_thread is responsible for monitoring and restarting instances server-tools/instance-manager/instance.cc: Instance class contains methods and data to manage a single instance server-tools/instance-manager/instance.h: This file contains class an instance class interface. The class is responsible for starting/stopping an instance server-tools/instance-manager/instance_map.cc: The instance repository. This class is also responsible for initialization of Instance class objects. server-tools/instance-manager/instance_options.cc: The Instance_options class contains all methods to get and handle options of an instance server-tools/instance-manager/mysql_connection.cc: The class responsible for handling MySQL client/server protocol connections server-tools/instance-manager/mysql_manager_error.h: The list of Instance Manger-specific errors server-tools/instance-manager/parse.cc: Simple query parser server-tools/instance-manager/parse.h: Parser interface server-tools/instance-manager/protocol.cc: Here implemented functions used to handle mysql client/server protocol server-tools/instance-manager/protocol.h: Interface for MySQL client/server protocol server-tools/instance-manager/thread_registry.cc: Thread registry stores information about every thread. It's main function is to provide graceful shutdown for all threads. server-tools/instance-manager/user_map.h: User map contains hash with user names and passwords
2004-10-23 09:32:52 +02:00
{ "socket", OPT_SOCKET, "Socket file to use for connection.",
(gptr *) &Options::socket_file_name, (gptr *) &Options::socket_file_name,
0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 },
Post-review fixes + some bugs fixed + several minor features BitKeeper/deleted/.del-client_func.c~3476a8a85cbd3c29: Delete: server-tools/instance-manager/client_func.c server-tools/instance-manager/Makefile.am: clien_func removed server-tools/instance-manager/buffer.cc: several methods added server-tools/instance-manager/buffer.h: Some error-handling fixes. server-tools/instance-manager/commands.cc: check for Buffer errors server-tools/instance-manager/guardian.cc: Guardian rewiriten. Not it works in a finite state machine-way. server-tools/instance-manager/guardian.h: Appropriate (to .cc) changes in the header + some comment added server-tools/instance-manager/instance.cc: added proxy thread to monitor instance. Two kinds of stop() now -- stop() and kill_instance which only sends a signal server-tools/instance-manager/instance.h: appropriate changes server-tools/instance-manager/instance_map.cc: cleanup server-tools/instance-manager/instance_map.h: cleanup server-tools/instance-manager/instance_options.cc: Caching of the pid-file-name is added. some comments added server-tools/instance-manager/instance_options.h: cleanup server-tools/instance-manager/listener.cc: listener my_thread_init added (though it doesn't use any mysys functions). Just in case server-tools/instance-manager/manager.cc: SIGCHLD handler removed. now instance monitoring is implemented through proxy threads. This is to work nicely with LinuxThreads server-tools/instance-manager/options.cc: added option to create a password file entry (this was implemented by Sergei Vojtovich) server-tools/instance-manager/parse.cc: inline function get_word moved to the header server-tools/instance-manager/parse.h: get_word moved here to use form parse_output server-tools/instance-manager/parse_output.cc: get_word() clone removed. now looking through the output linewise server-tools/instance-manager/protocol.cc: Buffer error chech added server-tools/instance-manager/user_map.cc: typo fixed
2005-02-11 12:21:59 +01:00
{ "passwd", 'P', "Prepare entry for passwd file and exit.", 0, 0, 0,
GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0 },
{ "bind-address", OPT_BIND_ADDRESS, "Bind address to use for connection.",
Intermediate commit - just to make new files visible to bk in the new tree server-tools/instance-manager/Makefile.am: Fixed IM linking to avoid using both mysys and libmysql as the define the same symbols and therefore conflict server-tools/instance-manager/listener.cc: Added ability to listen network ports server-tools/instance-manager/listener.h: Various additions to the Listener_thread_args server-tools/instance-manager/log.cc: merge server-tools/instance-manager/log.h: merge server-tools/instance-manager/manager.cc: Fixes and additions to enable guardian functionality server-tools/instance-manager/manager.h: Changed manager() signature server-tools/instance-manager/mysqlmanager.cc: Various fixes server-tools/instance-manager/options.cc: Added handling of default values for new options in the Options struct. (such as default_user, default_password, monitoring_interval e.t.c) server-tools/instance-manager/options.h: Added new options to the Options struct sql/net_serv.cc: Added MYSQL_INSTANCE_MANAGER defines to enable alarm handling in the IM server-tools/instance-manager/buffer.cc: Simple implementation of variable-length buffer server-tools/instance-manager/command.cc: Abstract command. All commands are derived from Command class server-tools/instance-manager/commands.h: Interfaces for all commands we have server-tools/instance-manager/factory.cc: Commands factory. This class hides command instantiation. The idea is to handle various protocols this way. (different commands for different protocols server-tools/instance-manager/guardian.cc: Guardian thread implementation (monitor and restart instances in case of a failure server-tools/instance-manager/guardian.h: Guardian_thread and Guardian_thread_args class interface. The Guardian_thread is responsible for monitoring and restarting instances server-tools/instance-manager/instance.cc: Instance class contains methods and data to manage a single instance server-tools/instance-manager/instance.h: This file contains class an instance class interface. The class is responsible for starting/stopping an instance server-tools/instance-manager/instance_map.cc: The instance repository. This class is also responsible for initialization of Instance class objects. server-tools/instance-manager/instance_options.cc: The Instance_options class contains all methods to get and handle options of an instance server-tools/instance-manager/mysql_connection.cc: The class responsible for handling MySQL client/server protocol connections server-tools/instance-manager/mysql_manager_error.h: The list of Instance Manger-specific errors server-tools/instance-manager/parse.cc: Simple query parser server-tools/instance-manager/parse.h: Parser interface server-tools/instance-manager/protocol.cc: Here implemented functions used to handle mysql client/server protocol server-tools/instance-manager/protocol.h: Interface for MySQL client/server protocol server-tools/instance-manager/thread_registry.cc: Thread registry stores information about every thread. It's main function is to provide graceful shutdown for all threads. server-tools/instance-manager/user_map.h: User map contains hash with user names and passwords
2004-10-23 09:32:52 +02:00
(gptr *) &Options::bind_address, (gptr *) &Options::bind_address,
0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 },
{ "port", OPT_PORT, "Port number to use for connections",
(gptr *) &Options::port_number, (gptr *) &Options::port_number,
Various fixes (cleanups, valgrind, makefiles, ...) server-tools/instance-manager/Makefile.am: increased default_monitoring interval server-tools/instance-manager/guardian.cc: some fixes for proper shutdown server-tools/instance-manager/guardian.h: removed init() prototype, as it was never used server-tools/instance-manager/instance.cc: cleanup() function removed server-tools/instance-manager/instance.h: cleanup() prototype removed server-tools/instance-manager/instance_map.cc: Instance_map::cleanup() removed, as instances have nothing to clean up server-tools/instance-manager/instance_map.h: Instance_map::cleanup() prototype removed server-tools/instance-manager/instance_options.cc: added print_argv() function for debug purposes server-tools/instance-manager/instance_options.h: declared print_argv() server-tools/instance-manager/listener.cc: some fixed in listener for proper shutdown server-tools/instance-manager/log.cc: cleanup server-tools/instance-manager/log.h: cleanup server-tools/instance-manager/manager.cc: some comments added server-tools/instance-manager/mysqlmanager.cc: we need to free memory in the very end server-tools/instance-manager/options.cc: fixed default options handling (as they were not working properly), added new method to cleanup Options server-tools/instance-manager/options.h: cleanup() declared server-tools/instance-manager/thread_registry.cc: cleanup server-tools/instance-manager/user_map.cc: missing password file is not a critical error anymore, as IM should be able to work as mysqld_safe only
2005-02-03 18:48:58 +01:00
0, GET_UINT, REQUIRED_ARG, DEFAULT_PORT, 0, 0, 0, 0, 0 },
Intermediate commit - just to make new files visible to bk in the new tree server-tools/instance-manager/Makefile.am: Fixed IM linking to avoid using both mysys and libmysql as the define the same symbols and therefore conflict server-tools/instance-manager/listener.cc: Added ability to listen network ports server-tools/instance-manager/listener.h: Various additions to the Listener_thread_args server-tools/instance-manager/log.cc: merge server-tools/instance-manager/log.h: merge server-tools/instance-manager/manager.cc: Fixes and additions to enable guardian functionality server-tools/instance-manager/manager.h: Changed manager() signature server-tools/instance-manager/mysqlmanager.cc: Various fixes server-tools/instance-manager/options.cc: Added handling of default values for new options in the Options struct. (such as default_user, default_password, monitoring_interval e.t.c) server-tools/instance-manager/options.h: Added new options to the Options struct sql/net_serv.cc: Added MYSQL_INSTANCE_MANAGER defines to enable alarm handling in the IM server-tools/instance-manager/buffer.cc: Simple implementation of variable-length buffer server-tools/instance-manager/command.cc: Abstract command. All commands are derived from Command class server-tools/instance-manager/commands.h: Interfaces for all commands we have server-tools/instance-manager/factory.cc: Commands factory. This class hides command instantiation. The idea is to handle various protocols this way. (different commands for different protocols server-tools/instance-manager/guardian.cc: Guardian thread implementation (monitor and restart instances in case of a failure server-tools/instance-manager/guardian.h: Guardian_thread and Guardian_thread_args class interface. The Guardian_thread is responsible for monitoring and restarting instances server-tools/instance-manager/instance.cc: Instance class contains methods and data to manage a single instance server-tools/instance-manager/instance.h: This file contains class an instance class interface. The class is responsible for starting/stopping an instance server-tools/instance-manager/instance_map.cc: The instance repository. This class is also responsible for initialization of Instance class objects. server-tools/instance-manager/instance_options.cc: The Instance_options class contains all methods to get and handle options of an instance server-tools/instance-manager/mysql_connection.cc: The class responsible for handling MySQL client/server protocol connections server-tools/instance-manager/mysql_manager_error.h: The list of Instance Manger-specific errors server-tools/instance-manager/parse.cc: Simple query parser server-tools/instance-manager/parse.h: Parser interface server-tools/instance-manager/protocol.cc: Here implemented functions used to handle mysql client/server protocol server-tools/instance-manager/protocol.h: Interface for MySQL client/server protocol server-tools/instance-manager/thread_registry.cc: Thread registry stores information about every thread. It's main function is to provide graceful shutdown for all threads. server-tools/instance-manager/user_map.h: User map contains hash with user names and passwords
2004-10-23 09:32:52 +02:00
{ "password-file", OPT_PASSWORD_FILE, "Look for Instane Manager users"
" and passwords here.",
(gptr *) &Options::password_file_name,
(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"
Intermediate commit - just to make new files visible to bk in the new tree server-tools/instance-manager/Makefile.am: Fixed IM linking to avoid using both mysys and libmysql as the define the same symbols and therefore conflict server-tools/instance-manager/listener.cc: Added ability to listen network ports server-tools/instance-manager/listener.h: Various additions to the Listener_thread_args server-tools/instance-manager/log.cc: merge server-tools/instance-manager/log.h: merge server-tools/instance-manager/manager.cc: Fixes and additions to enable guardian functionality server-tools/instance-manager/manager.h: Changed manager() signature server-tools/instance-manager/mysqlmanager.cc: Various fixes server-tools/instance-manager/options.cc: Added handling of default values for new options in the Options struct. (such as default_user, default_password, monitoring_interval e.t.c) server-tools/instance-manager/options.h: Added new options to the Options struct sql/net_serv.cc: Added MYSQL_INSTANCE_MANAGER defines to enable alarm handling in the IM server-tools/instance-manager/buffer.cc: Simple implementation of variable-length buffer server-tools/instance-manager/command.cc: Abstract command. All commands are derived from Command class server-tools/instance-manager/commands.h: Interfaces for all commands we have server-tools/instance-manager/factory.cc: Commands factory. This class hides command instantiation. The idea is to handle various protocols this way. (different commands for different protocols server-tools/instance-manager/guardian.cc: Guardian thread implementation (monitor and restart instances in case of a failure server-tools/instance-manager/guardian.h: Guardian_thread and Guardian_thread_args class interface. The Guardian_thread is responsible for monitoring and restarting instances server-tools/instance-manager/instance.cc: Instance class contains methods and data to manage a single instance server-tools/instance-manager/instance.h: This file contains class an instance class interface. The class is responsible for starting/stopping an instance server-tools/instance-manager/instance_map.cc: The instance repository. This class is also responsible for initialization of Instance class objects. server-tools/instance-manager/instance_options.cc: The Instance_options class contains all methods to get and handle options of an instance server-tools/instance-manager/mysql_connection.cc: The class responsible for handling MySQL client/server protocol connections server-tools/instance-manager/mysql_manager_error.h: The list of Instance Manger-specific errors server-tools/instance-manager/parse.cc: Simple query parser server-tools/instance-manager/parse.h: Parser interface server-tools/instance-manager/protocol.cc: Here implemented functions used to handle mysql client/server protocol server-tools/instance-manager/protocol.h: Interface for MySQL client/server protocol server-tools/instance-manager/thread_registry.cc: Thread registry stores information about every thread. It's main function is to provide graceful shutdown for all threads. server-tools/instance-manager/user_map.h: User map contains hash with user names and passwords
2004-10-23 09:32:52 +02:00
" Server binary.",
(gptr *) &Options::default_mysqld_path, (gptr *) &Options::default_mysqld_path,
0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 },
{ "monitoring-interval", OPT_MONITORING_INTERVAL, "Interval to monitor instances"
Intermediate commit - just to make new files visible to bk in the new tree server-tools/instance-manager/Makefile.am: Fixed IM linking to avoid using both mysys and libmysql as the define the same symbols and therefore conflict server-tools/instance-manager/listener.cc: Added ability to listen network ports server-tools/instance-manager/listener.h: Various additions to the Listener_thread_args server-tools/instance-manager/log.cc: merge server-tools/instance-manager/log.h: merge server-tools/instance-manager/manager.cc: Fixes and additions to enable guardian functionality server-tools/instance-manager/manager.h: Changed manager() signature server-tools/instance-manager/mysqlmanager.cc: Various fixes server-tools/instance-manager/options.cc: Added handling of default values for new options in the Options struct. (such as default_user, default_password, monitoring_interval e.t.c) server-tools/instance-manager/options.h: Added new options to the Options struct sql/net_serv.cc: Added MYSQL_INSTANCE_MANAGER defines to enable alarm handling in the IM server-tools/instance-manager/buffer.cc: Simple implementation of variable-length buffer server-tools/instance-manager/command.cc: Abstract command. All commands are derived from Command class server-tools/instance-manager/commands.h: Interfaces for all commands we have server-tools/instance-manager/factory.cc: Commands factory. This class hides command instantiation. The idea is to handle various protocols this way. (different commands for different protocols server-tools/instance-manager/guardian.cc: Guardian thread implementation (monitor and restart instances in case of a failure server-tools/instance-manager/guardian.h: Guardian_thread and Guardian_thread_args class interface. The Guardian_thread is responsible for monitoring and restarting instances server-tools/instance-manager/instance.cc: Instance class contains methods and data to manage a single instance server-tools/instance-manager/instance.h: This file contains class an instance class interface. The class is responsible for starting/stopping an instance server-tools/instance-manager/instance_map.cc: The instance repository. This class is also responsible for initialization of Instance class objects. server-tools/instance-manager/instance_options.cc: The Instance_options class contains all methods to get and handle options of an instance server-tools/instance-manager/mysql_connection.cc: The class responsible for handling MySQL client/server protocol connections server-tools/instance-manager/mysql_manager_error.h: The list of Instance Manger-specific errors server-tools/instance-manager/parse.cc: Simple query parser server-tools/instance-manager/parse.h: Parser interface server-tools/instance-manager/protocol.cc: Here implemented functions used to handle mysql client/server protocol server-tools/instance-manager/protocol.h: Interface for MySQL client/server protocol server-tools/instance-manager/thread_registry.cc: Thread registry stores information about every thread. It's main function is to provide graceful shutdown for all threads. server-tools/instance-manager/user_map.h: User map contains hash with user names and passwords
2004-10-23 09:32:52 +02:00
" in seconds.",
(gptr *) &Options::monitoring_interval,
(gptr *) &Options::monitoring_interval,
Various fixes (cleanups, valgrind, makefiles, ...) server-tools/instance-manager/Makefile.am: increased default_monitoring interval server-tools/instance-manager/guardian.cc: some fixes for proper shutdown server-tools/instance-manager/guardian.h: removed init() prototype, as it was never used server-tools/instance-manager/instance.cc: cleanup() function removed server-tools/instance-manager/instance.h: cleanup() prototype removed server-tools/instance-manager/instance_map.cc: Instance_map::cleanup() removed, as instances have nothing to clean up server-tools/instance-manager/instance_map.h: Instance_map::cleanup() prototype removed server-tools/instance-manager/instance_options.cc: added print_argv() function for debug purposes server-tools/instance-manager/instance_options.h: declared print_argv() server-tools/instance-manager/listener.cc: some fixed in listener for proper shutdown server-tools/instance-manager/log.cc: cleanup server-tools/instance-manager/log.h: cleanup server-tools/instance-manager/manager.cc: some comments added server-tools/instance-manager/mysqlmanager.cc: we need to free memory in the very end server-tools/instance-manager/options.cc: fixed default options handling (as they were not working properly), added new method to cleanup Options server-tools/instance-manager/options.h: cleanup() declared server-tools/instance-manager/thread_registry.cc: cleanup server-tools/instance-manager/user_map.cc: missing password file is not a critical error anymore, as IM should be able to work as mysqld_safe only
2005-02-03 18:48:58 +01:00
0, GET_UINT, REQUIRED_ARG, DEFAULT_MONITORING_INTERVAL,
0, 0, 0, 0, 0 },
initial import of Windows port of IM. server-tools/instance-manager/commands.cc: type cleanups for compiling on Windows now using Options::config_file for the location of the single my.cnf file we are using server-tools/instance-manager/guardian.cc: pthread_mutex_lock and unlock do not return a value on Windows so we return 0 in all cases server-tools/instance-manager/instance.cc: big changes here. Had to implement Windows versions of launch_and_wait and kill() server-tools/instance-manager/instance.h: added some function defs server-tools/instance-manager/instance_map.cc: pthread_mutex_lock and unlock do not return a value on Windows Also, now using only the file named as Options::config_file server-tools/instance-manager/instance_options.h: added reference to port.h server-tools/instance-manager/listener.cc: reworked and simplified the socket handling code. Added windows versions of the code that sets the sockets to be non-blocking and non-inheritable server-tools/instance-manager/listener.h: change Options to always be a struct. Really surprised GCC was letting this go. Options was declared to be struct in some places and class in other places. server-tools/instance-manager/log.cc: added reference to port.h server-tools/instance-manager/manager.cc: moved all the signal code inside some #ifndef __WIN__ blocks server-tools/instance-manager/manager.h: change Options to always be a struct. Really surprised GCC was letting this go. Options was declared to be struct in some places and class in other places. server-tools/instance-manager/mysqlmanager.cc: added in the Windows service code. server-tools/instance-manager/options.cc: Added in the windows options for running as a service and the code for loading settings only from a single file server-tools/instance-manager/options.h: added definitions for the new Windows service vars and routines server-tools/instance-manager/parse_output.cc: added reference to port.h server-tools/instance-manager/priv.cc: added reference to port.h server-tools/instance-manager/priv.h: linuxthreads should not be visible on Windows server-tools/instance-manager/thread_registry.cc: more __WIN__ blocking server-tools/instance-manager/user_map.cc: fixed passwd file code to handle files with \r\n line endings server-tools/instance-manager/IMService.cpp: New BitKeeper file ``server-tools/instance-manager/IMService.cpp'' server-tools/instance-manager/IMService.h: New BitKeeper file ``server-tools/instance-manager/IMService.h'' server-tools/instance-manager/WindowsService.cpp: New BitKeeper file ``server-tools/instance-manager/WindowsService.cpp'' server-tools/instance-manager/WindowsService.h: New BitKeeper file ``server-tools/instance-manager/WindowsService.h'' server-tools/instance-manager/mysqlmanager.vcproj: New BitKeeper file ``server-tools/instance-manager/mysqlmanager.vcproj'' server-tools/instance-manager/port.h: New BitKeeper file ``server-tools/instance-manager/port.h''
2005-07-20 17:55:40 +02:00
#ifdef __WIN__
{ "install", OPT_INSTALL_SERVICE, "Install as system service.",
(gptr *) &Options::install_as_service, (gptr*) &Options::install_as_service,
0, GET_BOOL, NO_ARG, 0, 0, 1, 0, 0, 0 },
{ "remove", OPT_REMOVE_SERVICE, "Remove system service.",
(gptr *)&Options::remove_service, (gptr*) &Options::remove_service,
0, GET_BOOL, NO_ARG, 0, 0, 1, 0, 0, 0},
#else
{ "run-as-service", OPT_RUN_AS_SERVICE,
"Daemonize and start angel process.", (gptr *) &Options::run_as_service,
0, 0, GET_BOOL, NO_ARG, 0, 0, 1, 0, 0, 0 },
{ "user", OPT_USER, "Username to start mysqlmanager",
(gptr *) &Options::user,
(gptr *) &Options::user,
0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 },
initial import of Windows port of IM. server-tools/instance-manager/commands.cc: type cleanups for compiling on Windows now using Options::config_file for the location of the single my.cnf file we are using server-tools/instance-manager/guardian.cc: pthread_mutex_lock and unlock do not return a value on Windows so we return 0 in all cases server-tools/instance-manager/instance.cc: big changes here. Had to implement Windows versions of launch_and_wait and kill() server-tools/instance-manager/instance.h: added some function defs server-tools/instance-manager/instance_map.cc: pthread_mutex_lock and unlock do not return a value on Windows Also, now using only the file named as Options::config_file server-tools/instance-manager/instance_options.h: added reference to port.h server-tools/instance-manager/listener.cc: reworked and simplified the socket handling code. Added windows versions of the code that sets the sockets to be non-blocking and non-inheritable server-tools/instance-manager/listener.h: change Options to always be a struct. Really surprised GCC was letting this go. Options was declared to be struct in some places and class in other places. server-tools/instance-manager/log.cc: added reference to port.h server-tools/instance-manager/manager.cc: moved all the signal code inside some #ifndef __WIN__ blocks server-tools/instance-manager/manager.h: change Options to always be a struct. Really surprised GCC was letting this go. Options was declared to be struct in some places and class in other places. server-tools/instance-manager/mysqlmanager.cc: added in the Windows service code. server-tools/instance-manager/options.cc: Added in the windows options for running as a service and the code for loading settings only from a single file server-tools/instance-manager/options.h: added definitions for the new Windows service vars and routines server-tools/instance-manager/parse_output.cc: added reference to port.h server-tools/instance-manager/priv.cc: added reference to port.h server-tools/instance-manager/priv.h: linuxthreads should not be visible on Windows server-tools/instance-manager/thread_registry.cc: more __WIN__ blocking server-tools/instance-manager/user_map.cc: fixed passwd file code to handle files with \r\n line endings server-tools/instance-manager/IMService.cpp: New BitKeeper file ``server-tools/instance-manager/IMService.cpp'' server-tools/instance-manager/IMService.h: New BitKeeper file ``server-tools/instance-manager/IMService.h'' server-tools/instance-manager/WindowsService.cpp: New BitKeeper file ``server-tools/instance-manager/WindowsService.cpp'' server-tools/instance-manager/WindowsService.h: New BitKeeper file ``server-tools/instance-manager/WindowsService.h'' server-tools/instance-manager/mysqlmanager.vcproj: New BitKeeper file ``server-tools/instance-manager/mysqlmanager.vcproj'' server-tools/instance-manager/port.h: New BitKeeper file ``server-tools/instance-manager/port.h''
2005-07-20 17:55:40 +02:00
#endif
{ "version", 'V', "Output version information and exit.", 0, 0, 0,
GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0 },
{ 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0 }
};
static void version()
{
Intermediate commit - just to make new files visible to bk in the new tree server-tools/instance-manager/Makefile.am: Fixed IM linking to avoid using both mysys and libmysql as the define the same symbols and therefore conflict server-tools/instance-manager/listener.cc: Added ability to listen network ports server-tools/instance-manager/listener.h: Various additions to the Listener_thread_args server-tools/instance-manager/log.cc: merge server-tools/instance-manager/log.h: merge server-tools/instance-manager/manager.cc: Fixes and additions to enable guardian functionality server-tools/instance-manager/manager.h: Changed manager() signature server-tools/instance-manager/mysqlmanager.cc: Various fixes server-tools/instance-manager/options.cc: Added handling of default values for new options in the Options struct. (such as default_user, default_password, monitoring_interval e.t.c) server-tools/instance-manager/options.h: Added new options to the Options struct sql/net_serv.cc: Added MYSQL_INSTANCE_MANAGER defines to enable alarm handling in the IM server-tools/instance-manager/buffer.cc: Simple implementation of variable-length buffer server-tools/instance-manager/command.cc: Abstract command. All commands are derived from Command class server-tools/instance-manager/commands.h: Interfaces for all commands we have server-tools/instance-manager/factory.cc: Commands factory. This class hides command instantiation. The idea is to handle various protocols this way. (different commands for different protocols server-tools/instance-manager/guardian.cc: Guardian thread implementation (monitor and restart instances in case of a failure server-tools/instance-manager/guardian.h: Guardian_thread and Guardian_thread_args class interface. The Guardian_thread is responsible for monitoring and restarting instances server-tools/instance-manager/instance.cc: Instance class contains methods and data to manage a single instance server-tools/instance-manager/instance.h: This file contains class an instance class interface. The class is responsible for starting/stopping an instance server-tools/instance-manager/instance_map.cc: The instance repository. This class is also responsible for initialization of Instance class objects. server-tools/instance-manager/instance_options.cc: The Instance_options class contains all methods to get and handle options of an instance server-tools/instance-manager/mysql_connection.cc: The class responsible for handling MySQL client/server protocol connections server-tools/instance-manager/mysql_manager_error.h: The list of Instance Manger-specific errors server-tools/instance-manager/parse.cc: Simple query parser server-tools/instance-manager/parse.h: Parser interface server-tools/instance-manager/protocol.cc: Here implemented functions used to handle mysql client/server protocol server-tools/instance-manager/protocol.h: Interface for MySQL client/server protocol server-tools/instance-manager/thread_registry.cc: Thread registry stores information about every thread. It's main function is to provide graceful shutdown for all threads. server-tools/instance-manager/user_map.h: User map contains hash with user names and passwords
2004-10-23 09:32:52 +02:00
printf("%s Ver %s for %s on %s\n", my_progname, mysqlmanager_version,
SYSTEM_TYPE, MACHINE_TYPE);
}
Intermediate commit - just to make new files visible to bk in the new tree server-tools/instance-manager/Makefile.am: Fixed IM linking to avoid using both mysys and libmysql as the define the same symbols and therefore conflict server-tools/instance-manager/listener.cc: Added ability to listen network ports server-tools/instance-manager/listener.h: Various additions to the Listener_thread_args server-tools/instance-manager/log.cc: merge server-tools/instance-manager/log.h: merge server-tools/instance-manager/manager.cc: Fixes and additions to enable guardian functionality server-tools/instance-manager/manager.h: Changed manager() signature server-tools/instance-manager/mysqlmanager.cc: Various fixes server-tools/instance-manager/options.cc: Added handling of default values for new options in the Options struct. (such as default_user, default_password, monitoring_interval e.t.c) server-tools/instance-manager/options.h: Added new options to the Options struct sql/net_serv.cc: Added MYSQL_INSTANCE_MANAGER defines to enable alarm handling in the IM server-tools/instance-manager/buffer.cc: Simple implementation of variable-length buffer server-tools/instance-manager/command.cc: Abstract command. All commands are derived from Command class server-tools/instance-manager/commands.h: Interfaces for all commands we have server-tools/instance-manager/factory.cc: Commands factory. This class hides command instantiation. The idea is to handle various protocols this way. (different commands for different protocols server-tools/instance-manager/guardian.cc: Guardian thread implementation (monitor and restart instances in case of a failure server-tools/instance-manager/guardian.h: Guardian_thread and Guardian_thread_args class interface. The Guardian_thread is responsible for monitoring and restarting instances server-tools/instance-manager/instance.cc: Instance class contains methods and data to manage a single instance server-tools/instance-manager/instance.h: This file contains class an instance class interface. The class is responsible for starting/stopping an instance server-tools/instance-manager/instance_map.cc: The instance repository. This class is also responsible for initialization of Instance class objects. server-tools/instance-manager/instance_options.cc: The Instance_options class contains all methods to get and handle options of an instance server-tools/instance-manager/mysql_connection.cc: The class responsible for handling MySQL client/server protocol connections server-tools/instance-manager/mysql_manager_error.h: The list of Instance Manger-specific errors server-tools/instance-manager/parse.cc: Simple query parser server-tools/instance-manager/parse.h: Parser interface server-tools/instance-manager/protocol.cc: Here implemented functions used to handle mysql client/server protocol server-tools/instance-manager/protocol.h: Interface for MySQL client/server protocol server-tools/instance-manager/thread_registry.cc: Thread registry stores information about every thread. It's main function is to provide graceful shutdown for all threads. server-tools/instance-manager/user_map.h: User map contains hash with user names and passwords
2004-10-23 09:32:52 +02:00
static const char *default_groups[]= { "manager", 0 };
Intermediate commit - just to make new files visible to bk in the new tree server-tools/instance-manager/Makefile.am: Fixed IM linking to avoid using both mysys and libmysql as the define the same symbols and therefore conflict server-tools/instance-manager/listener.cc: Added ability to listen network ports server-tools/instance-manager/listener.h: Various additions to the Listener_thread_args server-tools/instance-manager/log.cc: merge server-tools/instance-manager/log.h: merge server-tools/instance-manager/manager.cc: Fixes and additions to enable guardian functionality server-tools/instance-manager/manager.h: Changed manager() signature server-tools/instance-manager/mysqlmanager.cc: Various fixes server-tools/instance-manager/options.cc: Added handling of default values for new options in the Options struct. (such as default_user, default_password, monitoring_interval e.t.c) server-tools/instance-manager/options.h: Added new options to the Options struct sql/net_serv.cc: Added MYSQL_INSTANCE_MANAGER defines to enable alarm handling in the IM server-tools/instance-manager/buffer.cc: Simple implementation of variable-length buffer server-tools/instance-manager/command.cc: Abstract command. All commands are derived from Command class server-tools/instance-manager/commands.h: Interfaces for all commands we have server-tools/instance-manager/factory.cc: Commands factory. This class hides command instantiation. The idea is to handle various protocols this way. (different commands for different protocols server-tools/instance-manager/guardian.cc: Guardian thread implementation (monitor and restart instances in case of a failure server-tools/instance-manager/guardian.h: Guardian_thread and Guardian_thread_args class interface. The Guardian_thread is responsible for monitoring and restarting instances server-tools/instance-manager/instance.cc: Instance class contains methods and data to manage a single instance server-tools/instance-manager/instance.h: This file contains class an instance class interface. The class is responsible for starting/stopping an instance server-tools/instance-manager/instance_map.cc: The instance repository. This class is also responsible for initialization of Instance class objects. server-tools/instance-manager/instance_options.cc: The Instance_options class contains all methods to get and handle options of an instance server-tools/instance-manager/mysql_connection.cc: The class responsible for handling MySQL client/server protocol connections server-tools/instance-manager/mysql_manager_error.h: The list of Instance Manger-specific errors server-tools/instance-manager/parse.cc: Simple query parser server-tools/instance-manager/parse.h: Parser interface server-tools/instance-manager/protocol.cc: Here implemented functions used to handle mysql client/server protocol server-tools/instance-manager/protocol.h: Interface for MySQL client/server protocol server-tools/instance-manager/thread_registry.cc: Thread registry stores information about every thread. It's main function is to provide graceful shutdown for all threads. server-tools/instance-manager/user_map.h: User map contains hash with user names and passwords
2004-10-23 09:32:52 +02:00
static void usage()
{
version();
Intermediate commit - just to make new files visible to bk in the new tree server-tools/instance-manager/Makefile.am: Fixed IM linking to avoid using both mysys and libmysql as the define the same symbols and therefore conflict server-tools/instance-manager/listener.cc: Added ability to listen network ports server-tools/instance-manager/listener.h: Various additions to the Listener_thread_args server-tools/instance-manager/log.cc: merge server-tools/instance-manager/log.h: merge server-tools/instance-manager/manager.cc: Fixes and additions to enable guardian functionality server-tools/instance-manager/manager.h: Changed manager() signature server-tools/instance-manager/mysqlmanager.cc: Various fixes server-tools/instance-manager/options.cc: Added handling of default values for new options in the Options struct. (such as default_user, default_password, monitoring_interval e.t.c) server-tools/instance-manager/options.h: Added new options to the Options struct sql/net_serv.cc: Added MYSQL_INSTANCE_MANAGER defines to enable alarm handling in the IM server-tools/instance-manager/buffer.cc: Simple implementation of variable-length buffer server-tools/instance-manager/command.cc: Abstract command. All commands are derived from Command class server-tools/instance-manager/commands.h: Interfaces for all commands we have server-tools/instance-manager/factory.cc: Commands factory. This class hides command instantiation. The idea is to handle various protocols this way. (different commands for different protocols server-tools/instance-manager/guardian.cc: Guardian thread implementation (monitor and restart instances in case of a failure server-tools/instance-manager/guardian.h: Guardian_thread and Guardian_thread_args class interface. The Guardian_thread is responsible for monitoring and restarting instances server-tools/instance-manager/instance.cc: Instance class contains methods and data to manage a single instance server-tools/instance-manager/instance.h: This file contains class an instance class interface. The class is responsible for starting/stopping an instance server-tools/instance-manager/instance_map.cc: The instance repository. This class is also responsible for initialization of Instance class objects. server-tools/instance-manager/instance_options.cc: The Instance_options class contains all methods to get and handle options of an instance server-tools/instance-manager/mysql_connection.cc: The class responsible for handling MySQL client/server protocol connections server-tools/instance-manager/mysql_manager_error.h: The list of Instance Manger-specific errors server-tools/instance-manager/parse.cc: Simple query parser server-tools/instance-manager/parse.h: Parser interface server-tools/instance-manager/protocol.cc: Here implemented functions used to handle mysql client/server protocol server-tools/instance-manager/protocol.h: Interface for MySQL client/server protocol server-tools/instance-manager/thread_registry.cc: Thread registry stores information about every thread. It's main function is to provide graceful shutdown for all threads. server-tools/instance-manager/user_map.h: User map contains hash with user names and passwords
2004-10-23 09:32:52 +02:00
printf("Copyright (C) 2003, 2004 MySQL AB\n"
"This software comes with ABSOLUTELY NO WARRANTY. This is free software,\n"
"and you are welcome to modify and redistribute it under the GPL license\n");
printf("Usage: %s [OPTIONS] \n", my_progname);
my_print_help(my_long_options);
printf("\nThe following options may be given as the first argument:\n"
"--print-defaults Print the program argument list and exit\n"
"--defaults-file=# Only read manager configuration and instance\n"
" setings from the given file #. The same file\n"
" will be used to modify configuration of instances\n"
" with SET commands.\n");
Intermediate commit - just to make new files visible to bk in the new tree server-tools/instance-manager/Makefile.am: Fixed IM linking to avoid using both mysys and libmysql as the define the same symbols and therefore conflict server-tools/instance-manager/listener.cc: Added ability to listen network ports server-tools/instance-manager/listener.h: Various additions to the Listener_thread_args server-tools/instance-manager/log.cc: merge server-tools/instance-manager/log.h: merge server-tools/instance-manager/manager.cc: Fixes and additions to enable guardian functionality server-tools/instance-manager/manager.h: Changed manager() signature server-tools/instance-manager/mysqlmanager.cc: Various fixes server-tools/instance-manager/options.cc: Added handling of default values for new options in the Options struct. (such as default_user, default_password, monitoring_interval e.t.c) server-tools/instance-manager/options.h: Added new options to the Options struct sql/net_serv.cc: Added MYSQL_INSTANCE_MANAGER defines to enable alarm handling in the IM server-tools/instance-manager/buffer.cc: Simple implementation of variable-length buffer server-tools/instance-manager/command.cc: Abstract command. All commands are derived from Command class server-tools/instance-manager/commands.h: Interfaces for all commands we have server-tools/instance-manager/factory.cc: Commands factory. This class hides command instantiation. The idea is to handle various protocols this way. (different commands for different protocols server-tools/instance-manager/guardian.cc: Guardian thread implementation (monitor and restart instances in case of a failure server-tools/instance-manager/guardian.h: Guardian_thread and Guardian_thread_args class interface. The Guardian_thread is responsible for monitoring and restarting instances server-tools/instance-manager/instance.cc: Instance class contains methods and data to manage a single instance server-tools/instance-manager/instance.h: This file contains class an instance class interface. The class is responsible for starting/stopping an instance server-tools/instance-manager/instance_map.cc: The instance repository. This class is also responsible for initialization of Instance class objects. server-tools/instance-manager/instance_options.cc: The Instance_options class contains all methods to get and handle options of an instance server-tools/instance-manager/mysql_connection.cc: The class responsible for handling MySQL client/server protocol connections server-tools/instance-manager/mysql_manager_error.h: The list of Instance Manger-specific errors server-tools/instance-manager/parse.cc: Simple query parser server-tools/instance-manager/parse.h: Parser interface server-tools/instance-manager/protocol.cc: Here implemented functions used to handle mysql client/server protocol server-tools/instance-manager/protocol.h: Interface for MySQL client/server protocol server-tools/instance-manager/thread_registry.cc: Thread registry stores information about every thread. It's main function is to provide graceful shutdown for all threads. server-tools/instance-manager/user_map.h: User map contains hash with user names and passwords
2004-10-23 09:32:52 +02:00
my_print_variables(my_long_options);
}
Post-review fixes + some bugs fixed + several minor features BitKeeper/deleted/.del-client_func.c~3476a8a85cbd3c29: Delete: server-tools/instance-manager/client_func.c server-tools/instance-manager/Makefile.am: clien_func removed server-tools/instance-manager/buffer.cc: several methods added server-tools/instance-manager/buffer.h: Some error-handling fixes. server-tools/instance-manager/commands.cc: check for Buffer errors server-tools/instance-manager/guardian.cc: Guardian rewiriten. Not it works in a finite state machine-way. server-tools/instance-manager/guardian.h: Appropriate (to .cc) changes in the header + some comment added server-tools/instance-manager/instance.cc: added proxy thread to monitor instance. Two kinds of stop() now -- stop() and kill_instance which only sends a signal server-tools/instance-manager/instance.h: appropriate changes server-tools/instance-manager/instance_map.cc: cleanup server-tools/instance-manager/instance_map.h: cleanup server-tools/instance-manager/instance_options.cc: Caching of the pid-file-name is added. some comments added server-tools/instance-manager/instance_options.h: cleanup server-tools/instance-manager/listener.cc: listener my_thread_init added (though it doesn't use any mysys functions). Just in case server-tools/instance-manager/manager.cc: SIGCHLD handler removed. now instance monitoring is implemented through proxy threads. This is to work nicely with LinuxThreads server-tools/instance-manager/options.cc: added option to create a password file entry (this was implemented by Sergei Vojtovich) server-tools/instance-manager/parse.cc: inline function get_word moved to the header server-tools/instance-manager/parse.h: get_word moved here to use form parse_output server-tools/instance-manager/parse_output.cc: get_word() clone removed. now looking through the output linewise server-tools/instance-manager/protocol.cc: Buffer error chech added server-tools/instance-manager/user_map.cc: typo fixed
2005-02-11 12:21:59 +01:00
static void passwd()
{
char user[1024], *p;
const char *pw1, *pw2;
char pw1msg[]= "Enter password: ";
char pw2msg[]= "Re-type password: ";
Post-review fixes + some bugs fixed + several minor features BitKeeper/deleted/.del-client_func.c~3476a8a85cbd3c29: Delete: server-tools/instance-manager/client_func.c server-tools/instance-manager/Makefile.am: clien_func removed server-tools/instance-manager/buffer.cc: several methods added server-tools/instance-manager/buffer.h: Some error-handling fixes. server-tools/instance-manager/commands.cc: check for Buffer errors server-tools/instance-manager/guardian.cc: Guardian rewiriten. Not it works in a finite state machine-way. server-tools/instance-manager/guardian.h: Appropriate (to .cc) changes in the header + some comment added server-tools/instance-manager/instance.cc: added proxy thread to monitor instance. Two kinds of stop() now -- stop() and kill_instance which only sends a signal server-tools/instance-manager/instance.h: appropriate changes server-tools/instance-manager/instance_map.cc: cleanup server-tools/instance-manager/instance_map.h: cleanup server-tools/instance-manager/instance_options.cc: Caching of the pid-file-name is added. some comments added server-tools/instance-manager/instance_options.h: cleanup server-tools/instance-manager/listener.cc: listener my_thread_init added (though it doesn't use any mysys functions). Just in case server-tools/instance-manager/manager.cc: SIGCHLD handler removed. now instance monitoring is implemented through proxy threads. This is to work nicely with LinuxThreads server-tools/instance-manager/options.cc: added option to create a password file entry (this was implemented by Sergei Vojtovich) server-tools/instance-manager/parse.cc: inline function get_word moved to the header server-tools/instance-manager/parse.h: get_word moved here to use form parse_output server-tools/instance-manager/parse_output.cc: get_word() clone removed. now looking through the output linewise server-tools/instance-manager/protocol.cc: Buffer error chech added server-tools/instance-manager/user_map.cc: typo fixed
2005-02-11 12:21:59 +01:00
char crypted_pw[SCRAMBLED_PASSWORD_CHAR_LENGTH + 1];
fprintf(stderr, "Creating record for new user.\n");
fprintf(stderr, "Enter user name: ");
post-review fixes include/my_sys.h: added prototype for the defaults correction function libmysql/Makefile.shared: my_chsize added to libmysql to let my_correct_defaults_file be used from libmysql mysys/default.c: New defaults function added we use it to correct defaults file. Currently the function doesn't lock defaults file. This is because of the linking and backwards-compatibility issues. This needs to be fixed later. mysys/my_chsize.c: comment added server-tools/instance-manager/buffer.cc: cleanup server-tools/instance-manager/commands.cc: refactoring: removed do_command method from most of the classes server-tools/instance-manager/commands.h: cleanup server-tools/instance-manager/guardian.cc: cleanup server-tools/instance-manager/instance.cc: cleanup server-tools/instance-manager/instance_map.cc: cleanup server-tools/instance-manager/instance_options.cc: cleanup server-tools/instance-manager/instance_options.h: cleanup server-tools/instance-manager/listener.cc: cleanup server-tools/instance-manager/log.cc: cleanup server-tools/instance-manager/manager.cc: cleanup server-tools/instance-manager/messages.cc: new errors added server-tools/instance-manager/mysql_connection.cc: cleanup server-tools/instance-manager/mysql_manager_error.h: new error codes added server-tools/instance-manager/mysqlmanager.cc: clenup server-tools/instance-manager/options.cc: cleanup server-tools/instance-manager/parse.cc: removed unused function server-tools/instance-manager/parse.h: removed prototype server-tools/instance-manager/protocol.cc: cleanup server-tools/instance-manager/protocol.h: added enum to be used in protocol.cc instead of the constants
2005-05-15 23:54:02 +02:00
if (!fgets(user, sizeof(user), stdin))
Post-review fixes + some bugs fixed + several minor features BitKeeper/deleted/.del-client_func.c~3476a8a85cbd3c29: Delete: server-tools/instance-manager/client_func.c server-tools/instance-manager/Makefile.am: clien_func removed server-tools/instance-manager/buffer.cc: several methods added server-tools/instance-manager/buffer.h: Some error-handling fixes. server-tools/instance-manager/commands.cc: check for Buffer errors server-tools/instance-manager/guardian.cc: Guardian rewiriten. Not it works in a finite state machine-way. server-tools/instance-manager/guardian.h: Appropriate (to .cc) changes in the header + some comment added server-tools/instance-manager/instance.cc: added proxy thread to monitor instance. Two kinds of stop() now -- stop() and kill_instance which only sends a signal server-tools/instance-manager/instance.h: appropriate changes server-tools/instance-manager/instance_map.cc: cleanup server-tools/instance-manager/instance_map.h: cleanup server-tools/instance-manager/instance_options.cc: Caching of the pid-file-name is added. some comments added server-tools/instance-manager/instance_options.h: cleanup server-tools/instance-manager/listener.cc: listener my_thread_init added (though it doesn't use any mysys functions). Just in case server-tools/instance-manager/manager.cc: SIGCHLD handler removed. now instance monitoring is implemented through proxy threads. This is to work nicely with LinuxThreads server-tools/instance-manager/options.cc: added option to create a password file entry (this was implemented by Sergei Vojtovich) server-tools/instance-manager/parse.cc: inline function get_word moved to the header server-tools/instance-manager/parse.h: get_word moved here to use form parse_output server-tools/instance-manager/parse_output.cc: get_word() clone removed. now looking through the output linewise server-tools/instance-manager/protocol.cc: Buffer error chech added server-tools/instance-manager/user_map.cc: typo fixed
2005-02-11 12:21:59 +01:00
{
fprintf(stderr, "Unable to read user.\n");
return;
}
if ((p= strchr(user, '\n'))) *p= 0;
pw1= get_tty_password(pw1msg);
pw2= get_tty_password(pw2msg);
if (strcmp(pw1, pw2))
Post-review fixes + some bugs fixed + several minor features BitKeeper/deleted/.del-client_func.c~3476a8a85cbd3c29: Delete: server-tools/instance-manager/client_func.c server-tools/instance-manager/Makefile.am: clien_func removed server-tools/instance-manager/buffer.cc: several methods added server-tools/instance-manager/buffer.h: Some error-handling fixes. server-tools/instance-manager/commands.cc: check for Buffer errors server-tools/instance-manager/guardian.cc: Guardian rewiriten. Not it works in a finite state machine-way. server-tools/instance-manager/guardian.h: Appropriate (to .cc) changes in the header + some comment added server-tools/instance-manager/instance.cc: added proxy thread to monitor instance. Two kinds of stop() now -- stop() and kill_instance which only sends a signal server-tools/instance-manager/instance.h: appropriate changes server-tools/instance-manager/instance_map.cc: cleanup server-tools/instance-manager/instance_map.h: cleanup server-tools/instance-manager/instance_options.cc: Caching of the pid-file-name is added. some comments added server-tools/instance-manager/instance_options.h: cleanup server-tools/instance-manager/listener.cc: listener my_thread_init added (though it doesn't use any mysys functions). Just in case server-tools/instance-manager/manager.cc: SIGCHLD handler removed. now instance monitoring is implemented through proxy threads. This is to work nicely with LinuxThreads server-tools/instance-manager/options.cc: added option to create a password file entry (this was implemented by Sergei Vojtovich) server-tools/instance-manager/parse.cc: inline function get_word moved to the header server-tools/instance-manager/parse.h: get_word moved here to use form parse_output server-tools/instance-manager/parse_output.cc: get_word() clone removed. now looking through the output linewise server-tools/instance-manager/protocol.cc: Buffer error chech added server-tools/instance-manager/user_map.cc: typo fixed
2005-02-11 12:21:59 +01:00
{
fprintf(stderr, "Sorry, passwords do not match.\n");
Post-review fixes + some bugs fixed + several minor features BitKeeper/deleted/.del-client_func.c~3476a8a85cbd3c29: Delete: server-tools/instance-manager/client_func.c server-tools/instance-manager/Makefile.am: clien_func removed server-tools/instance-manager/buffer.cc: several methods added server-tools/instance-manager/buffer.h: Some error-handling fixes. server-tools/instance-manager/commands.cc: check for Buffer errors server-tools/instance-manager/guardian.cc: Guardian rewiriten. Not it works in a finite state machine-way. server-tools/instance-manager/guardian.h: Appropriate (to .cc) changes in the header + some comment added server-tools/instance-manager/instance.cc: added proxy thread to monitor instance. Two kinds of stop() now -- stop() and kill_instance which only sends a signal server-tools/instance-manager/instance.h: appropriate changes server-tools/instance-manager/instance_map.cc: cleanup server-tools/instance-manager/instance_map.h: cleanup server-tools/instance-manager/instance_options.cc: Caching of the pid-file-name is added. some comments added server-tools/instance-manager/instance_options.h: cleanup server-tools/instance-manager/listener.cc: listener my_thread_init added (though it doesn't use any mysys functions). Just in case server-tools/instance-manager/manager.cc: SIGCHLD handler removed. now instance monitoring is implemented through proxy threads. This is to work nicely with LinuxThreads server-tools/instance-manager/options.cc: added option to create a password file entry (this was implemented by Sergei Vojtovich) server-tools/instance-manager/parse.cc: inline function get_word moved to the header server-tools/instance-manager/parse.h: get_word moved here to use form parse_output server-tools/instance-manager/parse_output.cc: get_word() clone removed. now looking through the output linewise server-tools/instance-manager/protocol.cc: Buffer error chech added server-tools/instance-manager/user_map.cc: typo fixed
2005-02-11 12:21:59 +01:00
return;
}
make_scrambled_password(crypted_pw, pw1);
Post-review fixes + some bugs fixed + several minor features BitKeeper/deleted/.del-client_func.c~3476a8a85cbd3c29: Delete: server-tools/instance-manager/client_func.c server-tools/instance-manager/Makefile.am: clien_func removed server-tools/instance-manager/buffer.cc: several methods added server-tools/instance-manager/buffer.h: Some error-handling fixes. server-tools/instance-manager/commands.cc: check for Buffer errors server-tools/instance-manager/guardian.cc: Guardian rewiriten. Not it works in a finite state machine-way. server-tools/instance-manager/guardian.h: Appropriate (to .cc) changes in the header + some comment added server-tools/instance-manager/instance.cc: added proxy thread to monitor instance. Two kinds of stop() now -- stop() and kill_instance which only sends a signal server-tools/instance-manager/instance.h: appropriate changes server-tools/instance-manager/instance_map.cc: cleanup server-tools/instance-manager/instance_map.h: cleanup server-tools/instance-manager/instance_options.cc: Caching of the pid-file-name is added. some comments added server-tools/instance-manager/instance_options.h: cleanup server-tools/instance-manager/listener.cc: listener my_thread_init added (though it doesn't use any mysys functions). Just in case server-tools/instance-manager/manager.cc: SIGCHLD handler removed. now instance monitoring is implemented through proxy threads. This is to work nicely with LinuxThreads server-tools/instance-manager/options.cc: added option to create a password file entry (this was implemented by Sergei Vojtovich) server-tools/instance-manager/parse.cc: inline function get_word moved to the header server-tools/instance-manager/parse.h: get_word moved here to use form parse_output server-tools/instance-manager/parse_output.cc: get_word() clone removed. now looking through the output linewise server-tools/instance-manager/protocol.cc: Buffer error chech added server-tools/instance-manager/user_map.cc: typo fixed
2005-02-11 12:21:59 +01:00
printf("%s:%s\n", user, crypted_pw);
}
C_MODE_START
static my_bool
get_one_option(int optid,
const struct my_option *opt __attribute__((unused)),
char *argument __attribute__((unused)))
{
switch(optid) {
case 'V':
version();
exit(0);
Post-review fixes + some bugs fixed + several minor features BitKeeper/deleted/.del-client_func.c~3476a8a85cbd3c29: Delete: server-tools/instance-manager/client_func.c server-tools/instance-manager/Makefile.am: clien_func removed server-tools/instance-manager/buffer.cc: several methods added server-tools/instance-manager/buffer.h: Some error-handling fixes. server-tools/instance-manager/commands.cc: check for Buffer errors server-tools/instance-manager/guardian.cc: Guardian rewiriten. Not it works in a finite state machine-way. server-tools/instance-manager/guardian.h: Appropriate (to .cc) changes in the header + some comment added server-tools/instance-manager/instance.cc: added proxy thread to monitor instance. Two kinds of stop() now -- stop() and kill_instance which only sends a signal server-tools/instance-manager/instance.h: appropriate changes server-tools/instance-manager/instance_map.cc: cleanup server-tools/instance-manager/instance_map.h: cleanup server-tools/instance-manager/instance_options.cc: Caching of the pid-file-name is added. some comments added server-tools/instance-manager/instance_options.h: cleanup server-tools/instance-manager/listener.cc: listener my_thread_init added (though it doesn't use any mysys functions). Just in case server-tools/instance-manager/manager.cc: SIGCHLD handler removed. now instance monitoring is implemented through proxy threads. This is to work nicely with LinuxThreads server-tools/instance-manager/options.cc: added option to create a password file entry (this was implemented by Sergei Vojtovich) server-tools/instance-manager/parse.cc: inline function get_word moved to the header server-tools/instance-manager/parse.h: get_word moved here to use form parse_output server-tools/instance-manager/parse_output.cc: get_word() clone removed. now looking through the output linewise server-tools/instance-manager/protocol.cc: Buffer error chech added server-tools/instance-manager/user_map.cc: typo fixed
2005-02-11 12:21:59 +01:00
case 'P':
passwd();
exit(0);
case '?':
usage();
exit(0);
}
return 0;
}
C_MODE_END
Intermediate commit - just to make new files visible to bk in the new tree server-tools/instance-manager/Makefile.am: Fixed IM linking to avoid using both mysys and libmysql as the define the same symbols and therefore conflict server-tools/instance-manager/listener.cc: Added ability to listen network ports server-tools/instance-manager/listener.h: Various additions to the Listener_thread_args server-tools/instance-manager/log.cc: merge server-tools/instance-manager/log.h: merge server-tools/instance-manager/manager.cc: Fixes and additions to enable guardian functionality server-tools/instance-manager/manager.h: Changed manager() signature server-tools/instance-manager/mysqlmanager.cc: Various fixes server-tools/instance-manager/options.cc: Added handling of default values for new options in the Options struct. (such as default_user, default_password, monitoring_interval e.t.c) server-tools/instance-manager/options.h: Added new options to the Options struct sql/net_serv.cc: Added MYSQL_INSTANCE_MANAGER defines to enable alarm handling in the IM server-tools/instance-manager/buffer.cc: Simple implementation of variable-length buffer server-tools/instance-manager/command.cc: Abstract command. All commands are derived from Command class server-tools/instance-manager/commands.h: Interfaces for all commands we have server-tools/instance-manager/factory.cc: Commands factory. This class hides command instantiation. The idea is to handle various protocols this way. (different commands for different protocols server-tools/instance-manager/guardian.cc: Guardian thread implementation (monitor and restart instances in case of a failure server-tools/instance-manager/guardian.h: Guardian_thread and Guardian_thread_args class interface. The Guardian_thread is responsible for monitoring and restarting instances server-tools/instance-manager/instance.cc: Instance class contains methods and data to manage a single instance server-tools/instance-manager/instance.h: This file contains class an instance class interface. The class is responsible for starting/stopping an instance server-tools/instance-manager/instance_map.cc: The instance repository. This class is also responsible for initialization of Instance class objects. server-tools/instance-manager/instance_options.cc: The Instance_options class contains all methods to get and handle options of an instance server-tools/instance-manager/mysql_connection.cc: The class responsible for handling MySQL client/server protocol connections server-tools/instance-manager/mysql_manager_error.h: The list of Instance Manger-specific errors server-tools/instance-manager/parse.cc: Simple query parser server-tools/instance-manager/parse.h: Parser interface server-tools/instance-manager/protocol.cc: Here implemented functions used to handle mysql client/server protocol server-tools/instance-manager/protocol.h: Interface for MySQL client/server protocol server-tools/instance-manager/thread_registry.cc: Thread registry stores information about every thread. It's main function is to provide graceful shutdown for all threads. server-tools/instance-manager/user_map.h: User map contains hash with user names and passwords
2004-10-23 09:32:52 +02:00
/*
- Process argv of original program: get tid of --defaults-extra-file
and print a message if met there.
- call load_defaults to load configuration file section and save the pointer
for free_defaults.
Intermediate commit - just to make new files visible to bk in the new tree server-tools/instance-manager/Makefile.am: Fixed IM linking to avoid using both mysys and libmysql as the define the same symbols and therefore conflict server-tools/instance-manager/listener.cc: Added ability to listen network ports server-tools/instance-manager/listener.h: Various additions to the Listener_thread_args server-tools/instance-manager/log.cc: merge server-tools/instance-manager/log.h: merge server-tools/instance-manager/manager.cc: Fixes and additions to enable guardian functionality server-tools/instance-manager/manager.h: Changed manager() signature server-tools/instance-manager/mysqlmanager.cc: Various fixes server-tools/instance-manager/options.cc: Added handling of default values for new options in the Options struct. (such as default_user, default_password, monitoring_interval e.t.c) server-tools/instance-manager/options.h: Added new options to the Options struct sql/net_serv.cc: Added MYSQL_INSTANCE_MANAGER defines to enable alarm handling in the IM server-tools/instance-manager/buffer.cc: Simple implementation of variable-length buffer server-tools/instance-manager/command.cc: Abstract command. All commands are derived from Command class server-tools/instance-manager/commands.h: Interfaces for all commands we have server-tools/instance-manager/factory.cc: Commands factory. This class hides command instantiation. The idea is to handle various protocols this way. (different commands for different protocols server-tools/instance-manager/guardian.cc: Guardian thread implementation (monitor and restart instances in case of a failure server-tools/instance-manager/guardian.h: Guardian_thread and Guardian_thread_args class interface. The Guardian_thread is responsible for monitoring and restarting instances server-tools/instance-manager/instance.cc: Instance class contains methods and data to manage a single instance server-tools/instance-manager/instance.h: This file contains class an instance class interface. The class is responsible for starting/stopping an instance server-tools/instance-manager/instance_map.cc: The instance repository. This class is also responsible for initialization of Instance class objects. server-tools/instance-manager/instance_options.cc: The Instance_options class contains all methods to get and handle options of an instance server-tools/instance-manager/mysql_connection.cc: The class responsible for handling MySQL client/server protocol connections server-tools/instance-manager/mysql_manager_error.h: The list of Instance Manger-specific errors server-tools/instance-manager/parse.cc: Simple query parser server-tools/instance-manager/parse.h: Parser interface server-tools/instance-manager/protocol.cc: Here implemented functions used to handle mysql client/server protocol server-tools/instance-manager/protocol.h: Interface for MySQL client/server protocol server-tools/instance-manager/thread_registry.cc: Thread registry stores information about every thread. It's main function is to provide graceful shutdown for all threads. server-tools/instance-manager/user_map.h: User map contains hash with user names and passwords
2004-10-23 09:32:52 +02:00
- call handle_options to assign defaults and command-line arguments
to the class members.
if either of these function fail, return the error code.
*/
int Options::load(int argc, char **argv)
{
saved_argv= argv;
if (argc >= 2)
{
if (is_prefix(argv[1], "--defaults-file="))
{
Options::config_file= strchr(argv[1], '=') + 1;
}
if (is_prefix(argv[1], "--defaults-extra-file=") ||
is_prefix(argv[1], "--no-defaults"))
{
/* the log is not enabled yet */
fprintf(stderr, "The --defaults-extra-file and --no-defaults options"
" are not supported by\n"
"Instance Manager. Program aborted.\n");
goto err;
}
}
#ifdef __WIN__
setup_windows_defaults(*argv);
/*
On Windows, there are two possibilities. Either we are given
a defaults file on the command line or we use the my.ini file
that is in our app dir
*/
if (Options::config_file == NULL)
{
char *filename;
static const char default_win_config_file_name[]= "\\my.ini";
if (!GetModuleFileName(NULL, windows_config_file,
sizeof(windows_config_file)))
goto err;
filename= strrchr(windows_config_file, "\\");
/*
Don't check for the overflow as strlen("\\my.ini") is less
then strlen("mysqlmanager") (the binary name)
*/
strcpy(filename, default_win_config_file_name);
Options::config_file= windows_config_file;
}
#endif
initial import of Windows port of IM. server-tools/instance-manager/commands.cc: type cleanups for compiling on Windows now using Options::config_file for the location of the single my.cnf file we are using server-tools/instance-manager/guardian.cc: pthread_mutex_lock and unlock do not return a value on Windows so we return 0 in all cases server-tools/instance-manager/instance.cc: big changes here. Had to implement Windows versions of launch_and_wait and kill() server-tools/instance-manager/instance.h: added some function defs server-tools/instance-manager/instance_map.cc: pthread_mutex_lock and unlock do not return a value on Windows Also, now using only the file named as Options::config_file server-tools/instance-manager/instance_options.h: added reference to port.h server-tools/instance-manager/listener.cc: reworked and simplified the socket handling code. Added windows versions of the code that sets the sockets to be non-blocking and non-inheritable server-tools/instance-manager/listener.h: change Options to always be a struct. Really surprised GCC was letting this go. Options was declared to be struct in some places and class in other places. server-tools/instance-manager/log.cc: added reference to port.h server-tools/instance-manager/manager.cc: moved all the signal code inside some #ifndef __WIN__ blocks server-tools/instance-manager/manager.h: change Options to always be a struct. Really surprised GCC was letting this go. Options was declared to be struct in some places and class in other places. server-tools/instance-manager/mysqlmanager.cc: added in the Windows service code. server-tools/instance-manager/options.cc: Added in the windows options for running as a service and the code for loading settings only from a single file server-tools/instance-manager/options.h: added definitions for the new Windows service vars and routines server-tools/instance-manager/parse_output.cc: added reference to port.h server-tools/instance-manager/priv.cc: added reference to port.h server-tools/instance-manager/priv.h: linuxthreads should not be visible on Windows server-tools/instance-manager/thread_registry.cc: more __WIN__ blocking server-tools/instance-manager/user_map.cc: fixed passwd file code to handle files with \r\n line endings server-tools/instance-manager/IMService.cpp: New BitKeeper file ``server-tools/instance-manager/IMService.cpp'' server-tools/instance-manager/IMService.h: New BitKeeper file ``server-tools/instance-manager/IMService.h'' server-tools/instance-manager/WindowsService.cpp: New BitKeeper file ``server-tools/instance-manager/WindowsService.cpp'' server-tools/instance-manager/WindowsService.h: New BitKeeper file ``server-tools/instance-manager/WindowsService.h'' server-tools/instance-manager/mysqlmanager.vcproj: New BitKeeper file ``server-tools/instance-manager/mysqlmanager.vcproj'' server-tools/instance-manager/port.h: New BitKeeper file ``server-tools/instance-manager/port.h''
2005-07-20 17:55:40 +02:00
Intermediate commit - just to make new files visible to bk in the new tree server-tools/instance-manager/Makefile.am: Fixed IM linking to avoid using both mysys and libmysql as the define the same symbols and therefore conflict server-tools/instance-manager/listener.cc: Added ability to listen network ports server-tools/instance-manager/listener.h: Various additions to the Listener_thread_args server-tools/instance-manager/log.cc: merge server-tools/instance-manager/log.h: merge server-tools/instance-manager/manager.cc: Fixes and additions to enable guardian functionality server-tools/instance-manager/manager.h: Changed manager() signature server-tools/instance-manager/mysqlmanager.cc: Various fixes server-tools/instance-manager/options.cc: Added handling of default values for new options in the Options struct. (such as default_user, default_password, monitoring_interval e.t.c) server-tools/instance-manager/options.h: Added new options to the Options struct sql/net_serv.cc: Added MYSQL_INSTANCE_MANAGER defines to enable alarm handling in the IM server-tools/instance-manager/buffer.cc: Simple implementation of variable-length buffer server-tools/instance-manager/command.cc: Abstract command. All commands are derived from Command class server-tools/instance-manager/commands.h: Interfaces for all commands we have server-tools/instance-manager/factory.cc: Commands factory. This class hides command instantiation. The idea is to handle various protocols this way. (different commands for different protocols server-tools/instance-manager/guardian.cc: Guardian thread implementation (monitor and restart instances in case of a failure server-tools/instance-manager/guardian.h: Guardian_thread and Guardian_thread_args class interface. The Guardian_thread is responsible for monitoring and restarting instances server-tools/instance-manager/instance.cc: Instance class contains methods and data to manage a single instance server-tools/instance-manager/instance.h: This file contains class an instance class interface. The class is responsible for starting/stopping an instance server-tools/instance-manager/instance_map.cc: The instance repository. This class is also responsible for initialization of Instance class objects. server-tools/instance-manager/instance_options.cc: The Instance_options class contains all methods to get and handle options of an instance server-tools/instance-manager/mysql_connection.cc: The class responsible for handling MySQL client/server protocol connections server-tools/instance-manager/mysql_manager_error.h: The list of Instance Manger-specific errors server-tools/instance-manager/parse.cc: Simple query parser server-tools/instance-manager/parse.h: Parser interface server-tools/instance-manager/protocol.cc: Here implemented functions used to handle mysql client/server protocol server-tools/instance-manager/protocol.h: Interface for MySQL client/server protocol server-tools/instance-manager/thread_registry.cc: Thread registry stores information about every thread. It's main function is to provide graceful shutdown for all threads. server-tools/instance-manager/user_map.h: User map contains hash with user names and passwords
2004-10-23 09:32:52 +02:00
/* config-file options are prepended to command-line ones */
load_defaults(config_file, default_groups, &argc,
&saved_argv);
if ((handle_options(&argc, &saved_argv, my_long_options,
get_one_option)) != 0)
goto err;
Intermediate commit - just to make new files visible to bk in the new tree server-tools/instance-manager/Makefile.am: Fixed IM linking to avoid using both mysys and libmysql as the define the same symbols and therefore conflict server-tools/instance-manager/listener.cc: Added ability to listen network ports server-tools/instance-manager/listener.h: Various additions to the Listener_thread_args server-tools/instance-manager/log.cc: merge server-tools/instance-manager/log.h: merge server-tools/instance-manager/manager.cc: Fixes and additions to enable guardian functionality server-tools/instance-manager/manager.h: Changed manager() signature server-tools/instance-manager/mysqlmanager.cc: Various fixes server-tools/instance-manager/options.cc: Added handling of default values for new options in the Options struct. (such as default_user, default_password, monitoring_interval e.t.c) server-tools/instance-manager/options.h: Added new options to the Options struct sql/net_serv.cc: Added MYSQL_INSTANCE_MANAGER defines to enable alarm handling in the IM server-tools/instance-manager/buffer.cc: Simple implementation of variable-length buffer server-tools/instance-manager/command.cc: Abstract command. All commands are derived from Command class server-tools/instance-manager/commands.h: Interfaces for all commands we have server-tools/instance-manager/factory.cc: Commands factory. This class hides command instantiation. The idea is to handle various protocols this way. (different commands for different protocols server-tools/instance-manager/guardian.cc: Guardian thread implementation (monitor and restart instances in case of a failure server-tools/instance-manager/guardian.h: Guardian_thread and Guardian_thread_args class interface. The Guardian_thread is responsible for monitoring and restarting instances server-tools/instance-manager/instance.cc: Instance class contains methods and data to manage a single instance server-tools/instance-manager/instance.h: This file contains class an instance class interface. The class is responsible for starting/stopping an instance server-tools/instance-manager/instance_map.cc: The instance repository. This class is also responsible for initialization of Instance class objects. server-tools/instance-manager/instance_options.cc: The Instance_options class contains all methods to get and handle options of an instance server-tools/instance-manager/mysql_connection.cc: The class responsible for handling MySQL client/server protocol connections server-tools/instance-manager/mysql_manager_error.h: The list of Instance Manger-specific errors server-tools/instance-manager/parse.cc: Simple query parser server-tools/instance-manager/parse.h: Parser interface server-tools/instance-manager/protocol.cc: Here implemented functions used to handle mysql client/server protocol server-tools/instance-manager/protocol.h: Interface for MySQL client/server protocol server-tools/instance-manager/thread_registry.cc: Thread registry stores information about every thread. It's main function is to provide graceful shutdown for all threads. server-tools/instance-manager/user_map.h: User map contains hash with user names and passwords
2004-10-23 09:32:52 +02:00
return 0;
err:
return 1;
}
Various fixes (cleanups, valgrind, makefiles, ...) server-tools/instance-manager/Makefile.am: increased default_monitoring interval server-tools/instance-manager/guardian.cc: some fixes for proper shutdown server-tools/instance-manager/guardian.h: removed init() prototype, as it was never used server-tools/instance-manager/instance.cc: cleanup() function removed server-tools/instance-manager/instance.h: cleanup() prototype removed server-tools/instance-manager/instance_map.cc: Instance_map::cleanup() removed, as instances have nothing to clean up server-tools/instance-manager/instance_map.h: Instance_map::cleanup() prototype removed server-tools/instance-manager/instance_options.cc: added print_argv() function for debug purposes server-tools/instance-manager/instance_options.h: declared print_argv() server-tools/instance-manager/listener.cc: some fixed in listener for proper shutdown server-tools/instance-manager/log.cc: cleanup server-tools/instance-manager/log.h: cleanup server-tools/instance-manager/manager.cc: some comments added server-tools/instance-manager/mysqlmanager.cc: we need to free memory in the very end server-tools/instance-manager/options.cc: fixed default options handling (as they were not working properly), added new method to cleanup Options server-tools/instance-manager/options.h: cleanup() declared server-tools/instance-manager/thread_registry.cc: cleanup server-tools/instance-manager/user_map.cc: missing password file is not a critical error anymore, as IM should be able to work as mysqld_safe only
2005-02-03 18:48:58 +01:00
void Options::cleanup()
{
/* free_defaults returns nothing */
free_defaults(Options::saved_argv);
initial import of Windows port of IM. server-tools/instance-manager/commands.cc: type cleanups for compiling on Windows now using Options::config_file for the location of the single my.cnf file we are using server-tools/instance-manager/guardian.cc: pthread_mutex_lock and unlock do not return a value on Windows so we return 0 in all cases server-tools/instance-manager/instance.cc: big changes here. Had to implement Windows versions of launch_and_wait and kill() server-tools/instance-manager/instance.h: added some function defs server-tools/instance-manager/instance_map.cc: pthread_mutex_lock and unlock do not return a value on Windows Also, now using only the file named as Options::config_file server-tools/instance-manager/instance_options.h: added reference to port.h server-tools/instance-manager/listener.cc: reworked and simplified the socket handling code. Added windows versions of the code that sets the sockets to be non-blocking and non-inheritable server-tools/instance-manager/listener.h: change Options to always be a struct. Really surprised GCC was letting this go. Options was declared to be struct in some places and class in other places. server-tools/instance-manager/log.cc: added reference to port.h server-tools/instance-manager/manager.cc: moved all the signal code inside some #ifndef __WIN__ blocks server-tools/instance-manager/manager.h: change Options to always be a struct. Really surprised GCC was letting this go. Options was declared to be struct in some places and class in other places. server-tools/instance-manager/mysqlmanager.cc: added in the Windows service code. server-tools/instance-manager/options.cc: Added in the windows options for running as a service and the code for loading settings only from a single file server-tools/instance-manager/options.h: added definitions for the new Windows service vars and routines server-tools/instance-manager/parse_output.cc: added reference to port.h server-tools/instance-manager/priv.cc: added reference to port.h server-tools/instance-manager/priv.h: linuxthreads should not be visible on Windows server-tools/instance-manager/thread_registry.cc: more __WIN__ blocking server-tools/instance-manager/user_map.cc: fixed passwd file code to handle files with \r\n line endings server-tools/instance-manager/IMService.cpp: New BitKeeper file ``server-tools/instance-manager/IMService.cpp'' server-tools/instance-manager/IMService.h: New BitKeeper file ``server-tools/instance-manager/IMService.h'' server-tools/instance-manager/WindowsService.cpp: New BitKeeper file ``server-tools/instance-manager/WindowsService.cpp'' server-tools/instance-manager/WindowsService.h: New BitKeeper file ``server-tools/instance-manager/WindowsService.h'' server-tools/instance-manager/mysqlmanager.vcproj: New BitKeeper file ``server-tools/instance-manager/mysqlmanager.vcproj'' server-tools/instance-manager/port.h: New BitKeeper file ``server-tools/instance-manager/port.h''
2005-07-20 17:55:40 +02:00
#ifdef __WIN__
free((char*)default_password_file_name);
#endif
Various fixes (cleanups, valgrind, makefiles, ...) server-tools/instance-manager/Makefile.am: increased default_monitoring interval server-tools/instance-manager/guardian.cc: some fixes for proper shutdown server-tools/instance-manager/guardian.h: removed init() prototype, as it was never used server-tools/instance-manager/instance.cc: cleanup() function removed server-tools/instance-manager/instance.h: cleanup() prototype removed server-tools/instance-manager/instance_map.cc: Instance_map::cleanup() removed, as instances have nothing to clean up server-tools/instance-manager/instance_map.h: Instance_map::cleanup() prototype removed server-tools/instance-manager/instance_options.cc: added print_argv() function for debug purposes server-tools/instance-manager/instance_options.h: declared print_argv() server-tools/instance-manager/listener.cc: some fixed in listener for proper shutdown server-tools/instance-manager/log.cc: cleanup server-tools/instance-manager/log.h: cleanup server-tools/instance-manager/manager.cc: some comments added server-tools/instance-manager/mysqlmanager.cc: we need to free memory in the very end server-tools/instance-manager/options.cc: fixed default options handling (as they were not working properly), added new method to cleanup Options server-tools/instance-manager/options.h: cleanup() declared server-tools/instance-manager/thread_registry.cc: cleanup server-tools/instance-manager/user_map.cc: missing password file is not a critical error anymore, as IM should be able to work as mysqld_safe only
2005-02-03 18:48:58 +01:00
}
initial import of Windows port of IM. server-tools/instance-manager/commands.cc: type cleanups for compiling on Windows now using Options::config_file for the location of the single my.cnf file we are using server-tools/instance-manager/guardian.cc: pthread_mutex_lock and unlock do not return a value on Windows so we return 0 in all cases server-tools/instance-manager/instance.cc: big changes here. Had to implement Windows versions of launch_and_wait and kill() server-tools/instance-manager/instance.h: added some function defs server-tools/instance-manager/instance_map.cc: pthread_mutex_lock and unlock do not return a value on Windows Also, now using only the file named as Options::config_file server-tools/instance-manager/instance_options.h: added reference to port.h server-tools/instance-manager/listener.cc: reworked and simplified the socket handling code. Added windows versions of the code that sets the sockets to be non-blocking and non-inheritable server-tools/instance-manager/listener.h: change Options to always be a struct. Really surprised GCC was letting this go. Options was declared to be struct in some places and class in other places. server-tools/instance-manager/log.cc: added reference to port.h server-tools/instance-manager/manager.cc: moved all the signal code inside some #ifndef __WIN__ blocks server-tools/instance-manager/manager.h: change Options to always be a struct. Really surprised GCC was letting this go. Options was declared to be struct in some places and class in other places. server-tools/instance-manager/mysqlmanager.cc: added in the Windows service code. server-tools/instance-manager/options.cc: Added in the windows options for running as a service and the code for loading settings only from a single file server-tools/instance-manager/options.h: added definitions for the new Windows service vars and routines server-tools/instance-manager/parse_output.cc: added reference to port.h server-tools/instance-manager/priv.cc: added reference to port.h server-tools/instance-manager/priv.h: linuxthreads should not be visible on Windows server-tools/instance-manager/thread_registry.cc: more __WIN__ blocking server-tools/instance-manager/user_map.cc: fixed passwd file code to handle files with \r\n line endings server-tools/instance-manager/IMService.cpp: New BitKeeper file ``server-tools/instance-manager/IMService.cpp'' server-tools/instance-manager/IMService.h: New BitKeeper file ``server-tools/instance-manager/IMService.h'' server-tools/instance-manager/WindowsService.cpp: New BitKeeper file ``server-tools/instance-manager/WindowsService.cpp'' server-tools/instance-manager/WindowsService.h: New BitKeeper file ``server-tools/instance-manager/WindowsService.h'' server-tools/instance-manager/mysqlmanager.vcproj: New BitKeeper file ``server-tools/instance-manager/mysqlmanager.vcproj'' server-tools/instance-manager/port.h: New BitKeeper file ``server-tools/instance-manager/port.h''
2005-07-20 17:55:40 +02:00
#ifdef __WIN__
char* change_extension(const char *src, const char *newext)
{
char *dot= (char*)strrchr(src, '.');
initial import of Windows port of IM. server-tools/instance-manager/commands.cc: type cleanups for compiling on Windows now using Options::config_file for the location of the single my.cnf file we are using server-tools/instance-manager/guardian.cc: pthread_mutex_lock and unlock do not return a value on Windows so we return 0 in all cases server-tools/instance-manager/instance.cc: big changes here. Had to implement Windows versions of launch_and_wait and kill() server-tools/instance-manager/instance.h: added some function defs server-tools/instance-manager/instance_map.cc: pthread_mutex_lock and unlock do not return a value on Windows Also, now using only the file named as Options::config_file server-tools/instance-manager/instance_options.h: added reference to port.h server-tools/instance-manager/listener.cc: reworked and simplified the socket handling code. Added windows versions of the code that sets the sockets to be non-blocking and non-inheritable server-tools/instance-manager/listener.h: change Options to always be a struct. Really surprised GCC was letting this go. Options was declared to be struct in some places and class in other places. server-tools/instance-manager/log.cc: added reference to port.h server-tools/instance-manager/manager.cc: moved all the signal code inside some #ifndef __WIN__ blocks server-tools/instance-manager/manager.h: change Options to always be a struct. Really surprised GCC was letting this go. Options was declared to be struct in some places and class in other places. server-tools/instance-manager/mysqlmanager.cc: added in the Windows service code. server-tools/instance-manager/options.cc: Added in the windows options for running as a service and the code for loading settings only from a single file server-tools/instance-manager/options.h: added definitions for the new Windows service vars and routines server-tools/instance-manager/parse_output.cc: added reference to port.h server-tools/instance-manager/priv.cc: added reference to port.h server-tools/instance-manager/priv.h: linuxthreads should not be visible on Windows server-tools/instance-manager/thread_registry.cc: more __WIN__ blocking server-tools/instance-manager/user_map.cc: fixed passwd file code to handle files with \r\n line endings server-tools/instance-manager/IMService.cpp: New BitKeeper file ``server-tools/instance-manager/IMService.cpp'' server-tools/instance-manager/IMService.h: New BitKeeper file ``server-tools/instance-manager/IMService.h'' server-tools/instance-manager/WindowsService.cpp: New BitKeeper file ``server-tools/instance-manager/WindowsService.cpp'' server-tools/instance-manager/WindowsService.h: New BitKeeper file ``server-tools/instance-manager/WindowsService.h'' server-tools/instance-manager/mysqlmanager.vcproj: New BitKeeper file ``server-tools/instance-manager/mysqlmanager.vcproj'' server-tools/instance-manager/port.h: New BitKeeper file ``server-tools/instance-manager/port.h''
2005-07-20 17:55:40 +02:00
if (!dot) return (char*)src;
int newlen= dot-src+strlen(newext)+1;
char *temp= (char*)malloc(newlen);
initial import of Windows port of IM. server-tools/instance-manager/commands.cc: type cleanups for compiling on Windows now using Options::config_file for the location of the single my.cnf file we are using server-tools/instance-manager/guardian.cc: pthread_mutex_lock and unlock do not return a value on Windows so we return 0 in all cases server-tools/instance-manager/instance.cc: big changes here. Had to implement Windows versions of launch_and_wait and kill() server-tools/instance-manager/instance.h: added some function defs server-tools/instance-manager/instance_map.cc: pthread_mutex_lock and unlock do not return a value on Windows Also, now using only the file named as Options::config_file server-tools/instance-manager/instance_options.h: added reference to port.h server-tools/instance-manager/listener.cc: reworked and simplified the socket handling code. Added windows versions of the code that sets the sockets to be non-blocking and non-inheritable server-tools/instance-manager/listener.h: change Options to always be a struct. Really surprised GCC was letting this go. Options was declared to be struct in some places and class in other places. server-tools/instance-manager/log.cc: added reference to port.h server-tools/instance-manager/manager.cc: moved all the signal code inside some #ifndef __WIN__ blocks server-tools/instance-manager/manager.h: change Options to always be a struct. Really surprised GCC was letting this go. Options was declared to be struct in some places and class in other places. server-tools/instance-manager/mysqlmanager.cc: added in the Windows service code. server-tools/instance-manager/options.cc: Added in the windows options for running as a service and the code for loading settings only from a single file server-tools/instance-manager/options.h: added definitions for the new Windows service vars and routines server-tools/instance-manager/parse_output.cc: added reference to port.h server-tools/instance-manager/priv.cc: added reference to port.h server-tools/instance-manager/priv.h: linuxthreads should not be visible on Windows server-tools/instance-manager/thread_registry.cc: more __WIN__ blocking server-tools/instance-manager/user_map.cc: fixed passwd file code to handle files with \r\n line endings server-tools/instance-manager/IMService.cpp: New BitKeeper file ``server-tools/instance-manager/IMService.cpp'' server-tools/instance-manager/IMService.h: New BitKeeper file ``server-tools/instance-manager/IMService.h'' server-tools/instance-manager/WindowsService.cpp: New BitKeeper file ``server-tools/instance-manager/WindowsService.cpp'' server-tools/instance-manager/WindowsService.h: New BitKeeper file ``server-tools/instance-manager/WindowsService.h'' server-tools/instance-manager/mysqlmanager.vcproj: New BitKeeper file ``server-tools/instance-manager/mysqlmanager.vcproj'' server-tools/instance-manager/port.h: New BitKeeper file ``server-tools/instance-manager/port.h''
2005-07-20 17:55:40 +02:00
bzero(temp, newlen);
strncpy(temp, src, dot-src+1);
strcat(temp, newext);
return temp;
Various fixes (cleanups, valgrind, makefiles, ...) server-tools/instance-manager/Makefile.am: increased default_monitoring interval server-tools/instance-manager/guardian.cc: some fixes for proper shutdown server-tools/instance-manager/guardian.h: removed init() prototype, as it was never used server-tools/instance-manager/instance.cc: cleanup() function removed server-tools/instance-manager/instance.h: cleanup() prototype removed server-tools/instance-manager/instance_map.cc: Instance_map::cleanup() removed, as instances have nothing to clean up server-tools/instance-manager/instance_map.h: Instance_map::cleanup() prototype removed server-tools/instance-manager/instance_options.cc: added print_argv() function for debug purposes server-tools/instance-manager/instance_options.h: declared print_argv() server-tools/instance-manager/listener.cc: some fixed in listener for proper shutdown server-tools/instance-manager/log.cc: cleanup server-tools/instance-manager/log.h: cleanup server-tools/instance-manager/manager.cc: some comments added server-tools/instance-manager/mysqlmanager.cc: we need to free memory in the very end server-tools/instance-manager/options.cc: fixed default options handling (as they were not working properly), added new method to cleanup Options server-tools/instance-manager/options.h: cleanup() declared server-tools/instance-manager/thread_registry.cc: cleanup server-tools/instance-manager/user_map.cc: missing password file is not a critical error anymore, as IM should be able to work as mysqld_safe only
2005-02-03 18:48:58 +01:00
}
initial import of Windows port of IM. server-tools/instance-manager/commands.cc: type cleanups for compiling on Windows now using Options::config_file for the location of the single my.cnf file we are using server-tools/instance-manager/guardian.cc: pthread_mutex_lock and unlock do not return a value on Windows so we return 0 in all cases server-tools/instance-manager/instance.cc: big changes here. Had to implement Windows versions of launch_and_wait and kill() server-tools/instance-manager/instance.h: added some function defs server-tools/instance-manager/instance_map.cc: pthread_mutex_lock and unlock do not return a value on Windows Also, now using only the file named as Options::config_file server-tools/instance-manager/instance_options.h: added reference to port.h server-tools/instance-manager/listener.cc: reworked and simplified the socket handling code. Added windows versions of the code that sets the sockets to be non-blocking and non-inheritable server-tools/instance-manager/listener.h: change Options to always be a struct. Really surprised GCC was letting this go. Options was declared to be struct in some places and class in other places. server-tools/instance-manager/log.cc: added reference to port.h server-tools/instance-manager/manager.cc: moved all the signal code inside some #ifndef __WIN__ blocks server-tools/instance-manager/manager.h: change Options to always be a struct. Really surprised GCC was letting this go. Options was declared to be struct in some places and class in other places. server-tools/instance-manager/mysqlmanager.cc: added in the Windows service code. server-tools/instance-manager/options.cc: Added in the windows options for running as a service and the code for loading settings only from a single file server-tools/instance-manager/options.h: added definitions for the new Windows service vars and routines server-tools/instance-manager/parse_output.cc: added reference to port.h server-tools/instance-manager/priv.cc: added reference to port.h server-tools/instance-manager/priv.h: linuxthreads should not be visible on Windows server-tools/instance-manager/thread_registry.cc: more __WIN__ blocking server-tools/instance-manager/user_map.cc: fixed passwd file code to handle files with \r\n line endings server-tools/instance-manager/IMService.cpp: New BitKeeper file ``server-tools/instance-manager/IMService.cpp'' server-tools/instance-manager/IMService.h: New BitKeeper file ``server-tools/instance-manager/IMService.h'' server-tools/instance-manager/WindowsService.cpp: New BitKeeper file ``server-tools/instance-manager/WindowsService.cpp'' server-tools/instance-manager/WindowsService.h: New BitKeeper file ``server-tools/instance-manager/WindowsService.h'' server-tools/instance-manager/mysqlmanager.vcproj: New BitKeeper file ``server-tools/instance-manager/mysqlmanager.vcproj'' server-tools/instance-manager/port.h: New BitKeeper file ``server-tools/instance-manager/port.h''
2005-07-20 17:55:40 +02:00
void Options::setup_windows_defaults(const char *progname)
{
Options::password_file_name= default_password_file_name =
change_extension(progname, "passwd");
Options::log_file_name= default_log_file_name =
change_extension(progname, "log");
initial import of Windows port of IM. server-tools/instance-manager/commands.cc: type cleanups for compiling on Windows now using Options::config_file for the location of the single my.cnf file we are using server-tools/instance-manager/guardian.cc: pthread_mutex_lock and unlock do not return a value on Windows so we return 0 in all cases server-tools/instance-manager/instance.cc: big changes here. Had to implement Windows versions of launch_and_wait and kill() server-tools/instance-manager/instance.h: added some function defs server-tools/instance-manager/instance_map.cc: pthread_mutex_lock and unlock do not return a value on Windows Also, now using only the file named as Options::config_file server-tools/instance-manager/instance_options.h: added reference to port.h server-tools/instance-manager/listener.cc: reworked and simplified the socket handling code. Added windows versions of the code that sets the sockets to be non-blocking and non-inheritable server-tools/instance-manager/listener.h: change Options to always be a struct. Really surprised GCC was letting this go. Options was declared to be struct in some places and class in other places. server-tools/instance-manager/log.cc: added reference to port.h server-tools/instance-manager/manager.cc: moved all the signal code inside some #ifndef __WIN__ blocks server-tools/instance-manager/manager.h: change Options to always be a struct. Really surprised GCC was letting this go. Options was declared to be struct in some places and class in other places. server-tools/instance-manager/mysqlmanager.cc: added in the Windows service code. server-tools/instance-manager/options.cc: Added in the windows options for running as a service and the code for loading settings only from a single file server-tools/instance-manager/options.h: added definitions for the new Windows service vars and routines server-tools/instance-manager/parse_output.cc: added reference to port.h server-tools/instance-manager/priv.cc: added reference to port.h server-tools/instance-manager/priv.h: linuxthreads should not be visible on Windows server-tools/instance-manager/thread_registry.cc: more __WIN__ blocking server-tools/instance-manager/user_map.cc: fixed passwd file code to handle files with \r\n line endings server-tools/instance-manager/IMService.cpp: New BitKeeper file ``server-tools/instance-manager/IMService.cpp'' server-tools/instance-manager/IMService.h: New BitKeeper file ``server-tools/instance-manager/IMService.h'' server-tools/instance-manager/WindowsService.cpp: New BitKeeper file ``server-tools/instance-manager/WindowsService.cpp'' server-tools/instance-manager/WindowsService.h: New BitKeeper file ``server-tools/instance-manager/WindowsService.h'' server-tools/instance-manager/mysqlmanager.vcproj: New BitKeeper file ``server-tools/instance-manager/mysqlmanager.vcproj'' server-tools/instance-manager/port.h: New BitKeeper file ``server-tools/instance-manager/port.h''
2005-07-20 17:55:40 +02:00
}
#endif