Operating System - OpenVMS
cancel
Showing results for 
Search instead for 
Did you mean: 

System shutdown impossible through SSH?

 
Fredrik Israelsson
Occasional Advisor

System shutdown impossible through SSH?

I'm having problems shutting down systems through SSH.
I log into 7.3-2 och 8.3 Alphas as [1,4] and issue:
$ mc sysman shutdown node
and it almost always end up only partially shuting down the system. I have to log on to the console and issue the command from there, then it works fine. Using sysman through SSH in a cluster works if I only shut down other nodes than the one I'm logged into.

Any ideas?
4 REPLIES
Heinz W Genhart
Honored Contributor

Re: System shutdown impossible through SSH?

Hi Frederik

this is a known behaviour. You cant shutdown the system if you are logged in with ssh.

Try the follwing procedure. It creates a process and in the context of the created process the system will be shut down or rebooted (depends the last line of the procedure).

$ set ver
$ IF F$MODE() .EQS. "BATCH" THEN GOTO start_detached
$ depth = F$ENVIRONMENT("DEPTH")
$ IF depth .EQ. 0 THEN GOTO run_detached
$ GOTO start_detached
$!
$start_detached:
$ this_node=F$EDIT(F$GETSYI("NODENAME"),"COLLAPSE")
$ date=F$CVTIME("","comparison","DATE")
$ RUN SYS$SYSTEM:LOGINOUT.EXE -
/INPUT='F$ENVIRONMENT("PROCEDURE")' -
/OUTPUT='F$TRNLNM("SYS$LOGIN")'Shutdown_'this_node'_'date'.log -
/ERROR='f$trnlnm("sys$login")'Shutdown_'this_node'_'date'.log -
/PROC=SHUTDOWN -
/DETACHED
$ EXIT
$!
$run_detached:
$ SHUTDOWN == "@SYS$SYSTEM:SHUTDOWN 0 SHUTDOWN NO YES LATER NO NONE"
$ REBOOT == "@SYS$SYSTEM:SHUTDOWN 0 SHUTDOWN NO YES LATER YES REB"
$ REPL/ALL/BEL/URGENT "Detached REBOOT of ''F$GETSYI("NODENAME")'. PID is ''F$GETJPI("","PID")'"
$ REBOOT


Hope that helps

Regards

Heinz
Karl Rohwedder
Honored Contributor

Re: System shutdown impossible through SSH?

Fredrik,

when running on the local node, SYSMAN creates a subprocess of your current process to execute. When SSh gets stopped, your process dies and takes the subprocess with him. On other nodes in the cluster SYSMAN creates detached processes.
So if you specify a
SYSMAN>Set Environment /Node=yourself /User=System
before using the SHUTDOWN command, you may afterwads logout and the shutdown continues.

regards Kalle
Charlie Anderson
Occasional Visitor

Re: System shutdown impossible through SSH?

Here is an example on a standalone nodes via telnet or a Decwindows terminal session:

$ sysman
SYSMAN> set environment/node=0
Remote Password:
%SYSMAN-I-ENV, current command environment:
Individual nodes: 0
At least one node is not in local cluster
Username SYSTEM will be used on nonlocal nodes


SYSMAN> SHUTDOWN NODE

%SYSMAN-I-SHUTDOWN, SHUTDOWN request sent to node 0
SYSMAN>


SHUTDOWN message on NODEX from user SYSTEM at NODEX Batch 16:19:03
NODEX will shut down in 0 minutes; back up shortly via automatic reboot. Please
log off node NODEX.
Standalone

SYSMAN>exit

$

Wim Van den Wyngaert
Honored Contributor

Re: System shutdown impossible through SSH?

Note that SHUTDOWN NODE has /NOREMOVE_NODE as default. So make sure your votes are correctly assigned or you may block the cluster.

Wim
Wim