[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Please allow controlaula 1.3.1-1 into lenny



The version in Debian has two kind of changes:
- For the debianization:
  - fixes a grave error that avoided upgrades of the packages due to the
included daemon restarting and trying to restart udev & hal when
upgrading
  - Change the way the application behaves when using local apps inside
a ltsp environment. This change is made to use the same mechanism ltsp
has recently adopted to use local apps.

- For the new new upstream version: includes a minor fix to improve the
application behaviour when working inside an ltsp environment

Attached are the diffs for the debianization (debian.diff file) and the
upstream version (upstream.diff file). 

There is no package depending on ControlAula. Only a suggests from the
education-desktop-other. Thus, these changes don't affect to any other
package in the archive and make small, but important improvements for
controlaula users.

Best Regards
José L. Redrejo
diff -ur controlaula-1.3.1.orig/gambas-sources/src/Backend/RootActivities.class controlaula-1.3.orig/gambas-sources/src/Backend/RootActivities.class
--- controlaula-1.3.1.orig/gambas-sources/src/Backend/RootActivities.class	2008-11-24 12:02:06.000000000 +0100
+++ controlaula-1.3.orig/gambas-sources/src/Backend/RootActivities.class	2008-05-28 18:42:26.000000000 +0200
@@ -69,8 +69,7 @@
         Utils.collectGarbage()
         IF utils.isLTSP() THEN 
           TRY SHELL "killall -9 ssh" WAIT 
-          Utils.Killer
-          SHELL "/sbin/poweroff -f &"
+          SHELL "/sbin/poweroff -fp &"
         ELSE 
           TRY SHELL "killall -9 x-session-manager"
           SHELL "/sbin/poweroff -hp &"
diff -ur controlaula-1.3.1.orig/gambas-sources/src/Backend/Utils.class controlaula-1.3.orig/gambas-sources/src/Backend/Utils.class
--- controlaula-1.3.1.orig/gambas-sources/src/Backend/Utils.class	2008-11-24 12:02:06.000000000 +0100
+++ controlaula-1.3.orig/gambas-sources/src/Backend/Utils.class	2008-05-28 18:42:26.000000000 +0200
@@ -338,9 +338,7 @@
 STATIC PUBLIC FUNCTION isAlreadyRunning(anApp AS String) AS Boolean
 DIM result AS String
   SHELL "ps -FU " & User.Name & "|grep " & anApp & "|grep -v grep|grep -v \" " & Application.id & " \"" TO result
-  IF Debugging THEN PRINT "ps -FU " & User.Name & "|grep " & anApp & "|grep -v grep|grep -v \" " & Application.id & " \"" 
   result = Trim$(result)
-  IF Debugging THEN PRINT result
   RETURN (result <> "")
 
 END
@@ -594,7 +592,7 @@
   FOR EACH sTmp IN bits
     SHELL "getent passwd " & sTmp & "|cut -f3 -d:" TO tmpShell 'this works even with ldap users
     tmpShell = Trim$(tmpShell)
-    TRY uids.Add(sTmp, tmpShell) 
+    uids.Add(sTmp, tmpShell) 
   NEXT 
   
 'get current processes
@@ -606,7 +604,7 @@
     uid = CInt(bits[0])
     'uid's under 1000 are ignored and nobody user too, as it's used by some needed daemons:
     IF uid >= 1000 AND uid <> 65534 AND NOT uids.Exist(bits[0]) THEN 
-       TRY KillAllChildren(CInt(bits[1]))
+       KillAllChildren(CInt(bits[1]))
        IF Utils.Debugging THEN PRINT "\\\\\\Killed: " & bits[1] & " of " & bits[0]
     ENDIF 
   NEXT 
diff -ur controlaula-1.3.1.orig/gambas-sources/src/controlaula/MMain.module controlaula-1.3.orig/gambas-sources/src/controlaula/MMain.module
--- controlaula-1.3.1.orig/gambas-sources/src/controlaula/MMain.module	2008-11-24 12:02:06.000000000 +0100
+++ controlaula-1.3.orig/gambas-sources/src/controlaula/MMain.module	2008-05-28 18:42:26.000000000 +0200
@@ -46,7 +46,7 @@
     ENDIF
   
   ELSE 
-    TRY EXEC ["monitor.gambas"]
+    TRY SHELL "monitor.gambas"  
     WAIT 
     utils.collectGarbage()  
   ENDIF 
diff -ur controlaula-1.3.1.orig/gambas-sources/src/ltsp-sirvecole/StartUp.class controlaula-1.3.orig/gambas-sources/src/ltsp-sirvecole/StartUp.class
--- controlaula-1.3.1.orig/gambas-sources/src/ltsp-sirvecole/StartUp.class	2008-11-24 12:02:06.000000000 +0100
+++ controlaula-1.3.orig/gambas-sources/src/ltsp-sirvecole/StartUp.class	2008-05-28 18:42:26.000000000 +0200
@@ -55,7 +55,7 @@
    'Start listening orders:
    WAIT 2
    listener = RootListenerService.creator()
-   
+
    'for vlc broadcasting to work:
    SHELL "/sbin/route add -net 239.255.255.0/24 gw " & prefs.gateway & " &"
    
@@ -81,7 +81,7 @@
     RETURN 
   ENDIF 
   IF NOT Utils.receivedPing OR (prefs.needsMonitoring AND NOT listener.monitorContacted()) THEN 
-    SHELL "/sbin/poweroff -p &"
+    SHELL "/sbin/poweroff -fp &"
   ENDIF  
   
   Utils.detectTeacherHost
diff -ur controlaula-1.3.1/debian/changelog controlaula-1.3/debian/changelog
--- controlaula-1.3.1/debian/changelog	2008-12-07 16:58:16.000000000 +0100
+++ controlaula-1.3/debian/changelog	2008-12-07 16:58:23.000000000 +0100
@@ -1,19 +1,3 @@
-controlaula (1.3.1-1) unstable; urgency=medium
-
-  * New upstream version: 
-    - Fixed controlaula wrapper
-    - Better switching off for ltsp clients
-  * Upgrades of controlaula package
-  * Modified localapps to work as new upstream ltsp does them
-
- -- José L. Redrejo Rodríguez <jredrejo@debian.org>  Mon, 24 Nov 2008 12:00:31 +0100
-
-controlaula (1.3-4) unstable; urgency=low
-
-  * Added optional dependency on xtightvncviewer
-
- -- José L. Redrejo Rodríguez <jredrejo@debian.org>  Thu, 17 Jul 2008 17:37:18 +0200
- 
 controlaula (1.3-3) unstable; urgency=low
 
   * Fixed debian/copyright file
diff -ur controlaula-1.3.1/debian/control controlaula-1.3/debian/control
--- controlaula-1.3.1/debian/control	2008-12-07 16:58:16.000000000 +0100
+++ controlaula-1.3/debian/control	2008-12-07 16:58:23.000000000 +0100
@@ -7,7 +7,7 @@
 
 Package: controlaula
 Architecture: any
-Depends: ${shlibs:Depends}, gambas2-runtime (>= 2.0), gambas2-gb-crypt (>= 2.0), gambas2-gb-form (>= 2.0), gambas2-gb-gtk | kdesktop, gambas2-gb-qt | gnome-core, gambas2-gb-gtk (>= 2.0) | kdeaddons, gambas2-gb-gui, gambas2-gb-net-curl (>= 1.9.50), gambas2-gb-settings (>= 1.9.50), xvnc4viewer | xtightvncviewer, vlc, libdvdplay0 | libdvdnav4, zenity | kdebase-bin, wakeonlan, x11vnc (>= 0.8.2), cups-client, gobby (>= 0.4.1-1~linex3), avahi-utils (>= 0.6.16), sendfile, libnotify-bin, mini-httpd, bittornado, curl, gksu | kdebase-bin
+Depends: ${shlibs:Depends}, gambas2-runtime (>= 2.0), gambas2-gb-crypt (>= 2.0), gambas2-gb-form (>= 2.0), gambas2-gb-gtk | kdesktop, gambas2-gb-qt | gnome-core, gambas2-gb-gtk (>= 2.0) | kdeaddons, gambas2-gb-gui, gambas2-gb-net-curl (>= 1.9.50), gambas2-gb-settings (>= 1.9.50), xvnc4viewer, vlc, libdvdplay0 | libdvdnav4, zenity | kdebase-bin, wakeonlan, x11vnc (>= 0.8.2), cupsys-client, gobby (>= 0.4.1-1~linex3), avahi-utils (>= 0.6.16), sendfile, libnotify-bin, mini-httpd, bittornado, curl, gksu | kdebase-bin
 Recommends: iptables
 Suggests: libdvdcss2, finger-ldap
 Description: Classroom management tool
Sólo en controlaula-1.3/debian: docs
Sólo en controlaula-1.3/debian: iceweasel
Sólo en controlaula-1.3/debian: K20-local-app
diff -ur controlaula-1.3.1/debian/localapp controlaula-1.3/debian/localapp
--- controlaula-1.3.1/debian/localapp	2008-12-07 16:58:16.000000000 +0100
+++ controlaula-1.3/debian/localapp	2008-12-07 16:58:23.000000000 +0100
@@ -14,62 +14,40 @@
 # For it to work, it should be placed at /usr/bin in the ltsp chroot
 # with execution permissions
 #
-
-
-. /usr/share/ltsp/ltsp-common-functions
-
-logit() {
-    logger -t localapp -p daemon.info $1
-}
-
-
-if [ -z  "${LDM_USERNAME}" ]; then 
-	LDM_USERNAME=$(cat $(ls -1 /var/run/ltsplogin*|head -1))
-fi
-
-
-if [ -z  "${LDM_HOME}" ]; then 
-	LDM_HOME=$(cat $(ls -1 /var/run/ltsphome*|head -1))
-fi
-
-if [ -z  "${XAUTHORITY}" ]; then 
-	XAUTHORITY=${LDM_HOME}/.Xauthority
-fi
-
-
-if [ -n "${LDM_USERNAME}" -a -n "$(/usr/bin/id ${LDM_USERNAME})" ]; then
-    true
-else
-    logit "Unknown user:  $LDM_USERNAME"
-    exit 1
-fi
-
-
-
 launch()
 {	
-		su - ${LDM_USERNAME} -c "DISPLAY=$DISPLAY PULSESERVER=$PULSE_SERVER XAUTHORITY=$XAUTHORITY ${1}" &
+	ISFIREFOX=$(echo "${1}"|grep firefox)$(echo "${1}"|grep iceweasel)$(echo "${1}"|grep www-browser)
+	if [ ! -z "$ISFIREFOX" ]; then
+		param=""
+	   	for var in $1; do
+	   		ISFIREFOX=$(echo "${var}"|grep firefox)$(echo "${var}"|grep iceweasel)$(echo "${var}"|grep www-browser)
+          	if [  -z "$ISFIREFOX" ]; then
+          	 	param=$param" "$var
+          	fi
+      	done
+		if [ -e /usr/local/bin/iceweasel ]; then
+		  	/usr/local/bin/iceweasel $param &
+		fi
+	else
+		su -c "cd /var/tmp/${LOGIN};DISPLAY=:7.0  PULSE_SERVER=127.0.0.1:4713  ESPEAKER=127.0.0.1:16001  ${1}" ${LOGIN} &
+	fi
 
 }
 
 
-DISPLAY=:7.0
-PULSE_SERVER=127.0.0.1:4713
-# Make sure the local user has access to X
-chown ${LDM_USERNAME} $XAUTHORITY
-
+LOGIN=$(cat $(ls -1 /var/run/ltsplogin*|head -1))
 
 if [ ! -z "$1" ]; then
 	launch "${1}"
 	exit 0
 fi
 
-while :; do
+while [ -d  /var/tmp/${LOGIN} ] ; do
 
-	if [ -f ${LDM_HOME}/local.exec ]; then
-		LTSP_COMMAND=$(head -1 ${LDM_HOME}/local.exec)
-		rm -f ${LDM_HOME}/local.exec
-		launch "${LTSP_COMMAND}"
+	if [ -f /var/tmp/${LOGIN}/local.exec ]; then
+		COMMAND=$(head -1 /var/tmp/${LOGIN}/local.exec)
+		rm -f /var/tmp/${LOGIN}/local.exec
+		launch "${COMMAND}"
 	fi
 	
 	sleep 1     
diff -ur controlaula-1.3.1/debian/ltsp-controlaula.dirs controlaula-1.3/debian/ltsp-controlaula.dirs
--- controlaula-1.3.1/debian/ltsp-controlaula.dirs	2008-12-07 16:58:16.000000000 +0100
+++ controlaula-1.3/debian/ltsp-controlaula.dirs	2008-12-07 16:58:23.000000000 +0100
@@ -1,4 +1,3 @@
 etc/init.d
 usr/bin
 usr/share/ldm/rc.d
-var/cache/ltsp-localapps
diff -ur controlaula-1.3.1/debian/ltsp-controlaula.docs controlaula-1.3/debian/ltsp-controlaula.docs
--- controlaula-1.3.1/debian/ltsp-controlaula.docs	2008-12-07 16:58:16.000000000 +0100
+++ controlaula-1.3/debian/ltsp-controlaula.docs	2008-12-07 16:58:23.000000000 +0100
@@ -1 +1,2 @@
+debian/iceweasel
 debian/localapp
diff -ur controlaula-1.3.1/debian/ltsp-controlaula.install controlaula-1.3/debian/ltsp-controlaula.install
--- controlaula-1.3.1/debian/ltsp-controlaula.install	2008-12-07 16:58:16.000000000 +0100
+++ controlaula-1.3/debian/ltsp-controlaula.install	2008-12-07 16:58:23.000000000 +0100
@@ -1 +1,2 @@
 debian/S20-local-app usr/share/ldm/rc.d
+debian/K20-local-app usr/share/ldm/rc.d
diff -ur controlaula-1.3.1/debian/ltsp-controlaula.ltsp-sirvecole controlaula-1.3/debian/ltsp-controlaula.ltsp-sirvecole
--- controlaula-1.3.1/debian/ltsp-controlaula.ltsp-sirvecole	2008-12-07 16:58:16.000000000 +0100
+++ controlaula-1.3/debian/ltsp-controlaula.ltsp-sirvecole	2008-12-07 16:58:23.000000000 +0100
@@ -36,12 +36,9 @@
 
 
 bind_mounts () {
-
-    test -z "$tmpfs_dir" && tmpfs_dir=/var/lib/ltsp-client-setup
-    rw_dirs="/var/lib/dbus /etc/avahi/services /var/cache/hald" 
-    bindfiles="/etc/passwd /etc/group /etc/sirvecole"
-    copy_dirs="/home /var/cache/ltsp-localapps"
-   
+	test -z "$tmpfs_dir" && tmpfs_dir=/var/lib/ltsp-client-setup
+    rw_dirs="/var/lib/dbus /etc/avahi/services " 
+    copy_dirs="/etc "
     
     for f in $rw_dirs ; do
     	touch "$f" 2> /dev/null || root_write_method="bind_mounts"
@@ -65,17 +62,6 @@
             echo "WARNING: $d does not exist or it's already writtable"
         fi
     done
-
-    # mount one file on top of another
-    for f in $bindfiles ; do
-        if [ -e "$f" ]; then
-            mkdir -p "$(dirname $tmpfs_dir/$f)"
-            cp $f $tmpfs_dir/$f
-            mount --bind $tmpfs_dir/$f $f
-        else
-            echo "WARNING: $f does not exist"
-        fi
-    done
     
 }
 
@@ -89,12 +75,8 @@
   r=${r#*\ }
   
   if [ "$r" = "unknown" ]; then #we're inside the ltsp chroot: mount needed dirs on tmpfs
-        if  grep  -qs "nfs" /etc/mtab 
-        then    
-                root_write_method="bind_mounts"
-	  	bind_mounts
-        fi  
- 
+  
+  	bind_mounts 
   	sleep 1
   else
   	return
diff -ur controlaula-1.3.1/debian/rules controlaula-1.3/debian/rules
--- controlaula-1.3.1/debian/rules	2008-12-07 16:58:16.000000000 +0100
+++ controlaula-1.3/debian/rules	2008-12-07 16:58:23.000000000 +0100
@@ -59,7 +59,7 @@
 	dh_installchangelogs -i
 	dh_installdocs -i
 	dh_install -i
-	dh_installinit -i --init-script ltsp-sirvecole -r --no-start -u"start 24 2 3 5 ."
+	dh_installinit -i --init-script ltsp-sirvecole -r --no-start -u"start 98 2 3 5 . stop 20 0 1 6 ."
 	dh_installman debian/ltsp-sirvecole.gambas.8 -pltsp-controlaula
 	dh_link -i
 	dh_compress -i
@@ -75,7 +75,7 @@
 	dh_installdocs -a
 	dh_installchangelogs -a
 	dh_install -a
-	dh_installinit -a --init-script sirvecole -r --no-start -u"start 98 2 3 5 . stop 20 0 1 6 ."
+	dh_installinit -a --init-script sirvecole -r -u"start 98 2 3 5 . stop 20 0 1 6 ."
 	dh_installman debian/sirvecole.gambas.8  debian/pwd_controlaula.8  -pcontrolaula
 	dh_installman debian/controlaula.gambas.1  debian/monitor.gambas.1 debian/monitorProfe.gambas.1 -pcontrolaula
 	dh_strip -a
diff -ur controlaula-1.3.1/debian/S20-local-app controlaula-1.3/debian/S20-local-app
--- controlaula-1.3.1/debian/S20-local-app	2008-12-07 16:58:16.000000000 +0100
+++ controlaula-1.3/debian/S20-local-app	2008-12-07 16:58:23.000000000 +0100
@@ -28,105 +28,33 @@
 
 if [ -e /usr/bin/localapp ]; then
 
-    # Set up local uids/gids
+	DEFAULTGROUPS="adm dialout cdrom floppy audio dip video plugdev scanner fuse lpadmin admin netdev"
+	LOGIN=$(ssh -S $LDM_SOCKET $LDM_SERVER "id -un")
+	LOCAL_UID=$(ssh -S $LDM_SOCKET $LDM_SERVER "id -u")
+	LOCAL_GID=$(ssh -S $LDM_SOCKET $LDM_SERVER "id -g")
+	LOCAL_GROUP=$(ssh -S $LDM_SOCKET $LDM_SERVER "id -gn")
 
-    LOCALAPPS_CACHE=/var/cache/ltsp-localapps
-    mkdir -p ${LOCALAPPS_CACHE} 2>/dev/null
+	if [ -z "$LOGIN" ]; then
+		exit 1
+	fi
+	echo $LOGIN>/var/run/ltsplogin$LDM_SERVER
+
+	groupadd -g ${LOCAL_GID}  ${LOCAL_GROUP} 
+
+	useradd ${LOGIN}  -s /bin/bash -m  -d /var/tmp/${LOGIN}  -g ${LOCAL_GID}  -u ${LOCAL_UID} 
+
+
+	for each_group in $DEFAULTGROUPS; do
+		adduser  ${LOGIN} $each_group >/dev/null 2>&1 ||true
+	done
+
+
+	#here comes the magic:
+	sshfs -o nonempty,uid=${LOCAL_UID},gid=${LOCAL_GID},allow_other,ControlPath=${LDM_SOCKET}   ${LDM_SERVER}: /var/tmp/${LOGIN}
+
+
+	/usr/bin/localapp &
+	PID=$!
+	echo $PID > /var/lock/localapps
 
-    # Cleanup 
-    LOCALAPPSD_PIDFILE=/var/run/ltsp/localapp
-    mkdir -p /var/run/ltsp 2>/dev/null
-    [ -r "$LOCALAPPSD_PIDFILE" ] && LOCALAPPSD_PID=$(cat $LOCALAPPSD_PIDFILE)
-    # Kill PID
-    if [ -n "$LOCALAPPSD_PID" ]; then
-        pkill -P $LOCALAPPSD_PID
-        rm $LOCALAPPSD_PIDFILE
-    fi
-
-    # Copy /etc/passwd and /etc/group to cache if it does not exist (should only happen on first login)
-    for i in passwd group; do
-        if [ ! -e "${LOCALAPPS_CACHE}/${i}" ]; then
-            cp /etc/${i} "${LOCALAPPS_CACHE}/${i}"
-        else
-            cp "${LOCALAPPS_CACHE}/${i}" /etc/${i}
-        fi
-    done
-
-    # Get logged in username if not set
-    [ -z "$LDM_USERNAME" ] && LDM_USERNAME=$(ssh -S ${LDM_SOCKET} ${LDM_SERVER} 'echo ${USER}')
-    export LDM_USERNAME=${LDM_USERNAME}
-
-    echo $LDM_USERNAME>/var/run/ltsplogin${LDM_SERVER}
-
-    # Get passwd info *just* for that user
-    ssh -S ${LDM_SOCKET} ${LDM_SERVER} "/usr/bin/getent passwd ${LDM_USERNAME}" >>/etc/passwd
-
-    # Get all group info and copy to TMPGROUP
-    ssh -S ${LDM_SOCKET} ${LDM_SERVER} "/usr/bin/getent group" >>/etc/group
-
-    # Now, some groups may have different gids on the server than the client chroot
-    # So, let's prune out all the dups
-    TMPGROUP="${LOCALAPPS_CACHE}/tmpgroup"
-    gnames=""
-    while read line; do
-        gname=$(echo $line|cut -d: -f1)
-        match=
-        for e in $gnames; do
-            if [ "$gname" = "$e" ]; then
-                match=1
-            fi
-        done
-        if [ -z "$match" ]; then
-            echo "$line" >>${TMPGROUP}
-            gnames="$gnames $gname"
-        fi
-    done </etc/group
-    cp -f ${TMPGROUP} /etc/group
-    rm -f ${TMPGROUP}
-    chmod 644 /etc/group
-
-    # Get the system groups that the user belongs to, so we can add him back in
-    myGroups=$(ssh -S ${LDM_SOCKET} ${LDM_SERVER} /usr/bin/getent group|egrep "[,:]${LDM_USERNAME}(,|$)"|cut -d: -f1| tr '\n' ',' | sed -e 's/,$//g')
-    if [ -n "$myGroups" ]; then
-        usermod -G "$myGroups" "${LDM_USERNAME}"||true
-    fi
-
-    # Now, let's mount the home directory
-
-    # First, make the mountpoint
-    LDM_HOME=$(getent passwd ${LDM_USERNAME}|cut -d: -f6)
-    mkdir -p ${LDM_HOME}
-    export LDM_HOME=${LDM_HOME}
-    echo $LDM_HOME>/var/run/ltsphome${LDM_SERVER}
-
-    chown ${LDM_USERNAME}.${LDM_USERNAME} ${LDM_HOME}
-
-    ## Maybe do this:
-    ## export HOME=${LOCALAPPS_CACHE}
-
-    # Mount the home directory
-    sshfs -o nonempty,allow_other,ControlPath=${LDM_SOCKET} ${LDM_SERVER}:${LDM_HOME} ${LDM_HOME}
-
-    #Launch the ltsp-localappsd to handle the apps
-    (
-    echo $! > $LOCALAPPSD_PIDFILE
-
-    # if cups is installed in the chroot, use LDM_SERVER for printing
-    [ -d "/etc/cups" ] && echo "ServerName ${LDM_SERVER}" > /etc/cups/client.conf||true
-
-    /usr/bin/localapp
-
-    # Clean up cups config
-    [ -r "/etc/cups/client.conf" ] && rm -f /etc/cups/client.conf
-
-    # Copy back passwd and group
-    for i in passwd group; do
-        cp "${LOCALAPPS_CACHE}/${i}" /etc/${i}
-    done
-    
-    # Unmount sshfs and remove the mount dir
-    fusermount -uqz ${LDM_HOME}
-    rm -Rf ${LDM_HOME}
-    rm $LOCALAPPSD_PIDFILE
-    )&
 fi

Attachment: signature.asc
Description: Esta parte del mensaje =?ISO-8859-1?Q?est=E1?= firmada digitalmente


Reply to: