mirror of
https://github.com/FirebirdSQL/firebird.git
synced 2025-01-22 20:43:02 +01:00
Added fbsvcmgr, utility to access services manager
This commit is contained in:
parent
8ab625f41b
commit
8aba4a1ea1
@ -30,7 +30,7 @@
|
||||
# Contributor(s):
|
||||
#
|
||||
#
|
||||
# $Id: makeInstallImage.sh.in,v 1.18 2005-10-27 13:51:27 alexpeshkoff Exp $
|
||||
# $Id: makeInstallImage.sh.in,v 1.19 2007-05-03 11:24:39 alexpeshkoff Exp $
|
||||
#
|
||||
|
||||
# Script to copy install files from the build/transport area
|
||||
@ -141,6 +141,7 @@ copyFiles() {
|
||||
cp $BuiltFBDir/bin/nbackup $DestDir/bin/nbackup
|
||||
copyIfExists $BuiltFBDir/bin/gsplit $DestDir/bin/gsplit
|
||||
cp $BuiltFBDir/bin/gstat $DestDir/bin/gstat
|
||||
copyIfExists $BuiltFBDir/bin/fbsvcmgr $DestDir/bin/fbsvcmgr
|
||||
copyIfExists $BuiltFBDir/bin/isc4.gbak $DestDir/bin/isc4.gbak
|
||||
cp $BuiltFBDir/bin/isql $DestDir/bin/isql
|
||||
cp $BuiltFBDir/bin/qli $DestDir/bin/qli
|
||||
|
@ -138,6 +138,7 @@ copyFiles() {
|
||||
cp $BuiltFBDir/bin/gsec $DestDir/bin/gsec
|
||||
copyIfExists $BuiltFBDir/bin/gsplit $DestDir/bin/gsplit
|
||||
cp $BuiltFBDir/bin/gstat $DestDir/bin/gstat
|
||||
copyIfExists $BuiltFBDir/bin/fbsvcmgr $DestDir/bin/fbsvcmgr
|
||||
copyIfExists $BuiltFBDir/bin/security.gbak $DestDir/bin/security.gbak
|
||||
cp $BuiltFBDir/bin/isql $DestDir/bin/isql
|
||||
cp $BuiltFBDir/bin/nbackup $DestDir/bin/nbackup
|
||||
|
@ -46,12 +46,14 @@ LOCKPRINT_Files= print.cpp
|
||||
LOCKPRINT_Sources = $(addprefix lock/, $(LOCKPRINT_Files)) $(LOCKPRINT_Other_Sources)
|
||||
LOCKPRINT_Objects = $(addprefix $(OBJ)/, $(addsuffix .o, $(basename $(LOCKPRINT_Sources))))
|
||||
|
||||
|
||||
NBACKUP_Other_Sources = jrd/db_alias.cpp \
|
||||
common/config/config.cpp common/config/config_file.cpp $(OS_SPECIFIC_Sources)
|
||||
NBACKUP_Files= nbackup.cpp
|
||||
NBACKUP_Sources = $(addprefix utilities/, $(NBACKUP_Files)) $(NBACKUP_Other_Sources)
|
||||
NBACKUP_Objects = $(addprefix $(OBJ)/, $(addsuffix .o, $(basename $(NBACKUP_Sources)))) $(CLUMPLETS_Objects)
|
||||
|
||||
|
||||
CREATEDB_Files= create_db.cpp
|
||||
CREATEDB_Sources = $(addprefix utilities/, $(CREATEDB_Files))
|
||||
CREATEDB_Objects = $(addprefix $(OBJ)/, $(addsuffix .o, $(basename $(CREATEDB_Sources))))
|
||||
@ -65,12 +67,6 @@ DROP_Files= drop.cpp
|
||||
DROP_Sources = $(addprefix utilities/, $(DROP_Files)) $(DROP_Other_Sources)
|
||||
DROP_Objects = $(addprefix $(OBJ)/, $(addsuffix .o, $(basename $(DROP_Sources))))
|
||||
|
||||
GSERV_Files= gserv.cpp
|
||||
GSERV_Other_Sources = common/classes/fb_string.cpp common/classes/alloc.cpp \
|
||||
common/classes/ClumpletReader.cpp common/classes/ClumpletWriter.cpp \
|
||||
common/fb_exception.cpp common/utils.cpp
|
||||
GSERV_Sources = $(addprefix utilities/, $(GSERV_Files)) $(GSERV_Other_Sources)
|
||||
GSERV_Objects = $(addprefix $(OBJ)/, $(addsuffix .o, $(basename $(GSERV_Sources))))
|
||||
|
||||
GSTAT_Other_Sources = jrd/btn.cpp jrd/db_alias.cpp jrd/ods.cpp \
|
||||
common/config/config.cpp common/config/config_file.cpp common/utils.cpp\
|
||||
@ -80,11 +76,22 @@ GSTAT_Files = dba.epp ppg.cpp
|
||||
GSTAT_Sources = $(addprefix utilities/gstat/, $(GSTAT_Files)) $(GSTAT_Other_Sources)
|
||||
GSTAT_Objects = $(addprefix $(OBJ)/, $(addsuffix .o, $(basename $(GSTAT_Sources)))) $(CLUMPLETS_Objects)
|
||||
|
||||
|
||||
FBSVCMGR_Files= fbsvcmgr.cpp
|
||||
FBSVCMGR_Other_Sources = common/classes/fb_string.cpp common/classes/alloc.cpp \
|
||||
common/fb_exception.cpp common/utils.cpp
|
||||
|
||||
FBSVCMGR_Sources = $(addprefix utilities/, $(FBSVCMGR_Files)) $(FBSVCMGR_Other_Sources)
|
||||
FBSVCMGR_Objects = $(addprefix $(OBJ)/, $(addsuffix .o, $(basename $(FBSVCMGR_Sources)))) \
|
||||
$(FBCLASSES_MsgObjects) $(CLUMPLETS_Objects)
|
||||
|
||||
|
||||
FBGUARD_Other_Sources = jrd/isc.cpp jrd/divorce.cpp jrd/os/posix/path_utils.cpp
|
||||
FBGUARD_Files = guard.cpp util.cpp
|
||||
FBGUARD_Sources = $(addprefix utilities/guard/, $(FBGUARD_Files)) $(FBGUARD_Other_Sources)
|
||||
FBGUARD_Objects = $(addprefix $(OBJ)/, $(addsuffix .o, $(basename $(FBGUARD_Sources))))
|
||||
|
||||
|
||||
IBGUARD_A_Files = cntl_guard.cpp iscguard.cpp
|
||||
IBGUARD_A_Sources = $(addprefix iscguard/, $(IBGUARD_A_Files))
|
||||
IBGUARD_A_Objects = $(addprefix $(OBJ)/, $(addsuffix .o, $(basename $(IBGUARD_A_Sources))))
|
||||
@ -92,19 +99,23 @@ IBGUARD_B_Files = os/win32/chop.cpp
|
||||
IBGUARD_B_Sources = $(addprefix remote/, $(IBGUARD_B_Files))
|
||||
IBGUARD_B_Objects = $(addprefix $(OBJ)/, $(addsuffix .o, $(basename $(IBGUARD_B_Sources))))
|
||||
|
||||
|
||||
FBMGR_Other_Sources = jrd/os/posix/path_utils.cpp
|
||||
FBMGR_Files = ibmgr.cpp srvrmgr.cpp
|
||||
FBMGR_Sources = $(addprefix utilities/ibmgr/, $(FBMGR_Files)) $(FBMGR_Other_Sources)
|
||||
FBMGR_Objects = $(addprefix $(OBJ)/, $(addsuffix .o, $(basename $(FBMGR_Sources))))
|
||||
|
||||
|
||||
INSTREG_Files = install_reg.cpp registry.cpp
|
||||
INSTREG_Sources = $(addprefix utilities/install/, $(INSTREG_Files))
|
||||
INSTREG_Objects = $(addprefix $(OBJ)/, $(addsuffix .o, $(basename $(INSTREG_Sources))))
|
||||
|
||||
|
||||
INSTSVC_Files = install_svc.cpp services.cpp
|
||||
INSTSVC_Sources = $(addprefix utilities/install/, $(INSTSVC_Files))
|
||||
INSTSVC_Objects = $(addprefix $(OBJ)/, $(addsuffix .o, $(basename $(INSTSVC_Sources))))
|
||||
|
||||
|
||||
REBUILD_Files = rebuild.cpp rstore.epp rmet.epp
|
||||
REBUILD_Sources = $(addprefix utilities/rebuild/, $(REBUILD_Files))
|
||||
REBUILD_Objects = $(addprefix $(OBJ)/, $(addsuffix .o, $(basename $(REBUILD_Sources))))
|
||||
@ -116,13 +127,13 @@ RELAY_Objects = $(addprefix $(OBJ)/, $(addsuffix .o, $(basename $(RELAY_Sources)
|
||||
|
||||
|
||||
AllObjects = $(CREATEDB_Object) $(DROP_Object) $(GSTAT_Object) $(FBGUARD_Objects) \
|
||||
$(FBMGR_Objects) $(REBUILD_Objects) $(RELAY_Objects) $(GSERV_Objects)
|
||||
$(FBMGR_Objects) $(REBUILD_Objects) $(RELAY_Objects) $(FBSVCMGR_Objects)
|
||||
|
||||
|
||||
Dependencies = $(AllObjects:.o=.d)
|
||||
|
||||
|
||||
.PHONY: all gstat gsec fbguard fbmgr_bin nbackup gds_drop gds_relay create_db fb_lock_print gserv
|
||||
.PHONY: all gstat gsec fbguard fbmgr_bin nbackup gds_drop gds_relay create_db fb_lock_print fbsvcmgr
|
||||
|
||||
all: $(CLIENT_UTIL_TARGETS)
|
||||
|
||||
@ -149,17 +160,18 @@ $(GSTAT): $(GSTAT_Objects) $(CLUMPLETS_Objects) $(COMMON_Objects)
|
||||
$(LD) $(LINK_OPTS) $^ -o $@ -L$(LIB) -lfbclient $(LINK_LIBS) @PTHREAD_CFLAGS@ @PTHREAD_LIBS@
|
||||
|
||||
|
||||
|
||||
gds_drop: $(GDS_DROP)
|
||||
|
||||
$(GDS_DROP): $(DROP_Objects) $(LIBFBCLIENT_SO)
|
||||
$(LD) $(LINK_OPTS) $(DROP_Objects) -o $@ -L$(LIB) -lfbclient $(LINK_LIBS) @PTHREAD_CFLAGS@ @PTHREAD_LIBS@
|
||||
|
||||
gserv: $(LIBFBCLIENT_SO) $(GSERV)
|
||||
|
||||
$(GSERV): $(GSERV_Objects) $(LIBFBCLIENT_SO)
|
||||
fbsvcmgr: $(FBSVCMGR)
|
||||
|
||||
$(FBSVCMGR): $(FBSVCMGR_Objects) $(LIBFBCLIENT_SO)
|
||||
$(LD) $(LINK_OPTS) $^ -o $@ -L$(LIB) $(LINK_LIBS) @PTHREAD_CFLAGS@ @PTHREAD_LIBS@
|
||||
|
||||
|
||||
gds_relay: $(GDS_RELAY)
|
||||
|
||||
$(GDS_RELAY): $(RELAY_Objects) $(LIBFBCLIENT_SO)
|
||||
@ -171,23 +183,27 @@ fbguard: $(LIBFBCLIENT_SO) $(FBGUARD)
|
||||
$(FBGUARD): $(FBGUARD_Objects) $(FBCOMMON_Objects) $(FBCLASSES_Objects)
|
||||
$(LD) $(LINK_OPTS) $^ -o $@ -L$(LIB) -lfbclient $(LIB_GUI) $(LINK_LIBS) @PTHREAD_CFLAGS@ @PTHREAD_LIBS@
|
||||
|
||||
|
||||
ibguard: $(LIBFBCLIENT_SO) $(IBGUARD)
|
||||
|
||||
$(IBGUARD): $(IBGUARD_A_Objects) $(IBGUARD_B_Objects)
|
||||
$(LD) $(LINK_OPTS) $^ -o $@ -L$(LIB) $(FBCLASSES_Objects) $(FBCOMMON_Objects) -lfbclient \
|
||||
$(LIB_GUI) $(LINK_LIBS) @PTHREAD_CFLAGS@ @PTHREAD_LIBS@
|
||||
|
||||
|
||||
fbmgr_bin: $(FBMGR_BIN)
|
||||
|
||||
$(FBMGR_BIN): $(FBMGR_Objects)
|
||||
$(LD) $(LINK_OPTS) $^ -o $@ -L$(LIB) $(FBCLASSES_Objects) $(FBCOMMON_Objects) -lfbclient \
|
||||
$(LINK_LIBS) @PTHREAD_CFLAGS@ @PTHREAD_LIBS@
|
||||
|
||||
|
||||
instreg: $(INSTREG)
|
||||
|
||||
$(INSTREG): $(INSTREG_Objects)
|
||||
$(LD) $(LINK_OPTS) $^ -o $@ -L$(LIB) $(LINK_LIBS)
|
||||
|
||||
|
||||
instsvc: $(INSTSVC)
|
||||
|
||||
$(INSTSVC): $(INSTSVC_Objects)
|
||||
|
@ -53,8 +53,10 @@ LOCKPRINT_Files= print.cpp
|
||||
LOCKPRINT_Sources = $(addprefix lock/, $(LOCKPRINT_Files)) $(LOCKPRINT_Other_Sources)
|
||||
LOCKPRINT_Objects = $(addprefix $(OBJ)/, $(addsuffix .o, $(basename $(LOCKPRINT_Sources))))
|
||||
|
||||
|
||||
NBACKUP_Other_Sources = jrd/db_alias.cpp \
|
||||
common/config/config.cpp common/config/config_file.cpp $(OS_SPECIFIC_Sources)
|
||||
|
||||
NBACKUP_Files= nbackup.cpp
|
||||
NBACKUP_Sources = $(addprefix utilities/, $(NBACKUP_Files)) $(NBACKUP_Other_Sources)
|
||||
NBACKUP_Objects = $(addprefix $(OBJ)/, $(addsuffix .o, $(basename $(NBACKUP_Sources))))
|
||||
@ -72,6 +74,7 @@ DROP_Files= drop.cpp
|
||||
DROP_Sources = $(addprefix utilities/, $(DROP_Files)) $(DROP_Other_Sources)
|
||||
DROP_Objects = $(addprefix $(OBJ)/, $(addsuffix .o, $(basename $(DROP_Sources))))
|
||||
|
||||
|
||||
GSEC_Other_Sources = jrd/enc.cpp jrd/sha.cpp jrd/guid.cpp \
|
||||
jrd/isc_file.cpp common/config/config.cpp common/config/config_file.cpp \
|
||||
common/config/dir_list.cpp $(OS_SPECIFIC_Sources)
|
||||
@ -80,6 +83,7 @@ GSEC_Files = gsec.cpp security.cpp call_service.cpp
|
||||
GSEC_Sources = $(addprefix utilities/gsec/, $(GSEC_Files)) $(GSEC_Other_Sources)
|
||||
GSEC_Objects = $(addprefix $(OBJ)/, $(addsuffix .o, $(basename $(GSEC_Sources))))
|
||||
|
||||
|
||||
GSTAT_Other_Sources = jrd/btn.cpp jrd/db_alias.cpp common/utils.cpp jrd/ods.cpp \
|
||||
common/config/config.cpp common/config/config_file.cpp $(OS_SPECIFIC_Sources)
|
||||
|
||||
@ -88,6 +92,15 @@ GSTAT_Sources = $(addprefix utilities/gstat/, $(GSTAT_Files)) $(GSTAT_Other_Sour
|
||||
GSTAT_Objects = $(addprefix $(OBJ)/, $(addsuffix .o, $(basename $(GSTAT_Sources))))
|
||||
|
||||
|
||||
FBSVCMGR_Files= fbsvcmgr.cpp
|
||||
FBSVCMGR_Other_Sources = common/classes/fb_string.cpp common/classes/alloc.cpp \
|
||||
common/fb_exception.cpp common/utils.cpp
|
||||
|
||||
FBSVCMGR_Sources = $(addprefix utilities/, $(FBSVCMGR_Files)) $(FBSVCMGR_Other_Sources)
|
||||
FBSVCMGR_Objects = $(addprefix $(OBJ)/, $(addsuffix .o, $(basename $(FBSVCMGR_Sources)))) \
|
||||
$(FBCLASSES_MsgObjects) $(CLUMPLETS_Objects)
|
||||
|
||||
|
||||
IBGUARD_Files = guard.cpp util.cpp
|
||||
IBGUARD_Sources = $(addprefix utilities/guard/, $(IBGUARD_Files))
|
||||
IBGUARD_Objects = $(addprefix $(OBJ)/, $(addsuffix .o, $(basename $(IBGUARD_Sources))))
|
||||
@ -111,7 +124,7 @@ ifeq ($(PLATFORM),DARWIN)
|
||||
LINK_LIBS+=$(ICU_LIBS)
|
||||
endif
|
||||
|
||||
AllObjects = $(CREATEDB_Object) $(DROP_Object) \
|
||||
AllObjects = $(CREATEDB_Object) $(DROP_Object) $(FBSVCMGR_Objects) \
|
||||
$(GSEC_Objects) $(GSTAT_Object) $(IBGUARD_Objects) \
|
||||
$(IBMGR_Objects) $(REBUILD_Objects) $(RELAY_Objects) $(CLUMPLETS_Objects)
|
||||
|
||||
@ -122,7 +135,7 @@ AllObjects = $(CREATEDB_Objects) $(DROP_Objects) \
|
||||
Dependencies = $(AllObjects:.o=.d)
|
||||
|
||||
|
||||
.PHONY: create_db gstat gds_drop gds_relay gsec ibguard ibmgr_bin nbackup fb_lock_print
|
||||
.PHONY: create_db gstat gds_drop gds_relay gsec ibguard ibmgr_bin nbackup fb_lock_print fbsvcmgr
|
||||
|
||||
all: $(EMBED_UTIL_TARGETS)
|
||||
|
||||
@ -137,11 +150,13 @@ create_db: $(CREATE_DB)
|
||||
$(CREATE_DB): $(CREATEDB_Objects) $(LIBFBSTATIC_A) $(COMMON_Objects)
|
||||
$(LD) $(LINK_OPTS) $(CREATEDB_Objects) $(COMMON_Objects) -o $@ -L$(LIB) -lfbstatic $(LINK_LIBS) $(ICU_LIBS)
|
||||
|
||||
|
||||
nbackup: $(LIBFBEMBED_SO) $(NBACKUP)
|
||||
|
||||
$(NBACKUP): $(NBACKUP_Objects) $(CLUMPLETS_Objects) $(COMMON_Objects)
|
||||
$(LD) $(LINK_OPTS) $^ -o $@ $(FBEMBED_LINK) $(LINK_LIBS)
|
||||
|
||||
|
||||
fb_lock_print: $(LIBFBEMBED_SO) $(LOCKPRINT)
|
||||
|
||||
$(LOCKPRINT): $(LOCKPRINT_Objects) $(COMMON_Objects)
|
||||
@ -154,13 +169,18 @@ $(GSTAT): $(GSTAT_Objects) $(CLUMPLETS_Objects) $(COMMON_Objects)
|
||||
$(LD) $(LINK_OPTS) $^ -o $@ $(FBEMBED_LINK) $(LINK_LIBS)
|
||||
|
||||
|
||||
|
||||
gds_drop: $(GDS_DROP)
|
||||
|
||||
$(GDS_DROP): $(DROP_Objects) $(FBCOMMON_Objects) $(FBCLASSES_Objects)
|
||||
$(LD) $(LINK_OPTS) $^ -o $@ $(FBEMBED_LINK) $(LINK_LIBS)
|
||||
|
||||
|
||||
fbsvcmgr: $(FBSVCMGR)
|
||||
|
||||
$(FBSVCMGR): $(FBSVCMGR_Objects) $(LIBFBEMBED_SO)
|
||||
$(LD) $(LINK_OPTS) $^ -o $@ $(FBEMBED_LINK) $(LINK_LIBS)
|
||||
|
||||
|
||||
gds_relay: $(GDS_RELAY)
|
||||
|
||||
$(GDS_RELAY): $(RELAY_Objects) $(LIBFBEMBED_SO)
|
||||
@ -172,11 +192,13 @@ gsec: $(GSEC)
|
||||
$(GSEC): $(GSEC_Objects) $(CLUMPLETS_Objects) $(COMMON_Objects)
|
||||
$(LD) $(LINK_OPTS) $^ -o $@ $(FBEMBED_LINK) $(LINK_LIBS)
|
||||
|
||||
|
||||
ibguard: $(IBGUARD)
|
||||
|
||||
$(IBGUARD): $(IBGUARD_Objects) $(LIBFBEMBED_SO)
|
||||
$(LD) $(LINK_OPTS) $(IBGUARD_Objects) -o $@ $(FBEMBED_LINK) $(LINK_LIBS)
|
||||
|
||||
|
||||
ibmgr_bin: $(IBMGR_BIN)
|
||||
|
||||
$(IBMGR_BIN): $(IBMGR_Objects) $(LIBFBEMBED_SO)
|
||||
|
@ -260,7 +260,7 @@ FB_CLASSIC_SERVER = $(BIN)/fb_inet_server$(EXEC_EXT)
|
||||
# From utilities
|
||||
CREATE_DB = $(BIN)/create_db$(EXEC_EXT)
|
||||
GDS_DROP = $(BIN)/gds_drop$(EXEC_EXT)
|
||||
GSERV = $(BIN)/gserv$(EXEC_EXT)
|
||||
FBSVCMGR = $(BIN)/fbsvcmgr$(EXEC_EXT)
|
||||
GSTAT = $(BIN)/gstat$(EXEC_EXT)
|
||||
NBACKUP = $(BIN)/nbackup$(EXEC_EXT)
|
||||
LOCKPRINT = $(BIN)/fb_lock_print$(EXEC_EXT)
|
||||
|
@ -31,7 +31,7 @@ DEV_FLAGS=-DUSE_VALGRIND -p $(COMMON_FLAGS) $(WARN_FLAGS)
|
||||
|
||||
OS_ServerFiles=inet_server.cpp
|
||||
|
||||
EMBED_UTIL_TARGETS=gstat gds_drop gsec nbackup fb_lock_print
|
||||
CLIENT_UTIL_TARGETS=gds_drop gstat gsec fbguard fbmgr_bin nbackup fb_lock_print
|
||||
EMBED_UTIL_TARGETS=gstat gds_drop gsec nbackup fb_lock_print fbsvcmgr
|
||||
CLIENT_UTIL_TARGETS=gds_drop gstat gsec fbguard fbmgr_bin nbackup fb_lock_print fbsvcmgr
|
||||
|
||||
Physical_IO_Module=os/posix/unix.cpp
|
||||
|
@ -28,7 +28,7 @@ DEV_FLAGS=$(COMMON_FLAGS) $(WARN_FLAGS)
|
||||
|
||||
OS_ServerFiles=inet_server.cpp
|
||||
|
||||
EMBED_UTIL_TARGETS=gstat gds_drop gsec nbackup fb_lock_print
|
||||
CLIENT_UTIL_TARGETS=gds_drop gstat gsec fbguard fbmgr_bin nbackup fb_lock_print
|
||||
EMBED_UTIL_TARGETS=gstat gds_drop gsec nbackup fb_lock_print fbsvcmgr
|
||||
CLIENT_UTIL_TARGETS=gds_drop gstat gsec fbguard fbmgr_bin nbackup fb_lock_print fbsvcmgr
|
||||
|
||||
Physical_IO_Module=os/posix/unix.cpp
|
||||
|
@ -26,7 +26,7 @@ CXXFLAGS:= $(CXXFLAGS) -fno-rtti
|
||||
|
||||
OS_ServerFiles=inet_server.cpp
|
||||
|
||||
EMBED_UTIL_TARGETS=gstat gds_drop gsec nbackup fb_lock_print
|
||||
CLIENT_UTIL_TARGETS=gds_drop gstat gsec fbguard fbmgr_bin nbackup fb_lock_print
|
||||
EMBED_UTIL_TARGETS=gstat gds_drop gsec nbackup fb_lock_print fbsvcmgr
|
||||
CLIENT_UTIL_TARGETS=gds_drop gstat gsec fbguard fbmgr_bin nbackup fb_lock_print fbsvcmgr
|
||||
|
||||
Physical_IO_Module=os/posix/unix.cpp
|
||||
|
@ -15,7 +15,7 @@
|
||||
# All Rights Reserved.
|
||||
# Contributor(s): ______________________________________.
|
||||
# Start of file prefix.linux: $(VERSION) $(PLATFORM)
|
||||
#$Id: prefix.linux_mipsel,v 1.3 2007-04-01 10:34:25 alexpeshkoff Exp $
|
||||
#$Id: prefix.linux_mipsel,v 1.4 2007-05-03 11:24:50 alexpeshkoff Exp $
|
||||
# 2 Oct 2002, Nickolay Samofatov - Major cleanup
|
||||
|
||||
LD=@CXX@
|
||||
@ -30,7 +30,7 @@ OS_ServerFiles=inet_server.cpp
|
||||
LIB_LINK_OPTIONS:=-shared
|
||||
LIB_LINK_RPATH:=-Wl,-rpath,
|
||||
LIB_LINK_SONAME:=-Wl,-soname,
|
||||
EMBED_UTIL_TARGETS=gstat gds_drop gsec fb_lock_print nbackup
|
||||
CLIENT_UTIL_TARGETS=gds_drop gstat gsec fbguard fbmgr_bin fb_lock_print nbackup
|
||||
EMBED_UTIL_TARGETS=gstat gds_drop gsec fb_lock_print nbackup fbsvcmgr
|
||||
CLIENT_UTIL_TARGETS=gds_drop gstat gsec fbguard fbmgr_bin fb_lock_print nbackup fbsvcmgr
|
||||
|
||||
Physical_IO_Module=unix.cpp
|
||||
|
@ -24,7 +24,7 @@ DEV_FLAGS=-ggdb -O0 -DVIO_DEBUG -DLINUX -pipe -MMD -p -fPIC -Wall -Wno-switch -W
|
||||
|
||||
OS_ServerFiles=inet_server.cpp
|
||||
|
||||
EMBED_UTIL_TARGETS=gstat gds_drop gsec nbackup fb_lock_print
|
||||
CLIENT_UTIL_TARGETS=gds_drop gstat gsec fbguard fbmgr_bin nbackup fb_lock_print
|
||||
EMBED_UTIL_TARGETS=gstat gds_drop gsec nbackup fb_lock_print fbsvcmgr
|
||||
CLIENT_UTIL_TARGETS=gds_drop gstat gsec fbguard fbmgr_bin nbackup fb_lock_print fbsvcmgr
|
||||
|
||||
Physical_IO_Module=os/posix/unix.cpp
|
||||
|
@ -25,7 +25,7 @@ CXXFLAGS:= $(CXXFLAGS) -fno-rtti
|
||||
|
||||
OS_ServerFiles=inet_server.cpp
|
||||
|
||||
EMBED_UTIL_TARGETS=gstat gds_drop gsec nbackup fb_lock_print
|
||||
CLIENT_UTIL_TARGETS=gds_drop gstat gsec fbguard fbmgr_bin nbackup fb_lock_print
|
||||
EMBED_UTIL_TARGETS=gstat gds_drop gsec nbackup fb_lock_print fbsvcmgr
|
||||
CLIENT_UTIL_TARGETS=gds_drop gstat gsec fbguard fbmgr_bin nbackup fb_lock_print fbsvcmgr
|
||||
|
||||
Physical_IO_Module=os/posix/unix.cpp
|
||||
|
@ -1684,3 +1684,15 @@ C --
|
||||
PARAMETER (GDS__gstat_read_err = 336920606)
|
||||
INTEGER*4 GDS__gstat_sysmemex
|
||||
PARAMETER (GDS__gstat_sysmemex = 336920607)
|
||||
INTEGER*4 GDS__fbsvcmgr_bad_am
|
||||
PARAMETER (GDS__fbsvcmgr_bad_am = 336986113)
|
||||
INTEGER*4 GDS__fbsvcmgr_bad_wm
|
||||
PARAMETER (GDS__fbsvcmgr_bad_wm = 336986114)
|
||||
INTEGER*4 GDS__fbsvcmgr_bad_rs
|
||||
PARAMETER (GDS__fbsvcmgr_bad_rs = 336986115)
|
||||
INTEGER*4 GDS__fbsvcmgr_info_err
|
||||
PARAMETER (GDS__fbsvcmgr_info_err = 336986116)
|
||||
INTEGER*4 GDS__fbsvcmgr_query_err
|
||||
PARAMETER (GDS__fbsvcmgr_query_err = 336986117)
|
||||
INTEGER*4 GDS__fbsvcmgr_switch_unknown
|
||||
PARAMETER (GDS__fbsvcmgr_switch_unknown = 336986118)
|
||||
|
@ -849,3 +849,9 @@ const
|
||||
gds_gstat_open_err = 336920605;
|
||||
gds_gstat_read_err = 336920606;
|
||||
gds_gstat_sysmemex = 336920607;
|
||||
gds_fbsvcmgr_bad_am = 336986113;
|
||||
gds_fbsvcmgr_bad_wm = 336986114;
|
||||
gds_fbsvcmgr_bad_rs = 336986115;
|
||||
gds_fbsvcmgr_info_err = 336986116;
|
||||
gds_fbsvcmgr_query_err = 336986117;
|
||||
gds_fbsvcmgr_switch_unknown = 336986118;
|
||||
|
@ -838,5 +838,11 @@ static const struct {
|
||||
{"gstat_open_err", 336920605},
|
||||
{"gstat_read_err", 336920606},
|
||||
{"gstat_sysmemex", 336920607},
|
||||
{"fbsvcmgr_bad_am", 336986113},
|
||||
{"fbsvcmgr_bad_wm", 336986114},
|
||||
{"fbsvcmgr_bad_rs", 336986115},
|
||||
{"fbsvcmgr_info_err", 336986116},
|
||||
{"fbsvcmgr_query_err", 336986117},
|
||||
{"fbsvcmgr_switch_unknown", 336986118},
|
||||
{NULL, 0}
|
||||
};
|
||||
|
@ -871,7 +871,13 @@ const ISC_LONG isc_gstat_unexpected_eof = 336920580L;
|
||||
const ISC_LONG isc_gstat_open_err = 336920605L;
|
||||
const ISC_LONG isc_gstat_read_err = 336920606L;
|
||||
const ISC_LONG isc_gstat_sysmemex = 336920607L;
|
||||
const ISC_LONG isc_err_max = 816;
|
||||
const ISC_LONG isc_fbsvcmgr_bad_am = 336986113L;
|
||||
const ISC_LONG isc_fbsvcmgr_bad_wm = 336986114L;
|
||||
const ISC_LONG isc_fbsvcmgr_bad_rs = 336986115L;
|
||||
const ISC_LONG isc_fbsvcmgr_info_err = 336986116L;
|
||||
const ISC_LONG isc_fbsvcmgr_query_err = 336986117L;
|
||||
const ISC_LONG isc_fbsvcmgr_switch_unknown = 336986118L;
|
||||
const ISC_LONG isc_err_max = 822;
|
||||
|
||||
#else /* c definitions */
|
||||
|
||||
@ -1712,7 +1718,13 @@ const ISC_LONG isc_err_max = 816;
|
||||
#define isc_gstat_open_err 336920605L
|
||||
#define isc_gstat_read_err 336920606L
|
||||
#define isc_gstat_sysmemex 336920607L
|
||||
#define isc_err_max 816
|
||||
#define isc_fbsvcmgr_bad_am 336986113L
|
||||
#define isc_fbsvcmgr_bad_wm 336986114L
|
||||
#define isc_fbsvcmgr_bad_rs 336986115L
|
||||
#define isc_fbsvcmgr_info_err 336986116L
|
||||
#define isc_fbsvcmgr_query_err 336986117L
|
||||
#define isc_fbsvcmgr_switch_unknown 336986118L
|
||||
#define isc_err_max 822
|
||||
|
||||
#endif
|
||||
|
||||
|
@ -44,6 +44,7 @@ static const struct _facilities facilities[] = {
|
||||
{18, "GSEC "},
|
||||
{19, "LICENSE "},
|
||||
{21, "GSTAT "},
|
||||
{22, "FBSVCMGR "},
|
||||
{0, NULL}
|
||||
};
|
||||
|
||||
|
@ -838,5 +838,11 @@ static const struct {
|
||||
{336920605, "Can't open database file @1"}, /* 814, gstat_open_err */
|
||||
{336920606, "Can't read a database page"}, /* 815, gstat_read_err */
|
||||
{336920607, "System memory exhausted"}, /* 816, gstat_sysmemex */
|
||||
{336986113, "Wrong value for access mode"}, /* 817, fbsvcmgr_bad_am */
|
||||
{336986114, "Wrong value for write mode"}, /* 818, fbsvcmgr_bad_wm */
|
||||
{336986115, "Wrong value for reserve space"}, /* 819, fbsvcmgr_bad_rs */
|
||||
{336986116, "Unknown tag (@1) in info_svr_db_info block after isc_svc_query()"}, /* 820, fbsvcmgr_info_err */
|
||||
{336986117, "Unknown tag (@1) in isc_svc_query() results"}, /* 821, fbsvcmgr_query_err */
|
||||
{336986118, "Unknown switch \"@1\""}, /* 822, fbsvcmgr_switch_unknown */
|
||||
{0, NULL}
|
||||
};
|
||||
|
@ -835,4 +835,10 @@ static SLONG user_codes[] = {
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
};
|
||||
|
@ -837,5 +837,11 @@ static const struct {
|
||||
{336920605, -901}, /* 29 gstat_open_err */
|
||||
{336920606, -901}, /* 30 gstat_read_err */
|
||||
{336920607, -901}, /* 31 gstat_sysmemex */
|
||||
{336986113, -901}, /* 1 fbsvcmgr_bad_am */
|
||||
{336986114, -901}, /* 2 fbsvcmgr_bad_wm */
|
||||
{336986115, -901}, /* 3 fbsvcmgr_bad_rs */
|
||||
{336986116, -901}, /* 4 fbsvcmgr_info_err */
|
||||
{336986117, -901}, /* 5 fbsvcmgr_query_err */
|
||||
{336986118, -901}, /* 6 fbsvcmgr_switch_unknown */
|
||||
{0, 0}
|
||||
};
|
||||
|
@ -29,6 +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, 34)
|
||||
stop
|
||||
|
||||
COMMIT WORK;
|
||||
|
@ -3168,6 +3168,40 @@ Analyzing database pages ...', NULL, NULL);
|
||||
-- Do not change the arguments of the previous GSTAT messages.
|
||||
-- Write the new GSTAT messages here.
|
||||
('', '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);
|
||||
('', 'printInfo', 'gserv.cpp', NULL, 22, 7, NULL, 'Service Manager Version', NULL, NULL);
|
||||
('', 'printInfo', 'gserv.cpp', NULL, 22, 8, NULL, 'Server version', NULL, NULL);
|
||||
('', 'printInfo', 'gserv.cpp', NULL, 22, 9, NULL, 'Server implementation', NULL, NULL);
|
||||
('', 'printInfo', 'gserv.cpp', NULL, 22, 10, NULL, 'Path to firebird.msg', NULL, NULL);
|
||||
('', 'printInfo', 'gserv.cpp', NULL, 22, 11, NULL, 'Server root', NULL, NULL);
|
||||
('', 'printInfo', 'gserv.cpp', NULL, 22, 12, NULL, 'Path to lock files', NULL, NULL);
|
||||
('', 'printInfo', 'gserv.cpp', NULL, 22, 13, NULL, 'Security database', NULL, NULL);
|
||||
('', 'printInfo', 'gserv.cpp', NULL, 22, 14, NULL, 'Databases', NULL, NULL);
|
||||
('', 'printInfo', 'gserv.cpp', NULL, 22, 15, NULL, ' Database in use', NULL, NULL);
|
||||
('', 'printInfo', 'gserv.cpp', NULL, 22, 16, NULL, ' Number of attachments', NULL, NULL);
|
||||
('', 'printInfo', 'gserv.cpp', NULL, 22, 17, NULL, ' Number of databases', NULL, NULL);
|
||||
('', 'printInfo', 'gserv.cpp', NULL, 22, 18, NULL, 'Information truncated', NULL, NULL);
|
||||
('', 'usage', 'gserv.cpp', NULL, 22, 19, NULL, 'Usage: fbsvcmgr manager-name switches...', NULL, NULL);
|
||||
('', 'usage', 'gserv.cpp', NULL, 22, 20, NULL, 'Manager-name should be service_mgr, may be prefixed with host name', NULL, NULL);
|
||||
('', 'usage', 'gserv.cpp', NULL, 22, 21, NULL, 'according to common rules (host:service_mgr, \\host\service_mgr).', NULL, NULL);
|
||||
('', 'usage', 'gserv.cpp', NULL, 22, 22, NULL, 'Switches exactly match SPB tags, used in abbreviated form.', 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);
|
||||
('', 'usage', 'gserv.cpp', NULL, 22, 24, NULL, 'For example: isc_action_svc_backup is specified as action_backup,', NULL, NULL);
|
||||
('', 'usage', 'gserv.cpp', NULL, 22, 25, NULL, ' isc_spb_dbname => dbname,', NULL, NULL);
|
||||
('', 'usage', 'gserv.cpp', NULL, 22, 26, NULL, ' isc_info_svc_implementation => info_implementation,', NULL, NULL);
|
||||
('', 'usage', 'gserv.cpp', NULL, 22, 27, NULL, ' isc_spb_prp_db_online => prp_db_online and so on.', NULL, NULL);
|
||||
('', 'usage', 'gserv.cpp', NULL, 22, 28, NULL, 'You may specify single action or multiple info items when calling fbsvcmgr once.', NULL, NULL);
|
||||
('', 'usage', 'gserv.cpp', NULL, 22, 29, NULL, 'Full command line samples:', 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);
|
||||
('', 'usage', 'gserv.cpp', NULL, 22, 31, NULL, ' (will list header info in database employee on local machine)', 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);
|
||||
('', 'usage', 'gserv.cpp', NULL, 22, 33, NULL, ' (will show firebird version and databases usage on yourserver)', NULL, NULL);
|
||||
stop
|
||||
|
||||
COMMIT WORK;
|
||||
|
@ -826,6 +826,13 @@ COMMIT WORK;
|
||||
(-901, NULL, NULL, 21, 29, NULL, 'gstat_open_err', NULL, NULL)
|
||||
(-901, NULL, NULL, 21, 30, NULL, 'gstat_read_err', NULL, NULL)
|
||||
(-901, NULL, NULL, 21, 31, NULL, 'gstat_sysmemex', NULL, NULL)
|
||||
-- FBSVCMGR
|
||||
(-901, NULL, NULL, 22, 1, NULL, 'fbsvcmgr_bad_am', NULL, NULL)
|
||||
(-901, NULL, NULL, 22, 2, NULL, 'fbsvcmgr_bad_wm', NULL, NULL)
|
||||
(-901, NULL, NULL, 22, 3, NULL, 'fbsvcmgr_bad_rs', NULL, NULL)
|
||||
(-901, NULL, NULL, 22, 4, NULL, 'fbsvcmgr_info_err', NULL, NULL)
|
||||
(-901, NULL, NULL, 22, 5, NULL, 'fbsvcmgr_query_err', NULL, NULL)
|
||||
(-901, NULL, NULL, 22, 6, NULL, 'fbsvcmgr_switch_unknown', NULL, NULL)
|
||||
--
|
||||
stop
|
||||
|
||||
|
@ -34,9 +34,33 @@
|
||||
#include "../jrd/ibase.h"
|
||||
#include "../common/classes/ClumpletWriter.h"
|
||||
#include "../common/utils_proto.h"
|
||||
#include "../common/classes/MsgPrint.h"
|
||||
|
||||
// Here we define main control structure
|
||||
|
||||
typedef bool PopulateFunction(char**&, Firebird::ClumpletWriter&, unsigned int);
|
||||
|
||||
struct Switches
|
||||
{
|
||||
const char* name;
|
||||
PopulateFunction* populate;
|
||||
const Switches* options;
|
||||
unsigned int tag;
|
||||
unsigned char tagInf;
|
||||
};
|
||||
|
||||
// Get message from security database
|
||||
|
||||
Firebird::string getMessage(int n)
|
||||
{
|
||||
char buffer[256];
|
||||
const int FACILITY = 22;
|
||||
|
||||
fb_msg_format(0, FACILITY, n, sizeof(buffer), buffer, MsgFormat::SafeArg());
|
||||
|
||||
return Firebird::string(buffer);
|
||||
}
|
||||
|
||||
Firebird::string prepareSwitch(const char* arg)
|
||||
{
|
||||
Firebird::string s(arg);
|
||||
@ -49,6 +73,8 @@ Firebird::string prepareSwitch(const char* arg)
|
||||
return s;
|
||||
}
|
||||
|
||||
// add string tag to spb
|
||||
|
||||
bool putStringArgument(char**& av, Firebird::ClumpletWriter& spb, unsigned int tag)
|
||||
{
|
||||
if (! *av)
|
||||
@ -61,63 +87,63 @@ bool putStringArgument(char**& av, Firebird::ClumpletWriter& spb, unsigned int t
|
||||
return true;
|
||||
}
|
||||
|
||||
bool putAccessMode(char**& av, Firebird::ClumpletWriter& spb, unsigned int tag)
|
||||
// add some special format tags to spb
|
||||
|
||||
bool putSpecTag(char**& av, Firebird::ClumpletWriter& spb, unsigned int tag,
|
||||
const Switches* sw, ISC_STATUS errorCode)
|
||||
{
|
||||
if (! *av)
|
||||
return false;
|
||||
|
||||
Firebird::string s(prepareSwitch(*av++));
|
||||
if (s == "prp_am_readonly")
|
||||
spb.insertByte(tag, isc_spb_prp_am_readonly);
|
||||
else if (s == "prp_am_readwrite")
|
||||
spb.insertByte(tag, isc_spb_prp_am_readwrite);
|
||||
else
|
||||
for (; sw->name; ++sw)
|
||||
{
|
||||
Firebird::status_exception::raise(isc_random, isc_arg_string,
|
||||
"Wrong value for access mode", 0);
|
||||
if (s == sw->name)
|
||||
{
|
||||
spb.insertByte(tag, sw->tag);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
Firebird::status_exception::raise(errorCode, 0);
|
||||
return false; // compiler warning silencer
|
||||
}
|
||||
|
||||
const Switches amSwitch[] = {
|
||||
{"prp_am_readonly", 0, 0, isc_spb_prp_am_readonly, 0},
|
||||
{"prp_am_readwrite", 0, 0, isc_spb_prp_am_readwrite, 0},
|
||||
{0, 0, 0, 0, 0}
|
||||
};
|
||||
|
||||
bool putAccessMode(char**& av, Firebird::ClumpletWriter& spb, unsigned int tag)
|
||||
{
|
||||
return putSpecTag(av, spb, tag, amSwitch, isc_fbsvcmgr_bad_am);
|
||||
}
|
||||
|
||||
const Switches wmSwitch[] = {
|
||||
{"prp_wm_async", 0, 0, isc_spb_prp_wm_async, 0},
|
||||
{"prp_wm_sync", 0, 0, isc_spb_prp_wm_sync, 0},
|
||||
{0, 0, 0, 0, 0}
|
||||
};
|
||||
|
||||
bool putWriteMode(char**& av, Firebird::ClumpletWriter& spb, unsigned int tag)
|
||||
{
|
||||
if (! *av)
|
||||
return false;
|
||||
|
||||
Firebird::string s(prepareSwitch(*av++));
|
||||
if (s == "prp_wm_async")
|
||||
spb.insertByte(tag, isc_spb_prp_wm_async);
|
||||
else if (s == "prp_wm_sync")
|
||||
spb.insertByte(tag, isc_spb_prp_wm_sync);
|
||||
else
|
||||
{
|
||||
Firebird::status_exception::raise(isc_random, isc_arg_string,
|
||||
"Wrong value for write mode", 0);
|
||||
}
|
||||
|
||||
return true;
|
||||
return putSpecTag(av, spb, tag, wmSwitch, isc_fbsvcmgr_bad_wm);
|
||||
}
|
||||
|
||||
const Switches rsSwitch[] = {
|
||||
{"prp_res_use_full", 0, 0, isc_spb_prp_res_use_full, 0},
|
||||
{"prp_res", 0, 0, isc_spb_prp_res, 0},
|
||||
{0, 0, 0, 0, 0}
|
||||
};
|
||||
|
||||
bool putReserveSpace(char**& av, Firebird::ClumpletWriter& spb, unsigned int tag)
|
||||
{
|
||||
if (! *av)
|
||||
return false;
|
||||
|
||||
Firebird::string s(prepareSwitch(*av++));
|
||||
if (s == "prp_res_use_full")
|
||||
spb.insertByte(tag, isc_spb_prp_res_use_full);
|
||||
else if (s == "prp_res")
|
||||
spb.insertByte(tag, isc_spb_prp_res);
|
||||
else
|
||||
{
|
||||
Firebird::status_exception::raise(isc_random, isc_arg_string,
|
||||
"Wrong value for reserve space", 0);
|
||||
}
|
||||
|
||||
return true;
|
||||
return putSpecTag(av, spb, tag, rsSwitch, isc_fbsvcmgr_bad_rs);
|
||||
}
|
||||
|
||||
// add numeric (int32) tag to spb
|
||||
|
||||
bool putNumericArgument(char**& av, Firebird::ClumpletWriter& spb, unsigned int tag)
|
||||
{
|
||||
if (! *av)
|
||||
@ -129,6 +155,8 @@ bool putNumericArgument(char**& av, Firebird::ClumpletWriter& spb, unsigned int
|
||||
return true;
|
||||
}
|
||||
|
||||
// add boolean option to spb
|
||||
|
||||
bool putOption(char**&, Firebird::ClumpletWriter& spb, unsigned int tag)
|
||||
{
|
||||
spb.insertInt(isc_spb_options, tag);
|
||||
@ -136,6 +164,8 @@ bool putOption(char**&, Firebird::ClumpletWriter& spb, unsigned int tag)
|
||||
return true;
|
||||
}
|
||||
|
||||
// add argument-less tag to spb
|
||||
|
||||
bool putSingleTag(char**&, Firebird::ClumpletWriter& spb, unsigned int tag)
|
||||
{
|
||||
spb.insertTag(tag);
|
||||
@ -143,14 +173,8 @@ bool putSingleTag(char**&, Firebird::ClumpletWriter& spb, unsigned int tag)
|
||||
return true;
|
||||
}
|
||||
|
||||
struct Switches
|
||||
{
|
||||
const char* name;
|
||||
PopulateFunction* populate;
|
||||
const Switches* options;
|
||||
unsigned int tag;
|
||||
unsigned char tagInf;
|
||||
};
|
||||
// populate spb with tags according to user-defined command line switches
|
||||
// and programmer-defined set of Switches array
|
||||
|
||||
bool populateSpbFromSwitches(char**& av,
|
||||
Firebird::ClumpletWriter& spb,
|
||||
@ -162,7 +186,7 @@ bool populateSpbFromSwitches(char**& av,
|
||||
|
||||
Firebird::string s(prepareSwitch(*av));
|
||||
|
||||
while (sw->name)
|
||||
for (; sw->name; ++sw)
|
||||
{
|
||||
if (s == sw->name)
|
||||
{
|
||||
@ -183,7 +207,6 @@ bool populateSpbFromSwitches(char**& av,
|
||||
}
|
||||
return false;
|
||||
}
|
||||
++sw;
|
||||
}
|
||||
|
||||
return false;
|
||||
@ -302,6 +325,7 @@ const Switches addmodOptions[] = {
|
||||
{"sec_groupid", putNumericArgument, 0, isc_spb_sec_groupid, 0},
|
||||
{0, 0, 0, 0, 0}
|
||||
};
|
||||
|
||||
const Switches actionSwitch[] = {
|
||||
{"action_backup", putSingleTag, backupOptions, isc_action_svc_backup, isc_info_svc_line},
|
||||
{"action_restore", putSingleTag, restoreOptions, isc_action_svc_restore, isc_info_svc_line},
|
||||
@ -316,6 +340,8 @@ const Switches actionSwitch[] = {
|
||||
{0, 0, 0, 0, 0}
|
||||
};
|
||||
|
||||
// print information, returned by isc_svc_query() call
|
||||
|
||||
bool getLine(Firebird::string& dest, const char*& p)
|
||||
{
|
||||
unsigned short length = (unsigned short)
|
||||
@ -342,18 +368,18 @@ bool printLine(const char*& p)
|
||||
return rc;
|
||||
}
|
||||
|
||||
void printString(const char*& p, const char* text)
|
||||
void printString(const char*& p, int num)
|
||||
{
|
||||
printf ("%s: ", text);
|
||||
printf ("%s: ", getMessage(num).c_str());
|
||||
if (!printLine(p))
|
||||
{
|
||||
printf ("<no data>\n");
|
||||
}
|
||||
}
|
||||
|
||||
void printNumeric(const char*& p, const char* text)
|
||||
void printNumeric(const char*& p, int num)
|
||||
{
|
||||
printf ("%s: %d\n", text, getNumeric(p));
|
||||
printf ("%s: %d\n", getMessage(num).c_str(), getNumeric(p));
|
||||
}
|
||||
|
||||
class UserPrint
|
||||
@ -403,46 +429,46 @@ bool printInfo(const char* p, UserPrint& up)
|
||||
switch (*p++)
|
||||
{
|
||||
case isc_info_svc_version:
|
||||
printNumeric(p, "Service Manager Version");
|
||||
printNumeric(p, 7);
|
||||
break;
|
||||
case isc_info_svc_server_version:
|
||||
printString(p, "Server version");
|
||||
printString(p, 8);
|
||||
break;
|
||||
case isc_info_svc_implementation:
|
||||
printString(p, "Server implementation");
|
||||
printString(p, 9);
|
||||
break;
|
||||
case isc_info_svc_get_env_msg:
|
||||
printString(p, "Path to firebird.msg");
|
||||
printString(p, 10);
|
||||
break;
|
||||
case isc_info_svc_get_env:
|
||||
printString(p, "Server root");
|
||||
printString(p, 11);
|
||||
break;
|
||||
case isc_info_svc_get_env_lock:
|
||||
printString(p, "Path to lock files");
|
||||
printString(p, 12);
|
||||
break;
|
||||
case isc_info_svc_user_dbpath:
|
||||
printString(p, "Security database");
|
||||
printString(p, 13);
|
||||
break;
|
||||
|
||||
case isc_info_svc_svr_db_info:
|
||||
printf ("Databases:\n");
|
||||
do {
|
||||
printf ("%s:\n", getMessage(14).c_str());
|
||||
while (*p != isc_info_flag_end) {
|
||||
switch (*p++)
|
||||
{
|
||||
case isc_spb_dbname:
|
||||
printString(p, " Database in use");
|
||||
printString(p, 15);
|
||||
break;
|
||||
case isc_spb_num_att:
|
||||
printNumeric(p, " Number of attachments");
|
||||
printNumeric(p, 16);
|
||||
break;
|
||||
case isc_spb_num_db:
|
||||
printNumeric(p, " Number of databases");
|
||||
printNumeric(p, 17);
|
||||
break;
|
||||
default:
|
||||
printf("Unknown code (%d) in info_svr_db_info\n", p[-1]);
|
||||
return false;
|
||||
Firebird::status_exception::raise(isc_fbsvcmgr_info_err, isc_arg_number,
|
||||
static_cast<unsigned char>(p[-1]), 0);
|
||||
}
|
||||
} while (*p != isc_info_flag_end);
|
||||
}
|
||||
p++;
|
||||
break;
|
||||
|
||||
@ -473,20 +499,38 @@ bool printInfo(const char* p, UserPrint& up)
|
||||
return printLine(p);
|
||||
|
||||
case isc_info_truncated:
|
||||
printf ("Truncated\n");
|
||||
printf ("%s\n", getMessage(18).c_str());
|
||||
return false;
|
||||
|
||||
default:
|
||||
printf("Unknown tag in isc_svc_query() results (%d)\n", p[-1]);
|
||||
return false;
|
||||
Firebird::status_exception::raise(isc_fbsvcmgr_query_err, isc_arg_number,
|
||||
static_cast<unsigned char>(p[-1]), 0);
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
// short usage from firebird.msg
|
||||
|
||||
void usage()
|
||||
{
|
||||
for (int i=19; i<=33; ++i)
|
||||
{
|
||||
printf("%s\n", getMessage(i).c_str());
|
||||
}
|
||||
}
|
||||
|
||||
// simple main function
|
||||
|
||||
int main(int ac, char **av)
|
||||
{
|
||||
if (ac < 2)
|
||||
{
|
||||
usage();
|
||||
return 1;
|
||||
}
|
||||
|
||||
ISC_STATUS_ARRAY status;
|
||||
|
||||
try {
|
||||
@ -517,8 +561,7 @@ int main(int ac, char **av)
|
||||
//Here we are over with av parse, look - may be unknown switch left
|
||||
if (*av)
|
||||
{
|
||||
printf("Unknown switch '%s'\n", *av);
|
||||
return 1;
|
||||
Firebird::status_exception::raise(isc_fbsvcmgr_switch_unknown, isc_arg_string, *av, 0);
|
||||
}
|
||||
|
||||
isc_svc_handle svc_handle = 0;
|
Loading…
Reference in New Issue
Block a user