[sane-devel] scanbd integration (was Re: sane-backends release 1.0.26 schedule)

Louis Lagendijk louis at fazant.net
Sat May 6 15:43:10 UTC 2017


On Sat, 2017-05-06 at 21:20 +0900, Olaf Meeuwissen wrote:
> Hi Louis,
> 
> Louis Lagendijk writes:
> 
> > On Fri, 2017-04-28 at 08:04 -0400, m. allan noah wrote:
> > > Ok folks, it's time to get another sane-backends release out the
> > > door.
> > 
> > [snip]
> > 
> > Hi,
> > Yesterday when I had a look at our bug tracker for any issues in my
> > code I found https://alioth.debian.org/tracker/?func=detail&group_i
> > d=30186&aid=315004&atid=410366
> > This is an issue for scanbd integration that requires more
> > flexibility
> > for configuration of dll-loading: when scanbd is used users need to
> > use
> > the net backend only, but scanbd/saned need to be fed with the
> > "normal" list of backends.
> 
> Thanks for trying to improve scanbd integration.
> 
> > I made a patch to dll.c where
> > - It used the dll.conf with the name pointed out by env. var
> > SANE_CONFIG_FILE if defined, if not
> > - it tries to load a dll2.conf if it exists. This is meant to be a
> > file
> > dropped in thre sane config dir by scanbd. If that does not exist
> > - it follows the existing code path.
> 
> So, if I understand correctly, your patched dll backend tries
> 
>   $SANE_CONFIG_FILE (if defined)
>   $SANE_CONFIG_DIR/dll2.conf (if SANE_CONFIG_DIR is defined)
>   $sysconfdir/dll2.conf
>   $SANE_CONFIG_DIR/dll.conf (if SANE_CONFIG_DIR is defined)
>   $sysconfdir/dll.conf
> 
> where $sysconfdir is set at ./configure time.  Is that right?
> 
Yes, I am indeed using the $sysconfdir (or SANE_CONFIG_DIR) as search
path for all config files. 

I am using the sanei functions for loading the config, so the logic is
the same as for loading other config files.


> If so, I guess that could be okay but I don't like the dll2.conf name
> very much.  It seems to imply there's a dll2 backend.  There isn't
> one,
> not now at least.
Neither do I. I am still looking for something better, right now I am
trying to get a working solution. How about dll-override.conf?

> > I added a #include statement in the config file so dll2.conf can
> > include dll.conf if so required.
> 
> How does that work when SANE_CONFIG_DIR is defined?

I need to check this, but I am using sanei_config so it SHOULD (famous
last words) work. do it would follow the normal search path
(SANE_CONFIG_DIR if set, otherwise $sysconfdir). I actually implemented
this by a call to read_conf with the new name from within read_config.
This would allow even allow an include from an include.

I however just realized that if a user gets the override dll.conf,
scanbd could use dll.conf explicitely. This removes the need for the
#include, so i will remove it.

alan mailed me about one issue: if there is a dll2.conf but scanbd is
not started, sane would not find any scanners. I don't know what to do
about that case. Well start scanbd init scripts or the systemd units
could place/remove the dll2.conf, but that is to much of an hack. Maybe
 add a pidfile parameter on the first line in dll2.conf that if not
present makes sane fallback to dll.conf?

Thanks for the feedback
Louis



More information about the sane-devel mailing list