Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign upAdding the update job to Synology DSM Task Scheduler #107
Comments
This comment has been minimized.
This comment has been minimized.
|
Hi ztp, Can you add the following to your config.php file, reload the page and let me know what it returns? The Synology DSM probably uses a different name. var_dump($_SERVER['SERVER_SOFTWARE']); Thanks. |
dopeh
added
the
bug
label
Jun 23, 2014
This comment has been minimized.
This comment has been minimized.
|
Hi Pep, thank you for your interest on this. Loading any page of the phpservemon on a browser, it outputs: But I've managed to see what these values are when "status.cron.php" is run under the Synology Diskstation Task Manager (and not under the browser call): $_SERVER['SERVER_SOFTWARE'] is string(6) "Apache" So, the test in psm_is_cli(): return (!isset($_SERVER['SERVER_SOFTWARE']) && (php_sapi_name() == 'cli' || (is_numeric($_SERVER['argc']) && $_SERVER['argc'] > 0))); returns false because isset(...) returns true. Maybe that test on the 'SERVER_SOFTWARE' should be dropped? Regards |
dopeh
added this to the 3.1.0 milestone
Jul 28, 2014
dopeh
self-assigned this
Jul 28, 2014
This comment has been minimized.
This comment has been minimized.
|
Fixed for next release. |
dopeh
closed this
Jul 28, 2014
dopeh
reopened this
Jul 28, 2014
This comment has been minimized.
This comment has been minimized.
|
Update: removing the SERVER_SOFTWARE check will cause servers with "register_argc_argv" turned on to detect all web calls as CLI instead, so the previous "fix" is actually not a fix. |
akaztp commentedJun 23, 2014
Hi
I'm using PHPServerMon on an Synology DS212j. All went fine until I had to schedule the update job.
I wanted to use the DSM (synology desktop-like web interface) to schedule the update.
I've found that using the cli (though telnet) the status.cron.php worked ok but not when called using the DSM Task Scheduler. On the later case the script would output "This script can only be run from the command line.".
So I've removed the following lines from file status.cron.php:
if(!psm_is_cli()) {
die('This script can only be run from the command line.');
}
And now it works ok!
I have not tried to run the script using the cronjob configuration.
I don't know how to change the psdm_is_cli() to correctly accept the calling from the DSM Task Scheduler.
For me this solution is acceptable and I'm placing it here to help someone with the same problem.
Thx
ztp