[Bug 15032] [Plack] Scripts that fork (like stage-marc-import.pl) don't work as expected
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15032 --- Comment #30 from David Cook <dcook@prosentient.com.au> --- (In reply to Jonathan Druart from comment #26)
I do not think your Koha::Daemon will work for the background jobs.
To me, the best way to fix this would be to provide a Koha daemon, instead. But it would watch a DB table, which would allow us to build a view on top of it to manage the different jobs (and history).
We could also have different daemons for different needs (a param of the daemon matching a column in the DB table).
The question behind that is security, we will have to list the different operations the daemon is allowed to process (and so we will loose flexibility).
I have spent a *lot* of time trying to fix this issue by forking, etc. And my conclusion is: it's not feasible (see discussions and tries on related bug reports)
See also bug 1993.
My Koha::Daemon is just a module for making a daemon process; it's similar to Proc::Daemon on CPAN. But yeah I could see my Koha::OAI::Harvester::Listener and Koha::OAI::Harvester not working for all background jobs. They work well in my case but I'd be happy to actually replace (elements of) them with a more general Koha solution, if it worked for my use case too. Yeah I think that different daemons for different needs makes sense too. Like in the case of #10662, I originally wrote a generic job server, but then realized it might not suit everyone, so I re-wrote it just for that specific task of harvesting OAI-PMH records. Yeah, I don't think forking makes sense in a Plack/persistent environment. Actually, I don't think it makes sense in the CGI environment either, but it "worked". Setting up separate daemons is easy. I don't know why we don't just do that. The issue then I suppose is security, as you've said, and deciding on communication protocols. -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org