-
Notifications
You must be signed in to change notification settings - Fork 472
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add process misreads process status #451
Comments
I was able to reproduce this, I'll have to investigate further. |
any news on this issue? |
I assume you've hit this bug. Can you give me the process experiencing this issue. Also, can you provide the output of |
Yes I have this bug in one of my docker images. Here is the output of ps:
and this is the goss yaml i use for the check:
I see that COMMAND is somehow truncated, maybe that is the problem? |
Yeah, it's based on the command name. The document was updated sometime after this ticket was created to clarify that process Does goss a process work just fine with the output of |
Yes if I use the name that |
It can be mentioned in the documentation, but it's a little more nuanced than just truncated process name. In most cases comm will be a truncated basename of the first argument to command/args but it's not something that's enforced and isn't always the case.
https://www.man7.org/linux/man-pages/man2/execve.2.html contrived example: import os
os.execlp("sleep", "foo", "30") running that python code, here's the output of
real world example: firefox:
That all said, I'm open to any suggestions or recommendations on how to word the process documentation better. It currently reads as follows:
|
Looks like switching to gopsutil will fix this. That's scheduled for v0.4.0 of goss since it's a breaking change. see #597 |
Keeping this open, there are some challenges with gopsutil, so this is not fixed yet. Had to remove gopsutil from v4 release. |
gopsutil was not released as part of 4 due to it being too magical and difficult to reproduce as an end user. That said, the documentation has been updated to recommend: For example: $ cat -E /proc/634/comm
systemd-journal$
$ goss a process systemd-journal
Adding Process to './goss.yaml':
systemd-journal:
running: true I don't believe this is still a bug as the documentation has been updated to reflect expectations. There are still some enhancements I'd like to make to the process detection (e.g. duplicates processes with same name), but I consider those feature enhancements. Anyways, let me know if you disagree.. if not, I'll close out this issue in a week or two. |
Closing, feel free to comment on here or open a new issue if this is still an issue. |
For several processes on my RHEL 7.3 server, goss seems to misrecord the statuses of processes...
As a test, I pipe every process in ps into a goss add process command...
Apart from the fluff (CMD from ps header, and ps, cut, rev, sort used in the command above), one would expect all these processes to be actual running processes. Yet, goss reports several of them as NOT running.
If I take just systemd processes as an example:
We see 4 processes all running since May 21. If we examine the goss.yaml file we see this:
3 of the 4 are listed as running, but even though systemd-journald is running, it is reported as false...
Whatever is happening is consistent, in the sense that validation will pass confirming "systemd-journald" is not running when goss re-executes.
There are a few other processes (excluding ps, cut, rev, sort from the command that fed goss) from a vendor product on my system that similarly report as running false when they are actually running...
Any idea what is happening to cause this strange behavior?
[This is using v0.3.7 AMD64]
The text was updated successfully, but these errors were encountered: