Closed JackLeo closed 4 years ago
Correct, the process is bin/sh
if you need to test for a portion of the full command name, you can use command with ps
or whatever you desire.
So process running detects rabbitmq-server
within /bin/sh /etc/rc.d/init.d/rabbitmq-server start
but not within su rabbitmq -s /bin/sh -c /usr/lib/rabbitmq/bin/rabbitmq-server
? How come?
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
NOTE: This check is inspecting the name of the binary, not the name of the process. For example, a process with the name nginx: master process /usr/sbin/nginx would be checked with the process nginx. To discover the binary of a pid run ps -p
-o comm.
Documentation was updated a while back to clarify this. If the functionality changes, the documentation will be updated to reflect that.
https://github.com/aelsabbahy/goss/blob/master/docs/manual.md#process
I am using rabbitmq so have a test:
This works a charm on Centos7. Now I want to run the same tests on Docker to validate the automation. In Docker container from
centos:7
this does fail with the process not running.Now the reason as far as I understand is that
rabbitmq-server
, when launched through System V script, is more detectable.Centos7:
Docker centos:7:
So because it is wrapped in
su rabbitmq -s /bin/sh -c
a test for process running sh does work.