Skip to content

Don't set $MANPATH - #1599

Merged
craigcomstock merged 1 commit into
cfengine:masterfrom
abbeyj:manpath
Jun 2, 2026
Merged

craigcomstock merged 1 commit into
cfengine:masterfrom
abbeyj:manpath

Conversation

@abbeyj

@abbeyj abbeyj commented Feb 26, 2025

Copy link
Copy Markdown
Contributor

The man pages aren't built anymore since cfengine/core#715 . The directory /var/cfengine/share/man does not exist as part of the package so it does not make sense to refer to it.

The man pages aren't built anymore since cfengine/core#715 .
The directory /var/cfengine/share/man does not exist as part of the package
so it does not make sense to refer to it.
@craigcomstock

Copy link
Copy Markdown
Contributor

@abbeyj thanks for the contribution! How did you find this?

@abbeyj

abbeyj commented Mar 4, 2025

Copy link
Copy Markdown
Contributor Author

A coworker of mine noticed that their $MANPATH was pointing at a nonexistent directory and asked why. I figured out that it was getting set by /etc/profile.d/cfengine3.sh. This file is part of the cfengine-community RPM but the man pages are not shipped as part of this RPM, or any other RPM that I can find. So I'm assuming that when the man pages were dropped, removal of this part of profile.sh was overlooked. It would be easy to miss as nothing will really be broken by leaving this in place. It will just waste a few cycles on every login and on every invocation of man.

@craigcomstock

Copy link
Copy Markdown
Contributor

A coworker of mine noticed that their $MANPATH was pointing at a nonexistent directory and asked why. I figured out that it was getting set by /etc/profile.d/cfengine3.sh. This file is part of the cfengine-community RPM but the man pages are not shipped as part of this RPM, or any other RPM that I can find. So I'm assuming that when the man pages were dropped, removal of this part of profile.sh was overlooked. It would be easy to miss as nothing will really be broken by leaving this in place. It will just waste a few cycles on every login and on every invocation of man.

Very good. Thanks for the explanation. I'll take a look around and try to get this merged.

@github-actions

github-actions Bot commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

Marking this PR as stale due to inactivity; it will be closed in 7 days.

@github-actions github-actions Bot added the stale label Jun 1, 2026
@abbeyj

abbeyj commented Jun 1, 2026

Copy link
Copy Markdown
Contributor Author

I believe this is still relevant and I'd still like to have it merged and not closed.

@craigcomstock

Copy link
Copy Markdown
Contributor

I believe this is still relevant and I'd still like to have it merged and not closed.

Absolutely. I am looking at this now and will try to resolve it one way or another. Thanks for the contribution!

@craigcomstock

Copy link
Copy Markdown
Contributor

This change looks correct to me. We now install man pages to standard locations and not in /var/cfengine/share/man as part of the post install scriptlets: https://github.com/cfengine/buildscripts/blob/master/packaging/common/cfengine-non-hub/postinstall.sh#L55-L64

  case `os_type` in
    redhat|debian)
      if [ -f /usr/share/man/man8/$i.8.gz ]; then
        rm -f /usr/share/man/man8/$i.8.gz
      fi
      if $PREFIX/bin/$i -M > /usr/share/man/man8/$i.8; then
        gzip /usr/share/man/man8/$i.8 || true
      fi
      ;;
  esac

Man pages printed out with the -M option go back to the time of your referenced commit of doc removals and further back.
I checked a rhel-8 system with 3.27.1 cfengine-community repos package and the man pages work fine and are indeed in /usr/share/man/man8 as expected from the scriptlet above.

@craigcomstock
craigcomstock merged commit 06399d9 into cfengine:master Jun 2, 2026
@craigcomstock

Copy link
Copy Markdown
Contributor

@abbeyj Thanks for the contribution! We will take care of cherry picking this change back to LTS releases if we need to. Be well!

@craigcomstock

Copy link
Copy Markdown
Contributor

cherry picked #2541 and #2542

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants