Closed loliee closed 9 months ago
ℹ️ I didn't have any issues to validate many other services: sshd
, postgresql
, nginx
, redis
and other http
servers…
Does tcp6:9000 work? If it does, the doc explains it a bit.
Yes it works !
My apologies, I didn't check well my server state, may be this could help someone else, if no IP is defined in the php-fpm
listen
option, it will bind the IPV6 interface:
; /etc/php/8.2/fpm/pool.d/www.conf
listen = "9082"
listen.allowed_clients = 127.0.0.1 # This IPV4 address confused me
sudo sockstat -l
USER PROCESS PID PROTO SOURCE ADDRESS FOREIGN ADDRESS STATE
root php-fpm8.2 37132 tcp6 :::9082 :::* LISTEN
Adding the IPV4 loopback IP force it on tcp4:
; /etc/php/8.2/fpm/pool.d/www.conf
- listen = "9082"
+ listen = "127.0.0.1:9082"
listen.allowed_clients = 127.0.0.1 # This IPV4 address confused me
sudo sockstat -l
USER PROCESS PID PROTO SOURCE ADDRESS FOREIGN ADDRESS STATE
root php-fpm8.2 41486 tcp4 127.0.0.1:9082 *:* LISTEN
As a goss user the confusing point for me was this note in the documentation:
Note: Goss might consider your port to be listening on tcp6 rather than tcp, try running goss add port .. to see how goss detects it. (https://github.com/goss-org/goss/issues/149)
Because goss
didn't detect my service as listening on tcp6
!.
🎉 Also as a goss
user I really love this proposal because it makes the most common use case really simple and allow more finest checks tcp4/tcp6
as well.
Thanks for your help @aelsabbahy ! I also would like to congratulate you for this product, the alternative to testinfra
, serverspec
I was looking for.
Describe the bug
I have an issue when trying to ensure that a
php-fpm
service is listening withport
resource.How To Reproduce
I have the issue on a compute instance but it's seems to be reproductible in a docker container…
Start a docker container with php:8.2-fpm and take a shell in it:
Install
netcat
&goss
:Ensure service is listening with netcat:
I ran goss with the following spec file:
Expected Behavior
Detect port as
listening: true
.Actual Behavior
Running the add port command doesn't help:
Environment:
v0.4.2
Linux (Debian 11/12)