Page 1 of 1

Service script and POL shutdown

Posted: Thu Mar 17, 2011 7:51 am
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?

Re: Service script and POL shutdown

Posted: Thu Mar 17, 2011 9:35 am
by CWO
Its killed immediately where it's at. There has never been a way to do something on shutdown.

Re: Service script and POL shutdown

Posted: Thu Mar 17, 2011 10:58 am
by Turley
Since shutdown is a scriptside function you can do whatever you wish in your shutdownscript. Send events, start a different script...

Re: Service script and POL shutdown

Posted: Thu Mar 17, 2011 11:39 am
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?

Re: Service script and POL shutdown

Posted: Thu Mar 17, 2011 8:34 pm
by Turley
Of cause you cannot do something like:
Send_event(..);
Shutdown();
You need an additional event or a status variable.