Author Topic: REXX and 'mode'  (Read 515 times)

Ben

  • Full Member
  • ***
  • Thank You
  • -Given: 0
  • -Receive: 3
  • Posts: 182
  • Know Thyself
    • View Profile
REXX and 'mode'
« on: February 08, 2018, 07:00:25 pm »
Hello, everyone.

I have recently had some serious hardware issues on my server(s) and in the rebuilding process I have taken some time to rework the *.cmd files that start and restart my servers. The following example is for named.exe, but is typical of how I start/restart all of my server software.
 
While the following REXX script


Code: [Select]
--
/* 'Named Run.cmd' starts the DNS server named.exe  and keeps it going. Created 180127
   Last modified 180128, 180201, 180208, */

Do Forever

'ECHO OFF'

/* set window size */
'mode 29,7'

Say 'Named is running'

/* adjust as necessary */
'set path=C:\mptn\etc'
'C:'
'cd \mptn\etc'
'named'

Call Syssleep 2
end
exit do
--

works fine and loads the server well enough, (in this case named.exe), when it auto restarts after it fails, (or by testing via ^C), I get the following error;

Code: [Select]
SYS1041: The name mode is not recognized as an internal or external command, operable program or batch file.
    10 *-*     'mode 29,7';
       +++       RC(1041)

I'm no expert on this, but I know that some people who frequent this site are.

Can one of you experts, (or anyone for that matter), tell me why "mode 29,7" is accepted at first run, but not upon restart?

Thanks.

Doug Bissett

  • Hero Member
  • *****
  • Thank You
  • -Given: 1
  • -Receive: 39
  • Posts: 1035
    • View Profile
Re: REXX and 'mode'
« Reply #1 on: February 08, 2018, 08:57:06 pm »
Quote
'mode 29,7'

I have no idea why this would work, at all. It should be: mode CO29,7 or mode BW29,7

Dave Yeo

  • Hero Member
  • *****
  • Thank You
  • -Given: 8
  • -Receive: 106
  • Posts: 1459
    • View Profile
Re: REXX and 'mode'
« Reply #2 on: February 08, 2018, 09:11:49 pm »
That was my thought, then I looked at some code. Here's a snippet from awget\awgexec.cmd.

Code: [Select]
/* adjust session window */
parse upper value cfg.downloads_window with show","rows","cols
"MODE "rows","cols

so it seems to be valid REXX, can't find anything in the documentation though.

Rich Walsh

  • Jr. Member
  • **
  • Thank You
  • -Given: 0
  • -Receive: 6
  • Posts: 60
  • O N U !
    • View Profile
Re: REXX and 'mode'
« Reply #3 on: February 08, 2018, 09:14:50 pm »
Can one of you experts, (or anyone for that matter), tell me why "mode 29,7" is accepted at first run, but not upon restart?

Yep.

You did yourself in with 'set path=C:\mptn\etc'.  'mode.com' is in C:\os2 but that's no longer on the PATH for the session you started.  Try 'set path=C:\mptn\etc;%PATH%'

BTW... in an OS/2 session, there's no need for "CO" or "BW".

Dave Yeo

  • Hero Member
  • *****
  • Thank You
  • -Given: 8
  • -Receive: 106
  • Posts: 1459
    • View Profile
Re: REXX and 'mode'
« Reply #4 on: February 08, 2018, 09:29:38 pm »
Btw Ben, your gif triggers this,
Quote
Timestamp: 02/08/18 12:27:25 PM
Warning: Loading mixed (insecure) display content "http://www.sf-w.net/Pics/1/Ben_Dragon-100.gif" on a secure page
Source File: https://www.os2world.com/forum/index.php/topic,1650.0.html
Line: 0

In this new world of HTTPS everywhere.

Ben

  • Full Member
  • ***
  • Thank You
  • -Given: 0
  • -Receive: 3
  • Posts: 182
  • Know Thyself
    • View Profile
Re: REXX and 'mode'
« Reply #5 on: February 08, 2018, 11:41:19 pm »
Quote
'mode 29,7'

I have no idea why this would work, at all. It should be: mode CO29,7 or mode BW29,7

Mode CO*,* and mode *,* work the same; I have used either for years.
I did try the mode CO*,* option before first posting here; no difference.

Just in case anyone is wondering, I do use 4OS/2 I don't use it for the *.cmd files.

Ben

  • Full Member
  • ***
  • Thank You
  • -Given: 0
  • -Receive: 3
  • Posts: 182
  • Know Thyself
    • View Profile
Re: REXX and 'mode'
« Reply #6 on: February 08, 2018, 11:47:44 pm »
Btw Ben, your gif triggers this,
Quote
Timestamp: 02/08/18 12:27:25 PM
Warning: Loading mixed (insecure) display content "http://www.sf-w.net/Pics/1/Ben_Dragon-100.gif" on a secure page
Source File: https://www.os2world.com/forum/index.php/topic,1650.0.html
Line: 0

In this new world of HTTPS everywhere.

OK. Thanks for the heads up, Dave. I haven't finished with restoring/recreating my servers and the apache/2 files that I am presently using as place holders are ten years old.

I am working with Jan to try and recover the last incarnation. While it doesn't look likely, I am trying to remain optimistic.

Right now I can't do anything about the Avatar, but I will get around to it eventually; in the meantime, sorry for the eye-pollution.

Hmm. I have noticed that it also seems to have increased in size somehow since the last time I was on here, and is threatening the frame width limits...

Can you see it at all?
« Last Edit: February 08, 2018, 11:57:12 pm by Ben »

Ben

  • Full Member
  • ***
  • Thank You
  • -Given: 0
  • -Receive: 3
  • Posts: 182
  • Know Thyself
    • View Profile
Re: REXX and 'mode'
« Reply #7 on: February 08, 2018, 11:52:55 pm »
Can one of you experts, (or anyone for that matter), tell me why "mode 29,7" is accepted at first run, but not upon restart?

Yep.

You did yourself in with 'set path=C:\mptn\etc'.  'mode.com' is in C:\os2 but that's no longer on the PATH for the session you started.  Try 'set path=C:\mptn\etc;%PATH%'

BTW... in an OS/2 session, there's no need for "CO" or "BW".

Bang on, Rick!

And you got it in one... Mr. REXX.

Thank-you kindly, and everyone else for responding so quickly.