In Ubuntu Server, systemd-rfkill.service (and its associated socket, systemd-rfkill.socket) is a background daemon responsible for saving and restoring the hardware and software kill-switch states of radio transmitters (such as Wi-Fi and Bluetooth) across reboots. When you disable Wi-Fi using a physical laptop switch or a software command, this service ensures it remains disabled after a restart. While essential on laptops or mobile devices, this service is entirely unnecessary on dedicated, rack-mounted servers or virtual machines that either lack wireless hardware entirely or require static networking configurations that do not utilize dynamic radio kill-switches. Disabling it reduces boot complexity and cleans up the process list.
This guide explains how to completely disable the systemd-rfkill.service in Ubuntu Server, ensuring the system no longer wastes resources attempting to track non-existent radio states.
Stop and Mask the systemd-rfkill Service
Because this service is often socket-activated by kernel events related to rfkill hardware switches, we must disable both the service unit and its listening socket, and then mask them to prevent any accidental triggering.
- Log into your Ubuntu Server via SSH using an account with
sudoprivileges. - First, stop the service and the socket immediately if they are currently active:
sudo systemctl stop systemd-rfkill.service systemd-rfkill.socket - Next, disable them to prevent them from starting automatically on boot:
sudo systemctl disable systemd-rfkill.service systemd-rfkill.socket - Finally, to guarantee that systemd completely ignores the units and prevents the kernel from triggering them via socket activation, mask them entirely:
sudo systemctl mask systemd-rfkill.service systemd-rfkill.socket
Verify the Service Lockdown
By masking both the service and the socket, you have instructed systemd to symlink their unit files to /dev/null, effectively removing the radio state saving capability from the operating system stack.
To verify the lockdown is successful, run the following command to check the status of both units:
systemctl status systemd-rfkill.service systemd-rfkill.socket
The output for both will clearly state that they are masked. If your server is a virtual machine, you will also notice fewer extraneous entries in the kernel ring buffer (dmesg) during boot relating to rfkill sub-systems, confirming a cleaner, more optimized startup sequence tailored for a wired datacenter environment.