Last active
October 29, 2022 14:06
-
-
Save sayan3296/abb440ae715fc9779b7278fc74a305b3 to your computer and use it in GitHub Desktop.
Qpidd service not starting due to sudo errors ( case 03347873 )
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
## Assuming satellite 6.10 or 6.11 is installed with organization name RedHat. | |
## Also the "strace" package should be installed on the satellite server OS | |
for i in KATELLO_AGENT_STAT QPID_STAT; do unset $i; done | |
KATELLO_AGENT_STAT=$(awk '/enable_katello_agent:/{print $NF}' /etc/foreman-installer/scenarios.d/satellite-answers.yaml) | |
if [[ $KATELLO_AGENT_STAT = "false" ]] | |
then | |
echo "Enabling Katello-Agent feature" | |
satellite-installer --foreman-proxy-content-enable-katello-agent true | |
else | |
echo "Katello Agent feature is already enabled" | |
fi | |
QPID_STAT=$(systemctl is-active qpidd) | |
if [[ $QPID_STAT = "active" ]] | |
then | |
systemctl stop qpidd | |
echo "sudo su -" > /usr/local/bin/ss | |
chmod +x /usr/local/bin/ss | |
systemctl start qpidd | |
else | |
echo "qpidd is already down" | |
echo "sudo su -" > /usr/local/bin/ss | |
chmod +x /usr/local/bin/ss | |
fi | |
echo "Done" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Troubleshooting:
Install strace
Open two SSH sessions of the satellite server.
In the first session run this and leave it running: [ strace the systemd process ]
In the second session, stop and start the qpidd service.
Once the service is failed, Cancel the strace command and investigate the
qpidd_strace.log
file.As we can see here qpidd is trying to run something with the ss command and using the path
/usr/local/bin/ss
for the ss binary.If we do
systemctl cat qpidd
, we should be able to see , there is a Post action defined viaExecStartPost
param and that executes ss command to check the connectivity on port 5671. So this is expected.But strace tells us, as soon as the
ExecStartPost
step is executed, the service is trying to use "sudo su -" to do something and that is unexpected if compared with a working system.From a working system, check the binary part for ss and what package it is provided by.
So we see the package and binary path but the path is ont same as what strace is showing us i.e.
/usr/sbin/ss
/usr/local/bin/ss
Investigating further reveals that,
So, lets remove the file and ensure that OS can see ss binary from the expected location.
As we can see the expected location, let's restart the qpidd service now.