Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

UNDER CONSTRUCTION

Contents

Required parameters

ParameterValueExample
logfileFull path to the logfile that will be used to log the script outputlogfile=C:\Charon\myds20_shutdown.log
mode'opa0'mode=opa0
osEither Tru64 or VMSos=Tru64
servicename

CHARON instance service name.

(warning) When using expect, the service is stopped by the expect script either with 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 clixml file as described below.

password=12345
clixml

Defines the full path of the clixml file that contains the encrypted password (password parameter must then not be set).

To create this file, open a "cmd.exe " window and then run :

C:\Users\Administrator> cd C:\Charon

C:\Charon> powershell

PS C:\Charon> "<password>" | export-clixml <file>

Example:

PS C:\Charon> "12345" | export-clixml C:\Charon\myds20pwd.clixml
clixml=C:\Charon\myds20pwd.clixml
portDefines the port to access the console (same as the one defined in the configuration file).port=10003
promptDefines the prompt at the shell level of the guest operating system. Used by 'expect' to check that the connection did succeed.

prompt=myds20>

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

Example

Configuration file

#-----------------------------------------

# myds20 Tru64 V5.1 machine

#-----------------------------------------

logfile=C:\Charon\myds20_shutdown.log

servicename=myds20

mode=opa0

os=Tru64

username=root

clixml=C:\Charon\myds20pwd.clixml

port=10003

prompt=#

timeoutsec=120

Script execution

Check mode

(info) When check mode is enabled, a pop-up window will be displayed to check the expect operations performed on the CHARON instance console.

c:\Charon>powershell -file charon_cleanshutdown.ps1 -config myds20tru64.ini -check


Name                           Value

----                           -----

mode                           expect

servicename                    myds20

username                       root

expectbin                      C:\Tcl\bin\tclsh86.exe

plinkbin                       C:\Charon\plink.exe

os                             Tru64

port                           10003

clixml                         C:\Charon\myds20pwd.clixml

prompt                         #

logfile                        C:\Charon\myds20_shutdown.log


20160808:122235:INFO :0: Using 'C:\Charon\myds20_shutdown.log' as log file / append

20160808:122235:INFO :0: Check mode enabled.

20160808:122235:INFO :0: 'expect' will be used

20160808:122235:INFO :0: Service 'myds20' is Running (Display name: myds20)

20160808:122235:INFO :0: The 'clixml' file 'C:\Charon\myds20pwd.clixml' will be used to gather password for 'expect' mode.

20160808:122235:INFO :0: Killing all putty sessions...

20160808:122235:INFO :0: Invoking the expect script...

20160808:122235:INFO :0: Connecting to localhost port 10003 ...

20160808:122244:INFO :0: %EXPECT-I-BEGIN, Starting / UNIX... [2016-08-08 12:22:36]

20160808:122244:INFO :0: %EXPECT-I-SNDRET, Sending carriage return... [2016-08-08 12:22:37]

20160808:122245:INFO :0: Compaq Tru64 UNIX V5.1B (Rev. 2650) (pluto.localdomain) console

20160808:122245:INFO :0: login:

20160808:122245:INFO :0: %EXPECT-I-FOUND, Found UNIX login [2016-08-08 12:22:38]

20160808:122245:INFO :0: %EXPECT-I-LOGIN, Sending UNIX user: root ... [2016-08-08 12:22:38]

20160808:122245:INFO :0: root

20160808:122245:INFO :0: Password:

20160808:122245:INFO :0: %EXPECT-I-PASSW, Sending root password... [2016-08-08 12:22:39]

20160808:122245:INFO :0: Can't find an OSF-BASE, UNIX-WORKSTATION, or UNIX-SERVER license PAK

20160808:122245:INFO :0: Last login: Fri Aug  5 11:55:48 CEST 2016 on console

20160808:122245:INFO :0: Compaq Tru64 UNIX V5.1B (Rev. 2650); Fri Jun 24 17:08:56 CEST 2016

20160808:122245:INFO :0: The installation software has successfully installed your system.

20160808:122245:INFO :0: There are logfiles that contain a record of your installation.  These are:

20160808:122245:INFO :0:         /var/adm/smlogs/install.cdf     - configuration description file

20160808:122245:INFO :0:         /var/adm/smlogs/install.log     - general log file

20160808:122245:INFO :0:         /var/adm/smlogs/install.FS.log  - file system creation logs

20160808:122245:INFO :0:         /var/adm/smlogs/setld.log       - log for the setld(8) utility

20160808:122245:INFO :0:         /var/adm/smlogs/fverify.log     - verification log file

20160808:122245:INFO :0: #

20160808:122245:INFO :0: %EXPECT-S-LOGIN, login successful. [2016-08-08 12:22:39]

20160808:122245:INFO :0: %EXPECT-S-CHECK, Sending UNIX check command... [2016-08-08 12:22:39]

20160808:122245:INFO :0: # date;uname -a

20160808:122245:INFO :0: Fri Aug  5 11:56:31 CEST 2016

20160808:122245:INFO :0: OSF1 pluto.localdomain V5.1 2650 alpha

20160808:122245:INFO :0: # exit

20160808:122245:INFO :0:

20160808:122245:INFO :0: Compaq Tru64 UNIX V5.1B (Rev. 2650) (pluto.localdomain) console

20160808:122245:INFO :0:

20160808:122245:INFO :0: login:

20160808:122245:INFO :0: %EXPECT-S-CHECK, Check completed. [2016-08-08 12:22:42]

20160808:122245:INFO :0:

20160808:122245:INFO :0: %EXPECT-I-END, Exited with code 0. [2016-08-08 12:22:44]

20160808:122245:INFO :0: Check mode, no connection test to be performed.

20160808:122245:INFO :0: Check mode, the service myds20 will not be stopped

20160808:122245:INFO :0: Service is Running

20160808:122245:INFO :0: Done.

Shutdown execution

c:\Charon>powershell -file charon_cleanshutdown.ps1 -config myds20tru64.ini


Name                           Value

----                           -----

mode                           expect

servicename                    myds20

username                       root

expectbin                      C:\Tcl\bin\tclsh86.exe

plinkbin                       C:\Charon\plink.exe

os                             Tru64

port                           10003

clixml                         C:\Charon\myds20pwd.clixml

prompt                         #

logfile                        C:\Charon\myds20_shutdown.log


20160808:122546:INFO :0: Using 'C:\Charon\myds20_shutdown.log' as log file / append

20160808:122546:INFO :0: 'expect' will be used

20160808:122546:INFO :0: Service 'myds20' is Running (Display name: myds20)

20160808:122546:INFO :0: The 'clixml' file 'C:\Charon\myds20pwd.clixml' will be used to gather password for 'expect' mode.

20160808:122546:INFO :0: Killing all putty sessions...

20160808:122546:INFO :0: Invoking the expect script...

20160808:122546:INFO :0: Connecting to localhost port 10003 ...

20160808:122642:INFO :0: %EXPECT-I-BEGIN, Starting / UNIX... [2016-08-08 12:25:46]

20160808:122642:INFO :0: %EXPECT-I-SNDRET, Sending carriage return... [2016-08-08 12:25:47]

20160808:122642:INFO :0: Compaq Tru64 UNIX V5.1B (Rev. 2650) (pluto.localdomain) console

20160808:122642:INFO :0: login:

20160808:122642:INFO :0: %EXPECT-I-FOUND, Found UNIX login [2016-08-08 12:25:48]

20160808:122642:INFO :0: %EXPECT-I-LOGIN, Sending UNIX user: root ... [2016-08-08 12:25:48]

20160808:122642:INFO :0: root

20160808:122642:INFO :0: Password:

20160808:122642:INFO :0: %EXPECT-I-PASSW, Sending root password... [2016-08-08 12:25:49]

20160808:122642:INFO :0: Can't find an OSF-BASE, UNIX-WORKSTATION, or UNIX-SERVER license PAK

20160808:122642:INFO :0: Last login: Fri Aug  5 11:56:28 CEST 2016 on console

20160808:122642:INFO :0: Compaq Tru64 UNIX V5.1B (Rev. 2650); Fri Jun 24 17:08:56 CEST 2016

20160808:122642:INFO :0: The installation software has successfully installed your system.

20160808:122642:INFO :0: There are logfiles that contain a record of your installation.  These are:

20160808:122642:INFO :0:

20160808:122642:INFO :0:         /var/adm/smlogs/install.cdf     - configuration description file

20160808:122642:INFO :0:         /var/adm/smlogs/install.log     - general log file

20160808:122642:INFO :0:         /var/adm/smlogs/install.FS.log  - file system creation logs

20160808:122642:INFO :0:         /var/adm/smlogs/setld.log       - log for the setld(8) utility

20160808:122642:INFO :0:         /var/adm/smlogs/fverify.log     - verification log file

20160808:122642:INFO :0: #

20160808:122642:INFO :0: %EXPECT-S-LOGIN, login successful. [2016-08-08 12:25:49]

20160808:122642:INFO :0: %EXPECT-S-SHUTDWN, Sending UNIX shutdown... [2016-08-08 12:25:49]

20160808:122642:INFO :0: # init 0

20160808:122642:INFO :0: #

20160808:122642:INFO :0: INIT: New run level: 0

20160808:122642:INFO :0: The system is coming down. Please wait...

20160808:122642:INFO :0: Logins disabled

20160808:122642:INFO :0: LAT stopped.

20160808:122642:INFO :0: Unmounting NFS filesystems

20160808:122642:INFO :0: Halting processes ...

20160808:122642:INFO :0: The system is down.

20160808:122642:INFO :0: /proc: Invalid argument

20160808:122642:INFO :0: ....Halt completed....

20160808:122642:INFO :0: syncing disks... done

20160808:122642:INFO :0: CPU 0: Halting... (transferring to monitor)

20160808:122642:INFO :0: halted CPU 0

20160808:122642:INFO :0: halt code = 5

20160808:122642:INFO :0: HALT instruction executed

20160808:122642:INFO :0: PC = fffffc0000697b30

20160808:122642:INFO :0: P00>>>

20160808:122642:INFO :0: %EXPECT-S-SHUTDWN, Shutdown completed. [2016-08-08 12:26:38]

20160808:122642:INFO :0: %EXPECT-I-POWEROFF, Sending power off... [2016-08-08 12:26:38]

20160808:122642:INFO :0: power offFATAL ERROR: Network error: Software caused connection abort

20160808:122642:INFO :0: %EXPECT-S-POWEROFF, power off completed. [2016-08-08 12:26:40]

20160808:122642:INFO :0: %EXPECT-I-END, Exited with code 0. [2016-08-08 12:26:42]

20160808:122642:INFO :0: Service myds20 is already stopped

20160808:122642:INFO :0: Done.

  • No labels