[RFC] New hylafax package: getting rid of the twin directories structure
I am packaging the new hylafax version, 6.0. Now that Lenny has been
released I am taking squeeze as base distribution, but I would also give
support to older distribution. Starting from sarge, all users where
strongly advised to update to 2.6 kernel; etch and lenny started
delivering packages that do not work with kernel 2.4. Now I believe that
2.4 kernel is no more supported.
Current hylafax package requires a lot of configuration files in a
specific directory, i.e. /var/spool/hylafax/etc, while Debian keep
configuration files in /etc. So, the init.d script for hylafax, clone
the /etc/hylafax/ directory and copy everything
on /var/spool/hylafax/etc. This is a problem because of duplicated data
and because it require a method to keep both directories in sync.
Keeping all conffiles only in /var/spool/hylafax/etc is against Debian
policy, keeping all of them in /etc/hylafax won't work for hylafax
daemons chrooted in /var/spool/hylafax/. Symbolic links doesn't solve
the problem either.
With 2.6 kernels, we may use the "bind" option in order to mount
a /etc/hylafax on /var/spool/hylafax/etc. So, I am finally moving to
this new configuration, but I have a few concern that I would like to
share, looking for suggestion.
First of all, hylafax package support many configuration: you may start
all daemons from init.d script, or you may have a few othe started via
inittab, or you may have some of them started via inetd. All
configuration may be mixed.
Currently, both directories are kept update by the script
in /etc/init.d. If any daemon is run via inittab or inetd, then they get
only the configuration found in /var/spool/hylafax/etc.
Currently, the main configuration is in /etc/hylafax. Whenever anything
is changed, i.e. using faxadduser, then the command also
Option 1. The new way, in my opinion, is to check if any daemon is run
via inetd or inittab. If any, then keep the current way. Then check for
mount/bind capability, if not preset, then keep the current way.
Otherwise backup and remove /var/spool/hylafax/etc while *installing*
the new package. Then bind and unbind the new file system when starting
and stopping hylafax using init.d script.
Option 2. do not backup and remove the old directory so, if any daemon
starts via inetd or inittab, they would find a valid configuration. Keep
binding and unbinding from the init.d script even if daemons are run via
inetd or inittab.
Option 3. prompt the user for selecting the preferred way.
Option 4. create an option in /etc/defaults/hylafax to make init.d
script only bind/unbind, without starting/stopping daemon. This could be
useful to people still running daemons via inittab or inetd, but willing
to use the bind/unbind way.
In any case, when this package is installed (not upgraded), follow