From cc54175e43ce14c01f9c103541ffad795b17629c Mon Sep 17 00:00:00 2001 From: Christof Hanke Date: Sun, 28 Nov 2010 13:01:12 +0100 Subject: [PATCH] Unix afsd: Check for mountpoint /afs first Check for the existance of the mountpoint before trying to start. Change-Id: I56c7a69b2b24c465f987e33c3f88c6ac37e40dd0 Reviewed-on: http://gerrit.openafs.org/3392 Tested-by: BuildBot Reviewed-by: Derrick Brashear Tested-by: Derrick Brashear --- src/afsd/afsd.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/afsd/afsd.c b/src/afsd/afsd.c index 4c9cdd79e..495ceb3e5 100644 --- a/src/afsd/afsd.c +++ b/src/afsd/afsd.c @@ -1918,6 +1918,7 @@ afsd_run(void) { static char rn[] = "afsd"; /*Name of this routine */ struct afsconf_dir *cdir; /* config dir */ + struct stat statbuf; int lookupResult; /*Result of GetLocalCellName() */ int i; afs_int32 code; /*Result of fork() */ @@ -1951,6 +1952,16 @@ afsd_run(void) exit(1); } + if (stat(afsd_cacheMountDir, &statbuf)) { + printf("afsd: Mountpoint %s missing.\n", afsd_cacheMountDir); + exit(1); + } else { + if (!S_ISDIR(statbuf.st_mode)) { + printf("afsd: Mountpoint %s is not a directory.\n", afsd_cacheMountDir); + exit(1); + } + } + /* do some random computations in memcache case to get things to work * reasonably no matter which parameters you set. */ -- 2.39.5