Dependencies, configurations, drivers and Troubleshooting

Learning outcomes:

  • Able to use and troubleshoot dependencies
  • Able to use and troubleshoot gems and drivers
  • Able to find and modify config files, as well as know when/how not to modify config files
  • Able to explain what init.d and system.d are for and why we use them

Would you like to download my PowerPoint to follow along?

  • Dependencies
    • What is a dependency
      • When one thing (such as a program) relies on another thing (such as a second program
      • A way to point elsewhere for information you're using rather then copy the info
    • Why do we have them
      • Dependencies happen for saving space and sharing code
      • They can be a way to save space
      • A way to make applications without reinventing the wheel
      • Should get warnings if uninstalling packages that are dependencies
    • Some examples of dependencies
      • Version Dependency
        • Example: Python 2 vs Python 3
      • Package dependency
        • Example: OpenSSH has a package dependency of LibSSL
        • A ton of programs assume you have C libraries installed
    • Dependencies and security
      • Who manages the chain of what you're working on?
      • Who maintains the code? or Repository?
  • Package management
    • Sometimes you download unpacked source code and will need to compile before install because it's not coming from repo
      • The INSTALL file that includes instructions on how to install the package (Common in projects in C compiled projects)
      • Other languages will have required libraries
    • Example Gems:
      • RubyGems is the package manager for Ruby
      • Standard format for distributing programs and libraries
        • A Gem is supposed to be self-contained format (Gem is the Ruby term for Libraries)
        • Has a public repo to hold RubyGems
        • Public Repo is Supposed to help find gems and resolve dependencies
      • Each Gem should have the code, the documentation and the spec
  • Configuration files (configs)
    • What is a Configuration(or config) file
      • These files are used to set the initial settings and parameters for programs/system
      • Usually have an extension of .cnf .conf or .ini but could also be .cfg or .cf
      • There are some common config files you can look at for examples such as SSH config file
    • Configuration editing
      • Typically config files are plain text and editable in any text editor for easy checking remotely
      • Almost all allow comments, comments can be used to enable/disable settings and for documentation
      • Can be modified (Should create backup if you modify!)
      • Some config files are human readable, some aren't
      • Some configs have GUIs to help modify (not commonly used)
    • When config files checked
      • Common convention says rc in the name means it runs on startup
        • Example: .bashrc runs on startup
        • Example: /etc/hosts checked frequently
      • Some configs can be reloaded on command once you've made changes
        • Example: /sbin/service httpd reload
  • init.d and system.d
    • Both daemons
    • System.d is the newer version of the init framework
    • Switching from one to the other isn't recommended, and can create errors in your distro
    • System.d is used to work with services if you use the systemctl commands
      • Such as systemctl start to start a service
      • systemctl stop to stop one
    • History of issues and bit of a flamewar between the two options.
  • Drivers
    • What are drivers
      • Piece of software to make hardware work properly.
      • If working right, they are a black box, they hide the details of how the device works, it just works
      • Can be built separate from the kernel
      • Mostly the drivers come with your OS
        • Example: Printer drives come with CUPS (Common Unix Printing System)You can choose printer based on if driver is available or you might need to write one yourself to get your printer working
        • But you can install drivers if you want to
    • Proprietary drivers
      • Sometimes however the driver doesn't come with the system
        • Example: Nvidia and AMD graphics hardware which can lead to Reduced 3D gaming performance
        • Example: Wi-FI drivers Which can lead to reputation of "flaky" wifi
      • Some systems have driver managers (Linux Mint)
      • Some distros/flavours/developers are against proprietary drivers and make it difficult to use them on purpose(Fedora)
      • If the driver doesn't work easily and can't be found, it might not work at all unless you write a new one yourself
  • RunLevels
    • Runlevels are a way to show what subsystems and services are running
    • We can see some examples what runlevels are and how to change them
    • We might use this to go into runlevel 1 (single user) if we're running into huge issues on the system and need to kick everyone but admin off
  • Troubleshooting basics
    • Read error messages
    • Check internet access (ingress and egress)
    • Check running services
      • Try looking at what's running using top
      • See what's running at startup
    • Check hardware usage like disk usage, memory usage and any other available resources
    • Check your logs! Can be done on the command prompt
    • Check if others have that issue or it's a common problem(Google)

Suggested Activities and Discussion Topics:

  • Go into both your servers, Check your SSH config. What are the most important settings in there? What should be changed? What shouldn't? Make some notes on the answers to each question for each of your servers
  • Complete the lab that is found on This PDF Make sure you are paying careful attention to the requirements

Would you like to see some more classes? Click here