Skip to main content

Troubleshooting application issues

Hands-On Lab

 

Photo of Michael Christian

Michael Christian

Course Development Director in Content

Length

01:30:00

Difficulty

Advanced

In this exercise, you will troubleshoot three different application issues.

What are Hands-On Labs?

Hands-On Labs are scenario-based learning environments where learners can practice without consequences. Don't compromise a system or waste money on expensive downloads. Practice real-world skills without the real-world risk, no assembly required.

Troubleshooting application issues

Introduction

In this exercise, you will troubleshoot three different application issues.

  1. Troubleshoot and resolve issues using the dig, host, and nslookup commands.
  2. Assess the application /root/test_app for a memory leak.
  3. Assess and resolve the issue with /root/example_app.

Solution

Start by logging in to the lab server using the credentials provided on the hands-on lab page:

ssh cloud_user@PUBLIC_IP_ADDRESS

Become the root user:

sudo su -

Troubleshoot and resolve issues using the dig, host, and nslookup commands

  1. View the contents of /etc/resolv.conf to show the configured nameserver:

    cat /etc/resolv.conf
  2. Attempt to use dig to look up an IP for linuxacademy.com:

    dig linuxacademy.com
  3. Use ldd to view the libraries used by dig:

    ldd $(which dig)
  4. libdns.so.100 is missing. Use yum to find a package that installs this library:

    yum provides */libdns.so.100
  5. Reinstall the bind-libs package:

    yum reinstall -y bind-libs
  6. Attempt to use dig to look up an IP for linuxacademy.com:

    dig linuxacademy.com

Assess the application /root/memleak_test_app for a memory leak

  1. Install valgrind:

    yum install -y valgrind
  2. Run valgrind against /root/test_app:

    valgrind ./memleak_test_app
  3. If the app has a memory leak, remove executable permissions:

    chmod -x /root/memleak_test_app

Assess and resolve the issue with /root/example_app

  1. Attempt to run the application:

    /root/example_app
  2. Install strace:

    yum install -y strace
  3. Run the application again using strace:

    strace /root/example_app
  4. Create the missing file:

    touch /etc/example.conf
  5. Run the application again:

    /root/example_app

Conclusion

Congratulations, you've completed this hands-on lab!