Bug#462270: asterisk: agi-bin directory is intended for local scripts, and should be under /var

Tim Retout tim at retout.co.uk
Thu Jan 24 11:15:00 UTC 2008


On Wed, 2008-01-23 at 20:03 +0200, Tzafrir Cohen wrote:
> Just as you need to mount it read/write to install extra packages, you
> need to mount it read/write to install local scripts. As with cgi-bin -
> you can't easily have more than one directory, and it must also be used
> for scripts installed by packages.

With web servers such as Apache, it is generally possible for the
administrator to configure other cgi-bin directories at different
locations. Administrators do not have to put their custom CGI scripts
in /usr/lib/cgi-bin.

Asterisk can have only one agi-bin directory, so I do not think this is
comparable. (Hardcoding the full path in extensions.conf is not really
the same.)


> > This also has the benefit of retaining some compatibility with
> > upstream's location.
> 
> Upstream is incompatible with FHS. A symlink there might cause
> confusion.

Moving the directory altogether is potentially more confusing. For some
anecdotal evidence, see:
http://blog.andrew.net.au/2006/10/19#AGI_in_the_wrong_directory


> Can you give me a simple scenario where this actually helps? I'd hate
> complicating things for nothing.

I am mostly thinking about administrators writing custom AGI scripts,
and wanting to have them included in the agi-bin directory. They could
have different scripts on each host.

If they put their custom scripts into /usr/share/asterisk/agi-bin, then
the scripts may be overwritten by system upgrades; there is no guarantee
that a Debian package might not accidentally choose the same name as one
of the local scripts. See footnote [27] of FHS 2.3:
http://www.pathname.com/fhs/pub/fhs-2.3.html#FTN.AEN1450


Requiring administrators to add their own host-specific scripts
under /usr also goes against the FHS (and therefore Debian Policy); the
intention of the /usr hierarchy is that it is "shareable, read-only
data" that is not host-specific - it could potentially be shared between
different machines:
http://www.pathname.com/fhs/pub/fhs-2.3.html#THEUSRHIERARCHY

[Technically, site admins should perhaps be using somewhere under /srv
for host-specific scripts, not /usr/local:
http://www.pathname.com/fhs/pub/fhs-2.3.html#SRVDATAFORSERVICESPROVIDEDBYSYSTEM
...but it looks like it would be unwise for packages to install anything
there themselves.]

I believe symlinks in /var/lib/asterisk/agi-bin can be considered state
information of the system (i.e. the set of currently available AGI
scripts on this host) and fits the FHS criteria:
http://www.pathname.com/fhs/pub/fhs-2.3.html#VARLIBVARIABLESTATEINFORMATION


So, I hope this isn't just making things more complicated for nothing -
it could be interpreted as a violation of a "must" directive in Debian
Policy (section 9.1.1).

-- 
Tim Retout <tim at retout.co.uk>






More information about the Pkg-voip-maintainers mailing list