Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2015-04

How to cleanly terminate "http server application"/"fastcgi application"?

2 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Luca Olivetti

I couldn't find a built-in way to cleanly terminate them, so I had to install a signal handler to issue an Application.Terminate. Is there a provided way that I missed?

BTW, also, they don't daemonize under Linux/run as service under windows. Maybe they aren't supposed to?

Bye

Luca Olivetti Wetron Automation Technology http://www.wetron.es Tel. +34 935883004 Fax +34 935883007

Reply by email

Michael Van Canneyt
to Luca Olivetti
Luca Olivetti wrote
I couldn't find a built-in way to cleanly terminate them, so I had to install a signal handler to issue an Application.Terminate. Is there a provided way that I missed?

No. Calling Terminate is what needs to be called.
How/when this needs to be called is up to you.

Installing a signal handler is one way (a good one). I sometimes install a password protected URL handler that calls terminate.

BTW, also, they don't daemonize under Linux/run as service under windows. Maybe they aren't supposed to?

They are not supposed to.
That kind of thing is a design decision only you can make.

This is the reason why web components have the TWebHandler and TApplication classes split: the webhandler does the work, the TApplication part determines what kind of application it is. I have executables that can run as a service or as a normal binary.

Michael.

Reply by email