RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1142369 - 'systemctl' does not properly run the 'start', 'restart' or 'status' for a .service file containing an '@'
Summary: 'systemctl' does not properly run the 'start', 'restart' or 'status' for a .s...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: systemd
Version: 7.0
Hardware: Unspecified
OS: Linux
unspecified
medium
Target Milestone: rc
: ---
Assignee: systemd-maint
QA Contact: Frantisek Sumsal
URL:
Whiteboard:
Depends On:
Blocks: 1289485 1313485
TreeView+ depends on / blocked
 
Reported: 2014-09-16 16:17 UTC by R P Herrold
Modified: 2017-11-24 01:50 UTC (History)
8 users (show)

Fixed In Version: systemd-219-21.el7
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-11-04 00:41:33 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2016:2216 0 normal SHIPPED_LIVE systemd bug fix and enhancement update 2016-11-03 13:24:51 UTC

Description R P Herrold 2014-09-16 16:17:05 UTC
Description of problem:

'sysemctl' does not properly run the 'start', 'restart' or 'status' for a .service file containing an '@' in its name

Version-Release number of selected component (if applicable):

systemd-208-11.el7.x86_64

How reproducible:

attempt to use a well formed .service file

Steps to Reproduce:

install current EPEL openvpn

try to use it

some command options work (enable)  but several do not

Actual results:

[root@unknown00269E5882BA system]# rpm -qf openvpn@.service
openvpn-2.3.2-4.el7.x86_64

[root@unknown00269E5882BA system]# ls -al openvpn@.service
-rw-r--r--. 1 root root 335 Feb 14  2014 openvpn@.service

[root@unknown00269E5882BA system]# /bin/systemctl enable openvpn@.service
ln -s '/usr/lib/systemd/system/openvpn@.service' '/etc/systemd/system/multi-user.target.wants/openvpn@.service'

[root@unknown00269E5882BA system]# /bin/systemctl start openvpn@.service
Failed to issue method call: Unit name openvpn@.service is not valid.

[root@unknown00269E5882BA system]# /bin/systemctl status openvpn@.service
Failed to issue method call: Unit name openvpn@.service is not valid.

Comment 2 Lukáš Nykrýn 2014-09-17 08:54:18 UTC
That is a template service and it requires an argument.
http://0pointer.de/blog/projects/instances.html

Comment 3 R P Herrold 2014-09-17 17:14:21 UTC
understood -- but the error message returned says nothing of this (the '@' is a clear indicator). systemctl 'seems' to work in some cases, but not in others

A three year old blog post is not documentation, nor a substitute for a credible error message, or a man page describing such behaviours

Comment 7 Lukáš Nykrýn 2016-03-30 12:06:17 UTC
https://github.com/systemd/systemd/pull/2915

Comment 10 Frantisek Sumsal 2016-08-16 08:16:27 UTC
Verified on RHEL 7.3 Beta with systemd-219-26.el7.

Old package:
# systemctl status user@.service; echo $?
Failed to get properties: Unit name user@.service is not valid.
1

New package:
# systemctl status user@.service; echo $?
Failed to get properties: Unit name user@.service is missing the instance name.
1

Comment 12 errata-xmlrpc 2016-11-04 00:41:33 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHBA-2016-2216.html

Comment 13 Todd 2017-11-18 22:23:01 UTC
Dear Red Hat,

I am coming from the community: Scientific Linux 7.4

This issue has come back.  Would you please re-open it.

This is from the systemd recommendations in "man saned":
https://www.mankier.com/8/saned#Systemd_configuration_for_saned_with_systemd_support_compiled_in

# systemctl start saned\@.service

    Failed to start saned@.service: Unit name saned@.service is missing the instance name. 

Would you please re-fix this?

Many thanks,
-T

Comment 14 Jan Synacek 2017-11-20 07:50:51 UTC
Those recommendations are simply wrong. There's nothing in that service file that would use the argument of that service. You have two options:

1) Just remove the '@' from the service's name, as it's not used inside the service anyway. (This is what I would do.)

2) Change the service file to actually use the argument and then run the service with the argument like so:

# systemctl start saned

The 'foobar' part is the argument, the instance name that the error message is complaining about.

Comment 15 Michal Sekletar 2017-11-20 08:06:29 UTC
(In reply to Todd from comment #13)

> This is from the systemd recommendations in "man saned":
> https://www.mankier.com/8/
> saned#Systemd_configuration_for_saned_with_systemd_support_compiled_in
> 
> # systemctl start saned\@.service
> 
>     Failed to start saned@.service: Unit name saned@.service is missing the
> instance name. 

From manpage it is clear that saned is socket activated service. saned.socket has Accept=yes set. This means that saned@.service template is required and each connection to socket starts a new instance of that service template. You are expected to work with socket unit (start/stop/enable ...) instead of the service.

Also searching in the man page I fail to see where exactly does it recommend to start the service directly.

Comment 16 Jan Synacek 2017-11-20 08:34:03 UTC
(In reply to Michal Sekletar from comment #15)
> This means that saned@.service template is
> required and each connection to socket starts a new instance of that service
> template.

I didn't know that, sorry for the confusion.

Comment 17 Todd 2017-11-20 12:05:09 UTC
So, will you please reopen the bug?

Or should I open a new one and reference this one?

And are there any workaround?  (I did try saned\@sane.service and that got rid of the error message, but it also did not start saned.)

Comment 18 Lukáš Nykrýn 2017-11-20 12:32:45 UTC
You just need to start the socket instead of the service
systemctl start saned.socket

Comment 19 Todd 2017-11-20 13:10:30 UTC
(In reply to Lukáš Nykrýn from comment #18)
> You just need to start the socket instead of the service
> systemctl start saned.socket

# systemctl -l start saned.socket

# systemctl -l status saned.socket
● saned.socket - saned incoming socket
   Loaded: loaded (/etc/systemd/system/saned.socket; enabled; vendor preset: disabled)
   Active: active (listening) since Sun 2017-11-19 15:54:30 PST; 13h ago
   Listen: [::]:6566 (Stream)
 Accepted: 0; Connected: 0

Nov 19 15:54:30 foo.bar.local systemd[1]: Listening on saned incoming socket.
Nov 19 15:54:30 foo.bar.local systemd[1]: Starting saned incoming socket.

# ps ax | grep [s]aned
<nothing>

And PDF Studio can't find the scanner either.  PDF Studio can, if I start saned manually.

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


Am I misunderstanding something?

Comment 20 Lukáš Nykrýn 2017-11-20 13:22:31 UTC
You can't see any saned procvess running, because in this configuration saned is socket-activated. Which means that systemd listens on port 6566 and if there is an incoming connection it starts the saned process and hands over the connection.

I have no idea why PDF studio does not work. Maybe it uses a different mean to communicate with saned? But for that you need to talk to saned/pdf studio developers. Everything works on systemd level as expected.

Comment 21 R P Herrold 2017-11-20 18:24:54 UTC
ToddAndMargo

The systemd functionality is similar, to, and a partial formal sub-set of what the former 'xinetd' did -- listening for an inbound connection, and when content  is heard, ONLY THEN firing up the underlying application, here the 'saned' daemon.  This may be changed (tuned, really) in the cases of slow to start, or daemons which spawn off sub-process 'children', but this is one of scope here

It is also a subset of TCP-WRAPPERS functionality -- it can do source IP based restriction -- with a little work, so that one might limit connections to say only the localnet, or only selected 'outside network' IPs

The service is partial as id does not link in DNS resolution for name based permits or denies, but it is at least something

As to your question about 'should you clone this bug' or not, that is up to you.  My initial filing was about the documentation issue, and conformance, or non-conformance with LSB initscripts requirements.  Yours is more a usage question, and so really rather off topic in this bug

as to 'cloning' a bug to preserve context, see the upper right corner at the top of this bug.  It may make more sense to file it against the 'saned' providing SRPM package:   sane-backends

particularly, I do not see explicit systemd support there

$ rpm -ql sane-backends | grep syst
$

with kind regards,

-- Russ herrold

Comment 22 Todd 2017-11-23 03:45:55 UTC
Hi Russ,

Fedora has the daemon broken out of backends:

sane-backends-daemon.x86_64 1.0.27-5.fc27

Apparently, RHEL's version (1.0.24) came before the two were broken out AND RHEL's version did not throw the compiler switch to include the daemon.

$ ./configure --help | grep systemd
      --with-systemd          enable systemd support [default=yes]

Would you consider putting the daemon back in to where it goes.  I would ADORE it if you updates to Fedora's (1.0.27).

Please note that saned.socket will not run without the daemon support

Many thanks,
-T

Comment 23 Lukáš Nykrýn 2017-11-23 09:15:24 UTC
(In reply to Todd from comment #22)
> Hi Russ,
> 
> Fedora has the daemon broken out of backends:
> 
> sane-backends-daemon.x86_64 1.0.27-5.fc27
> 
> Apparently, RHEL's version (1.0.24) came before the two were broken out AND
> RHEL's version did not throw the compiler switch to include the daemon.
> 
> $ ./configure --help | grep systemd
>       --with-systemd          enable systemd support [default=yes]
> 
> Would you consider putting the daemon back in to where it goes.  I would
> ADORE it if you updates to Fedora's (1.0.27).
> 
> Please note that saned.socket will not run without the daemon support
> 
> Many thanks,
> -T

Can you please open a new bug for this? This one was solving a different issue.

Comment 24 Todd 2017-11-24 01:50:20 UTC
(In reply to Lukáš Nykrýn from comment #23)
> Can you please open a new bug for this? This one was solving a different
> issue.

Your wish is my command:
https://bugzilla.redhat.com/show_bug.cgi?id=1517029


Note You need to log in before you can comment on or make changes to this bug.