Onde eu instalo os comandos do usuário não final?

2

Em um projeto meu, tenho alguns comandos especializados que são chamados apenas por outros comandos e não devem ser invocados pelo usuário final. Esses comandos internos devem ser instalados em PREFIX / bin ou são melhor instalados em algum outro lugar, por exemplo, em PREFIX / lib?

Edit: Os comandos internos em questão são todos os scripts Awk. Como eles são independentes de arquitetura, considero instalá-los em PREFIXO / share / PACKAGE-NAME / bin. Isso seria uma boa escolha?

    
por August Karlstrom 31.10.2017 / 15:25

2 respostas

3

O Padrão de hierarquia do sistema de arquivos do Linux diz isso

/bin contains commands that may be used by both the system administrator and by users, but which are required when no other filesystems are mounted (e.g. in single user mode). It may also contain commands which are used indirectly by scripts.

e

The /lib directory contains those shared library images needed to boot the system and run the commands in the root filesystem, ie. by binaries in /bin and /sbin.

e

Utilities used for system administration (and other root-only commands) are stored in /sbin, /usr/sbin, and /usr/local/sbin. /sbin contains binaries essential for booting, restoring, recovering, and/or repairing the system in addition to the binaries in /bin. Programs executed after /usr is knownto be mounted (when there are no problems) are generally placed into /usr/sbin. Locally-installed system administration programs should be placed into /usr/local/sbin.

Finalmente,

/usr/lib includes object files and libraries. On some systems, it may also include internal binaries that are not intended to be executed directly by users or shell scripts. Applications may use a single subdirectory under /usr/lib. If an application uses a subdirectory, all architecture-dependent data exclusively used by the application must be placed within that subdirectory.

Há obviamente /usr/bin e várias outras opções. Sua definição para mim, parece mais com /usr/lib .

    
por 31.10.2017 / 15:57
0

A partir do FHS do Linux , capítulo 4.11 :

The /usr/share hierarchy is for all read-only architecture independent data files.

No entanto, você provavelmente deve usar /usr/libexec/ ou /usr/local/libexec/ , de acordo com as recomendações da FHS (capítulo 4.7 ):

/usr/libexec includes internal binaries that are not intended to be executed directly by users or shell scripts. Applications may use a single subdirectory under /usr/libexec.

Applications which use /usr/libexec in this way must not also use /usr/lib to store internal binaries, though they may use /usr/lib for the other purposes documented here.

    
por 31.10.2017 / 17:51