From bb8b7534bcd6579c7087ccb90051eceede4e1b98 Mon Sep 17 00:00:00 2001 From: Kevin Fourie Date: Sat, 19 Jul 2008 14:13:04 +0000 Subject: [PATCH] KTS-3496 "Error (warning fopen) when opening ktdms application under Linux" Fixed. Added chown to nobody on script init if current user is root. --- bin/scheduler.php | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/bin/scheduler.php b/bin/scheduler.php index c01a094..6ed0f52 100644 --- a/bin/scheduler.php +++ b/bin/scheduler.php @@ -51,6 +51,17 @@ if(file_exists($lock)){ exit(0); } +// If this is *nix and we are root then make sure file permisions are correct +if(!OS_WINDOWS && (get_current_user() == 'root')) +{ + // The log files... + try { + $default->log->debug( 'Scheduler: setting owner to nobody on - '.$default->logDirectory); + exec('chown -R nobody:0 '.escapeshellcmd($default->logDirectory)); + } catch(Exception $e) { + $default->log->debug('Scheduler: can\'t set owner to nobody - '.$e); + } +} /* ** Set up functions ** */ @@ -262,4 +273,4 @@ if (empty($aList)) $default->log->debug('Scheduler: stopping'); -?> \ No newline at end of file +?> -- libgit2 0.21.4