Bug 820363

Summary: chkconfig --list no longer displays xinetd services due to problems with systemd integration
Product: [Fedora] Fedora Reporter: Andrew J. Schorr <aschorr>
Component: chkconfigAssignee: Lukáš Nykrýn <lnykryn>
Status: CLOSED UPSTREAM QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 19CC: edgar.hoch, rvokal
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-01-12 08:46:25 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Patch chkconfig.c:isXinetdEnabled to check whether systemd has enabled xinetd none

Description Andrew J. Schorr 2012-05-09 18:43:03 UTC
Created attachment 583365 [details]
Patch chkconfig.c:isXinetdEnabled to check whether systemd has enabled xinetd

Description of problem:  chkconfig --list no longer displays xinetd services due to problems with systemd integration


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

How reproducible:
Run "chkconfig --list" and notice that no xinetd services are listed.

Steps to Reproduce:
1. chkconfig --list
2.
3.
  
Actual results:
Shows sysv services, but does not show xinetd services.

Expected results:
Should show both sysv and xinetd services.

Additional info:
In chkconfig.c, the isXinetdEnabled() function does not work properly.  It 
does not handle the case where xinetd is enabled by systemd.  I have attached
a patch that attempts to fix this.  I do not know if the patch is ideal, but
it seems to work for me.

Comment 1 Andrew J. Schorr 2012-05-10 15:54:16 UTC
Note: I do not think my patch works properly in a chroot environment.  I am not sure how to fix this, but would welcome some guidance on how to handle this properly.

Comment 2 Bill Nottingham 2012-05-14 16:10:50 UTC
*** Bug 821485 has been marked as a duplicate of this bug. ***

Comment 3 Fedora Admin XMLRPC Client 2012-10-18 20:02:09 UTC
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.

Comment 4 Lukáš Nykrýn 2013-01-30 14:45:00 UTC
Do you have any use-case why this could be a problem in chroot?

Comment 5 Andrew J. Schorr 2013-01-30 15:36:34 UTC
My patch includes the following test that I suspect will not work in a chroot:

if (system("systemctl is-enabled xinetd.service >/dev/null 2>&1") == 0)

If there is some way to detect this from the filesystem rather than calling
systemctl, that would probably be more robust.  I am not sufficiently familiar
with the systemd code to know how to do this properly.

For my purposes, the patch I provided is fine.  I was merely pointing out that
it is not fully robust and could possibly be improved by somebody with a better
knowledge of systemd internals.

Thanks,
Andy

Comment 6 Lukáš Nykrýn 2013-01-31 13:38:52 UTC
systemctl is-enabled works in chroot. So I think that we can use your solution.

Comment 7 Andrew J. Schorr 2013-01-31 14:54:23 UTC
If that is true, then the patch should be fine.  I am not familiar with the systemctl code, but my fear was that it may attempt to contact the systemd daemon via a socket, in which case it might be talking to the wrong daemon (i.e. the systemd daemon running on the host system, not in the chroot).  If you run strace, it seems to support my fears:

bash-4.2$ strace systemctl is-enabled xinetd.service 2>&1 | egrep 'socket|connect|xinetd'
execve("/bin/systemctl", ["systemctl", "is-enabled", "xinetd.service"], [/* 73 vars */]) = 0
socket(PF_FILE, SOCK_STREAM|SOCK_CLOEXEC, 0) = 3
connect(3, {sa_family=AF_FILE, sun_path="/var/run/dbus/system_bus_socket"}, 33) = 0
access("/etc/systemd/system/xinetd.service", F_OK) = -1 ENOENT (No such file or directory)
access("/lib/systemd/system/xinetd.service", F_OK) = 0
sendmsg(3, {msg_name(0)=NULL, msg_iov(2)=[{"l\1\0\1\23\0\0\0\2\0\0\0\247\0\0\0\1\1o\0\31\0\0\0/org/fre"..., 184}, {"\16\0\0\0xinetd.service\0", 19}], msg_controllen=0, msg_flags=0}, MSG_NOSIGNAL) = 203

So it is clearly discussing something with the systemd daemon.  Are you sure this works properly in a chroot?

Regards,
Andy

Comment 8 Lukáš Nykrýn 2013-01-31 15:55:41 UTC
There is a check for chroot in unit_is_enabled() in systemd and it will not use dbus in case of chroot.

bash-4.2# strace systemctl is-enabled xinetd.service 2>&1 | egrep 'socket|connect|xinetd'
execve("/bin/systemctl", ["systemctl", "is-enabled", "xinetd.service"], [/* 31 vars */]) = 0
access("/etc/systemd/system/xinetd.service", F_OK) = -1 ENOENT (No such file or directory)
access("/usr/lib/systemd/system/xinetd.service", F_OK) = 0
lstat("/etc/systemd/system/xinetd.service", 0x7fffde057b00) = -1 ENOENT (No such file or directory)
lstat("/usr/lib/systemd/system/xinetd.service", {st_mode=S_IFREG|0644, st_size=381, ...}) = 0
stat("/usr/lib/systemd/system/xinetd.service", {st_mode=S_IFREG|0644, st_size=381, ...}) = 0
readlink("/etc/systemd/system/multi-user.target.wants/xinetd.service", "/usr/lib/systemd/system/xinetd.s"..., 99) = 38
lstat("/usr/lib/systemd/system/xinetd.service", {st_mode=S_IFREG|0644, st_size=381, ...}) = 0

Comment 10 Fedora End Of Life 2013-04-03 20:20:16 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 19 development cycle.
Changing version to '19'.

(As we did not run this process for some time, it could affect also pre-Fedora 19 development
cycle bugs. We are very sorry. It will help us with cleanup during Fedora 19 End Of Life. Thank you.)

More information and reason for this action is here:
https://fedoraproject.org/wiki/BugZappers/HouseKeeping/Fedora19

Comment 11 Fedora End Of Life 2015-01-09 22:26:02 UTC
This message is a notice that Fedora 19 is now at end of life. Fedora 
has stopped maintaining and issuing updates for Fedora 19. It is 
Fedora's policy to close all bug reports from releases that are no 
longer maintained. Approximately 4 (four) weeks from now this bug will
be closed as EOL if it remains open with a Fedora 'version' of '19'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 19 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.