Connecting Tech Pros Worldwide Help | Site Map

Please help: How to log data before shutdown?

  #1  
Old July 17th, 2005, 06:41 AM
Jerry
Guest
 
Posts: n/a
Hi All!

Quick question:
Assume your PHP script is running in the background executing some
long, time consuming process. And while it's running the Host Service
Provider decides to shut down the server for maintenance.

How are running scripts in that case terminated? Will they exit
orderly or will they simply be aborted like pulling the plug?

Will the "register_shutdown_function()" be executed when a server
shut-down exits all running processes?

How can I get my script to write some log data before it is stopped
when the server shuts down or so?

Your help is greatly appreciated!!!
Jerry
  #2  
Old July 17th, 2005, 06:41 AM
Paul Delannoy
Guest
 
Posts: n/a

re: Please help: How to log data before shutdown?


Jerry a écrit:[color=blue]
> Hi All!
>
> Quick question:
> Assume your PHP script is running in the background executing some
> long, time consuming process. And while it's running the Host Service
> Provider decides to shut down the server for maintenance.
>
> How are running scripts in that case terminated?[/color]
YES of course
[color=blue]
> Will they exit
> orderly or will they simply be aborted like pulling the plug?[/color]
The second helas.
[color=blue]
> Will the "register_shutdown_function()" be executed when a server
> shut-down exits all running processes?[/color]
Perhaps no, perhaps yes.

[color=blue]
> How can I get my script to write some log data before it is stopped
> when the server shuts down or so?[/color]
Write your script with some regular 'data save' in a file.

  #3  
Old July 17th, 2005, 06:41 AM
Garp
Guest
 
Posts: n/a

re: Please help: How to log data before shutdown?



"Jerry" <submitstuff@lycos.com> wrote in message
news:m8j8c0hsms4ko6oka5pl9sbond778rtp2k@4ax.com...[color=blue]
> Hi All!
>
> Quick question:
> Assume your PHP script is running in the background executing some
> long, time consuming process. And while it's running the Host Service
> Provider decides to shut down the server for maintenance.
>
> How are running scripts in that case terminated? Will they exit
> orderly or will they simply be aborted like pulling the plug?
>
> Will the "register_shutdown_function()" be executed when a server
> shut-down exits all running processes?
>
> How can I get my script to write some log data before it is stopped
> when the server shuts down or so?
>
> Your help is greatly appreciated!!!
> Jerry[/color]

You'll need to clarify the problem you're having - scripts can stop running
at any second for countless reasons and they should be able to recover from
that on production sites (i.e. not file-locking anything, not relying on
databases not being in transitional states, etc). Database transactions
(autocommit disabled) is the way to go here. Again, no idea what problem
you're trying to avoid.

Garp


Closed Thread


Similar Threads
Thread Thread Starter Forum Replies Last Post
migration from oracle 8i to 9i susmita_ganguly@yahoo.com answers 4 June 27th, 2008 06:41 PM
HELP - SQL Server Crash ? Memory leak ? Thue Tuxen Sørensen answers 19 July 20th, 2005 03:43 AM
migration from oracle 8i to 9i susmita_ganguly@yahoo.com answers 4 July 19th, 2005 10:25 PM