Page 1 of 1

Shutdown via SSH

Posted: Sat Apr 09, 2022 5:19 pm
by ajbrehm
What's a good way to shutdown OpenVMS via SSH? Currently the shutdown.com procedure kills my sshd process and then aborts the shutdown.

Re: Shutdown via SSH

Posted: Sat Apr 09, 2022 9:38 pm
by arne_v
You could start a detached process doing the shutdown.

Re: Shutdown via SSH

Posted: Sat Apr 09, 2022 9:43 pm
by jonesd
$ mcr sysman shutdown node/minutes=0/invoke_shutdown

Re: Shutdown via SSH

Posted: Mon Apr 24, 2023 3:56 am
by sodjan
Was some time ago, but we have a short COM file that, when run, runs itself as a detached process and performes a reboot.

Code: Select all

$IF F$MODE().NES."OTHER"
$THEN
$  RUN /DET /INP='F$ENVIRONMENT("PROCEDURE")' -
       /OUT=OPA0: /PRIV=ALL /UIC=[1,4] -
       SYS$SYSTEM:LOGINOUT
$ELSE
$  SET PROC/PRIV=ALL
$  ASS OPA0: SYS$COMMAND
$  @SYS$SYSTEM:SHUTDOWN 0 SHUTDOWN YES YES LATER YES NONE
$  WAIT 08:00
$ENDIF
Long time ago, I instead did a "set host/lat" from another VMS system and run the shutdown or reboot.
LAT lives long enough on the system shutting down, so that the system shuts down when LAT has been closed.

Re: Shutdown via SSH

Posted: Mon Apr 24, 2023 1:38 pm
by m_detommaso

20.12.2022 - SHUTDOWN V1.0 Patch Kit for OpenVMS IA64 and Alpha (AXP)

Note: this fix has been included in patch kit VMS92X_UPDATE-V0200 for x86-64 version V9.2 and in E9.2-1 release.


Installation Rating: INSTALL_2 - No reboot is necessary after installation of this kit.

Integrity

vms842l3i_shutdown-v0100, version(s) of VSI OpenVMS to which this kit may be applied:

• VSI OpenVMS for Integrity Servers V8.4-1H1
• VSI OpenVMS for Integrity Servers V8.4-2
• VSI OpenVMS for Integrity Servers V8.4-2L1
• VSI OpenVMS for Integrity Servers V8.4-2L3


KIT DEPENDENCIES

• VMS841H1I_NOTARY-V0200 (if installing on V8.4-1H1)
• VMS842I_NOTARY-V0200 (if installing on V8.4-2)

All VSI OpenVMS patch kits now require the Notary V2.0 patch kit for their respective version of VSI OpenVMS. This is to ensure correct validation regardless of the manifest version in use. The Notary V2.0 kit named above which matches the version of VSI OpenVMS being patched is required for this kit to install.

• VMS842L1I_UPDATE-V0100 (if installing on V8.4-2L1)

All new patch kits for VSI OpenVMS for Integrity Servers V8.4-2L1 require the VMS842L1I_UPDATE-V0100 kit.

• None (if installing on V8.4-2L3)


Alpha
vms842l2a_shutdown-v0100; version(s) of VSI OpenVMS to which this kit may be applied:

• VSI OpenVMS Alpha V8.4-2L1
• VSI OpenVMS Alpha V8.4-2L2


KIT DEPENDENCIES:

• VMS842L1A_NOTARY-V0200 (if installing on V8.4-2L1)
• VMS842L2A_NOTARY-V0200 (if installing on V8.4-2L2)

All VSI OpenVMS patch kits now require the Notary V2.0 patch kit for their respective version of VSI OpenVMS. This is to ensure correct validation regardless of the manifest version in use. The Notary V2.0 kit named above which matches the version of VSI OpenVMS being patched is required for this kit to install.



PROBLEMS ADDRESSED IN THIS KIT - Allow terminals connected via OpenSSH to run SHUTDOWN.COM

A process connected to an OpenVMS system via OpenSSH could not successfully shutdown or reboot the system using the SYS$SYSTEM:SHUTDOWN.COM procedure. The associated process running the SSH image was not recognized as required while the shutdown was in progress and would be deleted, which would leave the shutdown in limbo. Other network terminal types, including previous implementations of SSH, were correctly skipped over when the shutdown procedure deleted processes, which allowed the shutdown to complete. With this patch kit, OpenSSH terminal sessions are now correctly handled so that the user shutting down the system continues the shutdown process to the end.

NOTE: If you plan to allow users with SSH connected sessions to shutdown the system, do not invoke the SSH$SHUTDOWN.COM from within the site-specific SYS$MANAGER:SYSHUTDWN.COM procedure. The SSH shutdown will delete the process executing the shutdown and leave the system in an inconsistent state with logins and SSH disabled, along with some other parts of the system shutdown, but nothing left running to complete the shutdown or reboot.

Images and/or Files Affected:

[SYSEXE]SHUTDOWN.COM


/Maurizio