dbTalk Databases Forums  

D3/NT automated shutdown, part II

comp.databases.pick comp.databases.pick


Discuss D3/NT automated shutdown, part II in the comp.databases.pick forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Brian Bond
 
Posts: n/a

Default D3/NT automated shutdown, part II - 02-06-2006 , 12:30 PM






In a posting several weeks ago, I inquired about automating a D3 shutdown.
The program below was submitted as a solution.

FOR I = 0 TO SYSTEM(18)
IF I NE SYSTEM(22) THEN EXECUTE "LOGOFF ":I:" (Z"
NEXT I
DATA 'Y'
CHAIN 'SHUTDOWN'

The program is run as user "ADMINISTRATOR_" with SYS2 privileges.


It is called from this three-line [edited] shutdown script:

[send an email "shutdown started..."]
C:\PROGRA~1\D3\D3Programs\D3Tcl.exe -d SYSPROG -c "RUN BP
AUTOMATED.SHUTDOWN"
[send an email "shutdown finished..."]



I installed the code, but due to some 24x7 scheduling conflicts, I hadn't
been able to test it (but given that the old program didn't work, I was
certainly no worse off having a new program that didn't work either...)

Cutting to the chase, we had a bad storm this weekend and the power went
out. I know the UPS script worked, since I received a "shutting down"
email, but I never received the following "finished" email.

After bringing the system back up, I had some time to actually run the new
D3 shutdown program. It hangs, apparently in a permanent manner, when it
chains to "shutdown". The UPS monitor finally gives up waiting for it and
shuts the server down anyway.

Any thoughts?

Thanks.



Reply With Quote
  #2  
Old   
Scott Ballinger
 
Posts: n/a

Default Re: D3/NT automated shutdown, part II - 02-06-2006 , 01:05 PM






Brian,

I don't think the (Z logoff option does anything in D3 anymore; the only
logoff option is (K which will "kill" a shelled out process.

That said, why bother with the logoff loop anyway? Doesn't shutdown do
that itself?

"shutdown" is a basic program in dm,bp,. If the data "Y" is causing the
problem, you could make your own that does the pre-shutdown stuff...

execute 'set-ovf-local 0 (f' capturing xx
execute 'clear-locks (q' capturing xx
execute 'sp-kill bfos' capturing xx;* [14]
execute 'sp-kill bds' capturing xx;* [14]
execute 't-det (u' capturing xx
execute 'network-setup shutdown';* [10]

and handles the transaction logger (if you use it) then chains to the
real shutdown process ":shutdown"

Unfortunately, as you are aware, in a 24x7 environment it is kind of
hard to test this stuff... (Sorry honey, I have to work on Christmas day
because that's the only time the system is available for this kind of
maintenance.)

/Scott Ballinger
Pareto Corporation
Edmonds WA USA
206 713 6006





Brian Bond wrote:
Quote:
In a posting several weeks ago, I inquired about automating a D3 shutdown.
The program below was submitted as a solution.

FOR I = 0 TO SYSTEM(18)
IF I NE SYSTEM(22) THEN EXECUTE "LOGOFF ":I:" (Z"
NEXT I
DATA 'Y'
CHAIN 'SHUTDOWN'

The program is run as user "ADMINISTRATOR_" with SYS2 privileges.


It is called from this three-line [edited] shutdown script:

[send an email "shutdown started..."]
C:\PROGRA~1\D3\D3Programs\D3Tcl.exe -d SYSPROG -c "RUN BP
AUTOMATED.SHUTDOWN"
[send an email "shutdown finished..."]



I installed the code, but due to some 24x7 scheduling conflicts, I hadn't
been able to test it (but given that the old program didn't work, I was
certainly no worse off having a new program that didn't work either...)

Cutting to the chase, we had a bad storm this weekend and the power went
out. I know the UPS script worked, since I received a "shutting down"
email, but I never received the following "finished" email.

After bringing the system back up, I had some time to actually run the new
D3 shutdown program. It hangs, apparently in a permanent manner, when it
chains to "shutdown". The UPS monitor finally gives up waiting for it and
shuts the server down anyway.

Any thoughts?

Thanks.



Reply With Quote
  #3  
Old   
Kevin Powick
 
Posts: n/a

Default Re: D3/NT automated shutdown, part II - 02-06-2006 , 03:28 PM



As Scott B. pointed out, since a SHUTDOWN should log off all lines
anyway, why bother with the LOGOFFs?

Also, why not shut down the D3 VME directly from the OS using:

C:\{InstallDir}\D3VME.EXE /STOP

You can check your D3 Books on line (help file) for more details, but
it appears to me that this will perform the same function as a SHUTDOWN
command from within D3.

This should also be much easier to implement with your UPS shutdown
script.

Kevin Powick


Reply With Quote
  #4  
Old   
Tony Gravagno
 
Posts: n/a

Default Re: D3/NT automated shutdown, part II - 02-06-2006 , 05:24 PM



Scott Ballinger wrote:

Quote:
"shutdown" is a basic program in dm,bp,. If the data "Y" is causing the
problem, you could make your own that does the pre-shutdown stuff...
Or just remove the DATA line and change the following line to:
CHAIN "SHUTDOWN (Y"


Before anyone puts "d3vme /stop" into a production environment I'd
like confirmation as to whether that really does do a clean shutdown
or if it's just a crash like "net stop d3vme".

T


Reply With Quote
  #5  
Old   
Kevin Powick
 
Posts: n/a

Default Re: D3/NT automated shutdown, part II - 02-06-2006 , 06:59 PM



Geez T, give me some credit. I did research this a little before
posting.

According to an old post by Mark Brown, d3vme / stop will perform a
logical shutdown and memory flush.

http://tinyurl.com/9j4at

--
Kevin Powick


Reply With Quote
  #6  
Old   
Kevin Powick
 
Posts: n/a

Default Re: D3/NT automated shutdown, part II - 02-06-2006 , 07:02 PM



Ok, on second thought, having read over my original reply, I see where
It looks like I was guessing when I said, "it seems to me...".

Back to my cave.

Kevin Powick


Reply With Quote
  #7  
Old   
Brian Bond
 
Posts: n/a

Default Re: D3/NT automated shutdown, part II - 02-07-2006 , 11:15 AM



I too was wondering why one would bother with doing the logoffs in a loop,
since it seemed to me that "shutdown" did the same thing as it was running.
But my observation is that there are some people in this newsgroup who
understand the innards of D3 far more than me and I am not going to be one
to ignore their advice.

So is there a difference between "net stop D3vme" and
"C:\{InstallDir}\D3VME.EXE /STOP"? I am suspecting "yes", thinking that
with the former, Windows just quasi-blasts the process as it sees fit,
whereas with the latter, D3 is shutting itself down in some sort of
controlled manner.

Doing a quick sidetrack into theory for a moment, presuming a "flush" is
performed immediately before D3 is is terminated in some non-desireable
manner (and the system is in a quiesent state), how much potential for
trouble is there? [I am not including an OS shutdown in this example.]

So at this point, it appears that Kevin's point of using
C:\{InstallDir}\D3VME.EXE /STOP in a shutdown script is a reasonable method
of controlling shutdown. Yea or nay? Thanks.





"Kevin Powick" <kevin (AT) powick (DOT) ca> wrote

Quote:
As Scott B. pointed out, since a SHUTDOWN should log off all lines
anyway, why bother with the LOGOFFs?

Also, why not shut down the D3 VME directly from the OS using:

C:\{InstallDir}\D3VME.EXE /STOP

You can check your D3 Books on line (help file) for more details, but
it appears to me that this will perform the same function as a SHUTDOWN
command from within D3.

This should also be much easier to implement with your UPS shutdown
script.

Kevin Powick




Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.