Skip to content
This repository has been archived by the owner on Mar 23, 2023. It is now read-only.

workerPids broken on CentOS 6.6 #35

Open
elronalds opened this issue Jul 30, 2015 · 5 comments
Open

workerPids broken on CentOS 6.6 #35

elronalds opened this issue Jul 30, 2015 · 5 comments
Labels

Comments

@elronalds
Copy link

The commit bc6b543 breaks functionality on CentOS 6.6.

ps -A -o pid,comm | grep [r]esque doesn't return any resque processes on CentOS 6.6, however the previous code ps -A -o pid,command | grep [r]esque does work fine.

@wa0x6e
Copy link
Owner

wa0x6e commented Jul 30, 2015

So it fix Solaris, but breaks CentOS ? What a pain ...T.T

@wa0x6e wa0x6e added the bug label Jul 30, 2015
@elronalds
Copy link
Author

@Kamisama I have some other servers that are running CentOS 7 and the new command ps -A -o pid,comm | grep [r]esque works fine. CentOS 6 is still widely used though, probably more than Solaris I would suspect.

@wa0x6e
Copy link
Owner

wa0x6e commented Jul 31, 2015

I'll put an if/else to target CentOS < 7 then

@manierim
Copy link

manierim commented Aug 6, 2015

Ah... on my dev virtual machines both CentOS 6.6 and CentOS 7.1.1503 needs command.

From ps man:
comm is just the "command name (only the executable name)"
command alias args: "command with all its arguments as a string"

so comm just returns php for the actual worker process (so grep doesn't find [r]esque), while command shows the entire arguments, therefore grep find the worker process as well as all the parent processes, making the list "dirty".

So I fixed it using both comm and command and then checking that the executable name is php: manierim/php-resque-ex@0d22a3729c87168c85a8a01477fef03fde9326ea

Maybe checking Solaris manual we might find a common way?
Or we have to use php_uname() to build the command conditionally (i.e. is there a ps equivalent under WIN systems)?

@wa0x6e
Copy link
Owner

wa0x6e commented Aug 6, 2015

I'm not familiar with CentOS nor Solaris, but I think we should revert the commit, and make the patch only target Solaris system with a condition.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants