FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Debian > Debian Development

 
 
LinkBack Thread Tools
 
Old 11-02-2011, 04:31 PM
Yaroslav Halchenko
 
Default directory under /usr/bin -- Ok or not?

Do we have any policy/recommendation forbidding/disadvising having
subdirectories under /usr/bin?

Conventionally, for packages which ship bulk of command line tools with
possible naming conflicts we seems to place them under /usr/lib/PACKAGE
(often regardless them being arch-dep or not)

I am packaging CMTK, where upstream agreed also to deliver a wrapper
script (/usr/bin/cmtk) so there would be a single point of entry to run
any needed command (in similar fashion to git), but also he made all
cmdline tools become available from ... /usr/bin/CMTK

I have checked FHS which only says:
"The following directories, or symbolic links to directories, must be in /usr/bin..."

so it seems to be ok to have subdirectories under /usr/bin (for /bin
there is strict "must not"), and I failed to find something in
debian policy forbidding or allowing taht. So would it be ok?

I kinda like that setup because then user doesn't need to
search anywhere under /usr/lib for a script I need from CMTK -- it
becomes available where I would expect it to find -- under
/usr/bin(/CMTK)

--
=------------------------------------------------------------------=
Keep in touch www.onerussian.com
Yaroslav Halchenko www.ohloh.net/accounts/yarikoptic


--
To UNSUBSCRIBE, email to debian-devel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 20111102173106.GH10325@onerussian.com">http://lists.debian.org/20111102173106.GH10325@onerussian.com
 
Old 11-02-2011, 05:00 PM
 
Default directory under /usr/bin -- Ok or not?

On Nov 02, Yaroslav Halchenko <debian@onerussian.com> wrote:

> Do we have any policy/recommendation forbidding/disadvising having
> subdirectories under /usr/bin?
We have the FHS, which says that you do not do this.

--
ciao,
Marco
 
Old 11-02-2011, 05:19 PM
Steve Langasek
 
Default directory under /usr/bin -- Ok or not?

On Wed, Nov 02, 2011 at 01:31:06PM -0400, Yaroslav Halchenko wrote:
> Do we have any policy/recommendation forbidding/disadvising having
> subdirectories under /usr/bin?

> Conventionally, for packages which ship bulk of command line tools with
> possible naming conflicts we seems to place them under /usr/lib/PACKAGE
> (often regardless them being arch-dep or not)

> I am packaging CMTK, where upstream agreed also to deliver a wrapper
> script (/usr/bin/cmtk) so there would be a single point of entry to run
> any needed command (in similar fashion to git), but also he made all
> cmdline tools become available from ... /usr/bin/CMTK

> I have checked FHS which only says:
> "The following directories, or symbolic links to directories, must be in /usr/bin..."

> so it seems to be ok to have subdirectories under /usr/bin (for /bin
> there is strict "must not"), and I failed to find something in
> debian policy forbidding or allowing taht. So would it be ok?

No, it's not ok. The per-package subdir should be created instead under
/usr/lib, and /usr/bin/cmtk can dispatch subcommands over there.

/usr/bin is on the path. Subdirs of /usr/bin are not on the path and should
not have to be added. Therefore there is no point in having subdirs of
/usr/bin, regardless of whether the FHS currently makes it explicit that
it's prohibited.

(It actually *is* a requirement from the FHS, because the FHS says that a
subdir in /usr/lib is the place where things must be placed; there's just no
backlink from the definition of /usr/bin that makes this clear without
reading the full FHS for context.)

--
Steve Langasek Give me a lever long enough and a Free OS
Debian Developer to set it on, and I can move the world.
Ubuntu Developer http://www.debian.org/
slangasek@ubuntu.com vorlon@debian.org
 
Old 11-02-2011, 05:24 PM
"John H. Robinson, IV"
 
Default directory under /usr/bin -- Ok or not?

Marco d'Itri wrote:
> On Nov 02, Yaroslav Halchenko <debian@onerussian.com> wrote:
>
> > Do we have any policy/recommendation forbidding/disadvising having
> > subdirectories under /usr/bin?
> We have the FHS, which says that you do not do this.

Where? Section 4.5. /usr/bin Most User Commands[1] specfically allows
directories, going so far as to explictly mentioning one directory, and
mandating a link to another directory.

You may be thinking of Section 3.4.2 Requirements[2] which forbids
directories; however that section refers only to /bin.

[1] http://www.pathname.com/fhs/pub/fhs-2.3.pdf pg 19
[1] http://www.pathname.com/fhs/pub/fhs-2.3.pdf pg 5

--
John H. Robinson, IV jaqque@debian.org
http ((((
WARNING: I cannot be held responsible for the above, sbih.org ( )(:[
as apparently my cats have learned how to type. spiders.html ((((


--
To UNSUBSCRIBE, email to debian-devel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 20111102182428.GA4746@a.mx.sbih.org">http://lists.debian.org/20111102182428.GA4746@a.mx.sbih.org
 
Old 11-02-2011, 06:43 PM
Yaroslav Halchenko
 
Default directory under /usr/bin -- Ok or not?

Thank you John for extending my argument with adequate references which
I have swallowed while composing my question email.

And if we are after reading FHS /usr/lib section:

/usr/lib includes object files, libraries, and internal binaries that
are not intended to be executed directly by users or shell scripts.

and in my case it becomes more interesting -- those tools *are intended*
to be executed by (interested) users directly. It is just due to proliferation
in number of the tools and conflicts with other packages they cannot go under
/usr/bin directly.

That is why for this package (as for few others we maintain already) we
are shipping also /etc/PKG/pkg.sh script so (interested) users could
source to have their PATH adjusted to get preference to execute tools
from the PKG instead of possibly available conflicting one under
/usr/bin. Wrapper script shipped directly under /usr/bin/ is only for
possible future adoption since at the moment all users (and their
scripts) rely on direct names of the cmdline tools.

Altogether, according to FHS /usr/lib/PKG is actually not preferable
location for them since indeed it is for solely internal use (and it is
now used to keep shared libraries)

On Wed, 02 Nov 2011, John H. Robinson, IV wrote:
> > > Do we have any policy/recommendation forbidding/disadvising having
> > > subdirectories under /usr/bin?
> > We have the FHS, which says that you do not do this.

> Where? Section 4.5. /usr/bin Most User Commands[1] specfically allows
> directories, going so far as to explictly mentioning one directory, and
> mandating a link to another directory.

> You may be thinking of Section 3.4.2 Requirements[2] which forbids
> directories; however that section refers only to /bin.

> [1] http://www.pathname.com/fhs/pub/fhs-2.3.pdf pg 19
> [1] http://www.pathname.com/fhs/pub/fhs-2.3.pdf pg 5
--
=------------------------------------------------------------------=
Keep in touch www.onerussian.com
Yaroslav Halchenko www.ohloh.net/accounts/yarikoptic


--
To UNSUBSCRIBE, email to debian-devel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 20111102194308.GI10325@onerussian.com">http://lists.debian.org/20111102194308.GI10325@onerussian.com
 
Old 11-02-2011, 06:53 PM
Yaroslav Halchenko
 
Default directory under /usr/bin -- Ok or not?

Thank you Steve !

With all due respect -- I disagree with your lines of
reasoning/support.

> The per-package subdir should be created instead under
> /usr/lib, and /usr/bin/cmtk can dispatch subcommands over there.

as I and John argued, FHS doesn't mandate them to be
under /usr/lib and actually allows for subdirectories under /usr/bin
(more below)

> /usr/bin is on the path.

100% correct

> Subdirs of /usr/bin are not on the path

also 100% correct, although could be made to be on the path (as any
other directory) upon user's intent, and could be executed "directly"

> and should not have to be added.
> (It actually *is* a requirement from the FHS, because the FHS says that a
> subdir in /usr/lib is the place where things must be placed; there's just no
> backlink from the definition of /usr/bin that makes this clear without
> reading the full FHS for context.)

as I have mentioned -- I see nowhere such a requirement, Moreover:

- FHS seems to allow subdirectories under /usr/bin:
"The following directories, or symbolic links to directories, must be
in /usr/bin ..."

and gives a nice example:

"mh Commands for the MH mail handling system (optional)"

- /usr/lib is destined for
"/usr/lib includes object files, libraries, and internal binaries
that are not intended to be executed directly by users or shell
scripts"

so indeed anything which cannot be executed directly -- should go
there. But "executed directly" in my understanding is not solely
being on the PATH -- if I can execute a tool via
/usr/lib/PKG/bin/xxx -- it is direct execution and thus should not
be hidden under /usr/lib


--
=------------------------------------------------------------------=
Keep in touch www.onerussian.com
Yaroslav Halchenko www.ohloh.net/accounts/yarikoptic


--
To UNSUBSCRIBE, email to debian-devel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 20111102195304.GJ10325@onerussian.com">http://lists.debian.org/20111102195304.GJ10325@onerussian.com
 
Old 11-02-2011, 07:48 PM
Roger Leigh
 
Default directory under /usr/bin -- Ok or not?

On Wed, Nov 02, 2011 at 03:43:08PM -0400, Yaroslav Halchenko wrote:
> Thank you John for extending my argument with adequate references which
> I have swallowed while composing my question email.
>
> And if we are after reading FHS /usr/lib section:
>
> /usr/lib includes object files, libraries, and internal binaries that
> are not intended to be executed directly by users or shell scripts.
>
> and in my case it becomes more interesting -- those tools *are intended*
> to be executed by (interested) users directly. It is just due to proliferation
> in number of the tools and conflicts with other packages they cannot go under
> /usr/bin directly.
[...]
> Altogether, according to FHS /usr/lib/PKG is actually not preferable
> location for them since indeed it is for solely internal use (and it is
> now used to keep shared libraries)

This is just nitpicking over the precise wording used. In practice,
this *is* where they belong, and it is what every other package does
(for example, postgresql). You can add that specific directory to
your path, should you choose.

When considering the divide between "internal use" and "for users",
consider that if it's for users to invoke then it should simply be
in the default path. It's not typical to need to add special
directories to one's path, and it's certainly not encouraged or
recommended.


Regards,
Roger

--
.'`. Roger Leigh
: :' : Debian GNU/Linux http://people.debian.org/~rleigh/
`. `' Printing on GNU/Linux? http://gutenprint.sourceforge.net/
`- GPG Public Key: 0x25BFB848 Please GPG sign your mail.


--
To UNSUBSCRIBE, email to debian-devel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 20111102204856.GJ28537@codelibre.net">http://lists.debian.org/20111102204856.GJ28537@codelibre.net
 
Old 11-02-2011, 08:19 PM
Yaroslav Halchenko
 
Default directory under /usr/bin -- Ok or not?

On Wed, 02 Nov 2011, Roger Leigh wrote:
> > Altogether, according to FHS /usr/lib/PKG is actually not preferable
> > location for them since indeed it is for solely internal use (and it is
> > now used to keep shared libraries)
> This is just nitpicking over the precise wording used.

really? since when it is nitpicking to quote FHS verbatim? once again:

"The following directories, or symbolic links to directories, must be in
/usr/bin, if the corresponding subsystem is installed:

Directory Description
mh Commands for the MH mail handling system (optional)"

?

> In practice,
> this *is* where they belong, and it is what every other package does
> (for example, postgresql). You can add that specific directory to
> your path, should you choose.

and I have been doing that for quite a few packages myself -- so I am
quite aware of this current "common practice". And that is why I
actually decided to check among standards and ask here either it
is mandated, because I always felt that executing anything from /usr/lib
felt awkward.

You might consider me blind or naive -- but so far none of the arguments
for not having a subdirectory under /usr/bin had any strongly supported
argument.

> When considering the divide between "internal use" and "for users",
> consider that if it's for users to invoke then it should simply be
> in the default path. It's not typical to need to add special
> directories to one's path, and it's certainly not encouraged or
> recommended.

Well -- that is all cool and in an ideal world I am with you on this
one. BUT it is often the case (e.g. with scientific software) that
suite provide bulk of (>100) cmdline tools. Some of those come without
unique names and are already widely used by people running Debian or
whatnot, so changing their habbits/scripts is not as easy as "lets just
renamed them". Sure thing we recommend upstream either coming up with
custom prefixes/unique names or gateway wrappers to avoid conflicts
and/or reduce hit on the proliferation of namespace of cmdline tools...
But once again -- it ain't happening at once and for all, so let's
not discuss this aspect further here.


--
=------------------------------------------------------------------=
Keep in touch www.onerussian.com
Yaroslav Halchenko www.ohloh.net/accounts/yarikoptic


--
To UNSUBSCRIBE, email to debian-devel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 20111102211926.GK10325@onerussian.com">http://lists.debian.org/20111102211926.GK10325@onerussian.com
 
Old 11-02-2011, 08:35 PM
Steve Langasek
 
Default directory under /usr/bin -- Ok or not?

On Wed, Nov 02, 2011 at 03:53:04PM -0400, Yaroslav Halchenko wrote:
> Thank you Steve !

> With all due respect -- I disagree with your lines of
> reasoning/support.

> > The per-package subdir should be created instead under
> > /usr/lib, and /usr/bin/cmtk can dispatch subcommands over there.

> as I and John argued, FHS doesn't mandate them to be
> under /usr/lib and actually allows for subdirectories under /usr/bin
> (more below)

The subdirectories of /usr/bin that are allowed in the FHS are spelled out
because they are exceptions.

> - /usr/lib is destined for
> "/usr/lib includes object files, libraries, and internal binaries
> that are not intended to be executed directly by users or shell
> scripts"

> so indeed anything which cannot be executed directly -- should go
> there. But "executed directly" in my understanding is not solely
> being on the PATH -- if I can execute a tool via
> /usr/lib/PKG/bin/xxx -- it is direct execution and thus should not
> be hidden under /usr/lib

Your understanding is misguided. If you intend it to be a user interface,
it belongs on the PATH. If you don't, it belongs under /usr/lib.

It is a bug in the FHS that it allows for this interpretation, but I have no
doubt that it is a bug and which way the FHS would be clarified to fix this
hole.

--
Steve Langasek Give me a lever long enough and a Free OS
Debian Developer to set it on, and I can move the world.
Ubuntu Developer http://www.debian.org/
slangasek@ubuntu.com vorlon@debian.org
 
Old 11-02-2011, 09:21 PM
Karl Goetz
 
Default directory under /usr/bin -- Ok or not?

On Wed, 2 Nov 2011 13:31:06 -0400
Yaroslav Halchenko <debian@onerussian.com> wrote:

> Do we have any policy/recommendation forbidding/disadvising having
> subdirectories under /usr/bin?

[...]

> I have checked FHS which only says:
> "The following directories, or symbolic links to directories, must be
> in /usr/bin..."
>
> so it seems to be ok to have subdirectories under /usr/bin (for /bin
> there is strict "must not"), and I failed to find something in
> debian policy forbidding or allowing taht. So would it be ok?

I don't have a link at the moment (because linuxfoundation
bugzilla/bzr/etc is still MIA), but I'm pretty sure its been clarified
forbidding subdirs in any of the (s)bin directories for FHS 3.0 (and
the exceptions you cite have also been removed).
If/when all the infrastructure comes back, you can find links to them
at [1].

[1]
http://lists.linuxfoundation.org/pipermail/fhs-discuss/2011-August/000334.html

thanks,
kk

--
Karl Goetz, (Kamping_Kaiser / VK7FOSS)
http://www.kgoetz.id.au
No, I won't join your social networking group
 

Thread Tools




All times are GMT. The time now is 01:15 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org