You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On a slightly related note, it feels a little bit brute-force-y to just kill all nginx master processes. It might be quite unlikely, but there could be another, completely unrelated, nginx process around, right?
What about spawning the nginx process via node core's child_process.spawn on proxrox start, remembering the pid (in the tmp folder), and killing only the process with that pid on proxrox stop?
I very much like the idea! But then proxrox stop could only stop the last started nginx process. Can we come up with a strategy to stop the nginx process which is currently running for a given .proxrox.yaml file?
I investigated a bit yesterday. The pid returned by child_process.spawnSync is not the pid of the nginx master process. Apparently nginx -c ... -p ... (the command used to start nginx) starts a short lived process which in turn spawns the master process. However, the nginx pid is already available in /tmp/proxrox/uuid/log/nginx.pid because this is configured in the nginx config template.
So we could have a look at all existing files that match the pattern /tmp/proxrox/uuid/log/nginx.pid, read the pids from those files and kill only those processes. That still would kill all nginx processes created by proxrox but it is a bit better than killing all nginx intances, even those not created by proxrox.
The alternative would be to put a file (only the pid or the whole tmp structure) into the current directory but that creates some new problems.
I think there is no third alternative, as proxrox has no persistent storage between proxrox start and proxrox stop.
The text was updated successfully, but these errors were encountered:
As discussed in #14
@basti1302:
@bripkens:
I investigated a bit yesterday. The pid returned by child_process.spawnSync is not the pid of the nginx master process. Apparently
nginx -c ... -p ...
(the command used to start nginx) starts a short lived process which in turn spawns the master process. However, the nginx pid is already available in /tmp/proxrox/uuid/log/nginx.pid because this is configured in the nginx config template.So we could have a look at all existing files that match the pattern /tmp/proxrox/uuid/log/nginx.pid, read the pids from those files and kill only those processes. That still would kill all nginx processes created by proxrox but it is a bit better than killing all nginx intances, even those not created by proxrox.
The alternative would be to put a file (only the pid or the whole tmp structure) into the current directory but that creates some new problems.
I think there is no third alternative, as proxrox has no persistent storage between proxrox start and proxrox stop.
The text was updated successfully, but these errors were encountered: