Taming Container Logs with Loki and systemd Journal

Introduction to Container Logging

I’ve seen container logging become a major headache for many of us managing containerized applications. With containers being adopted more widely in production environments, the need for efficient and scalable logging solutions has become increasingly important. Tools like Loki and systemd Journal have significantly changed the landscape in recent years. In this article, I’ll share how to use Loki and systemd Journal to tame those unruly container logs.

[Read More]

Taming the DNS Resolver: Getting resolvectl to Play Nice with Your Home Network

Introduction to resolvectl

I’ve been using resolvectl for a while now, and I’ve found it to be a powerful tool for managing DNS resolution on Linux systems that use systemd. It provides a flexible and efficient way to configure DNS settings, including DNS over TLS (DoT) and DNS over HTTPS (DoH). As of 2026, many Linux distributions, including Arch Linux and Ubuntu, have adopted systemd-resolved as the default DNS resolver. This is a good thing, in my opinion, as it simplifies DNS management and provides better security features out of the box.

[Read More]

Taming Log Noise with systemd's Built-in Journalctl Filters and Priorities

Introduction to Journalctl Filters

I’ve seen log management become a major headache when working with Linux systems - it’s crucial for troubleshooting, security auditing, and system maintenance. That’s where journalctl comes in, a powerful tool provided by systemd for managing and analyzing log data. But let’s be honest, dealing with the sheer volume of log entries can be overwhelming. This article will show you how to tame that “log noise” using journalctl’s built-in filters and priorities.

[Read More]

Using resolvectl to Debug Stubborn DNS Issues on Linux

Introduction to resolvectl

I’ve seen my fair share of DNS issues on Linux, and one of the most powerful tools in my arsenal is resolvectl. This command-line utility is part of the systemd suite and provides a comprehensive way to query and configure DNS settings on your system. In practice, resolvectl can be a lifesaver when dealing with stubborn DNS problems. Here, we’ll dive into how to use resolvectl to debug these issues, exploring its capabilities, and providing practical examples to help you troubleshoot and resolve DNS problems efficiently.

[Read More]

Taming Service Exposure with systemd's socket activation

Introduction to Socket Activation

I’ve seen socket activation become a game-changer for managing network services in Linux. By decoupling service activation from the actual service process, you gain more control over service exposure and can significantly improve security and reliability. In this article, we’ll dive into the world of systemd’s socket activation and explore how to harness its power.

What is Socket Activation?

Socket activation is a mechanism that allows systemd to manage network sockets independently of the service process. When a socket is activated, systemd creates a listening socket and waits for incoming connections. Once a connection is established, systemd starts the corresponding service process, passing the socket as a file descriptor. This approach provides several benefits, including improved security, better resource utilization, and increased flexibility. Don’t bother with trying to implement this manually - systemd makes it relatively straightforward.

[Read More]

Taming systemd Restart Policies to Prevent Service Mayhem

Introduction to systemd Restart Policies

I’ve seen systemd’s restart policies go wrong when they’re not properly configured, leading to more problems than they solve. Systemd is a core component of most modern Linux distributions, responsible for managing system services, including starting, stopping, and restarting them as needed. One of the key features of systemd is its ability to automatically restart services that fail or exit unexpectedly, which can help improve system reliability and uptime.

[Read More]

Taming Systemd Services that Refuse to Die

Managing Unresponsive Services in Linux

I’ve seen this go wrong when a service becomes unresponsive and refuses to die - it’s a real headache. Systemd is the default service manager for most modern Linux distributions, and while it’s robust, sometimes services just won’t quit. This can cause issues with system stability and security.

Identifying and Killing Unresponsive Services

To identify unresponsive services, I usually start with the systemctl command:

systemctl status

This lists all active services on your system. Look for services with a status of “failed” or “error”. The real trick is to also check the system logs for errors related to a specific service using journalctl. Don’t bother with manually scanning through logs, though - journalctl can filter out the noise.

[Read More]

Taming Disk-Hungry Logs: Strategies for Managing Log File Growth on Linux Systems

Introduction to Log Management

I’ve seen many Linux systems brought down by unmanaged log files, so it’s essential to have a solid log management strategy in place. Log files provide valuable insights into system activity, errors, and security incidents, but if left unmanaged, they can grow rapidly, consuming disk space and potentially leading to system instability. In this article, we’ll explore practical tools and techniques for managing log file growth on Linux systems.

[Read More]

Taming the Beast of Open File Handles and Unnecessary Service Exposure

Introduction to Open File Handles

I’ve seen this go wrong when a process leaves a trail of open file handles, causing performance issues and security vulnerabilities. Open file handles are a common issue in Linux systems, and managing them is crucial to prevent problems. In this article, we’ll explore how to identify and manage open file handles, as well as tackle unnecessary service exposure.

Understanding Open File Handles

When a process opens a file, the kernel assigns a unique file descriptor, which is used to interact with the file. Normally, when a process is done with a file, it closes the file descriptor, releasing system resources. However, if a process fails to close its file descriptors, open file handles can accumulate, leading to problems. The real trick is to catch these issues before they cause trouble.

[Read More]

Taming systemd's Restart Policy to Avoid Service Thrashing

Introduction to systemd’s Restart Policy

I’ve seen this go wrong when a service is misconfigured, leading to service thrashing - a situation where a service is repeatedly restarted in a short period, causing more harm than good. Systemd, a core component of many modern Linux distributions, is responsible for managing services, sockets, and other system resources. One of its key features is the ability to automatically restart services that fail or exit unexpectedly, which can help improve system reliability and uptime.

[Read More]