[X2Go-Commits] x2goserver.git - build-main (branch) updated: 3.0.1-2
X2Go dev team
git-admin at x2go.org
Wed Dec 4 06:17:19 CET 2013
The branch, build-main has been updated
via e5ca4ee2eb384b69989760511fcf15a55f50cf79 (commit)
from 3d51ceffea2987a4619ccb89399767352027cc9c (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
-----------------------------------------------------------------------
Summary of changes:
debian/changelog | 8 ++++++
debian/control | 2 +-
debian/rules | 2 ++
x2gomountdirs | 2 +-
x2goserver.conf | 5 ++++
x2gosessionlimit | 77 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
x2gostartagent | 21 +++++++++++++--
7 files changed, 113 insertions(+), 4 deletions(-)
create mode 100644 x2goserver.conf
create mode 100755 x2gosessionlimit
The diff of changes is:
diff --git a/debian/changelog b/debian/changelog
index 26e4c95..aadcf49 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,11 @@
+x2goserver (3.0.1-2) unstable; urgency=low
+
+ * setting dpi for x2goagent in x2gostartagent
+ * session limits for users and groups in /etc/x2go/x2goserver.conf
+ * ssh option ServerAliveInterval=300 in x2gomountdirs
+
+ -- Oleksandr Shneyder <oleksandr.shneyder at obviously-nice.de> Mon, 02 Nov 2009 16:30:15 +0100
+
x2goserver (3.0.1-1) unstable; urgency=low
* Support for sqlite
diff --git a/debian/control b/debian/control
index 5f33d54..dfb25e8 100644
--- a/debian/control
+++ b/debian/control
@@ -7,7 +7,7 @@ Standards-Version: 3.7.2
Package: x2goserver
Architecture: all
-Depends: x2goagent, sudo, lsof, ssh
+Depends: x2goagent, sudo, lsof, openssh-client
Recommends: sshfs
Description: x2goserver (daemon and tools)
x2go is a serverbased computing environment with
diff --git a/debian/rules b/debian/rules
index 7069731..e02fb55 100755
--- a/debian/rules
+++ b/debian/rules
@@ -74,7 +74,9 @@ install: build
install x2goterminate-session $(CURDIR)/debian/x2goserver/usr/bin/
install x2goumount $(CURDIR)/debian/x2goserver/usr/bin/
install x2goumount_session $(CURDIR)/debian/x2goserver/usr/bin/
+ install x2gosessionlimit $(CURDIR)/debian/x2goserver/usr/bin/
cp sql $(CURDIR)/debian/x2goserver/etc/x2go/
+ cp x2goserver.conf $(CURDIR)/debian/x2goserver/etc/x2go/
install x2gocleansessions $(CURDIR)/debian/x2goserver/usr/sbin/
install x2gocreatebase.sh $(CURDIR)/debian/x2goserver/usr/lib/x2go/script
install x2gosqlite.sh $(CURDIR)/debian/x2goserver/usr/lib/x2go/script
diff --git a/x2gomountdirs b/x2gomountdirs
index 6cfc3cd..fce9ef4 100755
--- a/x2gomountdirs
+++ b/x2gomountdirs
@@ -141,7 +141,7 @@ for(my $i=0;$i<@dirs;$i++)
if($outp =~ m/INSERT/)
{
print "inserted,\nsshfs -o IdentityFile=$key,UserKnownHostsFile=$key.ident $user\@$host:\"@dirs[$i]\" \"$mntpath\" -p $port\n";
- if(system("sshfs -o Cipher=blowfish,IdentityFile=$key,UserKnownHostsFile=$key.ident $user\@$host:\"@dirs[$i]\" \"$mntpath\" -p $port 2>>~/mounts.log")==0)
+ if(system("sshfs -o ServerAliveInterval=300,Cipher=blowfish,IdentityFile=$key,UserKnownHostsFile=$key.ident $user\@$host:\"@dirs[$i]\" \"$mntpath\" -p $port 2>>~/mounts.log")==0)
{
print "mount @dirs[$i] ok\n";
if(! $printspool)
diff --git a/x2goserver.conf b/x2goserver.conf
new file mode 100644
index 0000000..af1e1b6
--- /dev/null
+++ b/x2goserver.conf
@@ -0,0 +1,5 @@
+[limit users]
+#beispielb=1
+
+[limit groups]
+#x2gousers=1
diff --git a/x2gosessionlimit b/x2gosessionlimit
new file mode 100755
index 0000000..b0bec3b
--- /dev/null
+++ b/x2gosessionlimit
@@ -0,0 +1,77 @@
+#!/usr/bin/perl
+
+use strict;
+use Config::Simple;
+
+my $maxlimit=0;
+my $Config = new Config::Simple(syntax=>'ini');
+$Config->read('/etc/x2go/x2goserver.conf' );
+
+sub getGroupLimit
+{
+ my $group=shift;
+ my $strlimit=$Config->param("limit groups.$group");
+ if($strlimit ne "")
+ {
+ if($strlimit == 0)
+ {
+ print "0\n";
+ exit 0;
+ }
+ if($strlimit > $maxlimit)
+ {
+ $maxlimit=$strlimit;
+ }
+ }
+}
+
+my $uname;
+$uname=getpwuid($<);
+
+my $runningsessions=`x2golistsessions --all-servers`;
+my @sessions=split("\n",$runningsessions);
+my $scount=@sessions;
+
+my $strlimit=$Config->param("limit users.$uname");
+
+if($strlimit ne "")
+{
+ if($strlimit == 0)
+ {
+ print "0\n";
+ exit 0;
+ }
+ if($strlimit <= $scount)
+ {
+ print "LIMIT $strlimit\n";
+ exit 0;
+ }
+ print "$strlimit\n";
+ exit 0;
+}
+
+
+my ($name, $pass, $uid, $pgid, $quota, $comment, $gcos, $dir, $shell, $expire) = getpwnam($uname);
+
+while (my ($name, $passwd, $gid, $members) = getgrent())
+{
+ if( $pgid eq $gid)
+ {
+ getGroupLimit $name;
+ }
+ my @memebers=split(" ",$members);
+ foreach my $member (@memebers)
+ {
+ if($uname eq $member )
+ {
+ getGroupLimit $name;
+ }
+ }
+}
+
+if($maxlimit <= $scount)
+{
+ print "LIMIT $maxlimit\n";
+ exit 0;
+}
+print "$maxlimit\n";
diff --git a/x2gostartagent b/x2gostartagent
index 9f08860..dd79d8f 100755
--- a/x2gostartagent
+++ b/x2gostartagent
@@ -19,6 +19,15 @@ X2GO_RESIZE=0
X2GO_FULLSCREEN=0
+LIMIT=`x2gosessionlimit`
+LWORD=`echo $LIMIT | awk '{print $1}'`
+
+if [ "$LWORD" == "LIMIT" ]
+then
+ echo $LIMIT
+ exit -1
+fi
+
export NX_CLIENT=/usr/bin/x2gosuspend-agent
COLORDEPTH=`echo "$X2GO_TYPE"|awk '{split($0,a,"-depth_"); print a[2]}'`
@@ -168,7 +177,15 @@ DISPLAY=nx/nx,options=${SESSION_DIR}/options:${X2GO_PORT}
export DISPLAY
-LD_LIBRARY_PATH=$X2GO_LIB x2goagent -$SESSION_TYPE -geometry ${X2GO_GEOMETRY} -name "X2GO-${SESSION_NAME}" ${NX_AGENT} 2>${SESSION_DIR}/session.log &
+if [ "$X2GODPI" == "" ]
+then
+ X2GODPIOPTION_=""
+else
+ X2GODPIOPTION_="-dpi $X2GODPI"
+fi
+
+LD_LIBRARY_PATH=$X2GO_LIB x2goagent $X2GODPIOPTION_ -$SESSION_TYPE -geometry ${X2GO_GEOMETRY} -name "X2GO-${SESSION_NAME}" ${NX_AGENT} 2>${SESSION_DIR}/session.log &
+
X2GO_AGENT_PID=$!
@@ -181,4 +198,4 @@ echo $X2GO_AGENT_PID
echo $SESSION_NAME
echo $GR_PORT
echo $SOUND_PORT
-echo $FS_PORT
\ No newline at end of file
+echo $FS_PORT
hooks/post-receive
--
x2goserver.git (X2Go Server)
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "x2goserver.git" (X2Go Server).
More information about the x2go-commits
mailing list