1

Lintian tag description:

The Filesystem Hierarchy Standard forbids the installation of new directories in /usr/bin other than /usr/bin/mh.

However, all I can find the linked document is

This is the primary directory of executable commands on the system.

This allows executable commands to go there, but it does not forbid anything. What paragraph doees Lintian refer to?

The reason I like to put a subdirectory there is that I have a wrapper script, that the user uses instead of the binary, and I want the wrapper script to work without changes when "installing" the program. In short, the script looks like

options=()
debug=0
mode="rel"
for option in "$@"; do
    if [ "$option" == "--debug" ]; then
        debug=1
        mode="dbg"
    else
        options+=("$option")
    fi
done

current_dir=$(dirname "`readlink -f "${BASH_SOURCE[0]}"`")
binary="$current_dir"/__anja_"$mode"_"$arch"/anja

if [ $debug -eq 1 ]; then
    gdb --args "$binary" "${options[@]}"
else
    exec "$binary" "${options[@]}"
fi

where arch is deduced from /proc/cpuinfo. The build system emits the binary in the directory __anja_"$mode"_"$arch", in the project root directory.

Yes, the correct place for the real binaries is /usr/libexec, but then the script must be changed during the installation procedure.

3

Section 4.4.2 of the FHS, version 3.0, specifically states

There must be no subdirectories in /usr/bin.

Since you’re using Lintian, I suppose you’re targeting Debian or a derivative; in such an environment, the appropriate location for your binaries is a package-specific subdirectory of /usr/lib. Debian and its derivatives don’t use /usr/libexec.

  • Aah, the link on lintian pointed to an old version. – user877329 Jul 29 '17 at 7:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.