[FreeNX-kNX] RE: Nxserver --terminate problem and nxnode file is missing a line
Jonathan Chen
jonachen at cisco.com
Thu May 5 18:46:43 UTC 2005
A little bit more digging around (not expert bash programmer - FYI). I
finally got the "bash -x" mode to work for nxnode and below is basically
result of the nxnode section. I see no killing of the PID.
++ '[' -z /tmp/NX-jonachen ']'
+ echo 'NX> 1000 NXNODE - Version 1.4.0-03 OS (GPL)'
NX> 1000 NXNODE - Version 1.4.0-03 OS (GPL)
+ '[' --terminate '!=' --check -a --terminate '!=' --setkey ']'
+ read CMDLINE
+ CMDLINE=a=b&sessionid=4B231EA2EF30B960507DF2CF67E0375C
+ cmd_node_terminate
++ getparam_sessionid
+++ getparam sessionid
+++ stringinstring '&sessionid='
'a=b&sessionid=4B231EA2EF30B960507DF2CF67E0375C'
+++ return 0
+++ result=4B231EA2EF30B960507DF2CF67E0375C
+++ result=4B231EA2EF30B960507DF2CF67E0375C
+++ echo 4B231EA2EF30B960507DF2CF67E0375C
+++ return 0
++ sessionid=4B231EA2EF30B960507DF2CF67E0375C
++ '[' -n 4B231EA2EF30B960507DF2CF67E0375C ']'
++ echo 4B231EA2EF30B960507DF2CF67E0375C
+ sessionid=4B231EA2EF30B960507DF2CF67E0375C
+ echo 'NX> 716 Terminating session 4B231EA2EF30B960507DF2CF67E0375C on user
request.'
NX> 716 Terminating session 4B231EA2EF30B960507DF2CF67E0375C on user
request.
++ cd /tmp/NX-jonachen/.nx/
++ echo C-cde-dev-01-1000-4B231EA2EF30B960507DF2CF67E0375C
++ cut -d- -f3
+ display=dev
+ node_terminate_session cde-dev-01-dev-4B231EA2EF30B960507DF2CF67E0375C
+ '[' -d
/tmp/NX-jonachen/.nx/C-cde-dev-01-dev-4B231EA2EF30B960507DF2CF67E0375C/ ']'
+ return
+ echo 'NX> 1001 Bye.'
NX> 1001 Bye.
NX> 999 Bye
I probably am missing something but I'm not sure why it would "return" a
failure when the particular directory in question should exist.
node_terminate_session()
{
[ -d "$USER_FAKE_HOME/.nx/C-$1/" ] || return
AGENT_PID=$(cat $USER_FAKE_HOME/.nx/C-$1/pids/agent 2>/dev/null)
if [ -n "$AGENT_PID" ]
then
kill $AGENT_PID 2>/dev/null
if ! [ "$virtualdesktop" = "0" -a "$ENABLE_ROOTLESS_MODE" !=
"1" ]
then
sleep 1
kill -9 $AGENT_PID 2>/dev/null
fi
fi
# remove possible leftover display ...
display=$(echo $1 | cut -d"-" -f2)
rm -f /tmp/.X$display-lock
rm -f /tmp/.X11-unix/X$display
rm -f /tmp/.nX$display-lock
# remove cookie
$COMMAND_XAUTH -v source
$USER_FAKE_HOME/.nx/C-$sess_id/scripts/authority >/dev/null 2>&1
# FIXME: What to do on errors ... ?
# TODO: Add parsing of var ...
#mv $USER_FAKE_HOME/.nx/C-$1/ $USER_FAKE_HOME/.nx/F-C-$1/
rm -rf $USER_FAKE_HOME/.nx/C-$1/
}
> -----Original Message-----
> From: Jonathan Chen [mailto:jonachen@]
> Sent: Wednesday, May 04, 2005 10:43 AM
> To: 'freenx-knx at kde.org'
> Subject: Nxserver --terminate problem and nxnode file is
> missing a line
>
> Hi all,
>
> I seem to have problem terminating a session on RHEL 3(FreeNX
> 0.3.1 RPM). When trying to terminate my own session or
> others via sudo access, I get the following message...
>
> Sudo nxserver --terminate jonachen
>
> NX> 100 NXSERVER - Version 1.4.0-03 OS (GPL)
> stty: standard input: Invalid argument
> NX> 1000 NXNODE - Version 1.4.0-03 OS (GPL)
> NX> 716 Terminating session 251A41730829168C4D21369E3AC9319F
> on user request.
> NX> 1001 Bye.
> NX> 999 Bye
>
> I still am have not found the cause of my problem yet but
> wondering if I am using the command incorrectly under sudo
> environment. The command does kill my session on FreeNX's
> db, but not really kill the process when I do see a line to
> kill the processes too. So is this a bug or I did something
> wrong. I tried to do a sudo bash -x to follow the
> --terminate command line but was unable to because of sudo
> restriction settings.
>
> Also while doing a quick follow of the codes going to
> /usr/nxnode, I noticed that line below is missing...
>
> rm -f /tmp.nX$display-lock
>
> After
>
> # remove possible leftover display ...
> display=$(echo $1 | cut -d"-" -f2)
> rm -f /tmp/.X$display-lock
> rm -f /tmp/.X11-unix/X$display
>
> Under normal circumstances I believe the missing line is not
> needed because its taken cared of somewhere else in FreeNX
> codes. But doing a nxserver --terminate, its missing the above line.
>
>
More information about the FreeNX-kNX
mailing list