Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
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 1422877

Summary: lorax can't symlink rng.service in 7.4 (missing mkdir)
Product: Red Hat Enterprise Linux 7 Reporter: Lubos Kocman <lkocman>
Component: loraxAssignee: Brian Lane <bcl>
Status: CLOSED DUPLICATE QA Contact: Release Test Team <release-test-team-automation>
Severity: high Docs Contact:
Priority: unspecified    
Version: 7.4CC: dgilmore, msekleta, systemd-maint-list
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-02-17 21:56:51 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 Lubos Kocman 2017-02-16 12:53:02 UTC
Description of problem:

Hello folks, there seems to be a problem with you not running mkdir etc/systemd/system/basic.target.wants/ while this is done on upstream code


This currently breaks all nightly composes, since we're not able to finish lorax runtime
DEBUG util.py:257:  + lorax '--product=Red Hat Enterprise Linux' --version=7.4 --release=7.4 --source=file:///mnt/redhat/nightly/RHEL-7.4-20170215.n.0/work/s390x/repo --variant=Server --nomacboot --noupgrade --buildarch=s390x '--volid=RHEL-7.4 Server.s390x' --logfile=/mnt/redhat/nightly/RHEL-7.4-20170215.n.0/logs/s390x/buildinstall-Server-logs/lorax.log /mnt/redhat/nightly/RHEL-7.4-20170215.n.0/work/s390x/buildinstall/Server

exits on 

DEBUG util.py:257:  template command error in runtime-postinstall.tmpl:
DEBUG util.py:257:  2017-02-15 12:26:00,924:   symlink /lib/systemd/system/rngd.service etc/systemd/system/basic.target.wants/rngd.service
DEBUG util.py:257:    symlink /lib/systemd/system/rngd.service etc/systemd/system/basic.target.wants/rngd.service
DEBUG util.py:257:  2017-02-15 12:26:00,924:   OSError: [Errno 2] No such file or directory
DEBUG util.py:257:    OSError: [Errno 2] No such file or directory
DEBUG util.py:257:  Traceback (most recent call last):
DEBUG util.py:257:    File "/usr/sbin/lorax", line 330, in <module>
DEBUG util.py:257:      main(sys.argv)
DEBUG util.py:257:    File "/usr/sbin/lorax", line 232, in main
DEBUG util.py:257:      remove_temp=True)
DEBUG util.py:257:    File "/usr/lib/python2.7/site-packages/pylorax/__init__.py", line 272, in run
DEBUG util.py:257:      rb.postinstall()
DEBUG util.py:257:    File "/usr/lib/python2.7/site-packages/pylorax/treebuilder.py", line 136, in postinstall
DEBUG util.py:257:      self._runner.run("runtime-postinstall.tmpl", configdir=configdir_path)
DEBUG util.py:257:    File "/usr/lib/python2.7/site-packages/pylorax/ltmpl.py", line 182, in run
DEBUG util.py:257:      self._run(commands)
DEBUG util.py:257:    File "/usr/lib/python2.7/site-packages/pylorax/ltmpl.py", line 201, in _run
DEBUG util.py:257:      f(*args)
DEBUG util.py:257:    File "/usr/lib/python2.7/site-packages/pylorax/ltmpl.py", line 359, in symlink
DEBUG util.py:257:      os.symlink(target, self._out(dest))
DEBUG util.py:257:  OSError: [Errno 2] No such file or directory

I did check and 
DEBUG util.py:257:  + ls -la /lib/systemd/system/ 
...
DEBUG util.py:257:  -rw-r--r--  1 root root        129 Aug 17  2015 rngd.service exist


//Upstream code
## Start rngd
mkdir etc/systemd/system/basic.target.wants/
symlink /lib/systemd/system/rngd.service  etc/systemd/system/basic.target.wants/rngd.service

// this is what's in rhel-7.4 source archive
 29 ## Start rngd
 30 symlink /lib/systemd/system/rngd.service etc/systemd/system/basic.target.wants/rngd.service
 31 
 32 ## Disable unwanted systemd services



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


How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:

Comment 1 Dennis Gilmore 2017-02-16 13:28:31 UTC
systemd should be providing /etc/systemd/system/basic.target.wants/

Comment 3 Lukáš Nykrýn 2017-02-16 14:45:49 UTC
(In reply to Dennis Gilmore from comment #1)
> systemd should be providing /etc/systemd/system/basic.target.wants/

Nope, this is something that should be created on the run as a part of user configuration.

These directories are created on the fly when you enable something. If you are enabling units manually then you always need to make sure that this directory exists by yourself. Or just use systemctl.

Otherwise we should have to provide .wants directories for basically every unit that could exist on the system.

Comment 4 Michal Sekletar 2017-02-16 16:17:18 UTC
After installation of rng-tools package rpm will call %post script where we have following,

[0 root@qeos-142 ~]# rpm -q rng-tools
rng-tools-5-8.el7.x86_64
[0 root@qeos-142 ~]# rpm -q rng-tools --scripts
postinstall scriptlet (using /bin/sh):

if [ $1 -eq 1 ] ; then 
        # Initial installation 
        systemctl preset rngd.service >/dev/null 2>&1 || : 
fi

Default preset policy on RHEL7 will cause that rngd is enabled after package installation,

[0 root@qeos-142 ~]# grep rngd /usr/lib/systemd/system-preset/*
/usr/lib/systemd/system-preset/90-default.preset:enable rngd.service

According to upstream commit that added problematic code rngd was apparently disabled in installer image by default. But now it should be enabled (assuming that anaconda will boot into multi-user.target).

https://github.com/rhinstaller/lorax/commit/690feba3812579f965a4321660af88941ce2039e

Comment 5 Lubos Kocman 2017-02-17 11:01:01 UTC
Moving back to lorax then. I believe the actual ownership question that Dennis asked is probably worth separate issue, If somebody thinks it's a problem we need to solve.

Thanks

Lubos

Comment 6 Brian Lane 2017-02-17 17:14:33 UTC
The fix is ready: 
https://github.com/rhinstaller/lorax/pull/188

Comment 7 Brian Lane 2017-02-17 21:56:51 UTC

*** This bug has been marked as a duplicate of bug 1377430 ***