chdir when starting monitor_db to avoid issues such as
"shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory."
if monitor_db is started with an odd nfs pwd.
Signed-off-by: Gregory Smith <gps@google.com>
git-svn-id: http://test.kernel.org/svn/autotest/trunk@2877 592f7852-d20e-0410-864c-8624ca9c26a4
diff --git a/scheduler/monitor_db.py b/scheduler/monitor_db.py
index cc01159..02356d6 100644
--- a/scheduler/monitor_db.py
+++ b/scheduler/monitor_db.py
@@ -73,6 +73,11 @@
global RESULTS_DIR
RESULTS_DIR = args[0]
+ # Change the cwd while running to avoid issues incase we were launched from
+ # somewhere odd (such as a random NFS home directory of the person running
+ # sudo to launch us as the appropriate user).
+ os.chdir(RESULTS_DIR)
+
c = global_config.global_config
notify_statuses_list = c.get_config_value(scheduler_config.CONFIG_SECTION,
"notify_email_statuses",