r971 - trunk

tushar at linuxfromscratch.org tushar at linuxfromscratch.org
Wed Jul 27 09:56:57 PDT 2005


Author: tushar
Date: 2005-07-27 10:56:57 -0600 (Wed, 27 Jul 2005)
New Revision: 971

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

Modified: trunk/restoresettingsatlogin.txt
===================================================================
--- trunk/restoresettingsatlogin.txt	2005-07-20 15:36:14 UTC (rev 970)
+++ trunk/restoresettingsatlogin.txt	2005-07-27 16:56:57 UTC (rev 971)
@@ -82,7 +82,7 @@
 adjust them the same way. On my machine I login frequently in with kdm, and that uses the 
 kde-service, which is a symlink to the login-service:
 
-cd /etc/pam.d/security
+cd /etc/pam.d
 
 ls -al
 
@@ -99,7 +99,7 @@
 -rw-r--r--   1 root root  282 2003-08-13 18:22 passwd
 -rw-r--r--   1 root root  411 2003-08-12 17:53 shadow
 -rw-r--r--   1 root root  448 2005-07-18 10:18 su
--rw-r--r--   1 8036 root  666 2005-02-28 12:59 sudo
+-rw-r--r--   1 root root  666 2005-02-28 12:59 sudo
 -rw-r--r--   1 root root  257 2004-05-12 16:05 useradd
 -rw-r--r--   1 root root  200 2005-04-25 09:05 xscreensaver
 
@@ -137,10 +137,10 @@
 service=$2
 homedir=$(getent passwd | grep -E "^$userid" | cut -d ":" -f 6);
 
-nrusers=$(last $userid | grep -w "still logged in" | wc -l );
+nrusers=$(w -h  $userid | wc -l );
 
 
-if [ "$nrusers" = "0" ]; then
+if [ $nrusers -eq 0 ]; then
 
     # There are no other pending sessions for this user
 
@@ -167,7 +167,7 @@
 service=$2
 homedir=$(getent passwd | grep -E "^$userid" | cut -d ":" -f 6);
 
-nrusers=$(last $userid | grep -w "still logged in" | wc -l );
+nrusers=$(w -h $userid | wc -l );
 
 
 if [ "$nrusers" = "1" ]; then
@@ -193,11 +193,13 @@
 
 
 Note:
--  as you can see I use the command "last" to determine the users logged in. Other utilities
-as who, users gave not reliable information. I looks as if the utmp file is not always presenting 
-the right values. Utilities as who and users show information from utmp without any check, so 
-they inherit the faults. 'last' does some extra checking, which makes it more usable.
-Anyone knowing a better way to determine the amount of session for a user, please let me know.
+-  as you can see I use the command "w" to determine the users logged in. 
+Other utilities as who, users and last gave not reliable information. It 
+looks as if the utmp file is not always presenting the right values. 
+Utilities as who,users and last show information from utmp without any check, so 
+they inherit the faults. 'w' does some extra checking, which makes it more 
+usable. Anyone knowing a better way to determine how many times a user is logged 
+in, please let me know.
 
 
 
@@ -268,12 +270,12 @@
 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.
+-Storing settings on a central server can become very complicated 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. Windows uses the same strategy.
 
-
-These scripts are for the settings of kde. But this is just an example.
+-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 like creating 
 files or mounting shares are also possible.
@@ -285,12 +287,12 @@
 
 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 
-is the efficient way it handles changes.
+is the efficient way it handles (non)changes.
 
 This way it looks at the way Windows workstations handle settings: 
-when there is a [profiles] share, the server support "roamingprofiles".
+when there is a [profiles] share, the server supports "roamingprofiles".
 I think the way the saving en getting the "profile" at these 
-Windows machines works a lot like rsync for Linux.
+Windows machines looks a lot like rsync for Linux.
 
 
 
@@ -308,8 +310,14 @@
   * added the -u flag when getting the settings at login. 
   * added more comment on saving and restoring settings in a mutiuser/multihost (wow!)
     envionment.
+[2005-07-27]
+  * Use the command 'w' to determine how many times a user is logged in on the
+    system in stead of 'last'.
+  * Correction of some phrases: incorrect English. 
 
 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
+  * find out why runas=root does not work with pam_script at logout for me
+  * look for some way to show information about progres and/or errors when executing
+    the scripts when using a graphical login. xconsole?




More information about the hints mailing list