Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Shutdown guests with Expect tool

Introduction

Status
colourRed
titleto do
Specify telnet and expect must be installed

In case SSH cannot be used to perform clean shutdown of the guests, the "expect" tool can be used to connect to the console and , perform the login operation then and execute the shutdown command .depending on the console status (at login prompt, shell prompt or SRM prompt)

(warning) In  In this case the password is sent without encryption.

To facilitate use of "expect" for shutdown, an example is provided in the "guest_shutdown.exp" script located in the /opt/charon/utils folder. If you plan to customize the script, you'll have to create a copy and not use it directly as it will be overwritten in case of Toolkit upgrade. 

Note

'telnet' and 'expect' packages must be installed in order to use this feature

Warning

Console locked:

Any active session to the console must be killed before the "expect" script is executed.

(info) For example, if you are connected via "telnet" on the localhost/port (the kill is not done inside the expect script). See examples in the "/opt/charon/utils/charon_gstart.stop.example" file.

(warning) If the console is locked from another host (if you use putty for example), you will have to cancel the connection by yourself otherwise the shutdown will not be performed cleanly.

...