Dear X2Go folks,
while looking into sessions which are still active on the server after
the client was suspended and could not reconnect after resume, I noticed
that /usr/sbin/x2gocleansessions
seems to not properly exit. It is
somehow run in background and does not exit.
$ /usr/sbin/x2gocleansessions --help
$ echo $?
0
$ /usr/sbin/x2gocleansessions --version
$ echo $?
0
They are still listed by ps aux | grep x2go
.
Thanks,
Paul
Hi Paul,
On So 26 Aug 2012 15:15:40 CEST Paul Menzel wrote:
Dear X2Go folks,
while looking into sessions which are still active on the server after the client was suspended and could not reconnect after resume, I noticed that
/usr/sbin/x2gocleansessions
seems to not properly exit. It is somehow run in background and does not exit.$ /usr/sbin/x2gocleansessions --help $ echo $? 0 $ /usr/sbin/x2gocleansessions --version $ echo $? 0
They are still listed by
ps aux | grep x2go
.
X2Go clean sessions script is a daemon script. It should be possible
to execute multiple instances, but it should fork into background.
There is no --help and --version available, so these optioned commands
will just start another instance of the daemon.
Mike
--
DAS-NETZWERKTEAM mike gabriel, rothenstein 5, 24214 neudorf-bornstein fon: +49 (1520) 1976 148
GnuPG Key ID 0x25771B31 mail: mike.gabriel@das-netzwerkteam.de, http://das-netzwerkteam.de
freeBusy: https://mail.das-netzwerkteam.de/freebusy/m.gabriel%40das-netzwerkteam.de.xf...
Dear Mike,
as always, thank you for your fast response!
Am Sonntag, den 26.08.2012, 21:31 +0200 schrieb Mike Gabriel:
On So 26 Aug 2012 15:15:40 CEST Paul Menzel wrote:
Dear X2Go folks,
while looking into sessions which are still active on the server after the client was suspended and could not reconnect after resume, I noticed that
/usr/sbin/x2gocleansessions
seems to not properly exit. It is somehow run in background and does not exit.$ /usr/sbin/x2gocleansessions --help $ echo $? 0 $ /usr/sbin/x2gocleansessions --version $ echo $? 0
They are still listed by
ps aux | grep x2go
.X2Go clean sessions script is a daemon script. It should be possible
to execute multiple instances, but it should fork into background.
There is no --help and --version available, so these optioned commands
will just start another instance of the daemon.
Interesting, thank you for the explanation.
Is there an advantage over letting the user to decide to start in the foreground or in the background by using the ampersand »&«?
Thanks,
Paul
Is there an advantage to allowing multiple copies of the daemon to run, instead of having it do one of the following:
On Sun, Aug 26, 2012 at 12:51 PM, Paul Menzel < paulepanter@users.sourceforge.net> wrote:
Dear Mike,
as always, thank you for your fast response!
Am Sonntag, den 26.08.2012, 21:31 +0200 schrieb Mike Gabriel:
On So 26 Aug 2012 15:15:40 CEST Paul Menzel wrote:
Dear X2Go folks,
while looking into sessions which are still active on the server after the client was suspended and could not reconnect after resume, I noticed that
/usr/sbin/x2gocleansessions
seems to not properly exit. It is somehow run in background and does not exit.$ /usr/sbin/x2gocleansessions --help $ echo $? 0 $ /usr/sbin/x2gocleansessions --version $ echo $? 0
They are still listed by
ps aux | grep x2go
.X2Go clean sessions script is a daemon script. It should be possible to execute multiple instances, but it should fork into background. There is no --help and --version available, so these optioned commands will just start another instance of the daemon.
Interesting, thank you for the explanation.
Is there an advantage over letting the user to decide to start in the foreground or in the background by using the ampersand »&«?
Thanks,
Paul
X2Go-Dev mailing list X2Go-Dev@lists.berlios.de https://lists.berlios.de/mailman/listinfo/x2go-dev
Hi Benjamin,
On Mo 27 Aug 2012 02:24:02 CEST Benjamin Shadwick wrote:
Is there an advantage to allowing multiple copies of the daemon to run, instead of having it do one of the following:
- Either kill previous instance(s) of the daemon and replace it with a new running instance, or
- Abort the start of the new instance when a previous running instance is detected?
Yes, the lower solution has just appeared on my todo list. If you have
time to provide a patch, feel free to deliver on.
Otherwise, I will see to it during the next couple of days.
Mike
--
DAS-NETZWERKTEAM mike gabriel, rothenstein 5, 24214 neudorf-bornstein fon: +49 (1520) 1976 148
GnuPG Key ID 0x25771B31 mail: mike.gabriel@das-netzwerkteam.de, http://das-netzwerkteam.de
freeBusy: https://mail.das-netzwerkteam.de/freebusy/m.gabriel%40das-netzwerkteam.de.xf...
Am 27.08.2012 09:39, schrieb Mike Gabriel:
On Mo 27 Aug 2012 02:24:02 CEST Benjamin Shadwick wrote:
- Abort the start of the new instance when a previous running instance is detected?
Yes, the lower solution has just appeared on my todo list. If you have time to provide a patch, feel free to deliver on.
Otherwise, I will see to it during the next couple of days.
Hi Mike, das ist Bash und nicht Perl, und außerdem nicht sonderlich hübsch, aber vielleicht als Anregung...
#!/bin/bash PSOUTPUT=$(ps --no-headers -C $(basename $0)) COUNT=$(echo -e "$PSOUTPUT" | wc -l) if [ "$COUNT" -gt "1" ] ; then echo "Already running." exit 1 else echo "Running..." sleep 30 echo "Done." fi
Gruß Stefan
Whoops, sorry. Not enough caffeine this morning.
Am 27.08.2012 10:39, schrieb Stefan Baur:
Hi Mike, das ist Bash und nicht Perl, und außerdem nicht sonderlich hübsch, aber vielleicht als Anregung...
This translates to: "Hi Mike, this is Bash, not Perl, and not exactly elegant, but might serve as an inspiration.
#!/bin/bash PSOUTPUT=$(ps --no-headers -C $(basename $0)) COUNT=$(echo -e "$PSOUTPUT" | wc -l) if [ "$COUNT" -gt "1" ] ; then echo "Already running." exit 1 else echo "Running..." sleep 30 echo "Done." fi
-Stefan
Hi Paul,
On So 26 Aug 2012 21:51:05 CEST Paul Menzel wrote:
Dear Mike,
as always, thank you for your fast response!
Am Sonntag, den 26.08.2012, 21:31 +0200 schrieb Mike Gabriel:
On So 26 Aug 2012 15:15:40 CEST Paul Menzel wrote:
Dear X2Go folks,
while looking into sessions which are still active on the server after the client was suspended and could not reconnect after resume, I noticed that
/usr/sbin/x2gocleansessions
seems to not properly exit. It is somehow run in background and does not exit.$ /usr/sbin/x2gocleansessions --help $ echo $? 0 $ /usr/sbin/x2gocleansessions --version $ echo $? 0
They are still listed by
ps aux | grep x2go
.X2Go clean sessions script is a daemon script. It should be possible to execute multiple instances, but it should fork into background. There is no --help and --version available, so these optioned commands will just start another instance of the daemon.
Interesting, thank you for the explanation.
Is there an advantage over letting the user to decide to start in the foreground or in the background by using the ampersand »&«?
The script needs root privileges on the file system and it is launched via
invoke-rc.d x2goserver start
It is not supposed to run with user privileges. Please read the
script's Perl code for further insights.
Mike
--
DAS-NETZWERKTEAM mike gabriel, rothenstein 5, 24214 neudorf-bornstein fon: +49 (1520) 1976 148
GnuPG Key ID 0x25771B31 mail: mike.gabriel@das-netzwerkteam.de, http://das-netzwerkteam.de
freeBusy: https://mail.das-netzwerkteam.de/freebusy/m.gabriel%40das-netzwerkteam.de.xf...