r970 - trunk

archaic at linuxfromscratch.org archaic at linuxfromscratch.org
Wed Jul 20 08:36:14 PDT 2005


Author: archaic
Date: 2005-07-20 09:36:14 -0600 (Wed, 20 Jul 2005)
New Revision: 970

Modified:
   trunk/restoresettingsatlogin.txt
Log:
Updated restoresettingsatlogin.txt

Modified: trunk/restoresettingsatlogin.txt
===================================================================
--- trunk/restoresettingsatlogin.txt	2005-07-19 16:13:22 UTC (rev 969)
+++ trunk/restoresettingsatlogin.txt	2005-07-20 15:36:14 UTC (rev 970)
@@ -28,7 +28,7 @@
 But every machine has it's own settings, so you can't take your settings with 
 you, just like "roamingprofiles".
 
-When looking at PAM for Linux, it has the ability to use a loadable plugin, which will
+When looking at PAM for Linux, it has the ability to use a loadable plugin, which will 
 take care for retrieving settings from a central network host when a session opens, 
 and storing the same settings to the same host when a sessions closes.
 
@@ -104,18 +104,25 @@
 -rw-r--r--   1 root root  200 2005-04-25 09:05 xscreensaver
 
 
+
 Notes:
+
 - the pam_script.so uses some parameters. All of them are described in the README in the
 source directory. One of them, runas, when used as runas=root does not work for me. When
 closing a session, the onsessionclose script is executed with the privileges of the user who
 is logging out. Changing the uid to 0 gives errors.
+
 - when logging out using the normal console, the service is 'login'. Login did not call
 all the modules. I had to add a new parameter to the /etc/login.defs :
 
 CLOSE_SESSIONS        yes
 
+This option is there already in the shadow package since 2002-10-14, according to the ChangeLog,
+but does not appear in the login.defs, but is important for closing a session when the service is 
+login.
 
 
+
 2.3 Creating the session scripts
 --------------------------------
 
@@ -130,7 +137,7 @@
 service=$2
 homedir=$(getent passwd | grep -E "^$userid" | cut -d ":" -f 6);
 
-nrusers=$(last -f /var/run/utmp $userid | grep -w "still logged in" | wc -l );
+nrusers=$(last $userid | grep -w "still logged in" | wc -l );
 
 
 if [ "$nrusers" = "0" ]; then
@@ -160,7 +167,7 @@
 service=$2
 homedir=$(getent passwd | grep -E "^$userid" | cut -d ":" -f 6);
 
-nrusers=$(last -f /var/run/utmp $userid | grep -w "still logged in" | wc -l );
+nrusers=$(last $userid | grep -w "still logged in" | wc -l );
 
 
 if [ "$nrusers" = "1" ]; then
@@ -222,7 +229,7 @@
 	# no error found
 	#
 
-	rsync -rptgoz 192.168.0.3::sbon/.kde/ /home/sbon/.kde
+	rsync -rptgozu 192.168.0.3::sbon/.kde/ /home/sbon/.kde
 
     fi;
 fi;
@@ -243,22 +250,38 @@
 	# no error found
 	#
 
-	rsync -rptgoz  /home/sbon/.kde 192.168.0.3::sbon
+	rsync -rptgoz --delete /home/sbon/.kde 192.168.0.3::sbon
     fi;	
 
 fi;
 
 EOF
 
+Note:
+- see the difference between the rsync commando for login and logout. 
+First the -u flag at login and not logout.
+I don't want newer files get overwritten on login. When due to some reason 
+the settings are not saved properly, the most recent settings are still on the
+workstation and not on the server. You don't want them to be overwritten. That's
+reason for the -u flag at login. Not at logout. Why? Good question. 
+Now the --delete flag at logout.
+Obvious, you don't want that there are still files on the server, which are not 
+there (anymore?) on the workstation.
+
+Storing settings on a central server can become very comlicated when one user is logged
+on more than one machine at the same time. There is now way to 'merge' the settings.
+The setting saved at the last logout are the ones which will remain on the server.
+
+
 These scripts are for the settings of kde. But this is just an example.
 You can put any scrtipt ( with the .sh extension )
-in this directory. The bookmarks of Firefox for example. Other things as creating 
-files or mounting shares is also possible.
+in this directory. The bookmarks of Firefox for example. Other things like creating 
+files or mounting shares are also possible.
 
 The rsyncserver is hosted at 192.168.0.3, with a share [sbon]. This share
-can be accessed without credentials: public access. This is not so simple.
-The rsyncdaemon does not support pam yet. Could work is shell for transport 
-is ssh. Work to be done.
+can be accessed without credentials: public access. Making it work with 
+user-based access is not so simple. The rsyncdaemon does not support pam yet. 
+This could work when shell for transport is ssh. Work to be done.
 
 As you can see I use the rsync algoritm, but you can use also a
 ftp server with write-access. The big advantage of rsync however 
@@ -266,7 +289,8 @@
 
 This way it looks at the way Windows workstations handle settings: 
 when there is a [profiles] share, the server support "roamingprofiles".
-I think the way the saving en getting the "profile" works like rsync.
+I think the way the saving en getting the "profile" at these 
+Windows machines works a lot like rsync for Linux.
 
 
 
@@ -276,3 +300,16 @@
 CHANGELOG:
 [2005-07-18]
   * Initial hint.
+[2005-07-20]
+  * Some text changes: things could be explained better
+  * remove the -f parameter in the 'last' command. It works now with the standard
+    /var/log/wtmp file. The /var/run/utmp file was not so reliable after all.
+  * added the --delete flag to the rsync commando at logout. 
+  * added the -u flag when getting the settings at login. 
+  * added more comment on saving and restoring settings in a mutiuser/multihost (wow!)
+    envionment.
+
+TODO:
+
+  * authentication of users
+  * find out why runas=root does not work with pam_script at logout for me
\ No newline at end of file




More information about the hints mailing list