Closed ghost closed 4 years ago
thanks for all the details! just 1 Q: does this approach require crossbar to be run with local admim rights on windows (to be able to send a SIGTERM - even though the worker processes had been spawned from the controller process which also send the signal)?
@oberstet Oops, good question! On my company PC my account has local admin rights and SIGTERM works. Both "crossbar start" and "stop" commands are running without elevated command prompt. This is the output of the "crossbar stop" command with the fix applied:
C:\Users\xxxxxxx>crossbar stop
Stopping Crossbar.io currently running from node directory C:\Users\xxxxxx (PID 3328) ...
... process 3328 still alive - will _terminate_ now.
SIGTERM sent to process 3328 .. waiting for exit (5 seconds) ...
Process 3328 terminated.
Not sure if this still works for accounts without local admin rights... Unfortunately, I can't test it easily, as company group policies prevent me from creating such a local account on my company PC.
@oberstet I just found a way to create a new local account without admin rights on my Win 10 machine. Hope to have some time to install and test crossbar this afternoon. I'll keep you informed...
@oberstet Good news! My patched version of "crossbar stop" also works on a local Windows account without Administrator privileges (account is just part of USER group). So yes, SIGTERM will do the job!
published as part of https://github.com/crossbario/crossbar/tree/v20.8.1
Thanks a lot!
Crossbar version: Crossbar v20.5.1.dev1 Platform: Windows 10 Enterprise 1803
Error log:
Steps to reproduce:
Issue:
In Python on Windows, you cannot send a SIGINT signal to terminate a process, you have to use SIGTERM or
process.terminate
instead. Invoking SIGINT raises aValueError
which is not handled by your program.Fix:
In node/main.py add special cases for Windows, like this: