[csw-devel] SF.net SVN: gar:[15155] csw/mgar/pkg/screen/trunk/files/CSWscrn.postinstall

chninkel at users.sourceforge.net chninkel at users.sourceforge.net
Wed Jul 20 15:54:07 CEST 2011


Revision: 15155
          http://gar.svn.sourceforge.net/gar/?rev=15155&view=rev
Author:   chninkel
Date:     2011-07-20 13:54:07 +0000 (Wed, 20 Jul 2011)

Log Message:
-----------
screen: symlink old socket instead of copying

Modified Paths:
--------------
    csw/mgar/pkg/screen/trunk/files/CSWscrn.postinstall

Modified: csw/mgar/pkg/screen/trunk/files/CSWscrn.postinstall
===================================================================
--- csw/mgar/pkg/screen/trunk/files/CSWscrn.postinstall	2011-07-20 13:30:57 UTC (rev 15154)
+++ csw/mgar/pkg/screen/trunk/files/CSWscrn.postinstall	2011-07-20 13:54:07 UTC (rev 15155)
@@ -1,8 +1,18 @@
 
-# Screen socket directory has changed, so we move all existing files
-# to the new directory
-for DIR in /tmp/uscreens /tmp/screens; do
-	if [ -d "$DIR" ]; then
-		mv "$DIR"/* /var/opt/csw/run/screen/
-	fi
+NEW_SOCKET_DIR="/var/opt/csw/run/screen/"
+
+# Screen socket directory has changed, we symlink all existing
+# screen socket so the transition is transparent for users
+for SOCKET_DIR in /tmp/uscreens /tmp/screens; do
+	[ -d "$SOCKET_DIR" ] || continue
+	cd $SOCKET_DIR
+	for DIR in *; do
+		[ -d "$DIR" ] || continue
+		mkdir "$NEW_SOCKET_DIR/$DIR"
+		getfacl "$DIR" | setfacl -f - "$NEW_SOCKET_DIR/$DIR"
+		for SESSION in "$DIR"/*; do
+			[ -p "$DIR/$SESSION" ] || continue
+			ln -s "$DIR/$SESSION" "$NEW_SOCKET_DIR/$DIR/$SESSION"
+		done
+	done
 done


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.


More information about the devel mailing list