diff --git a/lang_helpers/gds_codes.ftn b/lang_helpers/gds_codes.ftn index b7bbd8c76a9..ede02d0b4fc 100644 --- a/lang_helpers/gds_codes.ftn +++ b/lang_helpers/gds_codes.ftn @@ -1826,5 +1826,7 @@ C -- PARAMETER (GDS__fbsvcmgr_query_err = 336986117) INTEGER*4 GDS__fbsvcmgr_switch_unknown PARAMETER (GDS__fbsvcmgr_switch_unknown = 336986118) + INTEGER*4 GDS__fbsvcmgr_bad_sm + PARAMETER (GDS__fbsvcmgr_bad_sm = 336986159) INTEGER*4 GDS__utl_trusted_switch PARAMETER (GDS__utl_trusted_switch = 337051649) diff --git a/lang_helpers/gds_codes.pas b/lang_helpers/gds_codes.pas index 3870a8f3791..95a4827f46d 100644 --- a/lang_helpers/gds_codes.pas +++ b/lang_helpers/gds_codes.pas @@ -920,4 +920,5 @@ gds_fbsvcmgr_info_err = 336986116; gds_fbsvcmgr_query_err = 336986117; gds_fbsvcmgr_switch_unknown = 336986118; + gds_fbsvcmgr_bad_sm = 336986159; gds_utl_trusted_switch = 337051649; diff --git a/src/alice/aliceswi.h b/src/alice/aliceswi.h index 69ef4c9fc41..15472138ac9 100644 --- a/src/alice/aliceswi.h +++ b/src/alice/aliceswi.h @@ -46,9 +46,9 @@ const unsigned long sw_two_phase = 0x00004000UL; const unsigned long sw_housekeeping = 0x00008000UL; const unsigned long sw_kill = 0x00010000UL; // Byte 2, Bit 0 //const unsigned long sw_begin_log = 0x00020000UL; -//const unsigned long sw_quit_log = 0x00040000UL; +//const unsigned long sw_quit_log = 0x00040000UL; const unsigned long sw_write = 0x00080000UL; -const unsigned long sw_no_reserve = 0x00100000UL; +const unsigned long sw_no_reserve = 0x00100000UL; const unsigned long sw_user = 0x00200000UL; const unsigned long sw_password = 0x00400000UL; const unsigned long sw_shut = 0x00800000UL; @@ -112,7 +112,8 @@ enum alice_switches IN_SW_ALICE_TRUSTED_AUTH = 44, #endif IN_SW_ALICE_TRUSTED_SVC = 45, - IN_SW_ALICE_TRUSTED_ROLE = 46 + IN_SW_ALICE_TRUSTED_ROLE = 46, + IN_SW_ALICE_HIDDEN_ONLINE = 47 }; static const char* ALICE_SW_ASYNC = "async"; @@ -126,7 +127,7 @@ static const in_sw_tab_t alice_in_sw_table[] = {IN_SW_ALICE_ACTIVATE, isc_spb_prp_activate, "activate", sw_activate, 0, ~(sw_activate | sw_user | sw_password), FALSE, 25, 0, NULL}, // msg 25: \t-activate shadow file for database usage - {IN_SW_ALICE_ATTACH, 0, "attach", sw_attach, + {IN_SW_ALICE_ATTACH, isc_spb_prp_attachments_shutdown, "attach", sw_attach, sw_shut, 0, FALSE, 26, 0, NULL}, // msg 26: \t-attach\tshutdown new database attachments #ifdef DEV_BUILD @@ -153,7 +154,7 @@ static const in_sw_tab_t alice_in_sw_table[] = {IN_SW_ALICE_FULL, isc_spb_rpr_full, "full", sw_full, sw_validate, 0, FALSE, 32, 0, NULL}, // msg 32: \t-full\t\tvalidate record fragments (-v) - {IN_SW_ALICE_FORCE, 0, "force", sw_force, + {IN_SW_ALICE_FORCE, isc_spb_prp_force_shutdown, "force", sw_force, sw_shut, 0, FALSE, 33, 0, NULL}, // msg 33: \t-force\t\tforce database shutdown {IN_SW_ALICE_HOUSEKEEPING, isc_spb_prp_sweep_interval, "housekeeping", @@ -211,7 +212,7 @@ static const in_sw_tab_t alice_in_sw_table[] = {IN_SW_ALICE_SWEEP, isc_spb_rpr_sweep_db, "sweep", sw_sweep, 0, ~(sw_sweep | sw_user | sw_password), FALSE, 45, 0, NULL}, // msg 45: \t-sweep\t\tforce garbage collection - {IN_SW_ALICE_SHUT, 0, "shut", sw_shut, + {IN_SW_ALICE_SHUT, isc_spb_prp_shutdown_mode, "shut", sw_shut, 0, ~(sw_shut | sw_attach | sw_cache | sw_force | sw_tran | sw_user | sw_password), FALSE, 46, 0, NULL}, // msg 46: \t-shut\t\tshutdown @@ -219,7 +220,7 @@ static const in_sw_tab_t alice_in_sw_table[] = sw_two_phase, 0, ~(sw_two_phase | sw_user | sw_password), FALSE, 47, 0, NULL}, // msg 47: \t-two_phase\tperform automated two-phase recovery - {IN_SW_ALICE_TRAN, 0, "tran", sw_tran, + {IN_SW_ALICE_TRAN, isc_spb_prp_transactions_shutdown, "tran", sw_tran, sw_shut, 0, FALSE, 48, 0, NULL}, // msg 48: \t-tran\t\tshutdown transaction startup #ifdef TRUSTED_AUTH @@ -258,28 +259,35 @@ static const in_sw_tab_t alice_in_sw_table[] = /* The next nine 'virtual' switches are hidden from user and are needed for services API ************************************************************************/ - {IN_SW_ALICE_HIDDEN_ASYNC, isc_spb_prp_wm_async, "write async", 0, 0, 0, - FALSE, 0, 0, NULL}, - {IN_SW_ALICE_HIDDEN_SYNC, isc_spb_prp_wm_sync, "write sync", 0, 0, 0, - FALSE, 0, 0, NULL}, - {IN_SW_ALICE_HIDDEN_USEALL, isc_spb_prp_res_use_full, "use full", 0, 0, 0, - FALSE, 0, 0, NULL}, - {IN_SW_ALICE_HIDDEN_RESERVE, isc_spb_prp_res, "use reserve", 0, 0, 0, - FALSE, 0, 0, NULL}, - {IN_SW_ALICE_HIDDEN_FORCE, isc_spb_prp_shutdown_db, "shut -force", 0, 0, 0, - FALSE, 0, 0, NULL}, - {IN_SW_ALICE_HIDDEN_TRAN, isc_spb_prp_deny_new_transactions, "shut -tran", - 0, 0, 0, FALSE, 0, 0, NULL}, - {IN_SW_ALICE_HIDDEN_ATTACH, isc_spb_prp_deny_new_attachments, - "shut -attach", 0, 0, 0, FALSE, 0, 0, NULL}, - {IN_SW_ALICE_HIDDEN_RDONLY, isc_spb_prp_am_readonly, "mode read_only", 0, - 0, 0, FALSE, 0, 0, NULL}, - {IN_SW_ALICE_HIDDEN_RDWRITE, isc_spb_prp_am_readwrite, "mode read_write", - 0, 0, 0, FALSE, 0, 0, NULL}, + {IN_SW_ALICE_HIDDEN_ASYNC, isc_spb_prp_wm_async, "write async", + 0, 0, 0, FALSE, 0, 0, NULL}, + {IN_SW_ALICE_HIDDEN_SYNC, isc_spb_prp_wm_sync, "write sync", + 0, 0, 0, FALSE, 0, 0, NULL}, + {IN_SW_ALICE_HIDDEN_USEALL, isc_spb_prp_res_use_full, "use full", + 0, 0, 0, FALSE, 0, 0, NULL}, + {IN_SW_ALICE_HIDDEN_RESERVE, isc_spb_prp_res, "use reserve", + 0, 0, 0, FALSE, 0, 0, NULL}, + {IN_SW_ALICE_HIDDEN_FORCE, isc_spb_prp_shutdown_db, "shut -force", + 0, 0, 0, FALSE, 0, 0, NULL}, + {IN_SW_ALICE_HIDDEN_TRAN, isc_spb_prp_deny_new_transactions, "shut -tran", + 0, 0, 0, FALSE, 0, 0, NULL}, + {IN_SW_ALICE_HIDDEN_ATTACH, isc_spb_prp_deny_new_attachments, "shut -attach", + 0, 0, 0, FALSE, 0, 0, NULL}, + {IN_SW_ALICE_HIDDEN_ONLINE, isc_spb_prp_online_mode, "online", + 0, 0, 0, FALSE, 0, 0, NULL}, + {IN_SW_ALICE_HIDDEN_RDONLY, isc_spb_prp_am_readonly, "mode read_only", + 0, 0, 0, FALSE, 0, 0, NULL}, + {IN_SW_ALICE_HIDDEN_RDWRITE, isc_spb_prp_am_readwrite, "mode read_write", + 0, 0, 0, FALSE, 0, 0, NULL}, /************************************************************************/ {IN_SW_ALICE_0, 0, NULL, 0, 0, 0, FALSE, 0, 0, NULL} }; +static const char* alice_mode_sw_table[] = +{ + "normal", "multi", "single", "full" +}; + #endif // ALICE_ALICESWI_H diff --git a/src/common/classes/ClumpletReader.cpp b/src/common/classes/ClumpletReader.cpp index d6ae10f9dfb..d3102c9a6e8 100644 --- a/src/common/classes/ClumpletReader.cpp +++ b/src/common/classes/ClumpletReader.cpp @@ -280,10 +280,15 @@ ClumpletReader::ClumpletType ClumpletReader::getClumpletType(UCHAR tag) const case isc_spb_prp_deny_new_transactions: case isc_spb_prp_set_sql_dialect: case isc_spb_options: + case isc_spb_prp_force_shutdown: + case isc_spb_prp_attachments_shutdown: + case isc_spb_prp_transactions_shutdown: return IntSpb; case isc_spb_prp_reserve_space: case isc_spb_prp_write_mode: case isc_spb_prp_access_mode: + case isc_spb_prp_shutdown_mode: + case isc_spb_prp_online_mode: return ByteSpb; } invalid_structure("unknown parameter for setting database properties"); diff --git a/src/include/consts_pub.h b/src/include/consts_pub.h index 3d5baa5de6c..9b16186532c 100644 --- a/src/include/consts_pub.h +++ b/src/include/consts_pub.h @@ -360,13 +360,27 @@ #define isc_spb_prp_set_sql_dialect 14 #define isc_spb_prp_activate 0x0100 #define isc_spb_prp_db_online 0x0200 +#define isc_spb_prp_force_shutdown 41 +#define isc_spb_prp_attachments_shutdown 42 +#define isc_spb_prp_transactions_shutdown 43 +#define isc_spb_prp_shutdown_mode 44 +#define isc_spb_prp_online_mode 45 + +/******************************************** + * Parameters for isc_spb_prp_shutdown_mode * + * and isc_spb_prp_onlibe_mode * + ********************************************/ +#define isc_spb_prp_sm_normal 0 +#define isc_spb_prp_sm_multi 1 +#define isc_spb_prp_sm_single 2 +#define isc_spb_prp_sm_full 3 /******************************************** * Parameters for isc_spb_prp_reserve_space * ********************************************/ #define isc_spb_prp_res_use_full 35 -#define isc_spb_prp_res 36 +#define isc_spb_prp_res 36 /****************************************** * Parameters for isc_spb_prp_write_mode * diff --git a/src/include/gen/codetext.h b/src/include/gen/codetext.h index 4c0bd506824..3cb71fc4d3a 100644 --- a/src/include/gen/codetext.h +++ b/src/include/gen/codetext.h @@ -909,6 +909,7 @@ static const struct { {"fbsvcmgr_info_err", 336986116}, {"fbsvcmgr_query_err", 336986117}, {"fbsvcmgr_switch_unknown", 336986118}, + {"fbsvcmgr_bad_sm", 336986159}, {"utl_trusted_switch", 337051649}, {NULL, 0} }; diff --git a/src/include/gen/iberror.h b/src/include/gen/iberror.h index 905c95929e7..ffab5364c59 100644 --- a/src/include/gen/iberror.h +++ b/src/include/gen/iberror.h @@ -943,8 +943,9 @@ const ISC_STATUS isc_fbsvcmgr_bad_rs = 336986115L; const ISC_STATUS isc_fbsvcmgr_info_err = 336986116L; const ISC_STATUS isc_fbsvcmgr_query_err = 336986117L; const ISC_STATUS isc_fbsvcmgr_switch_unknown = 336986118L; +const ISC_STATUS isc_fbsvcmgr_bad_sm = 336986159L; const ISC_STATUS isc_utl_trusted_switch = 337051649L; -const ISC_STATUS isc_err_max = 888; +const ISC_STATUS isc_err_max = 889; #else /* c definitions */ @@ -1857,8 +1858,9 @@ const ISC_STATUS isc_err_max = 888; #define isc_fbsvcmgr_info_err 336986116L #define isc_fbsvcmgr_query_err 336986117L #define isc_fbsvcmgr_switch_unknown 336986118L +#define isc_fbsvcmgr_bad_sm 336986159L #define isc_utl_trusted_switch 337051649L -#define isc_err_max 888 +#define isc_err_max 889 #endif diff --git a/src/include/gen/msgs.h b/src/include/gen/msgs.h index b4783744300..e2370e778ac 100644 --- a/src/include/gen/msgs.h +++ b/src/include/gen/msgs.h @@ -909,6 +909,7 @@ static const struct { {336986116, "Unknown tag (@1) in info_svr_db_info block after isc_svc_query()"}, /* 885, fbsvcmgr_info_err */ {336986117, "Unknown tag (@1) in isc_svc_query() results"}, /* 886, fbsvcmgr_query_err */ {336986118, "Unknown switch \"@1\""}, /* 887, fbsvcmgr_switch_unknown */ - {337051649, "Switches trusted_svc and trusted_role are not supported from command line"}, /* 888, utl_trusted_switch */ + {336986159, "Wrong value for shutdown mode"}, /* 888, fbsvcmgr_bad_sm */ + {337051649, "Switches trusted_svc and trusted_role are not supported from command line"}, /* 889, utl_trusted_switch */ {0, NULL} }; diff --git a/src/include/gen/sql_code.h b/src/include/gen/sql_code.h index be8f88a8d4b..3075b543e96 100644 --- a/src/include/gen/sql_code.h +++ b/src/include/gen/sql_code.h @@ -908,6 +908,7 @@ static const struct { {336986116, -901}, /* 4 fbsvcmgr_info_err */ {336986117, -901}, /* 5 fbsvcmgr_query_err */ {336986118, -901}, /* 6 fbsvcmgr_switch_unknown */ + {336986159, -901}, /* 47 fbsvcmgr_bad_sm */ {337051649, -901}, /* 1 utl_trusted_switch */ {0, 0} }; diff --git a/src/include/gen/sql_state.h b/src/include/gen/sql_state.h index b9f4fb4395a..4560613454e 100644 --- a/src/include/gen/sql_state.h +++ b/src/include/gen/sql_state.h @@ -908,6 +908,7 @@ static const struct { {336986116, "00000"}, // 4 fbsvcmgr_info_err {336986117, "00000"}, // 5 fbsvcmgr_query_err {336986118, "00000"}, // 6 fbsvcmgr_switch_unknown + {336986159, "00000"}, // 47 fbsvcmgr_bad_sm {337051649, "00000"}, // 1 utl_trusted_switch {0, NULL} }; diff --git a/src/jrd/svc.cpp b/src/jrd/svc.cpp index 733f2abff03..a0ca4d4e557 100644 --- a/src/jrd/svc.cpp +++ b/src/jrd/svc.cpp @@ -2314,6 +2314,9 @@ bool Service::process_switches(ClumpletReader& spb, string& switches) case isc_spb_prp_shutdown_db: case isc_spb_prp_deny_new_attachments: case isc_spb_prp_deny_new_transactions: + case isc_spb_prp_force_shutdown: + case isc_spb_prp_attachments_shutdown: + case isc_spb_prp_transactions_shutdown: case isc_spb_prp_set_sql_dialect: case isc_spb_rpr_commit_trans: case isc_spb_rpr_rollback_trans: @@ -2332,6 +2335,20 @@ bool Service::process_switches(ClumpletReader& spb, string& switches) return false; } break; + case isc_spb_prp_shutdown_mode: + case isc_spb_prp_online_mode: + if (get_action_svc_parameter(spb.getClumpTag(), alice_in_sw_table, switches)) + { + unsigned int val = spb.getInt(); + if (val >= FB_NELEM(alice_mode_sw_table)) + { + return false; + } + switches += alice_mode_sw_table[val]; + switches += " "; + break; + } + return false; default: return false; } diff --git a/src/msgs/facilities2.sql b/src/msgs/facilities2.sql index 1b84cec86cb..2d11601dcde 100644 --- a/src/msgs/facilities2.sql +++ b/src/msgs/facilities2.sql @@ -29,7 +29,7 @@ set bulk_insert INSERT INTO FACILITIES (LAST_CHANGE, FACILITY, FAC_CODE, MAX_NUM ('2002-03-05 02:30:12', 'LICENSE', 19, 60) ('2002-03-05 02:31:54', 'DOS', 20, 74) ('2007-04-07 13:11:00', 'GSTAT', 21, 37) -('2007-05-02 13:15:27', 'FBSVCMGR', 22, 47) +('2008-09-16 16:51:42', 'FBSVCMGR', 22, 48) ('2007-12-21 19:03:07', 'UTL', 23, 2) stop diff --git a/src/msgs/messages2.sql b/src/msgs/messages2.sql index 5da7531d059..34f278421bb 100644 --- a/src/msgs/messages2.sql +++ b/src/msgs/messages2.sql @@ -3249,52 +3249,53 @@ Analyzing database pages ...', NULL, NULL); -- Write the new GSTAT messages here. (NULL, 'main', 'dba.epp', NULL, 21, 36, NULL, ' -tr use trusted authentication', NULL, NULL); -- FBSVCMGR -('fbsvcmgr_bad_am', 'putAccessMode', 'gserv.cpp', NULL, 22, 1, NULL, 'Wrong value for access mode', NULL, NULL); -('fbsvcmgr_bad_wm', 'putWriteMode', 'gserv.cpp', NULL, 22, 2, NULL, 'Wrong value for write mode', NULL, NULL); -('fbsvcmgr_bad_rs', 'putReserveSpace', 'gserv.cpp', NULL, 22, 3, NULL, 'Wrong value for reserve space', NULL, NULL); -('fbsvcmgr_info_err', 'printInfo', 'gserv.cpp', NULL, 22, 4, NULL, 'Unknown tag (@1) in info_svr_db_info block after isc_svc_query()', NULL, NULL); -('fbsvcmgr_query_err', 'printInfo', 'gserv.cpp', NULL, 22, 5, NULL, 'Unknown tag (@1) in isc_svc_query() results', NULL, NULL); -('fbsvcmgr_switch_unknown', 'main', 'gserv.cpp', NULL, 22, 6, NULL, 'Unknown switch "@1"', NULL, NULL); -(NULL, 'printInfo', 'gserv.cpp', NULL, 22, 7, NULL, 'Service Manager Version', NULL, NULL); -(NULL, 'printInfo', 'gserv.cpp', NULL, 22, 8, NULL, 'Server version', NULL, NULL); -(NULL, 'printInfo', 'gserv.cpp', NULL, 22, 9, NULL, 'Server implementation', NULL, NULL); -(NULL, 'printInfo', 'gserv.cpp', NULL, 22, 10, NULL, 'Path to firebird.msg', NULL, NULL); -(NULL, 'printInfo', 'gserv.cpp', NULL, 22, 11, NULL, 'Server root', NULL, NULL); -(NULL, 'printInfo', 'gserv.cpp', NULL, 22, 12, NULL, 'Path to lock files', NULL, NULL); -(NULL, 'printInfo', 'gserv.cpp', NULL, 22, 13, NULL, 'Security database', NULL, NULL); -(NULL, 'printInfo', 'gserv.cpp', NULL, 22, 14, NULL, 'Databases', NULL, NULL); -(NULL, 'printInfo', 'gserv.cpp', NULL, 22, 15, NULL, ' Database in use', NULL, NULL); -(NULL, 'printInfo', 'gserv.cpp', NULL, 22, 16, NULL, ' Number of attachments', NULL, NULL); -(NULL, 'printInfo', 'gserv.cpp', NULL, 22, 17, NULL, ' Number of databases', NULL, NULL); -(NULL, 'printInfo', 'gserv.cpp', NULL, 22, 18, NULL, 'Information truncated', NULL, NULL); -(NULL, 'usage', 'gserv.cpp', NULL, 22, 19, NULL, 'Usage: fbsvcmgr manager-name switches...', NULL, NULL); -(NULL, 'usage', 'gserv.cpp', NULL, 22, 20, NULL, 'Manager-name should be service_mgr, may be prefixed with host name', NULL, NULL); -(NULL, 'usage', 'gserv.cpp', NULL, 22, 21, NULL, 'according to common rules (host:service_mgr, \\host\service_mgr).', NULL, NULL); -(NULL, 'usage', 'gserv.cpp', NULL, 22, 22, NULL, 'Switches exactly match SPB tags, used in abbreviated form.', NULL, NULL); -(NULL, 'usage', 'gserv.cpp', NULL, 22, 23, NULL, 'Remove isc_, spb_ and svc_ parts of tag and you will get the switch.', NULL, NULL); -(NULL, 'usage', 'gserv.cpp', NULL, 22, 24, NULL, 'For example: isc_action_svc_backup is specified as action_backup,', NULL, NULL); -(NULL, 'usage', 'gserv.cpp', NULL, 22, 25, NULL, ' isc_spb_dbname => dbname,', NULL, NULL); -(NULL, 'usage', 'gserv.cpp', NULL, 22, 26, NULL, ' isc_info_svc_implementation => info_implementation,', NULL, NULL); -(NULL, 'usage', 'gserv.cpp', NULL, 22, 27, NULL, ' isc_spb_prp_db_online => prp_db_online and so on.', NULL, NULL); -(NULL, 'usage', 'gserv.cpp', NULL, 22, 28, NULL, 'You may specify single action or multiple info items when calling fbsvcmgr once.', NULL, NULL); -(NULL, 'usage', 'gserv.cpp', NULL, 22, 29, NULL, 'Full command line samples:', NULL, NULL); -(NULL, 'usage', 'gserv.cpp', NULL, 22, 30, NULL, 'fbsvcmgr service_mgr user sysdba password masterke action_db_stats dbname employee sts_hdr_pages', NULL, NULL); -(NULL, 'usage', 'gserv.cpp', NULL, 22, 31, NULL, ' (will list header info in database employee on local machine)', NULL, NULL); -(NULL, 'usage', 'gserv.cpp', NULL, 22, 32, NULL, 'fbsvcmgr yourserver:service_mgr user sysdba password masterke info_server_version info_svr_db_info', NULL, NULL); -(NULL, 'usage', 'gserv.cpp', NULL, 22, 33, NULL, ' (will show firebird version and databases usage on yourserver)', NULL, NULL); -(NULL, 'printInfo', 'gserv.cpp', NULL, 22, 34, NULL, 'Transaction @1 is in limbo', NULL, NULL); -(NULL, 'printInfo', 'gserv.cpp', NULL, 22, 35, NULL, 'Multidatabase transaction @1 is in limbo', NULL, NULL); -(NULL, 'printInfo', 'gserv.cpp', NULL, 22, 36, NULL, 'Host Site: @1', NULL, NULL); -(NULL, 'printInfo', 'gserv.cpp', NULL, 22, 37, NULL, 'Transaction @1', NULL, NULL); -(NULL, 'printInfo', 'gserv.cpp', NULL, 22, 38, NULL, 'has been prepared', NULL, NULL); -(NULL, 'printInfo', 'gserv.cpp', NULL, 22, 39, NULL, 'has been committed', NULL, NULL); -(NULL, 'printInfo', 'gserv.cpp', NULL, 22, 40, NULL, 'has been rolled back', NULL, NULL); -(NULL, 'printInfo', 'gserv.cpp', NULL, 22, 41, NULL, 'is not available', NULL, NULL); -(NULL, 'printInfo', 'gserv.cpp', NULL, 22, 42, NULL, 'Remote Site: @1', NULL, NULL); -(NULL, 'printInfo', 'gserv.cpp', NULL, 22, 43, NULL, 'Database Path: @1', NULL, NULL); -(NULL, 'printInfo', 'gserv.cpp', NULL, 22, 44, NULL, 'Automated recovery would commit this transaction', NULL, NULL); -(NULL, 'printInfo', 'gserv.cpp', NULL, 22, 45, NULL, 'Automated recovery would rollback this transaction', NULL, NULL); -(NULL, 'printInfo', 'gserv.cpp', NULL, 22, 46, NULL, 'No idea should it be commited or rolled back', NULL, NULL); +('fbsvcmgr_bad_am', 'putAccessMode', 'fbsvcmgr.cpp', NULL, 22, 1, NULL, 'Wrong value for access mode', NULL, NULL); +('fbsvcmgr_bad_wm', 'putWriteMode', 'fbsvcmgr.cpp', NULL, 22, 2, NULL, 'Wrong value for write mode', NULL, NULL); +('fbsvcmgr_bad_rs', 'putReserveSpace', 'fbsvcmgr.cpp', NULL, 22, 3, NULL, 'Wrong value for reserve space', NULL, NULL); +('fbsvcmgr_info_err', 'printInfo', 'fbsvcmgr.cpp', NULL, 22, 4, NULL, 'Unknown tag (@1) in info_svr_db_info block after isc_svc_query()', NULL, NULL); +('fbsvcmgr_query_err', 'printInfo', 'fbsvcmgr.cpp', NULL, 22, 5, NULL, 'Unknown tag (@1) in isc_svc_query() results', NULL, NULL); +('fbsvcmgr_switch_unknown', 'main', 'fbsvcmgr.cpp', NULL, 22, 6, NULL, 'Unknown switch "@1"', NULL, NULL); +(NULL, 'printInfo', 'fbsvcmgr.cpp', NULL, 22, 7, NULL, 'Service Manager Version', NULL, NULL); +(NULL, 'printInfo', 'fbsvcmgr.cpp', NULL, 22, 8, NULL, 'Server version', NULL, NULL); +(NULL, 'printInfo', 'fbsvcmgr.cpp', NULL, 22, 9, NULL, 'Server implementation', NULL, NULL); +(NULL, 'printInfo', 'fbsvcmgr.cpp', NULL, 22, 10, NULL, 'Path to firebird.msg', NULL, NULL); +(NULL, 'printInfo', 'fbsvcmgr.cpp', NULL, 22, 11, NULL, 'Server root', NULL, NULL); +(NULL, 'printInfo', 'fbsvcmgr.cpp', NULL, 22, 12, NULL, 'Path to lock files', NULL, NULL); +(NULL, 'printInfo', 'fbsvcmgr.cpp', NULL, 22, 13, NULL, 'Security database', NULL, NULL); +(NULL, 'printInfo', 'fbsvcmgr.cpp', NULL, 22, 14, NULL, 'Databases', NULL, NULL); +(NULL, 'printInfo', 'fbsvcmgr.cpp', NULL, 22, 15, NULL, ' Database in use', NULL, NULL); +(NULL, 'printInfo', 'fbsvcmgr.cpp', NULL, 22, 16, NULL, ' Number of attachments', NULL, NULL); +(NULL, 'printInfo', 'fbsvcmgr.cpp', NULL, 22, 17, NULL, ' Number of databases', NULL, NULL); +(NULL, 'printInfo', 'fbsvcmgr.cpp', NULL, 22, 18, NULL, 'Information truncated', NULL, NULL); +(NULL, 'usage', 'fbsvcmgr.cpp', NULL, 22, 19, NULL, 'Usage: fbsvcmgr manager-name switches...', NULL, NULL); +(NULL, 'usage', 'fbsvcmgr.cpp', NULL, 22, 20, NULL, 'Manager-name should be service_mgr, may be prefixed with host name', NULL, NULL); +(NULL, 'usage', 'fbsvcmgr.cpp', NULL, 22, 21, NULL, 'according to common rules (host:service_mgr, \\host\service_mgr).', NULL, NULL); +(NULL, 'usage', 'fbsvcmgr.cpp', NULL, 22, 22, NULL, 'Switches exactly match SPB tags, used in abbreviated form.', NULL, NULL); +(NULL, 'usage', 'fbsvcmgr.cpp', NULL, 22, 23, NULL, 'Remove isc_, spb_ and svc_ parts of tag and you will get the switch.', NULL, NULL); +(NULL, 'usage', 'fbsvcmgr.cpp', NULL, 22, 24, NULL, 'For example: isc_action_svc_backup is specified as action_backup,', NULL, NULL); +(NULL, 'usage', 'fbsvcmgr.cpp', NULL, 22, 25, NULL, ' isc_spb_dbname => dbname,', NULL, NULL); +(NULL, 'usage', 'fbsvcmgr.cpp', NULL, 22, 26, NULL, ' isc_info_svc_implementation => info_implementation,', NULL, NULL); +(NULL, 'usage', 'fbsvcmgr.cpp', NULL, 22, 27, NULL, ' isc_spb_prp_db_online => prp_db_online and so on.', NULL, NULL); +(NULL, 'usage', 'fbsvcmgr.cpp', NULL, 22, 28, NULL, 'You may specify single action or multiple info items when calling fbsvcmgr once.', NULL, NULL); +(NULL, 'usage', 'fbsvcmgr.cpp', NULL, 22, 29, NULL, 'Full command line samples:', NULL, NULL); +(NULL, 'usage', 'fbsvcmgr.cpp', NULL, 22, 30, NULL, 'fbsvcmgr service_mgr user sysdba password masterke action_db_stats dbname employee sts_hdr_pages', NULL, NULL); +(NULL, 'usage', 'fbsvcmgr.cpp', NULL, 22, 31, NULL, ' (will list header info in database employee on local machine)', NULL, NULL); +(NULL, 'usage', 'fbsvcmgr.cpp', NULL, 22, 32, NULL, 'fbsvcmgr yourserver:service_mgr user sysdba password masterke info_server_version info_svr_db_info', NULL, NULL); +(NULL, 'usage', 'fbsvcmgr.cpp', NULL, 22, 33, NULL, ' (will show firebird version and databases usage on yourserver)', NULL, NULL); +(NULL, 'printInfo', 'fbsvcmgr.cpp', NULL, 22, 34, NULL, 'Transaction @1 is in limbo', NULL, NULL); +(NULL, 'printInfo', 'fbsvcmgr.cpp', NULL, 22, 35, NULL, 'Multidatabase transaction @1 is in limbo', NULL, NULL); +(NULL, 'printInfo', 'fbsvcmgr.cpp', NULL, 22, 36, NULL, 'Host Site: @1', NULL, NULL); +(NULL, 'printInfo', 'fbsvcmgr.cpp', NULL, 22, 37, NULL, 'Transaction @1', NULL, NULL); +(NULL, 'printInfo', 'fbsvcmgr.cpp', NULL, 22, 38, NULL, 'has been prepared', NULL, NULL); +(NULL, 'printInfo', 'fbsvcmgr.cpp', NULL, 22, 39, NULL, 'has been committed', NULL, NULL); +(NULL, 'printInfo', 'fbsvcmgr.cpp', NULL, 22, 40, NULL, 'has been rolled back', NULL, NULL); +(NULL, 'printInfo', 'fbsvcmgr.cpp', NULL, 22, 41, NULL, 'is not available', NULL, NULL); +(NULL, 'printInfo', 'fbsvcmgr.cpp', NULL, 22, 42, NULL, 'Remote Site: @1', NULL, NULL); +(NULL, 'printInfo', 'fbsvcmgr.cpp', NULL, 22, 43, NULL, 'Database Path: @1', NULL, NULL); +(NULL, 'printInfo', 'fbsvcmgr.cpp', NULL, 22, 44, NULL, 'Automated recovery would commit this transaction', NULL, NULL); +(NULL, 'printInfo', 'fbsvcmgr.cpp', NULL, 22, 45, NULL, 'Automated recovery would rollback this transaction', NULL, NULL); +(NULL, 'printInfo', 'fbsvcmgr.cpp', NULL, 22, 46, NULL, 'No idea should it be commited or rolled back', NULL, NULL); +('fbsvcmgr_bad_sm', 'putShutdownMode', 'fbsvcmgr.cpp', NULL, 22, 47, NULL, 'Wrong value for shutdown mode', NULL, NULL); -- UTL (messages common for many utilities) -- All messages use the new format. ('utl_trusted_switch', 'checkService', 'UtilSvc.cpp', NULL, 23, 1, NULL, 'Switches trusted_svc and trusted_role are not supported from command line', NULL, NULL); diff --git a/src/msgs/system_errors2.sql b/src/msgs/system_errors2.sql index 69ff7d219bf..ed0813dcab2 100644 --- a/src/msgs/system_errors2.sql +++ b/src/msgs/system_errors2.sql @@ -898,6 +898,7 @@ COMMIT WORK; (-901, '00', '000', 22, 4, 'fbsvcmgr_info_err', NULL, NULL) (-901, '00', '000', 22, 5, 'fbsvcmgr_query_err', NULL, NULL) (-901, '00', '000', 22, 6, 'fbsvcmgr_switch_unknown', NULL, NULL) +(-901, '00', '000', 22, 47, 'fbsvcmgr_bad_sm', NULL, NULL) -- UTILITIES (-901, '00', '000', 23, 1, 'utl_trusted_switch', NULL, NULL) -- diff --git a/src/utilities/fbsvcmgr.cpp b/src/utilities/fbsvcmgr.cpp index 4910d3eee53..db28d3091e5 100644 --- a/src/utilities/fbsvcmgr.cpp +++ b/src/utilities/fbsvcmgr.cpp @@ -144,6 +144,19 @@ bool putReserveSpace(char**& av, ClumpletWriter& spb, unsigned int tag) return putSpecTag(av, spb, tag, rsSwitch, isc_fbsvcmgr_bad_rs); } +const Switches shutSwitch[] = { + {"prp_sm_normal", 0, 0, isc_spb_prp_sm_normal, 0}, + {"prp_sm_multi", 0, 0, isc_spb_prp_sm_multi, 0}, + {"prp_sm_single", 0, 0, isc_spb_prp_sm_single, 0}, + {"prp_sm_full", 0, 0, isc_spb_prp_sm_full, 0}, + {0, 0, 0, 0, 0} +}; + +bool putShutdownMode(char**& av, ClumpletWriter& spb, unsigned int tag) +{ + return putSpecTag(av, spb, tag, shutSwitch, isc_fbsvcmgr_bad_sm); +} + // add numeric (int32) tag to spb bool putNumericArgument(char**& av, ClumpletWriter& spb, unsigned int tag) @@ -281,6 +294,11 @@ const Switches propertiesOptions[] = { {"prp_write_mode", putWriteMode, 0, isc_spb_prp_write_mode, 0}, {"prp_activate", putOption, 0, isc_spb_prp_activate, 0}, {"prp_db_online", putOption, 0, isc_spb_prp_db_online, 0}, + {"prp_force_shutdown", putNumericArgument, 0, isc_spb_prp_force_shutdown, 0}, + {"prp_attachments_shutdown", putNumericArgument, 0, isc_spb_prp_attachments_shutdown, 0}, + {"prp_transactions_shutdown", putNumericArgument, 0, isc_spb_prp_transactions_shutdown, 0}, + {"prp_shutdown_mode", putShutdownMode, 0, isc_spb_prp_shutdown_mode, 0}, + {"prp_online_mode", putShutdownMode, 0, isc_spb_prp_online_mode, 0}, {0, 0, 0, 0, 0} };