You are not logged in.
Pages: 1
Topic closed
Hi,
in GLPI 0.80rc3, cron.php use a relative path to the log but a chdir is done before the log file is open. Because of that the logger is not able to record issue.
The patch:
diff --git a/front/cron.php.orig b/front/cron.php
index 1b0e601..696993f 100644
--- a/front/cron.php.orig
+++ b/front/cron.php
@@ -33,13 +33,17 @@
// Purpose of file:
// ----------------------------------------------------------------------
+// Use canonicalized absolute pathname because we will
+// play with chdir
+define('GLPI_ROOT', realpath('..'));
+include (GLPI_ROOT . "/inc/includes.php");
+
+
+
// Ensure current directory when run from crontab
chdir(dirname($_SERVER["SCRIPT_FILENAME"]));
-define('GLPI_ROOT', '..');
-include (GLPI_ROOT . "/inc/includes.php");
-
if (!is_writable(GLPI_LOCK_DIR)) {
echo "\tERROR : " .GLPI_LOCK_DIR. " not writable\n";
echo "\trun script as 'apache' user\n";
Offline
I don't see any issue with previous code.
chdir goes to glpi/front, so .. is the right directory.
Your patch will break call from command line (where . is current directory, often, user's home)
Dév. Fedora 29 - PHP 5.6/7.0/7.1/7.2/7.3/7.4 - MariaDB 10.3 - GLPI master
Certifié ITILv3 - RPM pour Fedora, RHEL et CentOS sur https://blog.remirepo.net/
Offline
indeed, in can't reproduce the issue. Sorry
Cheers
Offline
Pages: 1
Topic closed