[fhs-discuss] Search paths

Lennart Poettering lennart at poettering.net
Mon May 16 09:42:58 PDT 2011


Heya,

so here's a thing to think about before standardizing any new places
where applications can be placed: how to include them in the search
paths? Search paths here can refer to various search paths, like the
venerable $PATH, to $LD_LIBRARY_PATH, to the path where PHP looks for
its plugins, or Python does, to the places where icon .pngs are searched
for, or D-Bus service files, or .desktop files, or mozilla looks for the
flash plugin, or man for the man pages.

Some parts of the system look in /usr/{lib,share}/something AND
/usr/local/{lib,share}/something. Many programs only look on the
former. But nothing looks in /opt.

The XDG basedir spec currently declares that /usr/share/something and
/usr/local/share/something need to be searched.

If we want to make /opt really useful we must provide a way so that
software installed in it can register with or extend system software. We
should make it possible that 3rd party vendors can place their flash
plugins in /opt, and they are found. Or that they can place a .desktop
file in /opt, and it appears in the menus. Or that they can install a
systemd system service and it can be started. Or that hey can install a
bus service and it can be autospawned. Or they can install a python
extension and python will be able to use it. And so on, and so on.

So, how should we fix this problem? I know that RH has doing "stacks",
where an additional script is used to enable/disable software installed
in /opt/redhat, by patching the software into the various search paths
used everywhere. I have my doubts about having a secondary packaging
scheme here, so I don't really like it. But, what *is* our story here?
The usefulness of /opt stands and falls with that question: how is
software installed there integrated with the system?

An easy way out would be to build on the XDG-base dir spec and declare
that /opt/*/share would also be searched for plugins/icons/desktop
files/... But that would enforce a directory structure beneath /opt/*/,
that is currently left unspecified. Do we want that?

Of course, including /opt/* by default in the search path of apps might
make sense for for .desktop files. But it definitely doesn't for shared
lib .sos? (but it again does for plugin .so!)

(Getting this right is probably crucial to get a more lively scene of
3rd party developers into Linux, because as long as this isn't fixed the
only path onto a Linux machine is via the distributor.)

Lennart

-- 
Lennart Poettering - Red Hat, Inc.


More information about the fhs-discuss mailing list