>From 2d6655a998283b3ae882650326a21031aa08bad1 Mon Sep 17 00:00:00 2001 From: Bill Peck Date: Wed, 17 Mar 2010 15:28:03 -0400 Subject: [PATCH 11/14] anaconda umounts /proc on us while were still running. Deal with it. --- aux/anamon | 27 ++++++++++++++------------- 1 files changed, 14 insertions(+), 13 deletions(-) diff --git a/aux/anamon b/aux/anamon index affe96f..9bf66e1 100644 --- a/aux/anamon +++ b/aux/anamon @@ -133,22 +133,23 @@ class MountWatcher: self.time = time.time() def update(self): - fd = open('/proc/mounts') found = 0 - while 1: - line = fd.readline() - if not line: - break - parts = string.split(line) - mp = parts[1] - if mp == self.mountpoint: - found = 1 - if line != self.line: - self.line = line - self.time = time.time() + if os.path.exists('/proc/mounts'): + fd = open('/proc/mounts') + while 1: + line = fd.readline() + if not line: + break + parts = string.split(line) + mp = parts[1] + if mp == self.mountpoint: + found = 1 + if line != self.line: + self.line = line + self.time = time.time() + fd.close() if not found: self.zero() - fd.close() def stable(self): self.update() -- 1.6.6.1