Bug 820363 - chkconfig --list no longer displays xinetd services due to problems with systemd integration
chkconfig --list no longer displays xinetd services due to problems with syst...
Product: Fedora
Classification: Fedora
Component: chkconfig (Show other bugs)
All Linux
unspecified Severity medium
: ---
: ---
Assigned To: Lukáš Nykrýn
Fedora Extras Quality Assurance
: 821485 (view as bug list)
Depends On:
  Show dependency treegraph
Reported: 2012-05-09 14:43 EDT by Andrew J. Schorr
Modified: 2015-01-12 03:46 EST (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2015-01-12 03:46:25 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
Patch chkconfig.c:isXinetdEnabled to check whether systemd has enabled xinetd (969 bytes, application/octet-stream)
2012-05-09 14:43 EDT, Andrew J. Schorr
no flags Details

  None (edit)
Description Andrew J. Schorr 2012-05-09 14:43:03 EDT
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):

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

Steps to Reproduce:
1. chkconfig --list
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 11:54:16 EDT
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 12:10:50 EDT
*** Bug 821485 has been marked as a duplicate of this bug. ***
Comment 3 Fedora Admin XMLRPC Client 2012-10-18 16:02:09 EDT
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 09:45:00 EST
Do you have any use-case why this could be a problem in chroot?
Comment 5 Andrew J. Schorr 2013-01-30 10:36:34 EST
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.

Comment 6 Lukáš Nykrýn 2013-01-31 08:38:52 EST
systemctl is-enabled works in chroot. So I think that we can use your solution.
Comment 7 Andrew J. Schorr 2013-01-31 09:54:23 EST
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
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?

Comment 8 Lukáš Nykrýn 2013-01-31 10:55:41 EST
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 16:20:16 EDT
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:
Comment 11 Fedora End Of Life 2015-01-09 17:26:02 EST
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.

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