98 lines
2.7 KiB
Plaintext
Executable File
98 lines
2.7 KiB
Plaintext
Executable File
******************************************************************************
|
|
*
|
|
* System Admin Transaction Logging - Shutdown 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.
|
|
* 03/25/96 18212 LAG Windows NT port
|
|
* 10/21/94 15120 DTM Added code to support new states (SUSP/SHUT in progress)
|
|
* 10/14/94 15101 DTM Corrected message displayed
|
|
* 05/15/94 13286 DTM Initial programming
|
|
*
|
|
*******************************************************************************
|
|
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 SHUT.MSG3
|
|
STOP
|
|
END
|
|
|
|
State = ""
|
|
RECIO( State, FINFO$AI.STATE, RECIO$FINFO )
|
|
IF State NE AI$LOGGING AND State NE AI$FULL AND State NE AI$SUSPENDED THEN
|
|
IF State = AI$WARM.START OR State = AI$INITIAL THEN
|
|
msg = "System is just now coming up, please be patient as the "
|
|
msg := "SHUTDOWN procedure may take some time to complete."
|
|
END
|
|
ELSE IF State = AI$SHUT.PROG THEN
|
|
msg = "System is currently in the process of being SHUTDOWN."
|
|
stop = 1
|
|
END
|
|
ELSE
|
|
msg = "System is not in a state that can be SHUTDOWN at this moment."
|
|
stop = 1
|
|
END
|
|
PRINT msg
|
|
IF stop THEN
|
|
STOP
|
|
END
|
|
END
|
|
|
|
|
|
;* Enable Logging
|
|
@SYSTEM.RETURN.CODE = 0
|
|
RECIO( AI$DISABLED, RECIO$STATE )
|
|
|
|
IF @SYSTEM.RETURN.CODE THEN
|
|
PRINT SHUT.MSG4
|
|
STOP
|
|
END
|
|
ELSE
|
|
|
|
State = ""
|
|
RECIO( State, FINFO$AI.STATE, RECIO$FINFO)
|
|
IF State = AI$FULL OR State = AI$SUSPENDED THEN
|
|
******************
|
|
** Windows NT port
|
|
**
|
|
IF OS.TYPE = "UNIX" THEN
|
|
Exec.Sentence = OS.EXEC:" '":UV.BIN:"/uvlogd":"'"
|
|
END ELSE
|
|
Exec.Sentence = OS.EXEC:" '":UV.BIN:"/uvbootd ":UV.BIN:"/uvlogd.exe":"'"
|
|
END
|
|
**
|
|
******************
|
|
EXECUTE Exec.Sentence CAPTURING junk
|
|
END
|
|
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' )
|
|
|
|
PRINT SHUT.MSG5: CURR.TIME : SUSP.MSG7 :CURR.DATE: STATE.MSG
|
|
END
|
|
END
|