Red Hat Enterprise Linux Diagnostics and Troubleshooting
Repair a non-running application.
Outcomes
You should be able to successfully repair the non-running application on your machine.
As the student user on the workstation machine, use the lab command to prepare your system for this exercise.
This command installs a custom application on your system.
[student@workstation ~]$ lab start compreview-review1
Specifications
The custom
programapplication is not functioning properly on theserverasystem.Troubleshoot and repair the issue, resulting in a functioning application.
The application prints the text "Success!" when it is functioning properly.
The
programcommand runs the application.The
programapplication relies on a locally running web service.
Troubleshoot and resolve the
programapplication issue.Log in to
serveraand switch to therootuser.[student@workstation ~]$
ssh student@servera...output omitted... [student@servera ~]$sudo -i[sudo] password for student:student[root@servera ~]#Attempt to run the
programcommand, and view any messages.The runtime linker cannot open the
libreadline.so.7library.[root@servera ~]#
programprogram: error while loading shared libraries: libreadline.so.7: cannot open shared object file: No such file or directoryDiscover whether any other shared libraries cannot be resolved.
No other libraries are missing.
[root@servera ~]#
which program/usr/bin/program [root@servera ~]#ldd /usr/bin/programlinux-vdso.so.1 (0x00007ffc55d92000) libreadline.so.7 => not found libc.so.6 => /lib64/libc.so.6 (0x00007f193603f000) /lib64/ld-linux-x86-64.so.2 (0x00007f1936404000)Identify the package that provides the missing shared library.
[root@servera ~]#
yum provides libreadline.so.7Last metadata expiration check: 2:05:19 ago on Fri 12 Nov 2021 02:41:41 PM EST. readline-7.0-10.el8.i686 : A library for editing typed command lines Repo : rhel-8.4-for-x86_64-baseos-rpms Matched from: Provide : libreadline.so.7Install the required packages.
The package is present, but the library that it provides is missing.
[root@servera ~]#
yum install readlineLast metadata expiration check: 2:06:19 ago on Fri 12 Nov 2021 02:41:41 PM EST. Package readline-7.0-10.el8.x86_64 is already installed. Dependencies resolved. Nothing to do. Complete!Verify the package's files.
The library file is missing.
[root@servera ~]#
rpm -V readlinemissing /usr/lib64/libreadline.so.7Reinstall the package to restore the missing file.
[root@servera ~]#
yum reinstall readline...output omitted... Reinstalled: readline-7.0-10.el8.x86_64 Complete!Attempt to run the
programcommand, and view any messages. When prompted, enter a string of characters.The application is starting, but presents a new error.
[root@servera ~]#
programEnter value:anystringError: application failed to run!
Troubleshoot and resolve the additional
programapplication issue.View the application's system calls.
The
straceoutput will pause when it reaches the string input prompt. Press Enter to view the full output.The application tries to connect to port 80 on the local system, but the connection is refused.
[root@servera ~]#
strace programexecve("/usr/bin/program", ["program"], 0x7ffcb6e91dd0 /* 25 vars */) = 0 ...output omitted... connect(3, {sa_family=AF_INET, sin_port=htons(80), sin_addr=inet_addr("127.0.0.1")}, 16) = -1 ECONNREFUSED (Connection refused) write(1, "Error: application failed to run"..., 34Error: application failed to run! ) = 34 exit_group(1) = ? exited with 1The application relies on a local web service to be running. Verify whether one is installed.
[root@servera ~]#
systemctl status httpdUnit httpd.service could not be found.Install and start a web server to listen on port 80.
[root@servera ~]#
yum install httpd...output omitted... [root@servera ~]#systemctl start httpdAttempt to run the
programcommand, and view any messages.The "Success!" output indicates that the
programapplication is functioning properly.[root@servera ~]#
programEnter value:anystringSuccess!Return to
workstationas thestudentuser.[root@servera ~]#
exit[student@servera ~]$exit[student@workstation ~]$