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 1206007 - systemd seems not to search template with "systemctl enable"
Summary: systemd seems not to search template with "systemctl enable"
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: systemd
Version: 7.1
Hardware: Unspecified
OS: Linux
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: systemd-maint
QA Contact: qe-baseos-daemons
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-03-26 06:14 UTC by Kazuo Moriwaka
Modified: 2015-04-02 08:02 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-04-02 08:02:36 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
strace -p 1 -e file in F21 (272.08 KB, text/plain)
2015-03-26 06:14 UTC, Kazuo Moriwaka
no flags Details
strace -p 1 -e file in RHEL7.1 (99.81 KB, text/plain)
2015-03-26 06:14 UTC, Kazuo Moriwaka
no flags Details

Description Kazuo Moriwaka 2015-03-26 06:14:01 UTC
Created attachment 1006675 [details]
strace -p 1 -e file in F21

Description of problem:

When I do "systemctl enable serial-getty", 
systemd doesn't find template /usr/lib/systemd/system/serial-getty@.service


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

systemd-208-20.el7.x86_64

How reproducible:

Always

Steps to Reproduce:
1. clean install rhel7.1
2. # systemctl enable serial-getty 

Actual results:

output "Failed to issue method call: No such file or directory" and link is not created.

Expected results:

symlink to enable serial-getty is created.

With my F21 environment, same command cause following message and made link.
"Created symlink from /etc/systemd/system/getty.target.wants/serial-getty to /usr/lib/systemd/system/serial-getty@.service."


Additional info:

With this reproducing, I took systemd's file operations with strace like following.
# strace -p 1 -e file -o systemd.strace

and the output seems systemd in RHEL7 doesn't search template.  

RHEL7# grep serial-getty systemd.strace
-----------------------------------------------------------
getxattr("/usr/lib/systemd/system/serial-getty@.service", "security.selinux", "system_u:object_r:getty_unit_file_t:s0", 255) = 39
lstat("/etc/systemd/system/serial-getty", 0x7ffff2387d20) = -1 ENOENT (No such file or directory)
open("/etc/systemd/system/serial-getty", O_RDONLY|O_NOCTTY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
lstat("/run/systemd/system/serial-getty", 0x7ffff2387d20) = -1 ENOENT (No such file or directory)
open("/run/systemd/system/serial-getty", O_RDONLY|O_NOCTTY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
lstat("/usr/local/lib/systemd/system/serial-getty", 0x7ffff2387d20) = -1 ENOENT (No such file or directory)
open("/usr/local/lib/systemd/system/serial-getty", O_RDONLY|O_NOCTTY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
lstat("/usr/lib/systemd/system/serial-getty", 0x7ffff2387d20) = -1 ENOENT (No such file or directory)
open("/usr/lib/systemd/system/serial-getty", O_RDONLY|O_NOCTTY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
-----------------------------------------------------------

F21# grep serial-getty systemd.strace
-----------------------------------------------------------
lstat("/etc/systemd/system/serial-getty", 0x7ffdd495d6e0) = -1 ENOENT (No such file or directory)
open("/etc/systemd/system/serial-getty", O_RDONLY|O_NOCTTY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
lstat("/run/systemd/system/serial-getty", 0x7ffdd495d6e0) = -1 ENOENT (No such file or directory)
open("/run/systemd/system/serial-getty", O_RDONLY|O_NOCTTY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
lstat("/usr/local/lib/systemd/system/serial-getty", 0x7ffdd495d6e0) = -1 ENOENT (No such file or directory)
open("/usr/local/lib/systemd/system/serial-getty", O_RDONLY|O_NOCTTY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
lstat("/usr/lib/systemd/system/serial-getty", 0x7ffdd495d6e0) = -1 ENOENT (No such file or directory)
open("/usr/lib/systemd/system/serial-getty", O_RDONLY|O_NOCTTY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/etc/systemd/system/serial-getty", O_RDONLY|O_NOCTTY|O_NOFOLLOW|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/run/systemd/system/serial-getty", O_RDONLY|O_NOCTTY|O_NOFOLLOW|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/usr/local/lib/systemd/system/serial-getty", O_RDONLY|O_NOCTTY|O_NOFOLLOW|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/usr/lib/systemd/system/serial-getty", O_RDONLY|O_NOCTTY|O_NOFOLLOW|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/etc/systemd/system/serial-getty@.service", O_RDONLY|O_NOCTTY|O_NOFOLLOW|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/run/systemd/system/serial-getty@.service", O_RDONLY|O_NOCTTY|O_NOFOLLOW|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/usr/local/lib/systemd/system/serial-getty@.service", O_RDONLY|O_NOCTTY|O_NOFOLLOW|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/usr/lib/systemd/system/serial-getty@.service", O_RDONLY|O_NOCTTY|O_NOFOLLOW|O_CLOEXEC) = 16
symlink("/usr/lib/systemd/system/serial-getty@.service", "/etc/systemd/system/getty.target.wants/serial-getty") = 0
open("/etc/systemd/system/getty.target.wants/serial-getty", O_RDONLY|O_NOCTTY|O_NOFOLLOW|O_CLOEXEC) = -1 ELOOP (Too many levels of symbolic links)
readlinkat(AT_FDCWD, "/etc/systemd/system/getty.target.wants/serial-getty", "/usr/lib/systemd/system/serial-g"..., 99) = 45
open("/usr/lib/systemd/system/serial-getty@.service", O_RDONLY|O_NOCTTY|O_NOFOLLOW|O_CLOEXEC) = 14
-----------------------------------------------------------

Comment 1 Kazuo Moriwaka 2015-03-26 06:14:45 UTC
Created attachment 1006677 [details]
strace -p 1 -e file in RHEL7.1

Comment 3 Kazuo Moriwaka 2015-03-26 06:43:15 UTC
I understand that systemd-208 will have function to make symlink to template.

Followings are quotation from Lennart's blog.
http://0pointer.de/blog/projects/serial-console.html

-----------------------------------------------------------
In many cases, this automatic logic should already suffice to get you a login prompt when you need one, without any specific configuration of systemd. However, sometimes there's the need to manually configure a serial getty, for example, if more than one serial login prompt is needed or the kernel console should be redirected to a different terminal than the login prompt. To facilitate this it is sufficient to instantiate serial-getty@.service once for each serial port you want it to run on[7]:

# systemctl enable serial-getty
# systemctl start serial-getty
-----------------------------------------------------------

-----------------------------------------------------------
[7] Note that this systemctl enable syntax only works with systemd 188 and newer (i.e. F18). On older versions use ln -s /usr/lib/systemd/system/serial-getty@.service /etc/systemd/system/getty.target.wants/serial-getty ; systemctl daemon-reload instead.
-----------------------------------------------------------

Comment 4 Lukáš Nykrýn 2015-03-26 08:16:39 UTC
That should work -> devel_ack.

Comment 5 Kevin Fenzi 2015-03-26 13:34:53 UTC
I'll note we are hitting this also with openvpn. ;( 

# systemctl enable openvpn@openvpn
Failed to issue method call: No such file or directory

# systemctl status openvpn@openvpn                                                   
openvpn - OpenVPN Robust And Highly Flexible Tunneling Application On openvpn
   Loaded: loaded (/usr/lib/systemd/system/openvpn@.service; enabled)
   Active: active (running) since Thu 2015-03-26 13:15:00 UTC; 19min ago
  Process: 32117 ExecStart=/usr/sbin/openvpn --daemon --writepid /var/run/openvpn/%i.pid --cd /etc/openvpn/ --config %i.conf (code=exited, status=0/SUCCESS)
 Main PID: 32131 (openvpn)
   CGroup: /system.slice/system-openvpn.slice/openvpn
           └─32131 /usr/sbin/openvpn --daemon --writepid /var/run/openvpn/openvpn.pid --cd /etc/openvpn/ --c...

Comment 6 Michal Sekletar 2015-04-02 08:02:36 UTC
This is now fixed in systemd-208-20.el7_1.2.


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