renatomefi / php-fpm-healthcheck

A POSIX compliant sh script to healthcheck PHP fpm status, can be used only for pinging or check for specific metrics
MIT License
491 stars 55 forks source link

36: set: Illegal option -o pipefail #11

Closed KarelWintersky closed 6 years ago

KarelWintersky commented 6 years ago

Installed as

wget -O /usr/local/bin/php-fpm-healthcheck \
https://raw.githubusercontent.com/renatomefi/php-fpm-healthcheck/master/php-fpm-healthcheck \
&& chmod +x /usr/local/bin/php-fpm-healthcheck

result is:

# php-fpm-healthcheck
/usr/local/bin/php-fpm-healthcheck: 36: set: Illegal option -o pipefail

# php-fpm-healthcheck -v
/usr/local/bin/php-fpm-healthcheck: 36: set: Illegal option -o pipefail
renatomefi commented 6 years ago

Hello!

What's the OS you're using it (or Docker image)? It's suppose to run on posix sh Also please check if the content of the file is correct accordingly to the repository

But actually I think I was mislead by busybox, I'll make some tests on dash to see how it goes

KarelWintersky commented 6 years ago

Ubuntu 16.04 , ZSH shell

failed

Gentoo, bash shell (root) AND ZSH shell (user) gives me:

blacktower ~ # php-fpm-healthcheck
blacktower ~ # php-fpm-healthcheck -v
Trying to connect to php-fpm via: localhost:9000

(I think, I have no PHP-FPM on my gentoo server)

renatomefi commented 6 years ago

Well, the idea is to use it under sh/dash since it's suppose to run under docker environment. I indeed found out that on dash set -o pipefail isn't available, if you remove it you should be able to use, I'll patch it soon! Also maybe I'll put an extra check if you haven't configure fpm or status page

renatomefi commented 6 years ago

@KarelWintersky in you can update your script and try again, just make sure you follow this firstly: https://github.com/renatomefi/php-fpm-healthcheck#enable-php-fpm-status-page