Re: Re: cf-agent floods logs with execv errors

"'Craig Comstock' via help-cfengine" <[email protected]> Tue, 16 Apr 2024 12:02:15 -0500
Newsgroups gmane.comp.sysutils.cfengine.general
Message-ID <CAMDw=qFLHNLX-b5R6VknEcXvcE__J-1iLBuNYQ_erhHpkiD7iA@mail.gmail.com>
Thanks for the report Xander.

It does look like that bit of policy could use some refactoring to work on
systems without getent.

Probably we could use the `getuserinfo()` policy function instead which
includes the home_dir entry.
https://docs.cfengine.com/docs/3.21/reference-functions-getuserinfo.html

Let us know if you want to work on the fix.

I created a ticket:
https://northerntech.atlassian.net/browse/CFE-4375

-Craig

On Tue, Apr 16, 2024 at 6:31 AM Xander Cage <[email protected]>
wrote:

> a quick grep in the masterfiles showed two instances of a getent call...
>
> root@nimvie: /var/cfengine/masterfiles # grep -r getent *
> lib/paths.cf:      "path[getent]"        string => "/usr/bin/getent";
> lib/vcs.cf:        string => execresult("$(paths.getent) passwd
> $(repo_uid)", noshell),
>
> vcs.cf seemst to be the culprit...
>
> On Tuesday, April 16, 2024 at 12:12:48 PM UTC+2 Xander Cage wrote:
>
>> i was just informed the getent is not a linux specific thing but is part
>> of posix . anyway, its not in aix so still a fix is necessary.
>>
>> On Tuesday, April 16, 2024 at 11:26:08 AM UTC+2 Xander Cage wrote:
>>
>>> Hi,
>>>
>>> cf-agent complains about /usr/bin/getent not found. as this is an aix
>>> environment this
>>> makes no sense. getent is a linux thing.
>>>
>>> Apr 16 09:36:35 kug01132 user:err|error cf-agent[10617102]:
>>> CFEngine(agent)  Couldn't run '/usr/bin/getent'. (execv: No such file or
>>> directory)
>>> Apr 16 09:41:25 kug01132 user:err|error cf-agent[2556430]:
>>> CFEngine(agent)  Couldn't run '/usr/bin/getent'. (execv: No such file or
>>> directory)
>>> Apr 16 09:46:15 kug01132 user:err|error cf-agent[36569520]:
>>> CFEngine(agent)  Couldn't run '/usr/bin/getent'. (execv: No such file or
>>> directory)
>>> Apr 16 09:51:06 kug01132 user:err|error cf-agent[18416128]:
>>> CFEngine(agent)  Couldn't run '/usr/bin/getent'. (execv: No such file or
>>> directory)
>>> Apr 16 09:55:56 kug01132 user:err|error cf-agent[54067624]:
>>> CFEngine(agent)  Couldn't run '/usr/bin/getent'. (execv: No such file or
>>> directory)
>>> Apr 16 10:01:47 kug01132 user:err|error cf-agent[459462]:
>>> CFEngine(agent)  Couldn't run '/usr/bin/getent'. (execv: No such file or
>>> directory)
>>> Apr 16 10:06:37 kug01132 user:err|error cf-agent[20120026]:
>>> CFEngine(agent)  Couldn't run '/usr/bin/getent'. (execv: No such file or
>>> directory)
>>> Apr 16 10:11:27 kug01132 user:err|error cf-agent[58458376]:
>>> CFEngine(agent)  Couldn't run '/usr/bin/getent'. (execv: No such file or
>>> directory)
>>> Apr 16 10:16:17 kug01132 user:err|error cf-agent[58458558]:
>>> CFEngine(agent)  Couldn't run '/usr/bin/getent'. (execv: No such file or
>>> directory)
>>> Apr 16 10:21:07 kug01132 user:err|error cf-agent[17564104]:
>>> CFEngine(agent)  Couldn't run '/usr/bin/getent'. (execv: No such file or
>>> directory)
>>> Apr 16 10:25:57 kug01132 user:err|error cf-agent[43057456]:
>>> CFEngine(agent)  Couldn't run '/usr/bin/getent'. (execv: No such file or
>>> directory)
>>> Apr 16 10:31:48 kug01132 user:err|error cf-agent[23462412]:
>>> CFEngine(agent)  Couldn't run '/usr/bin/getent'. (execv: No such file or
>>> directory)
>>> Apr 16 10:36:37 kug01132 user:err|error cf-agent[4325842]:
>>> CFEngine(agent)  Couldn't run '/usr/bin/getent'. (execv: No such file or
>>> directory)
>>> Apr 16 10:41:28 kug01132 user:err|error cf-agent[52036014]:
>>> CFEngine(agent)  Couldn't run '/usr/bin/getent'. (execv: No such file or
>>> directory)
>>> Apr 16 10:46:18 kug01132 user:err|error cf-agent[18875116]:
>>> CFEngine(agent)  Couldn't run '/usr/bin/getent'. (execv: No such file or
>>> directory)
>>> Apr 16 10:51:09 kug01132 user:err|error cf-agent[43057622]:
>>> CFEngine(agent)  Couldn't run '/usr/bin/getent'. (execv: No such file or
>>> directory)
>>> Apr 16 10:55:58 kug01132 user:err|error cf-agent[46203222]:
>>> CFEngine(agent)  Couldn't run '/usr/bin/getent'. (execv: No such file or
>>> directory)
>>>
>>> needs to be fixed...
>>>
>>> wbr
>>>
>>> chris
>>>
>> --
> You received this message because you are subscribed to the Google Groups
> "help-cfengine" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/help-cfengine/ca18dddf-38ea-4027-9aec-9840369106dbn%40googlegroups.com
> <https://groups.google.com/d/msgid/help-cfengine/ca18dddf-38ea-4027-9aec-9840369106dbn%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>


-- 

*Craig Comstock* (he/him)
CFEngineer/Digger | CFEngine <https://cfengine.com/>
Kansas, USA
 <https://www.linkedin.com/company/northern.tech>
<https://twitter.com/northerntechhq> <https://northern.tech>
Northern.tech <https://northern.tech> | Securing the world's connected
devices

-- 
You received this message because you are subscribed to the Google Groups "help-cfengine" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/help-cfengine/CAMDw%3DqFLHNLX-b5R6VknEcXvcE__J-1iLBuNYQ_erhHpkiD7iA%40mail.gmail.com.