How to restart the nxd service without terminating sessions
The Network Server for accepting connection by NX protocol is nxd and is listening on port 4000 by default,
see also the Server Guide at: https://www.nomachine.com/all-documents
If the nxd service is not running for some reasons, the client will receive a message like this:
Could not connect to the server.
Error is 107: Connection refused
Running sessions or disconnected session are not affected by a stopped nxd, just new connection by NX protocol will be not possible. Connected clients will stay connected to their sessions while nxd is stopped or restarted.
The server command to restart nxd is:
nxserver --restart nxd
If for some reasons the nxd service needs to be restarted and the 'nxserver --restart nxd' command doesn't help because of an inconsistent status of the process, it's possible to manually terminate the current nxd process and start a new one. To do that:
1) Retrieve pid (<pid>) of current nxd process from the output of this command:
$ ps -ef |grep "nxserver.bin --daemon"
2) Kill the nxd process:
$ sudo kill -9 <pid>
The nxd service will then be automatically respawned.This can be verified by executing these commands:
$ sudo /etc/NX/nxserver --status
and
$ ps -ef |grep nxd
