Bug 266694 - emulators/open-vm-tools rc script produces extraneous output, breaks puppet
Summary: emulators/open-vm-tools rc script produces extraneous output, breaks puppet
Status: Closed DUPLICATE of bug 266520
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Renato Botelho
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-09-28 22:22 UTC by Ray Bellis
Modified: 2022-10-03 17:55 UTC (History)
0 users

See Also:
bugzilla: maintainer-feedback? (garga)


Attachments
Fixed rc script (787 bytes, application/x-shellscript)
2022-09-28 22:22 UTC, Ray Bellis
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ray Bellis 2022-09-28 22:22:31 UTC
Created attachment 236929 [details]
Fixed rc script

The patch in commit eb65cf5cbe543a6372834bee33243344bc40f737 to "silence checkvm_cmd" is incorrect.

This line:

checkvm_cmd="%%PREFIX%%/bin/vmware-checkvm > /dev/null 2>&1"

does not cause stdout and stderr redirection, it simply passes the three extra tokens to the vmware-checkvm command in argv.

The correct solution is to define checkvm_cmd as a function:

checkvm_cmd()
{
  %%PREFIX%%/bin/vmware-checkvm > /dev/null 2>&1
}

This error causes our puppet manifests to break because the extraneous output from `service vmware-guestd rcvar` causes puppet's FreeBSD "service" resource provider to barf.

I've attached a fixed version of vmware-guestd.in.   In theory vmware-kmod.in has the same issue but it hasn't bitten us the way this one did.
Comment 1 Renato Botelho freebsd_committer freebsd_triage 2022-09-29 10:57:57 UTC
I'll work on it later today.  Thanks!
Comment 2 Renato Botelho freebsd_committer freebsd_triage 2022-09-30 17:32:38 UTC
Ray,

Can you please test the fix proposed by https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=266520 and let me know if it solves the case for you too?
Comment 3 Ray Bellis 2022-09-30 23:24:05 UTC
Yes, this works, although I personally prefer my version that uses a function rather than an explicit call to eval, this being in my experience a more common pattern in RC files.

thanks

Ray
Comment 4 Renato Botelho freebsd_committer freebsd_triage 2022-10-03 17:55:46 UTC

*** This bug has been marked as a duplicate of bug 266520 ***