deployphp / deployer

The PHP deployment tool with support for popular frameworks out of the box
https://deployer.org
MIT License
10.41k stars 1.47k forks source link

Handling of ProcessTimedOutException is unreliable #3782

Open jimwins opened 4 months ago

jimwins commented 4 months ago

The output of the ps x | ... command is not checked to see if a PID was actually retrieved. This can happen with a command that is long enough that the $shellId doesn't appear because it's only using ps x instead of ps wwx.

You could also eliminate the use of grep by making it: ps wwx | awk '/$shellId/ && !/awk/ {print \$1; exit}'

https://github.com/deployphp/deployer/blob/51e8e82c0726b0386d2989c42df003899d35af8a/src/Component/Ssh/Client.php#L96-L99

Upvote & Fund

Fund with Polar