[X2Go-Dev] /usr/sbin/x2gocleansessions does not properly quit

Stefan Baur newsgroups.mail2 at stefanbaur.de
Mon Aug 27 10:39:15 CEST 2012


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



More information about the x2go-dev mailing list