The solution to stopping all of the various SVMs before VM shutdown is
to use yet another SVM. Create a user named SHUTTRAP that is
autologged by AUTOLOG1 or 2 that has a profile exec that does:
/* Profile exec */
Address Command
'EXEC SHUTTRAP EXEC BYEBYE'
Exit
Now you write a BYEBYE EXEC that does everything you want it to do.
Once it has verified that everything is down, it logs off which allows
CP to shut down. For example:
/* BYEBYE EXEC */
Address Command
'CP SEND CP TCPIP EXT'
'CP SMSG RSCS RSCS SHUTDOWN'
'EXEC DIRMAINT SHUTDOWN'
(you get the idea.)
'CONWAIT'
'CP LOGOFF'
And here is my SHUTTRAP EXEC:
/* SHUTTRAP EXEC */
Parse upper source . howcalled execn exect execm synonym .
Address Command
'NUCEXT' execn /* Loaded already? */
Signal on error
If RC<>0 then do /* No, load it first */
'CMDCALL STATE' execn 'MODULE *'
'NUCXLOAD' execn '(SYSTEM'
end
else do /* Loaded, check attributes */
signal off error
'MAKEBUF'
signal on error
buff=RC
'NUCXMAP' execn '(STACK LIFO'
Pull . . . . . . attributes
'DROPBUF' buff
If wordpos('SYSTEM',attributes)=0 then do /* Must be SYSTEM */
'NUCXDROP' execn
'CMDCALL STATE' execn 'MODULE *'
'NUCXLOAD' execn '(SYSTEM'
end
end
''execn arg(1) /* Call the nucleus extension */
Error:
Exit RC
--
Bruce Hayden
Linux on System z Advanced Technical Support
Endicott, NY