[sane-devel] Response to systemd integration, sane-devel Digest, Vol 91, Issue 12

2013-01-11 Thread Michael Watson
Louis,

Thank you.

When I posted the integration tweaks the service complained on startup as
simple with a dbus name.  This was solved with changing the type to dbus.  I
have since settled on type simple and no dbus name, and it's working fine
with no complaining.  

FYI startup and shutdown:

/usr/lib/udev/rules.d/99-local.rules
ENV{ID_VENDOR_ID}==04a9, ENV{ID_MODEL_ID}==190a, ACTION==add,
RUN+=/usr/bin/systemctl start scanbd
ENV{SUBSYSTEM}==usb, ENV{ID_PRODUCT_FROM_DATABASE}==CanoScan LiDE 210,
ACTION==remove, RUN+=/usr/bin/systemctl stop s$

Had to snoop the messages (udevadm monitor --property) for remove to sense
removal properly.

At the time I though scanbm.socket had to be enabled to listen.  I was
wrong.  I've since removed the install section and it works fine.  When
working though this I found out xinetd was no longer necessary (see below
root vs saned).  Archlinuxarm supports socket activation.

In summary,

scanbd.service startup and shutdown with udev rules (scanbd.service
not enabled)
scanbm.socket enabled
monitoring: saned Ssl /usr/local/sbin/scanbd -f
net scan:   saned Ssl /usr/local/sbin/scanbd -f
root  Ss  /usr/local/sbin/scanbm
root  Ss  saned
scan by button: saned Ssl /usr/local/sbin/scanbd -f
root  S   /bin/bash
/usr/local/etc/scanbd/ccp2pdf.script
root  S   scanimage --device-name
genesys:libusb:001:008 --resolution ...

xinetd started (e.g. udev rule) and scanbm.socket disabled
monitoring: saned Ssl /usr/local/sbin/scanbd -f
root  Ss  /usr/sbin/xinetd -dontfork
net scan:   saned Ssl /usr/local/sbin/scanbd -f
root  Ss  /usr/sbin/xinetd -dontfork
saned Ss  scanbm
saned Ss  saned
scan by button: saned Ssl /usr/local/sbin/scanbd -f
root  Ss  /usr/sbin/xinetd -dontfork
root  S   /bin/bash
/usr/local/etc/scanbd/ccp2pdf.script
root  S   scanimage --device-name
genesys:libusb:001:008 --resolution ...

With xinetd scanbm and saned run as user saned when scanning via network.

Any thoughts?

R/
Mike





-Original Message-
From: sane-devel-bounces+mwatson33=comcast@lists.alioth.debian.org
[mailto:sane-devel-bounces+mwatson33=comcast.net at lists.alioth.debian.org] On
Behalf Of sane-devel-request at lists.alioth.debian.org
Sent: Friday, January 11, 2013 7:00 AM
To: sane-devel at lists.alioth.debian.org
Subject: sane-devel Digest, Vol 91, Issue 12


Send sane-devel mailing list submissions to
sane-devel at lists.alioth.debian.org

To subscribe or unsubscribe via the World Wide Web, visit
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel
or, via email, send a message with subject or body 'help' to
sane-devel-request at lists.alioth.debian.org

You can reach the person managing the list at
sane-devel-owner at lists.alioth.debian.org

When replying, please edit your Subject line so it is more specific than
Re: Contents of sane-devel digest...


Today's Topics:

   1. using scanners unable to USB_AUTOSUSPEND (Wilhelm)
   2. Re: using scanners unable to USB_AUTOSUSPEND (Johannes Meixner)
   3. Re: Perfection 610: cannot scan in color (Evil Mr Henry)
   4. Re: Perfection 610: cannot scan in color (Evil Mr Henry)
   5. Re: Scanner Button Daemon [scanbd]: release 1.3 (Louis Lagendijk)
   6. Re: using scanners unable to USB_AUTOSUSPEND (Wilhelm)


--

Message: 1
Date: Thu, 10 Jan 2013 16:58:54 +0100
From: Wilhelm wilhelm.me...@fh-kl.de
To: sane-devel at lists.alioth.debian.org
Subject: [sane-devel] using scanners unable to USB_AUTOSUSPEND
Message-ID: 50EEE53E.5020002 at fh-kl.de
Content-Type: text/plain; charset=ISO-8859-15; format=flowed

Hi all,

recently I had problems with my old EPSON 1670 Scanner, because it 
doesn't support usb autosuspend that most distros enable by default in 
the linux kernel. That causes scanimage or other applications (e.g. like 
scanner button daemon scanbd) to freeze or even reading wrong values.

If anyone is interested: I have put some hints in README.txt of scanbd. You
can find it at

http://scanbd.svn.sourceforge.net/viewvc/scanbd/trunk/doc/?sortby=rev

HTH,
-- 
Wilhelm




--

Message: 2
Date: Thu, 10 Jan 2013 17:29:54 +0100 (CET)
From: Johannes Meixner jsm...@suse.de
To: sane-devel at lists.alioth.debian.org
Subject: Re: [sane-devel] using scanners unable to USB_AUTOSUSPEND
Message-ID: alpine.LNX.2.00.1301101715290.12362 at nelson.suse.de
Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed


Hello,

On Jan 10 16:58 Wilhelm wrote 

[sane-devel] Response to systemd integration, sane-devel Digest, Vol 91, Issue 12

2013-01-11 Thread Louis Lagendijk
On Fri, 2013-01-11 at 08:38 -0500, Michael Watson wrote:
 Louis,
 
 Thank you.
 
 When I posted the integration tweaks the service complained on startup as
 simple with a dbus name.  This was solved with changing the type to dbus.  I
 have since settled on type simple and no dbus name, and it's working fine
 with no complaining.  
 
 FYI startup and shutdown:
 
 /usr/lib/udev/rules.d/99-local.rules
 ENV{ID_VENDOR_ID}==04a9, ENV{ID_MODEL_ID}==190a, ACTION==add,
 RUN+=/usr/bin/systemctl start scanbd
 ENV{SUBSYSTEM}==usb, ENV{ID_PRODUCT_FROM_DATABASE}==CanoScan LiDE 210,
 ACTION==remove, RUN+=/usr/bin/systemctl stop s$
 
 Had to snoop the messages (udevadm monitor --property) for remove to sense
 removal properly.
This is a very nice add-on. I will have a look at it to see if this
would work for me to. I will add it to the systemd integration directory

 
 At the time I though scanbm.socket had to be enabled to listen.  I was
 wrong.  I've since removed the install section and it works fine.  When
 working though this I found out xinetd was no longer necessary (see below
 root vs saned).  Archlinuxarm supports socket activation.
 
ok, good to see that there is consistency over different platforms and
systemd versions. Thanks for the report
 In summary,
 
   scanbd.service startup and shutdown with udev rules (scanbd.service
 not enabled)
Sounds pretty good.
   scanbm.socket enabled
   monitoring: saned Ssl /usr/local/sbin/scanbd -f
   net scan:   saned Ssl /usr/local/sbin/scanbd -f
   root  Ss  /usr/local/sbin/scanbm
   root  Ss  saned
   scan by button: saned Ssl /usr/local/sbin/scanbd -f
   root  S   /bin/bash
 /usr/local/etc/scanbd/ccp2pdf.script
   root  S   scanimage --device-name
Looks ok.

 genesys:libusb:001:008 --resolution ...
   
   xinetd started (e.g. udev rule) and scanbm.socket disabled
   monitoring: saned Ssl /usr/local/sbin/scanbd -f
   root  Ss  /usr/sbin/xinetd -dontfork
   net scan:   saned Ssl /usr/local/sbin/scanbd -f
   root  Ss  /usr/sbin/xinetd -dontfork
   saned Ss  scanbm
   saned Ss  saned
   scan by button: saned Ssl /usr/local/sbin/scanbd -f
   root  Ss  /usr/sbin/xinetd -dontfork
   root  S   /bin/bash
I am not sure I understand this part: what do you use xinetd for? For
scanbd it is not used at all, right? Is xinetd started by dbus on
scanner detection? 
/systemd scanbm.socket does all you need for starting scanbm/saned for
scanning.

 /usr/local/etc/scanbd/ccp2pdf.script
   root  S   scanimage --device-name
 genesys:libusb:001:008 --resolution ...
 
 With xinetd scanbm and saned run as user saned when scanning via network.
 
scanbd runs as the usert set in scanbd.conf, I need to check how this
works for scanbm right now. I will check later this weekend, but I guess
that User and Group are missing in scanbm at .service. My bad. I will
investigate this a bit further and update the examples in the svn
repository
Kind regards,
Louis