Bug 1728139

Summary: chkconfig package fails to install on fresh fc30 server install as /etc/init.d already exists
Product: [Fedora] Fedora Reporter: Mark Dickinson <mdickinson>
Component: chkconfigAssignee: Lukáš Nykrýn <lnykryn>
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: low Docs Contact:
Priority: unspecified    
Version: 30CC: jamacku, jsynacek, lnykryn, msekleta
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-07-09 19:16:41 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:

Description Mark Dickinson 2019-07-09 06:33:29 UTC
Description of problem:
The chkconfig package fails to install if /etc/init.d exists, that directory does exist by default on a fresh fc30 server install preventing the package from installing.

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

How reproducible:
Easily reproducible.

Steps to Reproduce:
1. Build a machine using the latest available server iso Fedora-Server-dvd-x86_64-30-1.2.iso
2.Try to install the chkconfig package

Actual results:
chkconfig fails to install as the /etc/init.d directory exists, although it is an empty directory.

root@localhost ~]# dnf -y install chkconfig
Last metadata expiration check: 0:46:44 ago on Tue 09 Jul 2019 15:49:11 NZST.
Dependencies resolved.
=====================================================================================================================================================================================
 Package                                     Architecture                             Version                                         Repository                                Size
=====================================================================================================================================================================================
Installing:
 chkconfig                                   x86_64                                   1.11-4.fc30                                     fedora                                   152 k

Transaction Summary
=====================================================================================================================================================================================
Install  1 Package

Total download size: 152 k
Installed size: 741 k
Downloading Packages:
chkconfig-1.11-4.fc30.x86_64.rpm                                                                                                                     383 kB/s | 152 kB     00:00    
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                                                                112 kB/s | 152 kB     00:01     
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                                                                                                                             1/1 
  Installing       : chkconfig-1.11-4.fc30.x86_64                                                                                                                                1/1 
Error unpacking rpm package chkconfig-1.11-4.fc30.x86_64
error: unpacking of archive failed on file /etc/init.d: cpio: File from package already exists as a directory in system

  Verifying        : chkconfig-1.11-4.fc30.x86_64                                                                                                                                1/1 

Failed:
  chkconfig-1.11-4.fc30.x86_64                                                                                                                                                       

Error: Transaction failed
[root@localhost ~]#

Expected results:
the package to provide the chkconfig command would install as it is only the chkconfig command itself that is needed by users installing the package, the README the package wants to place into /etc/init.d should not cause a failure.

Additional info:
manually deleting the empty directory with rmdir /etc/init.d and rerunning the dnf install command allows the package (and chkconfig command) to be installed correctly.

Comment 1 Jan Macku 2019-07-09 12:57:28 UTC
I tried to reproduce your issue on VM running Fedora-Server-x86_64-30-1.2 and there is no directory called /etc/init.d.

You might see on some systems symlink called /etc/init.d created by packages (like initscripts, chkconfig), but this should not cause any trouble.

May I ask you why do you had directory /etc/init.d?

Comment 2 Mark Dickinson 2019-07-09 19:16:41 UTC
My apologies. This can be probably be closed as I have just worked out where /etc/init.d came from, I installed a package that placed a file there instead of /etc/rc.d/init.d and when I removed the package it removed the file it placed there but not the directory.
[root@localhost ~]# rpm -qf /etc/init.d
file /etc/init.d is not owned by any package

So if chkconfig had been the first package installed it would not have been an issue as it would have created the link.

So while the chkconfig package should probably handle the existence of the directory, in this case I accidentally created the directory.
Happy for this to close as user error. Sorry for making this mistake and wasting your time.