Versions Compared

Key

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

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

...

When the script is initialized using option 6 or when a new virtual machine is added, the following lines are added:

...

# Parameter $1: contains full path to cfg file
# Parameter $2: contains full path to emulator exe file
#
# Important notes:
# - comments & commands must be on separate lines
# - respect the structure of the file with case/in/esac
# - only place your commands between the selection and the ';;' line
#
. /opt/charon/utils/charon_common
#
case "$1"
in
  <configuration file>)
    #-- Uncomment and complete one of the following lines:
    #${CHARONDIR}/utils/charon_gstop_expect
\ $1 \ $2 root <password> "<prompt>" <HPUX/MPEIX>
    #${CHARONDIR}/utils/charon_gstop_rsh
\ $1 \ $2 <hostname> <HPUX/MPEIX>
    #${CHARONDIR}/utils/charon_gstop_ssh
\ $1 \ $2 <hostname> <HPUX/MPEIX>
    #/<path>/<myscript>
    ;;

...

esac

One of the blue colored lines above has to be uncommented depending on the method chosen. Other lines can remain in the script or can be deleted.

...

...

#
. /opt/charon/utils/charon_common
#
case "$1"
in
  /charon/plutorp7400.cfg)
    ${CHARONDIR}/utils/charon_gstop_ssh $1 $2 pluto5 TRU64rp7400 HPUX
    ;;
  *)
    echo "Invalid parameter '$1'"
    exit 1
    ;;
esac

...

Stop script execution example with "ssh" on Red Hat Enterprise Linux 7.8:


Include Page
KBCOMMON:DOC-GoToToc
KBCOMMON:DOC-GoToToc

Provided shutdown scripts explanation

...

titleNote for Red Hat Enterprise Linux/CentOS 7 and 8

(warning) Whatever the shutdown script execution result is, the stop request sent by the systemctl command will stop the emulator. It is very important then to ensure the stop script has been tested and validated.

charon_gstop_expect

  • Check if there's an active connection to the console on the local host, kill if any.
  • Execute the /opt/charon/utils/guest_shutdown.exp expect script with the values provided: username (root), password, prompt, operating system (either TRU64 or VMS). This script is able to send the shutdown command depending on the returned characters on the console. This can be the SRM prompt ">>>", the "login:" or "username:" prompts or the prompt of the logged in user.
  • Report all output to /opt/charon/log/console.stop.<guest name>.log.

...

Div
classpagebreak


Example:

#!/bin/sh
#
case "$1"
in
  /charon/pluto.cfg)
    ssh -o ConnectTimeout=2 pluto5 "uptime|cut -f1 -d','" 2>/dev/null
    RETVAL=$?
    ;;
  *)
    echo "Invalid parameter '$1'"
    RETVAL=1
    ;;
esac
echo "==RETVAL=${RETVAL}=="
exit ${RETVAL}

...