@mkobel opened this Issue on January 20th 2015

The command ps ex (in core/CliMulti/Process.php in Method isProcessStillRunning) cannot be executed on Solaris.
Changing this command to ps -e it works.

@tsteur commented on January 20th 2015 Member

It used to use -e but the dash was removed while working on #5842 see https://github.com/piwik/piwik/commit/ca84f227dc1de30fd96e76ab5e7f61d5d5adca87

@diosmosis do you remember why it was removed? If we have to execute it this way maybe we could run ps ex first and if it fails use ps -ex?

@mnapoli commented on January 20th 2015 Contributor

Could we consider using something like Symfony's Process? Or is there a particular reason we don't use it? They seem to have an alternative solution using proc_get_status(), that would (hopefully) prevent us maintenance and bugfixes like this.

@tsteur commented on January 21st 2015 Member

Probably not, the latest version requires PHP 5.5.9

@diosmosis commented on January 21st 2015 Member

There was an issue w/ using '-...' on BSD. I can't quite remember what happened, but wikipedia says "Most systems derived from BSD fail to accept the SUS and POSIX standard options because of historical conflicts (for example, the "e" or "-e" option will cause the display of environment variables)." [1]. Sounds familiar.

[1] http://en.wikipedia.org/wiki/Ps_%28Unix%29

@mnapoli commented on January 21st 2015 Contributor

Symfony 3 will require 5.5, but Symfony 2 requires 5.3.3.

@tsteur commented on January 21st 2015 Member

We could give it a try then. We don't use it much so would be easy to replace for a test although there are a few warnings in the docs to consider which makes it maybe a bit more work. How long will they support Symfony 2? I'm pretty sure we looked that time into it and there was something why we couldn't use it.

It would be nice if it still worked on the same systems as it does today. I can't find anything about this in docs or composer so presume it just works everywhere. By looking at the code we'll have to patch their PHP executable finder as it seems to not correctly find a valid php that we can use (eg cgi, fpm, ...). Probably we could also inject another dependency there and use our own instead. We should also make sure their code makes sure it detects the end of a process in all cases to prevent ending in a never ending loop. We might have to make more adjustments here.

@mattab commented on February 19th 2015 Member

@mkobel when you say core:archive does not work on Solaris, does it actually fail? because even if ps -e fails to execute, then it should fallback to using HTTP rather than processes which should still work. Can you post the error message?

@mkobel commented on March 2nd 2015

As far as I know, the fallback does not work automatically.

The error message is the following:
( I replaced the URL of Piwik with PIWIKURL )

INFO CoreConsole[2015-01-20 07:30:19] ---------------------------                           
INFO CoreConsole[2015-01-20 07:30:19] INIT                         
INFO CoreConsole[2015-01-20 07:30:19] Piwik is installed at: PIWIKURL                         
INFO CoreConsole[2015-01-20 07:30:19] Running Piwik 2.10.0 as Super User                                                                                                                 
usage: ps [ -aAdeflcjLPyZ ] [ -o format ] [ -t termlist ]                                                                                                                                
        [ -u userlist ] [ -U userlist ] [ -G grouplist ]                                                                                                                                 
        [ -p proclist ] [ -g pgrplist ] [ -s sidlist ] [ -z zonelist ]                                                                                                                   
  'format' is one or more of:                                                                                                                                                            
        user ruser group rgroup uid ruid gid rgid pid ppid pgid sid taskid ctid                                                                                                          
        pri opri pcpu pmem vsz rss osz nice class time etime stime zone zoneid                                                                                                           
        f s c lwp nlwp psr tty addr wchan fname comm args projid project pset                                                                                                            
ERROR CoreConsole[2015-01-20 07:30:19] Got invalid response from API request:                                                                                                            
+PIWIKURL?module=API&method=API.getDefaultMetricTranslations&format=original&serialize=1&trigger=archivephp. The response was empty. This usually means a   
+server error. This solution to this error is generally to increase the value of 'memory_limit' in your php.ini file. Please check your Web server Error Log file for more details.    
+ERROR CoreConsole[2015-01-20 07:30:19] The Piwik URL PIWIKURL does not seem to be pointing to a Piwik server. Response was ''.                             
ERROR CoreConsole[2015-01-20 07:30:19] The Piwik URL PIWIKURL does not seem to be pointing to a Piwik server. Response was ''.                              

  The Piwik URL PIWIKURL does not seem to be pointing to a Piwik server. Response was ''.                  
@mattab commented on September 11th 2015 Member

Hi @mkobel - do you still experience this bug in 2.14.3? if so, is there any chance you could grant us access to Solaris server so we can test and investigate this issue?

@mkobel commented on September 22nd 2015

Yes, the bug still exists and we changed the command to ps -e.
I'm sorry, we cannot grant access to the server.

@mattab commented on September 22nd 2015 Member

If anyone has access to a Solaris server or wants to provide a Pull request that solves the issue on Solaris, we will welcome it!

@bartonjd commented on April 11th 2016

So I am running OmniOS which is based on Solaris 10 (uname -a output: SunOS piwik 5.11 omnios-170cea2 i86pc i386 i86pc), changing ps ex to ps -e worked for me. I would be willing to test any patches or suggestions you may have

ps ex works in Solaris/bash but not when called from ./core/CliMulti/Process.php. For some reason (maybe environment related it only works for me when I use -e if it is being called from within PHP

Powered by GitHub Issue Mirror