macos prefs pane more reliable running indicator
authorDerrick Brashear <shadow@dementia.org>
Sun, 28 Feb 2010 01:09:42 +0000 (20:09 -0500)
committerDerrick Brashear <shadow@dementia.org>
Sun, 28 Feb 2010 21:45:50 +0000 (13:45 -0800)
instead of grepping ps output, look for AFS in df output. not
happy with this either but it's way more reliable.

Change-Id: I73ff53bc1cc24c9484011a870546b6334ff66b49
Reviewed-on: http://gerrit.openafs.org/1410
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

src/platform/DARWIN/AFSPreference/AFSPropertyManager.h
src/platform/DARWIN/AFSPreference/AFSPropertyManager.m

index 7a733df..0009387 100644 (file)
@@ -13,6 +13,7 @@
 
 #define AFS_DAEMON_STARTUPSCRIPT       "/Library/OpenAFS/Tools/root.client/usr/vice/etc/afs.rc"
 #define AFS_DAEMON_PATH                                "/Library/LaunchDaemons/org.openafs.filesystems.afs.plist"
+#define AFS_FS_MOUNT                    "AFS"
 #define AFS_DAEMON_LAUNCH_PATH         "/private/var/db/openafs/etc/launchafs.sh"
 /*!
     @class             AFSPropertyManager
index 4da7e66..a5fb45e 100644 (file)
 // -------------------------------------------------------------------------------
 -(BOOL) checkAfsStatusForStartup {
        BOOL result = NO;
-       NSString *fsResult = [TaskUtil executeTaskSearchingPath:@"ps" args:[NSArray arrayWithObjects:@"-ef", nil]];
-       result = (fsResult?([fsResult rangeOfString:@AFS_DAEMON_LAUNCH_PATH].location != NSNotFound):NO);
+       NSString *dfResult = [TaskUtil executeTaskSearchingPath:@"/bin/df" args:[NSArray arrayWithObjects:nil]];
+       result = (dfResult?([dfResult rangeOfString:@AFS_FS_MOUNT].location != NSNotFound):NO);
        return result;
 }