Ben Chuanlong Du's Blog

It is never too late to learn.

Manage systemd Services and Units

Things on this page are fragmentary and immature notes/thoughts of the author. Please read with your own judgement!

  1. List all services names.

    service --status-all
    
  2. List all systemd units.

    systemctl
    
  3. Disable a service.

    systemctl disable service_name
    
  4. Check whether systemd is running as PID 1.

    ps --no-headers -o comm 1
    

A List of Services to Disable

Safe to Disable

  1. bluetooth

    sudo systemctl disable bluetooth
    
  2. openvpn

    sudo systemctl disable openvpn
    
  3. virtualbox

    sudo systemctl disable virtualbox
    
  4. packagekit

    sudo systemctl mask packagekit
    

    Notice that subcommand systemctl mask (instead of systemctl disable) is used as systemctl disable does not work in this case. For the difference between systemctl disable and systemctl mask, please refer to What is the difference between "systemctl mask" and "systemctl disable"? .

Controversial Ones

  1. snapd
    sudo systemctl disable snapd.service
    sudo systemctl disable snapd.socket
    sudo systemctl disable snapd.seeded
    sudo systemctl disable snapd.snap-repair.timer
    

References

Comments