Red Hat Satellite engineering is moving the tracking of its product development work on Satellite 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 "Satellite project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs will be migrated starting at the end of May. 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 "Satellite project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/SAT-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 1964394 - Warning: postgresql.service changed on disk, when calling foreman-maintain service restart
Summary: Warning: postgresql.service changed on disk, when calling foreman-maintain se...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Installation
Version: 6.10.0
Hardware: x86_64
OS: Linux
medium
medium
Target Milestone: 6.11.0
Assignee: Ewoud Kohl van Wijngaarden
QA Contact: Omkar Khatavkar
URL:
Whiteboard:
: 1987288 1995895 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-05-25 12:03 UTC by Devendra Singh
Modified: 2022-08-02 09:37 UTC (History)
15 users (show)

Fixed In Version: foreman-installer-3.1.2.2
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 2067120 2070991 (view as bug list)
Environment:
Last Closed: 2022-07-05 14:28:57 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 32323 0 High Closed Warning: postgresql.service changed on disk. Run 'systemctl daemon-reload' to reload units. 2022-03-29 12:31:14 UTC
Red Hat Product Errata RHSA-2022:5498 0 None None None 2022-07-05 14:29:18 UTC

Description Devendra Singh 2021-05-25 12:03:11 UTC
Description of problem: Some of the warning messages comes in satellite services restart


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

How reproducible:
always

Steps to Reproduce:
1. Install Satellite with 6.10 snap1. 
2. Restart the Satellite services 
3. Some of the warning messages displayed in service stop and start

# foreman-maintain service restart
Running Restart Services
================================================================================
Check if command is run as root user:                                 [OK]
--------------------------------------------------------------------------------
Restart applicable services: 

Stopping the following service(s):
rh-redis5-redis, postgresql, pulpcore-api, pulpcore-content, pulpcore-resource-manager, rh-redis5-redis, tomcat, dynflow-sidekiq@orchestrator, foreman, httpd, puppetserver, dynflow-sidekiq@worker-1, dynflow-sidekiq@worker-hosts-queue-1, foreman-proxy
\ stopping puppetserver                                                         
Warning: Stopping foreman.service, but it can still be activated by:
  foreman.socket
| stopping rh-redis5-redis                                                      
Warning: postgresql.service changed on disk. Run 'systemctl daemon-reload' to reload units.

Warning: Stopping pulpcore-api.service, but it can still be activated by:
  pulpcore-api.socket

Warning: Stopping pulpcore-content.service, but it can still be activated by:
  pulpcore-content.socket
/ All services stopped                                                          

Starting the following service(s):
rh-redis5-redis, postgresql, pulpcore-api, pulpcore-content, pulpcore-resource-manager, rh-redis5-redis, tomcat, dynflow-sidekiq@orchestrator, foreman, httpd, puppetserver, dynflow-sidekiq@worker-1, dynflow-sidekiq@worker-hosts-queue-1, foreman-proxy
\ starting rh-redis5-redis                                                      
Warning: postgresql.service changed on disk. Run 'systemctl daemon-reload' to reload units.
/ All services started                                                [OK]      


Actual results:
Warning messages come in satellite service restart

Expected results:
Warning message should not come in satellite service restart

Additional info:

Comment 1 Eric Helms 2021-08-03 22:45:59 UTC
*** Bug 1987288 has been marked as a duplicate of this bug. ***

Comment 2 Ewoud Kohl van Wijngaarden 2021-08-06 16:35:29 UTC
(In reply to Devendra Singh from comment #0)
> 1. Install Satellite with 6.10 snap1. 

To properly analyze this, the debug installer logs are needed. I must know what the property NeedDaemonReload is right before the service restart. It should execute this command to retrieve it.

systemctl show --property=NeedDaemonReload -- postgresql.service

If you get the warning, it should clearly return yes but the fact it doesn't reload suggests it doesn't.

It may also be helpful to see what systemctl cat postgresql.service says.

Comment 3 Ewoud Kohl van Wijngaarden 2021-08-06 17:18:47 UTC
Never mind the NEEDINFO, I found a minimal reproducer (on CentOS 7):

yum install -y -q centos-release-scl-rh
yum install -y -q rh-postgresql12-postgresql-server-syspaths
postgresql-setup --initdb
systemctl start postgresql.service
systemctl show --property=NeedDaemonReload -- postgresql.service
mkdir /etc/systemd/system/postgresql.service.d
cat <<EOF > /etc/systemd/system/postgresql.service.d/limits.conf
[Service]
LimitNOFILE=10000
EOF
systemctl show --property=NeedDaemonReload -- postgresql.service
systemctl daemon-reload
systemctl show --property=NeedDaemonReload -- postgresql.service

When you run it:

# yum install -y -q centos-release-scl-rh
warning: /var/cache/yum/x86_64/7/extras/packages/centos-release-scl-rh-2-3.el7.centos.noarch.rpm: Header V3 RSA/SHA256 Signature, key ID f4a80eb5: NOKEY
Public key for centos-release-scl-rh-2-3.el7.centos.noarch.rpm is not installed
Importing GPG key 0xF4A80EB5:
 Userid     : "CentOS-7 Key (CentOS 7 Official Signing Key) <security>"
 Fingerprint: 6341 ab27 53d7 8a78 a7c2 7bb1 24c6 a8a7 f4a8 0eb5
 Package    : centos-release-7-8.2003.0.el7.centos.x86_64 (@anaconda)
 From       : /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
# yum install -y -q rh-postgresql12-postgresql-server-syspaths
warning: /var/cache/yum/x86_64/7/centos-sclo-rh/packages/rh-postgresql12-postgresql-12.7-1.el7.x86_64.rpm: Header V4 RSA/SHA256 Signature, key ID f2ee9d55: NOKEY
Public key for rh-postgresql12-postgresql-12.7-1.el7.x86_64.rpm is not installed
Importing GPG key 0xF2EE9D55:
 Userid     : "CentOS SoftwareCollections SIG (https://wiki.centos.org/SpecialInterestGroup/SCLo) <security>"
 Fingerprint: c4db d535 b1fb ba14 f8ba 64a8 4eb8 4e71 f2ee 9d55
 Package    : centos-release-scl-rh-2-3.el7.centos.noarch (@extras)
 From       : /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-SCLo
# postgresql-setup --initdb
 * Initializing database in '/var/opt/rh/rh-postgresql12/lib/pgsql/data'
 * Initialized, logs are in /var/lib/pgsql/initdb_rh-postgresql12-postgresql.log
# systemctl start postgresql.service
# systemctl show --property=NeedDaemonReload -- postgresql.service
NeedDaemonReload=no
# mkdir /etc/systemd/system/postgresql.service.d
# cat <<EOF > /etc/systemd/system/postgresql.service.d/limits.conf
> [Service]
> LimitNOFILE=10000
> EOF
# systemctl show --property=NeedDaemonReload -- postgresql.service
NeedDaemonReload=yes
# systemctl daemon-reload
# systemctl show --property=NeedDaemonReload -- postgresql.service
NeedDaemonReload=yes

The problem is that we rely on a service symlink:

# ls -l /usr/lib/systemd/system/postgresql.service 
lrwxrwxrwx. 1 root root 58 Aug  6 17:11 /usr/lib/systemd/system/postgresql.service -> /usr/lib/systemd/system/rh-postgresql12-postgresql.service

The real service name is rh-postgresql12-postgresql. This means systemd doesn't look at /etc/systemd/system/postgresql.service.d. If we do:

# mv /etc/systemd/system/postgresql.service.d /etc/systemd/system/rh-postgresql12-postgresql.service.d

Then we see it does work:

# systemctl show --property=NeedDaemonReload -- postgresql.service
NeedDaemonReload=yes
# systemctl daemon-reload
# systemctl show --property=NeedDaemonReload -- postgresql.service
NeedDaemonReload=no


Running systemctl cat postgresql.service also informs us it loads:

# /usr/lib/systemd/system/rh-postgresql12-postgresql.service
<snip>
# /etc/systemd/system/rh-postgresql12-postgresql.service.d/limits.conf
<snip>

Comment 4 Ewoud Kohl van Wijngaarden 2021-08-06 17:39:32 UTC
And a really ugly workaround that appears to work:

ln -s postgresql.service.d /etc/systemd/system/rh-postgresql12-postgresql.service.d

Comment 7 Ewoud Kohl van Wijngaarden 2021-08-23 13:02:41 UTC
*** Bug 1995895 has been marked as a duplicate of this bug. ***

Comment 12 Evgeni Golov 2022-03-17 10:48:23 UTC
I've proposed a patch upstream to fix the PostgreSQL part of the warnings:
Warning: postgresql.service changed on disk. Run 'systemctl daemon-reload' to reload units.


However this will not affect the socket ones:
Warning: Stopping foreman.service, but it can still be activated by:
  foreman.socket

Warning: Stopping pulpcore-api.service, but it can still be activated by:
  pulpcore-api.socket

Warning: Stopping pulpcore-content.service, but it can still be activated by:
  pulpcore-content.socket

Those can be fixed if we stop (and start) the sockets in foreman-maintain too. [The stop needs to happen *before* the service stop].

However, I'd argue that this BZ should be split up in two, one fore PostgreSQL, one for sockets.

Comment 13 Bryan Kearney 2022-03-29 12:03:48 UTC
Upstream bug assigned to ekohlvan

Comment 14 Bryan Kearney 2022-03-29 12:03:50 UTC
Moving this bug to POST for triage into Satellite since the upstream issue https://projects.theforeman.org/issues/32323 has been resolved.

Comment 15 Omkar Khatavkar 2022-05-04 13:10:28 UTC
Tested on Satellite 6.11 and snap 18.5, Not able to see the warning messages for the PostgreSQL, Marking as verified and creating BZ for sockets https://bugzilla.redhat.com/show_bug.cgi?id=2081714


# foreman-maintain service restart

Running Restart Services
================================================================================
Check if command is run as root user:                                 [OK]
--------------------------------------------------------------------------------
Restart applicable services:

Stopping the following service(s):
redis, postgresql, pulpcore-api, pulpcore-content, pulpcore-worker, pulpcore-worker, pulpcore-worker, pulpcore-worker, pulpcore-worker, pulpcore-worker, tomcat, dynflow-sidekiq@orchestrator, foreman, httpd, dynflow-sidekiq@worker-1, dynflow-sidekiq@worker-hosts-queue-1, foreman-proxy
- stopping httpd
Warning: Stopping foreman.service, but it can still be activated by:
  foreman.socket
- stopping pulpcore-content
Warning: Stopping pulpcore-api.service, but it can still be activated by:
  pulpcore-api.socket

Warning: Stopping pulpcore-content.service, but it can still be activated by:
  pulpcore-content.socket
\ All services stopped

Starting the following service(s):
redis, postgresql, pulpcore-api, pulpcore-content, pulpcore-worker, pulpcore-worker, pulpcore-worker, pulpcore-worker, pulpcore-worker, pulpcore-worker, tomcat, dynflow-sidekiq@orchestrator, foreman, httpd, dynflow-sidekiq@worker-1, dynflow-sidekiq@worker-hosts-queue-1, foreman-proxy
\ All services started                                                [OK]
--------------------------------------------------------------------------------

Comment 18 errata-xmlrpc 2022-07-05 14:28:57 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 (Moderate: Satellite 6.11 Release), 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/RHSA-2022:5498


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