Operating System - OpenVMS
1755143 Members
3016 Online
108830 Solutions
New Discussion юеВ

SYS$COMMAND and OPA0 During System Startup

 
SOLVED
Go to solution
Manny DeAssis
Frequent Advisor

SYS$COMMAND and OPA0 During System Startup

I'm running VMS 7.3-2 on a GS1280 Alpha. I need to prompt an operator during system startup at OPA0 for input. Typical DCL won't cut it because it appears that sys$command and sys$input behave a little different during system startup.

Can anyone present a simple script or the magic syntax one needs to accomplish this feat. I remember doing it in the past with something along the lines as an open command but I just can't remember the full syntax.

Currently using the 'ask := read sys$command /prompt='. No output or prompt for input ever appears at OPA0.
9 REPLIES 9
Steven Schweda
Honored Contributor

Re: SYS$COMMAND and OPA0 During System Startup

This sounds like a very bad idea, but where
in the start-up? SYSTARTUP_VMS.COM?

I don't know when OPA0 gets created/defined,
but you could try opening that, and then
reading and writing there (in DCL).

Why would anyone wish to do this?

> [...] I just can't remember the full syntax.

"HELP OPEN"?
David B Sneddon
Honored Contributor

Re: SYS$COMMAND and OPA0 During System Startup

Depening on exactly what it is you need to
ask, have you considered a conversational
boot and setting one of the USERx SYSGEN
parameters?

Dave
Karl Rohwedder
Honored Contributor

Re: SYS$COMMAND and OPA0 During System Startup

Manny,

have you tried reading from SYS$OUTPUT?
Don't forget to specify a timeout at least, so that the startup will finish even if no operator is available. Personally I would also prefer the setting of USERx SYSGEN parameters.

regards Kalle
Volker Halle
Honored Contributor
Solution

Re: SYS$COMMAND and OPA0 During System Startup

Manny,

you could use '$ OPEN/READ/WRITE cons OPA0:' to open a channel to OPA0: and then use '$ READ cons ...' to read from the physical OPA0: console terminal during boot. Consider to specify a timeout value on the read and take the appropriate action, if the read times out.

Volker.
Phil.Howell
Honored Contributor

Re: SYS$COMMAND and OPA0 During System Startup

try something like this
Phil

$ open/read oper_console opa0:
$ read -
/time_out = 10 -
/prompt = "Is this startup a world startup [Y] ?" -
oper_console startup_answer
$ close oper_console
$ if startup_answer .eqs. "" then startup_answer = "Y"
$ if startup_answer then goto not_stand_alone
Art Wiens
Respected Contributor

Re: SYS$COMMAND and OPA0 During System Startup

This bit of code has worked here for "many" years (Dated 10-May-1990) ... hopefully it displays somewhat close with the "magic" Retain Format button ...

In SYSTARTUP_VMS.COM :

$ ans$time_period = 60! time out period = 60 seconds
$!
$ Open/Read/Error=NO_CONSOLE console_device opa0:
$
$!
$! Display startup menu and ask for startup type
$!
$ tell ""
$ tell " The following system startup choices are available:"
$ tell " "
$ tell " N - normal system startup"
$ tell " S - normal system startup, allow no users"
$ tell " C - customize startup process"
$ tell " F - failure reboot"
$STARTUP_CHOICE:
$ tell ""
$ read/prompt="---> Enter startup choice (,S,C,F): " -
/time_out='ans$time_period -
/error=DEFAULT_CHOICE/end_of_file=DEFAULT_CHOICE -
console_device startup_type
$ goto PARSE_CHOICE

Works on VAX systems (v6.2) with VT terminals as consoles and on Alpha's (v7.2-2) running DecWindows.

HTH,
Art
Jeffrey Goodwin
Frequent Advisor

Re: SYS$COMMAND and OPA0 During System Startup

In line with Art's response, this has worked for many years at our site:

$ FULL:
$ do_full :== "TRUE"
$ say " Startup Options:"
$ say " ---------------
$ say " Q - Quick (Full) Bring system up with batch/logins enabled"
$ say " S - Standalone Bring system up with nobatch/nologins"
$ say " M - Min startup Exit from SYSTARTUP_VMS right now"
$ say " V - Set verify True Verify on and ask for another option"
$ say ""
$! ************************************
$ valid_options:== "QSMV"
$ open console opa0:
$ get_startup:
$ call test_cpus
$ read/time=60/error=timeout/prompt="Startup Option: " console input
$ startup == f$edit( input, "TRIM,UPCASE" )
$ timeout:
$ pos = f$locate( startup, valid_options )
$ if pos .eq. f$length( valid_options ) then $goto get_startup
$ if startup .nes. "V" then $goto skip_verify
$ set ver ! enable verify
$ goto get_startup
$ SKIP_VERIFY:
$ close console
$ this_node = f$getsyi("nodename")
$ if startup .eqs. "S" then startup$interactive_logins == 0 >


After 60 seconds, the boot will continue.

This will not work if logging is enabled via STARTUP_P2.

-Jeff
Manny DeAssis
Frequent Advisor

Re: SYS$COMMAND and OPA0 During System Startup

I would like to thank everyone for their speedy responses. As it turns out (via trial & error) I found the command I needed. It's basically the same command and concept that Volker, Phil & Art had suggested. I had a need for this a few years back. I just couldn't remember how we did it.

Now we need the same concept applied for contingency. If we're in an actual contingency we basically come up with all our settings intact. However if we're having a test we usually implement 'special settings' on the fly during system startup. Applying the 'open file opa0' during system startup is what I was looking for.

Thanks again to all who responded.
Manny DeAssis
Frequent Advisor

Re: SYS$COMMAND and OPA0 During System Startup

Oh, and thanks to you too Jeff.