On 11/18/2017 02:45 AM, ToddAndMargo wrote:
Hi All,

SL 7.4


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 not use the name saned\@.service 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 [email protected]: Unit name [email protected] 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
[email protected] - Scanner Service
   Loaded: loaded (/etc/systemd/system/[email protected]; 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?


Many thanks,
-T



Followup:

saned\@.service was the correct name

I was starting the wrong service.  I should have started:

# systemctl   enable saned.socket   (one time only)
# systemctl -l start saned.socket

Plus, my version of sane-backends, does not have systemd
support compiled in.




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

Reply via email to