Conversation
Notices
-
Embed this notice
@grunfink@comam.es I have a couple little feature requests that I think might slightly improve the usage of #Snac with cgi-fcgi on cheap shared hostings:
1) add to server.json an option to configure a folder where to write logs (or at least to save them in a dedicated folder in base dir) instead of standard output. Within such folder, I'd name them after the start date of the server (e.g. snac_2024-12-13.log). When the option is not defined, I'd preserve the current behavior (log to stdout).
2) when running as a server, acquire an advisory lock on the pid, and if you cannot acquire the lock, just exit because someone else is still handling requests for that basedir.
-
Embed this notice
Great. I'll do the advisory lock on the pidfile, I think it's a good measure.
-
Embed this notice
As for 1) I just noticed the log/ folder that exactly does what I need, sorry for the noise @grunfink@comam.es
2) might still be useful on race conditions, when two different requests to cgi-fcgi find that snac is not running at the same time and both try to start it: we don't want to have two instances of snac racing so the second should happily exits.
-
Embed this notice
I've just pushed to the repository a version with pidfile locking; please, confirm if it meets your needs.