****************************************************************************** * * System Admin Transaction Logging - Enable Logging * * Module %M% Version %I% Date %H% * * (c) Copyright 1998 Ardent Software Inc. - All Rights Reserved * This is unpublished proprietary source code of Ardent Software Inc. * The copyright notice above does not evidence any actual or intended * publication of such source code. * ******************************************************************************* * * Maintenence log - insert most recent change descriptions at top * * Date.... GTAR# WHO Description........................................ * 10/14/98 23801 SAP Change copyrights. * 10/01/96 19347 LA Check if logging is already enabled or coming up. * 06/07/96 18585 EAP Added $OPTIONS INFORMATION so that * @SYSTEM.RETURN.CODE is set by EXECUTE * 03/25/96 18212 LAG Windows NT port * 05/24/95 16198 GMH Change how uniVerse home dir is obtained * 01/23/95 15836 CSM option to terminate prepared stale tx at startup * 10/14/94 15104 DTM Fixed to verify number of prompts * 10/14/94 15101 DTM Corrected message displayed * 07/12/94 13286 DTM Corrected flag/error file option * 05/15/94 13286 DTM Initial programming * ******************************************************************************* $OPTIONS INFORMATION id = "%W%" ******************************************************************************* $INCLUDE UNIVERSE.INCLUDE TLOG.H $INCLUDE UNIVERSE.INCLUDE FILENAMES.H $INCLUDE UNIVERSE.INCLUDE MACHINE.NAME ALLOWED = 0 CALL *ISUSER.B( 0, ALLOWED ) ;* Do superuser verification IF NOT(ALLOWED) THEN PRINT ENBL.MSG3 STOP END * Check if it is OK to enable logging: if it is in the process of * shutting down or suspending or if it is already enabled or being * enabled, then don't try to enable it. State = "" RECIO( State, FINFO$AI.STATE, RECIO$FINFO ) IF State = AI$SHUT.PROG OR State = AI$SUSP.PROG THEN PRINT ENBL.MSG12 STOP END IF State = AI$LOGGING OR State = AI$INITIAL OR State = AI$WARM.START THEN PRINT ENBL.MSG11 STOP END ;* Enable Logging TMP = TRIM( @SENTENCE ) CNT = COUNT( TMP, " " ) IF ( CNT > 2 ) OR ( CNT < 1 ) THEN PRINT "Error: Incorrect number of arguments" STOP END OPT = FIELD( TMP, " ", 2 ) ****************** ** Windows NT port ** IF OS.TYPE = "UNIX" THEN command = OS.EXEC:" '":UV.BIN:"/uvlogd" END ELSE command = OS.EXEC:" '":UV.BIN:"/uvbootd ":UV.BIN:"/uvlogd.exe" END ** ****************** IF OPT = "NO" THEN command := " -r " END ELSE IF OPT NE "YES" THEN PRINT "Error: Must specify either YES or NO as the second option" STOP END END OPT = FIELD( TMP, " ", 3 ) IF OPT = "SYNC" THEN command := " -s " END command := "'" EXECUTE command CAPTURING junk IF @SYSTEM.RETURN.CODE THEN PRINT ENBL.MSG4 STOP END ELSE LOOP CURR.DATE = DATE() CURR.TIME = TIME() UNTIL CURR.DATE = DATE() DO REPEAT CURR.TIME = OCONV( CURR.TIME, 'MTS' ) CURR.DATE = OCONV( CURR.DATE, 'D' ) SEQ.NUMBER = 0 RECIO( SEQ.NUMBER, FINFO$AI.SEQUENCE, RECIO$FINFO ) PRINT ENBL.MSG5: CURR.TIME : SUSP.MSG7 :CURR.DATE: STATE.MSG END END