[sane-devel] scanbd on archlinuxarm

Andreas Dick andudi at gmx.ch
Mon Dec 24 21:53:22 UTC 2012

Am Montag, 24. Dezember 2012, 09.09:59 schrieb Michael Watson:
> Arch Linux Arm is not quite debian.  I may have run into a permissions issue
> with libsub.

I have a similar problem with my HP OfficeJet muliti function device 
(printer+scanner) on wheezy/i386 and even on lenny/i386! (thus I do not think 
this is arch dependent :-)

The sane libusb driver (hpaio) is working fine on the server:
root at wheezy:~# sane-find-scanner -q
found USB scanner (vendor=0x03f0 [HP], product=0x5912 [Officejet Pro 8600]) at 
root at wheezy:~# scanimage -L                                                                                                                                                                
device `hpaio:/usb/Officejet_Pro_8600?serial=CN261BK2W705KD' is a Hewlett-
Packard Officejet_Pro_8600 all-in-one

but if I try to scan from remote with saned over inetd, "scanimage -L" is not 
able to fine any scanner! I found that the reason is just that the libusb 
driver runns in the group of lp:
root at wheezy:~# ll /proc/bus/usb/005/002
crw-rw-r-- 1 root lp 189, 513 24. Dez 10:27 /dev/bus/usb/005/002
and not in the scanner group as saned is member of!

of coarse, a simple hotfix could be to chmod 666 the device file (as found by 
googling in plenty of forums), but this is not nice at all!
My better solutions is just to add saned to the lp group
root at wheezy:~# addgroup saned lp
and remote scanning works fine!

My question is now : should this not be done by the distro already? Or even by 
the saned package? Or is it the hplip driver that is wrong? To conclude, I 
think that this should be fixed somehow but I do not know who is responsable...


> Version 1.2.1 installed fine:
>     USE_SANE=yes make -e clean all
>     USE_SANE=yes make install
> As far as I can tell the scanbd configuration is set (required *.conf and
> locations) with user =  saned and group = scanner.
> scanimage -L works as user root and user saned (member of scanner):
>     device `net:localhost:genesys:libusb:001:008' is a Canon LiDE 210
> flatbed scanner
> As user root, /usr/local/bin/scanbd -df -c /usr/local/etc/scanbd/scanbd.conf
> works great (remote scanning and buttons).
> As user saned it does not find the scanner:
> /usr/local/bin/scanbd: debug on: level: 7
> /usr/local/bin/scanbd: dropping privs to uid saned
> /usr/local/bin/scanbd: dropping privs to gid scanner
> /usr/local/bin/scanbd: group scanner has member:
> /usr/local/bin/scanbd: saned
> /usr/local/bin/scanbd: drop privileges to gid: 96
> /usr/local/bin/scanbd: Running as effective gid 96
> /usr/local/bin/scanbd: drop privileges to uid: 1001
> /usr/local/bin/scanbd: Running as effective uid 1001
> /usr/local/bin/scanbd: dbus_init
> /usr/local/bin/scanbd: dbus match
> type='signal',interface='org.freedesktop.Hal.Manager'
> /usr/local/bin/scanbd: sane version 1.0
> /usr/local/bin/scanbd: Scanning for local-only devices
> /usr/local/bin/scanbd: start_sane_threads
> /usr/local/bin/scanbd: start dbus thread
> /usr/local/bin/scanbd: udev init
> /usr/local/bin/scanbd: get udev monitor
> /usr/local/bin/scanbd: udev fd is non-blocking, now setting to blocking mode
> /usr/local/bin/scanbd: start udev thread
> /usr/local/bin/scanbd: udev thread started
> /usr/local/bin/scanbd: timeout: 500 ms
> /usr/local/bin/scanbd: Iteration on dbus call
> /usr/local/bin/scanbd: Iteration on dbus call
> repeat
> Grepping on "Scanning for local-only devices" --> sane.c --> void
> get_sane_devices(void)
> Arch Linux Arm has recently shifted to systemd.  Run as a service it behaves
> like user saned, not root.
> =================
> [Unit]
> Description=Scan Button Deamon
> After=network.target
> [Service]
> Type=simple
> User=root
> Group=root
> WorkingDirectory=/usr/local/etc/scanbd
> ExecStart=/usr/local/bin/scanbd -df -c /usr/local/etc/scanbd/scanbd.conf
> RemainAfterExit=yes
> [Install]
> WantedBy=multi-user.target
> =================
> What is your read on this.
> R/
> Michael

More information about the sane-devel mailing list