Special Considerations for Windows

 

 

This section applies to instances running directly on Windows. This does not apply to instances running within Linux Docker containers on Windows

Windows does not support Unix-style signals. Signals are software interrupts that applications can use to determine when important events occur. For example, signals are used by most operating systems to let an application know that shut down has been requested so that the application can perform any needed cleanup processing.

This means that automatic seat deactivation doesn’t work on Windows in most scenarios. The only scenario where seat deactivation works automatically on Windows is when the instance is started from an interactive command prompt/shell and stopped using CTRL+C.

Automatic Seat Deactivation in PM2 for Windows

If deploying an instance in PM2 for Windows, automatic seat deactivation will only work if the process is started with PM2’s --shutdown-with-message option. This option causes PM2 to send an Inter-Process Communication (IPC) message to the process. Profound.js and Profound API will listen for this message and perform automatic seat deactivation before shutting down.

See section Windows Graceful Stop in the PM2 documentation for more information:

If deploying in PM2 on other operating systems, standard shutdown using signals is recommended.

Automatic Seat Deactivation in Visual Studio Code for Windows

Instances started with VS Code’s debugger will NOT perform automatic seat deactivation when shut down using the stop button in the debug toolbar:

To work around this, you can shut down using an alternate technique. In your launch configuration, set the console field to “integratedTerminal”. Example launch configuration:

{ "version": "0.2.0", "configurations": [ { "type": "node", "request": "launch", "name": "Launch Program", "skipFiles": [ "<node_internals>/**" ], "program": "${workspaceFolder}\\start.js", "console": "integratedTerminal", "env": { "PJS_FLOATING_AUTHORIZATION": "plls_api_xxx" } } ] }

When started using this configuration, the instance launches in a debug terminal window. You can then type CTRL+C in the terminal window to shut down with automatic seat deactivation:

Wait a moment after typing, and you should see the deactivation messages: