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 1452582

Summary: After upgrade, major services are not enabled by default
Product: Red Hat Enterprise Linux 6 Reporter: Renaud Métrich <rmetrich>
Component: preupgrade-assistant-el6toel7Assignee: Petr Stodulka <pstodulk>
Status: CLOSED ERRATA QA Contact: Tereza Cerna <tcerna>
Severity: high Docs Contact:
Priority: unspecified    
Version: 6.9CC: jmazanek, ovasik, tcerna
Target Milestone: rcKeywords: Extras
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: preupgrade-assistant-el6toel7-0.6.68-1.el6 Doc Type: No Doc Update
Doc Text:
undefined
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-08-02 00:09:16 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:
Bug Depends On:    
Bug Blocks: 1429926    
Attachments:
Description Flags
New services.py proposal: please rework it to be compliant with guidelines if any none

Description Renaud Métrich 2017-05-19 09:17:30 UTC
Created attachment 1280340 [details]
New services.py proposal: please rework it to be compliant with guidelines if any

Description of problem:

After upgrade from RHEL6 to RHEL7 using redhat-upgrade-tool/preupgrade-assistant, major services are not enabled by default:
  atd, crond, rpcbin, rsyslog + some others

This prevent the OS from being really operational.

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

preupgrade-assistant-el6toel7-0.6.66-3.el6.noarch

How reproducible:

Always

Steps to Reproduce:
1. Upgrade a RHEL6
2. Check rsyslog.service status: systemctl status rsyslog.service

Actual results:

# systemctl status rsyslog
● rsyslog.service - System Logging Service
   Loaded: loaded (/usr/lib/systemd/system/rsyslog.service; disabled; vendor preset: enabled)

Expected results:

# systemctl status rsyslog
● rsyslog.service - System Logging Service
   Loaded: loaded (/usr/lib/systemd/system/rsyslog.service; enabled; vendor preset: enabled)

Additional info:

In /var/log/upgrade.log, we can see the following trace:
May 18 12:00:50 vm-fips upgrade-post[14288]: The rsyslog.service service is not mentioned in the 90-default.preset file and therefore the postupgrade script will not handle it

This is due to bad/no handling of wildcards present in /usr/lib/systemd/system-preset/90-default.preset by Python script /usr/share/preupgrade/RHEL6_7/system/initscripts/control/postupgrade.d/services.py.

I'm attaching a modified version of the script to handle wildcards properly.
To do so, I open the 90-default.preset file, read the lines, then keep only "enable XXX" lines, then compute XXX as a fnmatch pattern translated into a regex.
The check_preset function becomes simplified because it becomes a simple pattern matching function.
Note that check_preset's "service" argument is the full service name (e.g. rsyslog.service) and we know the service effectively exists because determine_services() does the job of finding which services correspond to the service description in "enabled.ok" (e.g. by specifying "nfs" in "enabled.ok", "nfs-server.service" will come up among other service names).

Comment 3 Alois Mahdal 2017-05-26 20:11:41 UTC
Notes for QA
============

To verify, apply steps from comment 0.  (Ie. for now just verify the case of rsyslogd.)  Also review the patch once it arrives in repo.

Comment 6 Tereza Cerna 2017-07-03 13:56:05 UTC
==============================================================
Verified in:
    preupgrade-assistant-2.4.1-1.el6.noarch
    preupgrade-assistant-el6toel7-0.6.70-2.el6.noarch
    preupgrade-assistant-el6toel7-data-0.20170620-1.el6.noarch
PASS
==============================================================

Patch was applied in new package of preupgrade-assistant-el6toel7 in file RHEL6_7/packages/ReplacedPackages/noauto_postupgrade.d/install_rpmlist.sh b/RHEL6_7/packages/ReplacedPackages/noauto_postupgrade.d/install_rpmlist.sh


Tested manually:
  1. Upgrade a RHEL6 to RHEL7
  2. Check statuses of major services (rsyslog, atd, crond):
  # systemctl status rsyslog
  ● rsyslog.service - System Logging Service
     Loaded: loaded (/usr/lib/systemd/system/rsyslog.service; enabled; vendor preset: enabled)
     Active: active (running) since Mon 2017-07-03 06:10:29 EDT; 1h 12min ago
  # cat /var/log/upgrade.log | grep rsyslog
  Jul 03 10:05:06 hp-dl380pgen8-02-vm-5.lab.bos.redhat.com upgrade-post[23725]: /usr/bin/systemctl enable rsyslog.service
  Jul 03 10:05:06 hp-dl380pgen8-02-vm-5.lab.bos.redhat.com upgrade-post[23725]: Created symlink /etc/systemd/system/multi-user.target.wants/rsyslog.service, pointing to /usr/lib/systemd/system/rsyslog.service.


Automated test case was created:
/CoreOS/preupgrade-assistant-el6toel7/upg/rsyslog-is-enabled-after-upgrade

Comment 8 errata-xmlrpc 2017-08-02 00:09:16 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2017:2400