3

I am looking to make the Pi more responsive by disabling unneeded service. I am looking to disable services in /etc/init.d (and anywhere else if there are other places) and want to find a list somewhere that details all the services that are optional so I can disable it. Or can anyone give me a list of unneeded services?

Where can I find such a list? Raspbian stretch is what I'm using.

2
  • try researching debian resources instead of RPi resources
    – jsotola
    Commented Oct 11, 2019 at 23:58
  • 1
    What does unneeded mean? What makes you think that disabling services will help your rpi be more responsive?
    – abolotnov
    Commented Oct 12, 2019 at 1:32

5 Answers 5

5

If you want Raspbian with just the necessary services, start with a download of Raspbian Buster Lite 2019-09-26 from https://downloads.raspberrypi.org/raspbian_lite_latest

Then add in any pieces that are missing that you need to run your server.

You can find the things that delay boot time (usually networking) with systemd-analyze and systemd-analyze blame commands.

2

This is for future me as well ;) Source listed below.

Disable wireless drivers: Disable loading the drivers for bluetooth and WiFi. As well as reducing the number of interfaces it may reduce power usage.

# cat > /etc/modprobe.d/raspi-blacklist.conf <<EOF

# WiFi
blacklist brcmfmac
blacklist brcmutil

# Bluetooth
blacklist btbcm
blacklist hci_uart
EOF

Disable bluetooth: The bluetooth service is not required

# systemctl disable bluetooth
# systemctl stop bluetooth

Disable avahi: The Pi is going to use simple uni-cast DNS - multi-cast DNS support is not required.

# systemctl disable avahi-daemon
# systemctl stop avahi-daemon

Disable TriggerHappy: The Pi isn't being used with button. Disable the TriggerHappy daemon (not[e] that it is a init.d service)

# systemctl disable triggerhappy
# systemctl stop triggerhappy 

source: https://plone.lucidsolutions.co.nz/hardware/raspberry-pi/3/disable-unwanted-raspbian-services

1

Your question isn't easy to answer. it depends on what you want to have running. "Raspbian Buster Light" will have a much smaller list of mandatory services than "Raspbian Buster with desktop and recommended software". And no, I haven't seen a list of needed services for this installations. I think all running services are needed to have a stable operating system for what it is setup. You can find all running services with:

rpi ~$ systemctl

Another way to strip down an installation is to setup a system with debootstrap. This is a tiny Raspbian installation only with essential programs and services to have a minimal running system. Here you can be sure that you only have mandatory services running. Then you can install step by step what you want and control what additional services you want. How to do it look at Install base Raspbian from repository, not using an image.

1

Rather than check an existing list, I'd suggest running service --status-all and looking at what's already running. Installs take on a life of their own after you've been using them for a while. Some of the listed services you'll probably recognize. The rest are easy enough to Google and work out if you need it.

Checking my own service list, which is from a somewhat out of date Jessie Lite install, there's not much I'd suggest disabling. Maybe dhcpcd/ifplugd/networking/ssh/wicd if you didn't use networking, but that's it. I think Rasbian already fairly trimmed down.

Another option would be to use a package manager like aptitude to see what's installed, which includes descriptions, and remove those packages you don't need.

1

If a service is mandatory or optional depends on your use case. For me is printing or sound not necessary, therefore I can disable cups and alsa service.

First run:

systemctl --type service --state running

to see what kind of services are running.

Stopping unnecessary services. In my case it was not enough to just run:

systemctl stop <ServiceName>.service && systemctl disable <ServiceName>.service

I had to mask them because some .socket are able to start services. Here are some services I disabled on my RPi without running in any issues:

sudo systemctl mask bluetooth.service
sudo systemctl mask cups.service
sudo systemctl mask hciuart.service
sudo systemctl mask alsa-state.service
sudo systemctl mask cups-browsed.service

If you set a fixed IP and use a LAN cable instead of wifi, you can also disable the following services:

sudo systemctl mask dhcpcd.service
sudo systemctl mask wpa_supplicant.service

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.