From: MERC::"uunet!CRVAX.SRI.COM!RELAY-INFO-VAX" 16-JAN-1993 16:14:09.48 To: jeh@cmkrnl.com CC: info-vax@kl.sri.com Subj: RE: Remotely rebooting vms In article <1993Jan14.115207.1170@cmkrnl.com>,jeh@cmkrnl.com, Jamie Hanrahan, writes: matthews@vulcan.resmel.bhp.com.au writes: >In article <1993Jan14.114547.279@vulcan.resmel.bhp.com.au>, > matthews@vulcan.resmel.bhp.com.au writes: >> I quite often log onto our vax6420 from home (modem to terminal server and then >> to vax via lat) after hours to make necessary changes to the system parameters, >> or even install/upgrade the layered products, but I have never been successful >> in rebooting the system this way. > [...] > > How can I successfully reboot the system from home ? > > I used to do this by submitting SYS$SYSTEM:SHUTDOWN.COM to run in a batch job. > This worked even though the queues are stopped as part of the shutdown sequence > -- shutdown was smart enough not to kill itself in that way. It probably still > works. You will need to look at it and figure out how to set up the command > procedure parameters to provide the desired amount of delay, request a reboot, > and so on. Last time I tried it, the queue manager stopped the queues and the SHUTDOWN wasn't complete. (Didn't try it using the new, VMS 5.5 queue manager, but I suspect the results will be the same). The best way (other than what Jamie describes below) is to create a DETACHed process. Below, is a command procedure I picked up off the net written by Carl Karcher which can perform the SHUTDOWN on the current node or another node in a cluster, ultimately as a DETACHed process. It presumes that you have a queue (or logical name) of the form: NODE$BATCH that is local to that node. You might want to omit the /LOG and /OOUTPUT parts, especially if the user doing the SHUTDOWN doesn't have the system disk, which doesn't get dismounted, as his default disk. Enjoy ! > Another option -- since you're dialing in through a terminal server -- is to > connect one of the other ports on the terminal server to a "local" port on the > target VAX (ie a port on a terminal mux). (You'll need a "null modem" cable > for this.) In the terminal server, DEFINE a SERVICE on that server port. Then > when you dial in, instead of CONNECTing to the VAX directly, connect to the > service that maps to the LAT port that connects to the VAX mux port. Now you > can log in and start the shutdown sequence, confident that nothing in the > shutdown sequence will pull the rug out from under you. -Regis ============================================================================ $!From: IN%"KARCHER%MIT.MFENET@NMFECC.arpa" 8-APR-1988 05:25 $! FILE: REBOOT.COM VERSION 1.0 EDIT: 880317 - CAK ORIG: TWF $! DCL procedure to run shutdown to reboot LAVC nodes. It assumes batch queues $! in the LAVC have names of format "node$BATCH". Change the SUBMIT line for $! other conventions. The shutdown is done immediately $ $ THIS_FILE = F$ENV("PROCEDURE") ! Get the name of this file $ NODE := 'F$GETSYI("SCSNODE")' $ IF F$MODE() .EQS. "BATCH" THEN GOTO BATCH ! If BATCH mode dispatch to commands $ IF F$ENV("DEPTH") .EQ. 0 THEN GOTO DETACHED ! If Detached dispatch to commands $ $! At this point we're Not Batch or Detached, assume it's interactive. $ $ IF P1 .EQS. "" THEN INQUIRE P1 "Node to reboot [''NODE']" $ IF P1 .EQS. "" THEN P1 = NODE $ SUBMIT/NOPRINT/LOG/QUE='P1'$BATCH 'THIS_FILE' ! Submit this file on proper queue $ EXIT $ $! The following section runs in batch mode on the node we want to shutdown. $! It creates a detached process that takes it's input from this the DETACHED $! section of this file to run the actual shutdown procedure. This is required $! since the SHUTDOWN procedure will only run in interative mode. $BATCH: $ LOG_FILE = F$PARSE (".LOG",THIS_FILE) ! Build log filename from this file $ RUN/DETACH/INPUT='THIS_FILE' /OUTPUT='LOG_FILE' SYS$SYSTEM:LOGINOUT ! Create a process to run SHUTDOWN $ EXIT $ $! The following section supplies DCL commands to the process we created above $! using LOGINOUT and runs the SHUTDOWN procedure on the node to be shutdown. $DETACHED: $ VERIFY = F$VERIFY(0) ! Turn off verification $ WRITE SYS$OUTPUT "%REBOOT-I-STARTED, Detached job started on node ''NODE' at ''F$TIME()'" $ REPLY/NODE='NODE'/USER/BELL "%REBOOT-I-STARTED, System shutdown procedure started ..." $ DEFINE SHUTDOWN$INFORM_NODES 'NODE' ! Only bother this node $ @SYS$SYSTEM:SHUTDOWN 0 REBOOT NO YES SHORTLY YES REBOOT_CHECK ! Execute SHUTDOWN to reboot this node ------------------------------------------------------------------------------ END OF PROCEDURE C. A. Karcher MIT Plasma Fusion Center KARCHER%PFCVAX@MIT-XX.LCS.MIT.EDU.ARPA KARCHER%MIT.MFENET@NMFECC.ARPA KARCHER%MIT.MFENET@ANLVMS.BITNET