Closed djanjusevic-srce closed 2 weeks ago
Hi @djanjusevic-srce
thank you for your report.
Yes, NAME
should not be set to glpi-agent-cron
, but glpi-agent
.
The LOG
var here is only there to log cron task execution and any eventual stderr output from started script.
So I'll modify the installer to set in front of the /etc/cron.hourly/glpi-agent
script:
NAME=glpi-agent
LOG=LOG=/var/log/$NAME-cron.log
Thank you @g-bougard for the quick answer; You are definitely right, log file location or name are not crucial for successfully executing the cron job, but NAME variable is.
Cheers, Dragan
Hi @djanjusevic-srce
next nightly build should work as expected.
Bug reporting acknowledgment
Yes, I read it
Professional support
None
Describe the bug
When installing GLPI agent via installation script (1.7.3, 1.8 or 1.9 tested) on DEB-based OS (tested on Ubuntu 22.04, Debian 10, 11 and 12), I end up with the cron file in /etc/cron.hourly containing
Few lines below, same cron file is trying to source the following:
which doesnt' exist since variable NAME is set to "glpi-agent-cron" instead of "glpi-agent".
Also, installation script forces LOG variable to be /var/log/$NAME.log in cron file no matter what options you give to script when installing.
I suggest the following:
1) Set NAME variable in cron file to "glpi-agent" 2) Make LOG either a) respect the corresponding commandline option given to script or b) set it to /var/log/$NAME/$NAME.log to be consistent with RPM-based installations.
To reproduce
Expected behavior
Cron job should produce the inventory file in /root/inventory.json
Operating system
Linux
GLPI Agent version
1.9, 1.8, 1.7.3
GLPI version
10.0.11
GLPIInventory plugin or other plugin version
GLPI Inventory v1.3.5
Additional context
No response