Skip to content

nxagent window in desktop mode can not be closed #435

@mviereck

Description

@mviereck

I'm using nxagent as a standalone nested X server.
If any applications are running in nxagent, I can not close nxagent desktop window.
I get this error message:

NXTransDialog: WARNING! Couldn't start '/usr/NX/bin/nxclient'. Error is 2 'No such file or directory'.
Warning: Couldn't start '/usr/NX/bin/nxclient'. Error is 2 'No such file or directory'.

As nxclient does not exist, I'm using a workaround. I can specify a fake nxclient with environment variable NX_CLIENT. nxagent sends this cli options:

--dialog yesnosuspend --caption NX --message Press the disconnect button to disconnect the running session.
You will be able to resume the session at later time. Press the
terminate button to exit the session and close all the running
programs. --parent 9869 --display :1448

Switch --parent provides the process id of nxagent. Parsing the output, I can kill nxagent:

#! /bin/bash
# helper script to terminate nxagent. 
# nxagent runs program stored in NX_CLIENT if desktop window close button is pressed.
# (real nxclient does not exist)
echo "NXclient: $@" >> '$Xinitlogfile'
parsed=$(getopt --options="" --longoptions="parent:,display:,dialog:,caption:,message:" -- "$@")
eval set -- $parsed
while [ -n "$1" ] ; do
  case "$1" in
    --dialog) dialog=$2 && shift ;;
    --display|--caption|--message|--window) shift ;;
    --parent) pid=$2 && shift ;;
    --) ;;
  esac
  shift
done
case $dialog in
  yesnosuspend)  kill $pid  ;;
esac

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions