Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Update for script version 2.2

Anchor
TOC
TOC
Include Page
KBCOMMON:KB-CSSstyle
KBCOMMON:KB-CSSstyle

...

ParameterValueExample
logfileOptional full path to the logfile that will be used to log the script output. If not specified a file name and path will be chosen based on session log file (one file per script execution). The file name is usually based on the configuration_name followed by "-SHUTDOWN-" and date/time.logfile=C:\Charon\myds20_shutdown.log
mode'opa0'mode=opa0
osEither Tru64 or VMSos=Tru64
servicename

CHARON instance service name.

(warning) When using "opa0" mode, the service is stopped by a "power off" or the "F6" key. If this operation does not succeed (cannot connect to console or "F6" key not enabled for example), it is then stopped using a Windows service command.

servicename=myds20
usernameDefines the remote username that will be used to connect to the console of the CHARON instance (if not already logged in)

For OpenVMS: username=system

For Tru64: username=root

password

Defines the password in clear text that will be used to connect to the console.

The password can be also stored in an encrypted file as described below.

(warning) If password is sent then cryptedpass (below) value must be set to "none" or left empty.

password=12345
cryptedpass

Full path to the text file containing the crypted encrypted password. To create this file, open a command window "cmd.exe" and run "powershell". At the powershell PowerShell prompt, enter the following command:

ConvertTo-SecureString -String "<password>" -AsPlainText -Force | ConvertFrom-SecureString | Out-File "<full path to the file>"

(warning) Please note the password encryption is based on current user credentials

(info) The parameter can be set to "none" or simply commented if not used.

cryptedpass=C:\Charon\myds20pwd.txt
cryptedpsys

Full path to the text file containing the encrypted password that will be used as "system" user (during Windows server shutdown). To create this file, open a command window "cmd.exe", run "psexec -i -s cmd.exe" ((info) psexec is provided in the kit) and run "powershell" from the newly opened window. At the PowerShell prompt, enter the following command:

ConvertTo-SecureString -String "<password>" -AsPlainText -Force | ConvertFrom-SecureString | Out-File "<full path to the file>"

(lightbulb) Use a different name for the output file as the one user for "cryptedpass"

(info) The parameter can be set to "none" or simply commented if not used.

cryptedpsys=C:\Charon\myds20pwd_sys.txt
portDefines the port to access the console (same as the one defined in the configuration file).port=10003
prompt

Defines the prompt at the shell level of the guest operating system. Used to check the user is connected.

Notes:

  • If the prompt contain spaces, it is necessary to add them in the configuration file
  • The prompt must not contain any escape character.

prompt=myds20>

timelimitsecDefines the maximum number of seconds the script can run (default = 180 seconds). This value depends on the time needed to shutdown properly the operating system.timelimitsec=600
windowwidth

Optional parameters used to resize the window when running with service user ("system" account).

Useful during Windows shutdown to check operations executed.

Width = 132 and Height = 32 by default. BufferHeight set 2000 lines by default.

windowwidth=120
windowheightwindowheight=50

...


Div
classcommandline

c:\Windows\system32>C:\charon\charon_cleanshutdown.ps1 -config C:\charon\myds20vms.ini

Charon clean shutdown

Name            Value
----            -----


cryptedpass     C:\Charon\myds20vms_cryptpass.txt
mode            opa0
os              VMS
port            10007
prompt          VMS084>
servicename     ds20vms
timelimitsec    180
username        system
waitbeforestop  10
windowheight    50
windowwidth     132


18:24:38 [INFO ] Using 'C:\Program Files\CHARON\Virtual Machines\ds20vms\ds20vms-SHUTDOWN-2020-06-02-18-24-38-000000000.log' as
log file / one log file per script execution
18:24:38 [INFO ] Defined symbolic link 'C:\Program Files\CHARON\Virtual Machines\ds20vms\ds20vms-SHUTDOWN.log'
18:24:38 [INFO ] Using 'C:\charon\myds20vms.ini' as configuration file
18:24:38 [INFO ] Execution date : 02-Jun-2020 18:24:38
18:24:38 [INFO ] Script version : 02-Jun-20 V2.1 (MD5: ED6D76E7CCC3F0016C34D88BADE4EC1A )
18:24:38 [INFO ] Powershell version : 5.1.18362.752
18:24:38 [INFO ] Computer name : WIN10-MAIN
18:24:38 [INFO ] Username : bruno
18:24:38 [INFO ] Windows version : Microsoft Windows 10 Pro
18:24:38 [INFO ] Administrator mode : True
18:24:38 [INFO ] Windows shutdown scripts:
18:24:38 [INFO ] - Hide execution : False
18:24:38 [INFO ] - Maximum duration : 7 minutes 30 seconds
18:24:38 [INFO ] - Exec position#1 : c:\charon\myds20vms.ini (!)
18:24:38 [INFO ] - Exec position#2 : c:\charon\pluto_tru64.ini
18:24:38 [INFO ]
18:24:38 [INFO ] 'opa0' will be used
18:24:38 [INFO ] Service 'ds20vms' is Running (Display name: ds20vms)
18:24:38 [INFO ] Using crypted password stored in 'C:\Charon\myds20vms_cryptpass.txt'.
18:24:38 [INFO ] No putty session active.
18:24:38 [INFO ] Connecting to OPA0 console, port 10007
18:24:38 [INFO ] Sending CRLF...
18:24:38 [INFO ] Time limit: 18:27:38. Seconds remaining: 180
18:24:42 [RCVD ]
18:24:42 [RCVD ]
18:24:42 [RCVD ] Welcome to OpenVMS (TM) Alpha Operating System, Version V8.4
18:24:42 [RCVD ]
18:24:42 [RCVD ] Username:
18:24:42 [INFO ] Got: [Username: ]
18:24:42 [INFO ] Sending VMS username...
18:24:42 [INFO ] Username sent
18:24:42 [INFO ] Time limit: 18:27:38. Seconds remaining: 176
18:24:45 [RCVD ] system
18:24:45 [RCVD ] Password:
18:24:45 [INFO ] Got: [Password: ]
18:24:45 [INFO ] Sending password, try #1 of 3
18:24:45 [INFO ] Password sent
18:24:47 [INFO ] Time limit: 18:27:38. Seconds remaining: 171
18:24:51 [RCVD ]
18:24:51 [RCVD ] Welcome to OpenVMS (TM) Alpha Operating System, Version V8.4
18:24:51 [RCVD ] Last interactive login on Tuesday, 2-JUN-2020 17:23:59.38
18:24:51 [RCVD ] Last non-interactive login on Friday, 15-MAY-2020 11:34:51.97[c\Z
18:24:51 [INFO ] Got: [ Last non-interactive login on Friday, 15-MAY-2020 11:34:51.97[c\Z]
18:24:51 [INFO ] Case unknown: [ Last non-interactive login on Friday, 15-MAY-2020 11:34:51.97[c\Z]. Retrying...
18:24:53 [INFO ] Time limit: 18:27:38. Seconds remaining: 165
18:24:56 [RCVD ] [0c
18:24:56 [INFO ] Got: [[0c]
18:24:56 [INFO ] Case unknown: [[0c]. Retrying...
18:24:58 [INFO ] Time limit: 18:27:38. Seconds remaining: 160
18:25:02 [RCVD ]
18:25:02 [RCVD ] %SET-W-NOTSET, error modifying OPA0:
18:25:02 [RCVD ] -SET-I-UNKTERM, unknown terminal type[c\Z
18:25:02 [INFO ] Got: [-SET-I-UNKTERM, unknown terminal type[c\Z]
18:25:02 [INFO ] Case unknown: [-SET-I-UNKTERM, unknown terminal type[c\Z]. Retrying...
18:25:04 [INFO ] Time limit: 18:27:38. Seconds remaining: 154
18:25:07 [RCVD ] [0c
18:25:07 [INFO ] Got: [[0c]
18:25:07 [INFO ] Case unknown: [[0c]. Retrying...
18:25:09 [INFO ] Time limit: 18:27:38. Seconds remaining: 149
18:25:13 [RCVD ]
18:25:13 [RCVD ] %SET-W-NOTSET, error modifying OPA0:
18:25:13 [RCVD ] -SET-I-UNKTERM, unknown terminal type
18:25:13 [RCVD ] VMS084>
18:25:13 [INFO ] Got: [ VMS084> ]
18:25:13 [INFO ] Found prompt.
18:25:13 [INFO ] Sending VMS shutdown...
18:25:13 [INFO ] Command sent
18:25:18 [INFO ] Time limit: 18:27:38. Seconds remaining: 140
18:25:21 [RCVD ] @SYS$MANAGER:CHARON_SHUTDOWN.COM
18:25:21 [RCVD ] $ PURGE /KEEP=20 SYS$MANAGER:CHARON_SHUTDOWN.LOG
18:25:21 [RCVD ] $ RUN /DETACH SYS$SYSTEM:LOGINOUT.EXE /INPUT=SYS$MANAGER:CHARON_SHUTDOWN -
18:25:21 [RCVD ] /OUTPUT=SYS$MANAGER:CHARON_SHUTDOWN.LOG /UIC=[1,4]
18:25:21 [RCVD ] %RUN-S-PROC_ID, identification of created process is 00000125
18:25:21 [RCVD ] $ ENDIF
18:25:21 [RCVD ] $ ENDIF
18:25:21 [RCVD ] $ EXIT
18:25:21 [RCVD ] VMS084>
18:25:21 [RCVD ]
18:25:21 [RCVD ]
18:25:21 [RCVD ] SHUTDOWN -- Perform an Orderly System Shutdown
18:25:21 [RCVD ] on node VMS084
18:25:21 [RCVD ]
18:25:21 [RCVD ]
18:25:21 [RCVD ] %SHUTDOWN-I-OPERATOR, this terminal is now an operator's console
18:25:21 [RCVD ] %SHUTDOWN-I-DISLOGINS, interactive logins will now be disabled
18:25:21 [RCVD ] %SET-I-INTSET, login interactive limit = 0, current interactive value = 1
18:25:21 [RCVD ] %SHUTDOWN-I-STOPQUEUES, the queues on this node will now be stopped
18:25:21 [RCVD ]
18:25:21 [RCVD ] SHUTDOWN message on VMS084 from user SYSTEM at VMS084 Batch 17:25:30
18:25:21 [RCVD ] VMS084 will shut down in 0 minutes; back up LATER. Please log off node VMS084.
18:25:21 [RCVD ] SHUTDOWN
18:25:21 [RCVD ]

... (truncated)
18:25:22 [RCVD ] %%%%%%%%%%% OPCOM 2-JUN-2020 17:25:33.68 %%%%%%%%%%%
18:25:22 [RCVD ] Message from user SYSTEM on VMS084
18:25:22 [RCVD ] %SECSRV-I-SERVERSHUTDOWN, security server shutting down
18:25:22 [RCVD ]
18:25:22 [RCVD ] VMS084>
18:25:22 [INFO ] Got: [ VMS084> ]
18:25:22 [INFO ] Found prompt, waiting for shutdown to start or complete...
18:25:27 [INFO ] Time limit: 18:27:38. Seconds remaining: 131
18:25:30 [RCVD ]
18:25:30 [RCVD ] SYSTEM SHUTDOWN COMPLETE
18:25:30 [RCVD ]
18:25:30 [RCVD ]
18:25:30 [RCVD ]
18:25:30 [RCVD ] halted CPU 0
18:25:30 [RCVD ]
18:25:30 [RCVD ] halt code = 5
18:25:30 [RCVD ] HALT instruction executed
18:25:30 [RCVD ] PC = ffffffff8008fa84
18:25:30 [RCVD ] P00>>>
18:25:30 [INFO ] Got: [P00>>>]
18:25:30 [INFO ] Sending 'power off'...
18:25:31 [INFO ] Service ds20vms is stopped
18:25:31 [INFO ] Script ended.

(question) RCVD messages correspond to the received data from the OPA0 console.

...