[26750] in Source-Commits

home help back first fref pref prev next nref lref last post

/svn/athena r25728 - trunk/debathena/config/lightdm-config/debian

daemon@ATHENA.MIT.EDU (Jonathan D Reed)
Thu Aug 16 15:07:56 2012

Date: Thu, 16 Aug 2012 15:07:54 -0400
From: Jonathan D Reed <jdreed@MIT.EDU>
Message-Id: <201208161907.q7GJ7sOs006341@drugstore.mit.edu>
To: source-commits@MIT.EDU
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Author: jdreed
Date: 2012-08-16 15:07:54 -0400 (Thu, 16 Aug 2012)
New Revision: 25728

Modified:
   trunk/debathena/config/lightdm-config/debian/changelog
   trunk/debathena/config/lightdm-config/debian/debathena-lightdm-greeter
Log:
In lightdm-config:
  * Deal with AFS possibly not being up by the time lightdm starts
  * Remove stray debugging print statement


Modified: trunk/debathena/config/lightdm-config/debian/changelog
===================================================================
--- trunk/debathena/config/lightdm-config/debian/changelog	2012-08-16 17:25:12 UTC (rev 25727)
+++ trunk/debathena/config/lightdm-config/debian/changelog	2012-08-16 19:07:54 UTC (rev 25728)
@@ -1,3 +1,10 @@
+debathena-lightdm-config (1.7) unstable; urgency=low
+
+  * Deal with AFS possibly not being up by the time lightdm starts
+  * Remove stray debugging print statement
+
+ -- Jonathan Reed <jdreed@mit.edu>  Thu, 16 Aug 2012 15:07:45 -0400
+
 debathena-lightdm-config (1.6) unstable; urgency=low
 
   * Populate the update start time correctly

Modified: trunk/debathena/config/lightdm-config/debian/debathena-lightdm-greeter
===================================================================
--- trunk/debathena/config/lightdm-config/debian/debathena-lightdm-greeter	2012-08-16 17:25:12 UTC (rev 25727)
+++ trunk/debathena/config/lightdm-config/debian/debathena-lightdm-greeter	2012-08-16 19:07:54 UTC (rev 25728)
@@ -87,13 +87,6 @@
         # No need to check these, they get checked later.
         self.backgroundImageFile = config.get('Greeter', 'background_image')
         self.motdFilename = config.get('Greeter', 'motd_filename')
-        if self.appendCodenameToMotd:
-            try:
-                codename = subprocess.Popen(["lsb_release", "-s", "-c"], stdout=subprocess.PIPE).communicate()[0]
-                if codename and os.path.exists(self.motdFilename + "." + codename.strip()):
-                    self.motdFilename += "." + codename.strip()
-            except OSError:
-                print >>sys.stderr, "Couldn't append codename to motd_filename.  Oh well..."
         self.nologinFile = config.get('Greeter', 'nologin_file')
         
         # Set up and connect to the greeter
@@ -198,6 +191,9 @@
         self.winLogin.show()
         self.initBackgroundWindow()
         self.initBrandingWindow()
+        self.afsMonitor = Gio.File.new_for_path("/afs/athena").monitor_directory(Gio.FileMonitorFlags.WATCH_MOUNTS, None)
+        self.afsAvailable = os.path.isdir("/afs/athena")
+        self.afsMonitor.connect("changed", self.afsStatusChanged)
         self.initMotdWindow()
         # Connect Gtk+ signal handlers
         self.builder.connect_signals(handlers)
@@ -225,6 +221,13 @@
     def initMotdWindow(self):
         self.winMotd = self.builder.get_object("winMotd")
         motdFile=None
+        if self.appendCodenameToMotd:
+            try:
+                codename = subprocess.Popen(["lsb_release", "-s", "-c"], stdout=subprocess.PIPE).communicate()[0]
+                if codename and os.path.exists(self.motdFilename + "." + codename.strip()):
+                    self.motdFilename += "." + codename.strip()
+            except OSError:
+                print >>sys.stderr, "Couldn't get codename to append to motd_filename.  Oh well..."
         try:
             motdFile = open(self.motdFilename, "r")
         except IOError, e:
@@ -379,6 +382,14 @@
             self.gtkSettings.set_property('gtk-theme-name', self.origTheme)
 
 
+    def afsStatusChanged(self, monitor, file1, file2, evt_type):
+        if evt_type == Gio.FileMonitorEvent.CREATED:
+            if not self.winMotd.get_property("visible"):
+                self.initMotdWindow()
+            self.afsAvailable = True
+        if evt_type == Gio.FileMonitorEvent.UNMOUNTED:
+            self.afsAvailable = False
+
     def _file_changed(self, monitor, file1, file2, evt_type):
         if evt_type == Gio.FileMonitorEvent.CREATED:
             self.loginNotebook.set_current_page(1)
@@ -494,6 +505,10 @@
                 self.errDialog("Logging in as '%s' disallowed by configuation" % (currUser))
                 self.startOver()
                 return True
+            if not self.afsAvailable and (passwd.pw_dir.startswith("/mit") or passwd.pw_dir.startswith("/afs")):
+                self.errDialog("Your AFS home directory does not appear to be available.  This may indicate a problem with this workstation, or with the AFS servers.  Please try another workstation.")
+                self.startOver()
+                return True
 
         # Set the label to the value of the prompt
         self.prompt_label.set_text(text)
@@ -657,7 +672,6 @@
     # in any calls
     config.readfp(io.BytesIO("[Greeter]\n"))
     config.read(options.config_file)
-    print >>sys.stderr, config.get('Greeter', 'time_PEDANTRY')
     Gtk.init(None);
     main_loop = GObject.MainLoop ()
     dagreeter = DebathenaGreeter(options, config)


home help back first fref pref prev next nref lref last post