Service script and POL shutdown

Get Help on scripting in POL with configurations, config setups, script trouble shooting, etc.
Post Reply
xeon
Forum Regular
Posts: 338
Joined: Fri Oct 31, 2008 3:18 am

Service script and POL shutdown

Post by xeon »

Suppose that you have a script which starts at POL startup and that runs in background. Something like this:

Code: Select all

program xyz()
...
while (1)
   ...
   sleep(10);
endwhile
endprogram
Now, suppose that POL is Shutdown();-ed.

How it's handled the shutdown of a script like this? It is killed in the middle of the execution, or the core wait for the first pause in the script, for example a sleep(), and then shuts it down?

Is there a nice way to handle POL shutdown inside the script?
User avatar
CWO
POL Expert
Posts: 1160
Joined: Sat Feb 04, 2006 5:49 pm

Re: Service script and POL shutdown

Post by CWO »

Its killed immediately where it's at. There has never been a way to do something on shutdown.
Turley
POL Developer
Posts: 670
Joined: Sun Feb 05, 2006 4:45 am

Re: Service script and POL shutdown

Post by Turley »

Since shutdown is a scriptside function you can do whatever you wish in your shutdownscript. Send events, start a different script...
xeon
Forum Regular
Posts: 338
Joined: Fri Oct 31, 2008 3:18 am

Re: Service script and POL shutdown

Post by xeon »

Ugh. Ugly.

I can surely send some event before calling Shutdown();, but it's not very nice, everything that a script like this should have done in the time after it exits, and before POL is shutted down, isn't done. Not something I couldn't live without, but surely desiderable.
Maybe there's a way to "freeze" the world?
Turley
POL Developer
Posts: 670
Joined: Sun Feb 05, 2006 4:45 am

Re: Service script and POL shutdown

Post by Turley »

Of cause you cannot do something like:
Send_event(..);
Shutdown();
You need an additional event or a status variable.
Post Reply