Replies: 1 comment 3 replies
-
@btriller I can reproduce your issue. Looking at the code that builds up the set of attributes to and together I see that the description we have isn't quite accurate as you have discovered. Instead of all specified attributes being ANDed together, we only AND together the attributes which match processes. I added a debug log in that code for your example and see this is the case:
It does seem that both the commit you mention and the docs commit (cfengine/documentation@833b243) do not accurately describe the behavior of the code. I wasn't sure if I agreed with you about the no process_select behavior when there were more than one other attribute but looking at more examples in the docs I agree with you that the code should work as described and not as implemented. I have logged a ticket for this: https://northerntech.atlassian.net/browse/CFE-4511 feel free to chime in there or continue the conversation here. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Documentation [1] for
process_result
currently states that if it's missing in aprocess_select
body it willAND
all select attributes present in that body but that actually not true.Given following policy:
with
% ps -o pid,ppid,vsz,comm,cmd $(pgrep --parent 1 sshd) PID PPID VSZ COMMAND CMD 1548 1 15620 sshd sshd: /usr/sbin/sshd -D [listener] 0 of 10-100 startups
IMO should not not report
sshd without process result found
as
vsz
won't ever be in the range of1,1
.Also, if
process_select
body w/oprocess_result
is allowed, above error messages shouldn't be emitted.Documentation for this was changed on 10dbceb.
[1] https://github.com/cfengine/documentation/blob/87dd84131ef2b8c169d61d1f9a2996a1586f630f/reference/promise-types/processes.markdown?plain=1#L298-L306
Beta Was this translation helpful? Give feedback.
All reactions