Best practice to run initialization task before FCGI server starts?
Added by pppez80 almost 4 years ago
I have some initialization process (read from DB, write to cache) that I would like to execute before spawning the multi threads of my fastcgi.server.
Is there a general approach / best practice on how to implement? I could write my own startup daemon but wonder if there is a different path with lighttpd at play?
Replies (3)
RE: Best practice to run initialization task before FCGI server starts? - Added by gstrauss almost 4 years ago
Whether lighttpd is starting your fastcgi server with "bin-path", or you are starting your server via an external mechanism, it appears that the answer to your question is the same for both: your server startup script should do the things you want to do at startup, and then should execute your fastcgi server.
RE: Best practice to run initialization task before FCGI server starts? - Added by pppez80 almost 4 years ago
Sorry, I am not sure I follow. Can you unpack
your server startup script should do the things you want to do at startup, and then should execute your fastcgi server.
Is there a way to define a startup script in lighttpd that gets called and execute syncronously before the fastcgi server gets started?
RE: Best practice to run initialization task before FCGI server starts? - Added by gstrauss almost 4 years ago
How do you start your fastcgi server? That is your (fastcgi) server startup script.