Discussion:
Bug#950646: sane-utils: saned does not work if starteed via systemd
(too old to reply)
stefan
2020-02-04 13:30:01 UTC
Permalink
Package: sane-utils
Version: 1.0.27-3.2
Severity: important

Manual starting of saned (as user saned) works. I can access the scanners remotley.

But if saned is started via systemd, it does not work. scanimage -L on a client does not find anything.
● saned.socket - saned incoming socket
Loaded: loaded (/lib/systemd/system/saned.socket; enabled; vendor preset: enabled)
Active: active (listening) since Tue 2020-02-04 13:56:52 CET; 6min ago
Listen: [::]:6566 (Stream)
Accepted: 1; Connected: 0;
Tasks: 0 (limit: 4915)
Memory: 68.0K
CGroup: /system.slice/saned.socket
Feb 04 13:56:52 ws2 systemd[1]: Listening on saned incoming socket.
● saned.service
Loaded: masked (Reason: Unit saned.service is masked.)
Active: inactive (dead)
I cannot unmask it.

dpkg-reconfigure offers two otions. Run as standalone server and start on demand (using inetd) I tried out both but that makes no difference.
Feb 4 13:57:37 ws2 systemd[1]: Created slice system-saned.slice.
Feb 4 13:57:37 ws2 systemd[1]: Started Scanner Service (192.168.1.60:46168).
Feb 4 13:57:37 ws2 saned[1080]: saned (AF-indep+IPv6+systemd) from sane-backends 1.0.27 starting up
Feb 4 13:57:37 ws2 saned[1080]: check_host: access by remote host: ::ffff:192.168.1.60
Feb 4 13:57:43 ws2 saned[1080]: saned exiting
It seems that systemd starts on demand. Maybe this is the problem.

Is it possible to run saned permanently?

Regards Stefan


-- System Information:
Debian Release: 10.2
APT prefers stable-updates
APT policy: (500, 'stable-updates'), (500, 'stable'), (500, 'oldstable')
Architecture: amd64 (x86_64)

Kernel: Linux 5.3.0-0.bpo.2-amd64 (SMP w/2 CPU cores)
Locale: LANG=de_DE.utf8, LC_CTYPE=de_DE.utf8 (charmap=UTF-8), LANGUAGE=de_DE.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages sane-utils depends on:
ii adduser 3.118
ii debconf [debconf-2.0] 1.5.71
ii libavahi-client3 0.7-4+b1
ii libavahi-common3 0.7-4+b1
ii libc6 2.28-10
ii libieee1284-3 0.2.11-13
ii libjpeg62-turbo 1:1.5.2-2+b1
ii libpng16-16 1.6.36-6
ii libsane 1.0.27-3.2
ii libsystemd0 241-7~deb10u2
ii libusb-1.0-0 2:1.0.22-2
ii lsb-base 10.2019051400
ii update-inetd 4.49

sane-utils recommends no packages.

Versions of packages sane-utils suggests:
ii avahi-daemon 0.7-4+b1
pn unpaper <none>

-- Configuration Files:
/etc/default/saned changed:
RUN=yes
RUN_AS_USER=saned

/etc/sane.d/saned.conf changed:
localhost
192.168.1.0/24


-- debconf information:
* sane-utils/saned_scann
Stefan Ziegenbalg
2020-02-04 14:20:02 UTC
Permalink
Thank you for filing a new Bug report with Debian.
You can follow progress on this Bug here: 950646: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=950646.
This is an automatically generated reply to let you know your message
has been received.
Your message is being forwarded to the package maintainers and other
interested parties for their attention; they will reply in due course.
As you requested using X-Debbugs-CC, your message was also forwarded to
(after having been given a Bug report number, if it did not have one).
If you wish to submit further information on this problem, please
to report a problem with the Bug-tracking system.
Patrick Holthuizen
2020-06-08 14:10:01 UTC
Permalink
I experience the same problem. Any update or feasible workaround is
appreciated.
Bernhard Übelacker
2020-08-18 09:40:02 UTC
Permalink
Hello Stefan, hello Patrick,
I am not specifically involved in packaging sane but tried
to reproduce your issue.

These were the steps I tested:
- systemctl enable saned.socket
- systemctl start saned.socket
- activated the backend "test" in /etc/sane.d/dll.conf
- added the "remote" server localhost to /etc/sane.d/net.conf
- listed scanners with "scanimage -L"
- made a test scan with "scanimage --device-name=net:localhost:test:0 > testscan"

As far as I see this worked as exepected, so your issue might be
related to the backend you are using.
Unfortunately the information which backend you need is
not included in your reports.

Also you might make the output more verbose by
- adding "SANE_DEBUG_DLL=255" to the Environment
line in /lib/systemd/system/***@.service
- reload that change by "systemctl daemon-reload"
- test again.

Kind regards,
Bernhard
Bernhard Übelacker
2020-08-26 23:00:02 UTC
Permalink
Hello Patrick,
you might add in the sane unit file a backend specific
logging environment too. That should give much more details
for the plustek module.

Kind regards,
Bernhard

/lib/systemd/system/***@.service:
Environment=SANE_CONFIG_DIR=/etc/sane.d SANE_DEBUG_DLL=255 SANE_DEBUG_PLUSTEK=12
Bernhard Übelacker
2020-09-01 19:10:02 UTC
Permalink
Hello Patrick,
I found another environment to increase verbosity
another little bit, please see below.


Your output points also into the direction of an permission
problem like what Stefan described in the first message.

The unit file starts the saned server with user and group saned.


On the other side it seems that the scanners usb vendor id and
product id should be inside /usr/lib/udev/hwdb.d/20-sane.hwdb,
and should get matched to libsane_matched=yes by udev ...

Could you please additionally provide an output of 'lsusb'?


A workaround might be to change the user running saned in the
systemd-unit file, or add the saned user to a group that could
access the usb devices.

Kind regards,
Bernhard


/lib/systemd/system/***@.service:
User=saned
Group=saned
Environment=SANE_CONFIG_DIR=/etc/sane.d SANE_DEBUG_DLL=255 SANE_DEBUG_PLUSTEK=12 SANE_DEBUG_SANEI_USB=255
Bernhard Übelacker
2020-09-01 19:30:01 UTC
Permalink
Hello,
searched the upstream issue tracker and found following,
that seems to match your situation.

https://gitlab.com/sane-project/backends/-/issues/275
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=958074

Kind regards,
Bernhard
Jörg Frings-Fürst
2020-09-30 16:50:02 UTC
Permalink
fixed 950646 sane-backends/1.0.31-2
thanks

Hello,

this bug ist fixed in version 1.0.31-2. The requested rule is now installed.
So I close this bug.

CUJörg
--
New:
GPG Fingerprint: 63E0 075F C8D4 3ABB 35AB 30EE 09F8 9F3C 8CA1 D25D
GPG key (long) : 09F89F3C8CA1D25D
GPG Key : 8CA1D25D
CAcert Key S/N : 0E:D4:56

Old pgp Key: BE581B6E (revoked since 2014-12-31).

Jörg Frings-FÌrst
D-54470 Lieser


git: https://jff.email/cgit/

Threema: SYR8SJXB
Wire: @joergfringsfuerst
Skype: joergpenguin
Ring: jff
Telegram: @joergfringsfuerst


My wish list:
- Please send me a picture from the nature at your home.
Loading...