SituationSome programs that I build from source have a directory libexec in the installation directory (for example, gnuplot). As a matter of rule, I add a export LD_LIBRARY_PATH=${installation directory}lib:${LD_LIBRARY_PATH}to my .bashrc when I have lib folders. Likewise with PATH and PKG_CONFIG_PATH if ${insdir}/bin and ${insdir}/lib/pkgconfig exist. I have developed this practice based on the many indications to do so gathered with usage.I can see that the files contained in libexec are binary executables.QuestionsWhat is their purpose in contrast to the executables stowed in bin?Should dedicated variables (in the guise of PATH, LD_LIBRARY_PATH, PKG_CONFIG_PATH) be set to make them known to the shell environment? If not, would PATH would do just as fine? Or perhaps there's no need ever to set anything because they are used by special programs that are content with a relative path? This topic is close to Portable binaries and the libexec path which addresses a similar point when creating libexec files in a package, though
Should libexec folders be added to some PATH-like variables?
filesystems;path;executable
libexec is intended for private binaries, i.e. binaries which are used by a program but which shouldn't be available generally. See the FHS:/usr/libexec includes internal binaries that are not intended to be executed directly by users or shell scripts.So no, you shouldn't add it to any PATH-style variables.