Linux-RedHat Troubleshooting

Tags linux

Audience

Staff 

 

Overview

This guide provides troubleshooting steps for common issues encountered on Linux servers. It covers network connectivity problems, permission errors, service failures, zombie process accumulation, and incorrect filesystem mounting. Each section includes practical commands and solutions to diagnose and resolve these issues efficiently, ensuring system stability and optimal performance.

 

Linux-RedHat Troubleshooting

1-Network Connectivity Issues 

Issue

The server is unreachable from the network, or specific service are not accessible

Troubleshooting steps:

  1. Check the network interface configuration using ' ip addr show' and ensure the interface is up and has an IP address. 
  2. Test network connectivity with 'ping' to a known IP address outside your network. 
  3. Use 'ip-route' to find your default gateway then 'ping <gateway-ip>' to verify local network connectivity. 
  4. Use 'traceroute' command to find where the connection drops.
  5. Check firewall setting with 'iptables -L' or by using 'firewall-cmd --list-all' to ensure traffic is allowed. 
  6. Verify that the necessary service are running using 'systemctl status service-name' 
  7. In some cases simply reloading the Network Manager can resolve issues 'systemctl reload NetworkManager' 
  8. Check the configuration file "/etc/sysconfig/network-scripts/ifcfg-<interface" ( default path to the configuration file) for errors or misconfigurations.
  9.  Review system logs for networking issues with 'journalctl -u NetworkManager' or look at  '/var/log/messages'  for relevant entries.  
  10. Ensure '/etc/resolv.conf' contains valid DNS servers. Use 'cat /etc/resolv.conf'  to view. 
  11. Use 'nslookup google.com' to test DNS resolution.  

 

2-Permission Issues 

Issues

Unable to access or execute files, application reporting access denied.

Troubleshooting steps:

  1. Use 'ls -ld path/to/file_or_directory' to display detailed permissions. 
  2. for files or directories inside a path, ensure you have execute ('x') permission on all parent directories for user or service trying to access the file. 
  3. If the file or directory is accessible by a group, use 'group username' to ensure the user is part of the correct group. 
  4. If the user is not in the required group,add them using 'usermod -aG groupname username'. Remember, changes to group membership require a logout/login to take effect. 
  5. Use 'chmod' to adjust permissions. 
  6. Use 'chown user:group path/to/file-or-directory'  to correct ownership. For services, ensure the service user owns the directories/file it need to access 
  7. Check for the presence of SUID/SGID (special permissions) which can affect how executables run. Use 'ls -l' and look for an 's' in the permission string. 
  8. Adjust these special permission carefully with 'chmod'. For example , "chmod g+s directory-name' sets the SGID bit on a directory 

 

3-Service Fails to Start

Issue 

A critical service (e.g., Apache, MySQL) fails to start 

Troubleshooting Steps:

  1. Attempt to start the service manually using 'systemctl start service-name' and observe the output. 
  2. Check the service's log files for errors. For systemd service, use 'journalctl -u service-name'
  3. Verify the configuration file for syntax error or misconfiguration. Many services have a syntax check command. 
  4. Check for port conflicts or required ports being in use with 'netstat -tuln' or 'ss -tuln' 
  5. Ensure all dependencies for the service are correctly installed and configured. 

 

4-Zombie Processes Accumulation 

Issue

An excessive number of zombie processes can be observed using tools like 'top'. While they don't consume resources like active processes, too many can eventually exhaust the process ID limit.

Troubleshooting steps: 

  1. Identify the parent process creating zombies by checking the PPID of the zombie processes using 'ps aux | grep 'Z' .
  2. Check if the parent process can be safely restarted, do so to clean out zombie processes.
  3. Review the code of the parent application to ensure it properly waits for child processes to prevent zombies in future. 

 

5- Incorrect filesystem Mounting 

Issue

Partitions are not mounted automatically at boot, or the wrong partitions are mounted 

Troubleshooting steps 

  1. Check '/etc/fstab' for correct UUIDs and mount options. 
  2. Use 'blkid' to verify partition UUIDs and correct them in '/etc/fstab' 
  3. Ensure the filesystem type is correctly specified in '/etc/fstab' 

 

 

Feedback and Concerns:

If you have any feedback regarding this article, please reach out to hsitkb@pitt.edu.  You can also leave a comment below as well.