[Info-vax] Reopen OPERATOR.LOG from batch?
Simon Clubley
clubley at remove_me.eisner.decus.org-Earth.UFP
Thu Sep 5 13:16:23 EDT 2019
On 2019-09-05, Bob Gezelter <gezelter at rlgsc.com> wrote:
> On Thursday, September 5, 2019 at 9:33:23 AM UTC-4, bill... at navistar.com wrote:
>> On Thursday, September 5, 2019 at 7:55:45 AM UTC-5, Jan-Erik Söderholm wrote:
>> > Hi.
>> >
>> > The online HELP for REPLY/LOG says:
>> >
>> > "The current terminal must be enabled as an operator terminal."
>> >
>> > And HELP for REPLY/ENABLE says:
>> >
>> > "The /ENABLE qualifier cannot be entered from a batch job."
>> >
>> > So then, how to close/reopen OPERATOR.LOG from a batch job?
>> >
>> > Jan-Erik.
>>
>> I rename, close, and archive the OPERATOR.LOG files on our clusters daily from a single batch job that uses SYSMAN to execute a procedure on all of the cluster members. This code snippet is basically what you need.
>>
>> $ define /user SYS$COMMAND OPA0:
>> $ reply/enable
>> $ define /user SYS$COMMAND OPA0:
>> $ reply /log ! create the new log file
>
> Jan-Erik,
>
> To understand why the DEFINE/USER, place a SHOW LOGICAL SYS$COMMAND in place of the REPLY commands, to wit:
>
> $ define /user SYS$COMMAND OPA0:
> $ show logical sys$command
>
> Check the output. Then comment out the DEFINE command and repeat. The difference should be obvious (hint: do a SHOW DEVICE/FULL on two devices.)
>
I think Jan-Erik has probably worked out what that command does already, :-)
but the real question is _why_ does it make a difference ?
The answer appears to be that reply/enable checks whether it is running
in a batch job by checking whether the current input device is a terminal
or not.
Unless that behaviour is documented as supported, it seems to me
that behaviour is prone to breaking if someone changes the code to
check in the proper way for whether the command is being run in a
batch job.
Question: Can you start up a scripted pseudo terminal session from
within a program running in a batch job (I've never tried it) and
if so, will the pseudo terminal session appear as an interactive
session or as a batch session ?
If it's the former, that might be a supported way for Jan-Erik to
do this.
Simon.
--
Simon Clubley, clubley at remove_me.eisner.decus.org-Earth.UFP
Microsoft: Bringing you 1980s technology to a 21st century world
More information about the Info-vax
mailing list