[sane-devel] Saned systemd issues

ToddAndMargo ToddAndMargo at zoho.com
Sat Nov 18 10:48:23 UTC 2017


Hi All,

Scientific Linux 7.4 (RHEL Clone based on CentOS)

# rpm -qa sane-backends
sane-backends-1.0.24-9.el7.x86_64


I can start /usr/sbin/saned from the command line:

/usr/sbin/saned -a saned -d128; echo $?; ps ax | grep -i [s]aned
0
29857 ?        Ss     0:00 /usr/sbin/saned -a saned -d128

But not from my systemd scripts, which I picked up from
"man saned".

Note that I can use the name saned\@.service name due to
a very long standing bug:

'systemctl' does not properly run the 'start', 'restart' or 'status' for 
a .service file containing an '@'
https://bugzilla.redhat.com/show_bug.cgi?id=1142369

In my case it gives:
     Failed to start saned at .service: Unit name saned at .service is
     missing the instance name.


So I called 'saned\@.service" "saned\@sane.service"

<code saned.socket>
[Unit]
Description=saned incoming socket

[Socket]
ListenStream=6566
Accept=yes
MaxConnections=1

[Install]
WantedBy=sockets.target
</code>


<code saned\@sane.service>
[Unit]
Description=Scanner Service
Requires=saned.socket

[Service]
RemainAfterExit=yes
ExecStart=/usr/sbin/saned -a saned -s
User=saned
Group=saned
# User=root
# Group=root
StandardInput=null
StandardOutput=syslog
StandardError=syslog
Environment=SANE_CONFIG_DIR=/etc/sane.d
# If you need to debug your configuration uncomment the next line and
# change it as appropriate to set the desired debug options
Environment=SANE_DEBUG_DLL=255 SANE_DEBUG_BJNP=5

[Install]
Also=saned.socket
<code>

Error message is

# systemctl daemon-reload; systemctl stop saned.socket; systemctl stop 
saned\@sane.service;  systemctl start saned.socket; systemctl start 
saned\@sane.service; systemctl -l status saned\@sane.service; ps ax | 
grep [s]aned
● saned at sane.service - Scanner Service
    Loaded: loaded (/etc/systemd/system/saned at sane.service; indirect; 
vendor preset: disabled)
    Active: active (exited) since Sat 2017-11-18 02:42:54 PST; 46ms ago
   Process: 31110 ExecStart=/usr/sbin/saned (code=exited, status=0/SUCCESS)
  Main PID: 31110 (code=exited, status=0/SUCCESS)

Nov 18 02:42:54 rn4.rent-a-nerd.local systemd[1]: Started Scanner Service.
Nov 18 02:42:54 rn4.rent-a-nerd.local systemd[1]: Starting Scanner 
Service...
Nov 18 02:42:54 rn4.rent-a-nerd.local saned[31110]: saned 
(AF-indep+IPv6) from sane-backends 1.0.24 starting up


ps command is empty

How do I troubleshoot this?

Why did it succeed and exit?

And were are the logs for 'Environment=SANE_DEBUG_DLL=255
SANE_DEBUG_BJNP=5"?


Many thanks,
-T


-- 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Computers are like air conditioners.
They malfunction when you open windows
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~




More information about the sane-devel mailing list