Enabling a user does not enable it

Forums / NoMachine for Linux / Enabling a user does not enable it

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
  • #35219


    My use case is that I’m starting NoMachine (v7.6.2) automatically with a script and then enable a user (the server is configured with “EnableUserDB 1”) in a bash script

    systemctl is-active --quiet nxserver
    if [ "$exit_code" != "0" ]
    # The service is not running, we start it
    service nxserver start
    # sleep 2 # Weird hack to make it work
    # Authorize the user to open a nomachine session
    log "Nxserver enabling of $SLURM_JOB_USER"
    /usr/NX/bin/nxserver --userenable $SLURM_JOB_USER

    Unfortunately, even though I see NoMachine saying my user is enabled “NX> 301 User ‘xxxx’ is enabled in the NX user DB.”, half of the time it ends being enabled and half of the time it is not. I check the status with ‘/usr/NX/bin/nxserver –userlist’ and also checked if I could log or not with nxplayer.

    My weird hack is to add a “sleep 2” and now it always works but that’s awful;

    I thought I should be waiting for the nxserver to be started but my attempt were unsucessful . I used the code

    service nxserver start
    systemctl is-active --quiet nxserver
    while [ "$exit_code" != "0" ]; do
    systemctl is-active --quiet nxserver
    sleep 1

    Do you have any idea on what is going wrong and what’s the proper way to handle it ?

    Thank you for your help and thank you for the good job.


    In your script possibly instead of:

    service nxserver start

    Use this:

    service nxserver start > /dev/null 2>&1 &


    /etc/NX/nxserver --startup


    Thank you for your answer but unfortunately I do not understand why that should fix the problem.

    Your first suggestion will just redirect the stdout and stderr to /dev/null

    For the second one you propose, it triggers two questions in my mind ; The nxserver service starts

    /etc/NX/nxserver --daemon

    which is indeed different from the one you propose : etc/NX/nxserver --startup ; But do you know the difference ? is etc/NX/nxserver --startup blocking when etc/NX/nxserver --daemon is not ?

    Thank you.

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.