New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
procfs needed by process component as of Piwik 2.2 #5041
Comments
This may work: @is_resource(fopen('/proc', 'r')) |
I need to reopen this issue because this check is not sufficient and I think it is not requried. The problem with the current solution is that it does not check if procfs is mounted. For example I have a shared hosting with no procfs:
A mounted /proc and not mounted /proc has both a "stream" resource type. So is_resource() is not sufficient enough to test if /proc is really mounted or not.
See http://www.php.net/manual/en/resource.php But there is an error anyway when ps is executed under such conditions
So the check returnsSuccessCode('ps') should already handle this situation. Or was there a case where this check was wrong? |
What output do you get from these commands? maybe you know how we can patch the is_resource line? |
Maybe it is possible to check if /proc/version or something like that exists and can be read? Would be interesting why the returnSuccessCode('ps') is true if /proc can not be accessed. |
What is the response to the following command on your console? ps > /dev/null 2>&1 & echo $? |
I think that line is the problem. Why haven't I seen this before?
the single & brings ps to the background which is successfull and returns always 0. But the return value of ps itself is 1 in my case. But that is not checked with this command. This line should do the trick:
|
For what it's worth, this continues to be a problem on FreeBSD. RELEASE FreeBSD 8.2-RELEASE !#0 Sorry I don't have the technical chops to explain why. I have patched core/CliMulti/Process.php to always return false, and Piwik is working fine. The error reported by Piwik whenever cron runs console core:archive: ps: Process environment requires procfs(5) |
can you please create another ticket? we will investigate why it does not work yet on Freebsd |
As of Piwik 2.2, the locking mechanics of the new process component uses "ps -e" to check for a given PID.
Therefore, the process environment needs a mounted proc file system, which is not present on all servers.
So we should check for the presence of procfs.
The text was updated successfully, but these errors were encountered: