* [add] more asserts and checks
* [fix] PHP sockets detection in tests
* [fix] improved socket dir detection
* [fix] improved service name detection, code simplification
* [fix] socket pools check
* [fix] mapfile -d
* [add] local vars
* [add] Travis CI folds
* [add] color output
* [add] zero exit code on success
* [add] cache for ondemand pm and check status of pools during discovery
* [fix] improved detection of some commands
* [add] info about ondemand pools, update syntax of discovery script in samples
## Fix (all problems specified in issue #12)
- **More robust method to discover sockets** (when PHP pool uses sockets). Script performs automatic checks of socket files (the file exists and is really a socket).
- **More robust method to discover host and port** (when PHP pool uses TCP connection).
- **Support of pools when PHP daemon listens on any network interface**. This mode is activated when in PHP pool configuration the `listen` command specifies only a port, without a host IP, for example:
```
listen = 9000
```
- **Correct discovery of pools in some cases.** The script performs analysis of all processes that belong to the pool. Previously, we checked only the first process, as a result if a pool somehow had multiple processes (for example Memcached, Redis, PostgreSQL) then discovery could capture wrong data. Now this problem is fixed.
- **Improved detection of pools**. We use better expressions in `grep` now. Previously special characters in pool names could lead to script failures. Besides such approach is a more robust method to fix#10.
## New functionality
- **Debug mode** of the discovery script helps to investigate problems that may happen
Replace $(NF-1) by $(NF).
I don't know, but on my CentOs server, the commande "lsof -p 1179 2>/dev/null | grep unix | head -1" gives me :
php-fpm 1179 php-fpm 24u unix 0xffff8f77b774dc00 0t0 8958617 /local/php/sockets/php7_mediawiki.sock
So, the socket is in the last row, not in the before last.