0

I am using the htop command to get a list of all processes running on my raspberry pi 4 and I was curious if there exists a list of all processes that are required for the pi to continue running. I want to kill any process that is not required for proper operation.

E.g I notice things like snapd, python3, and gmain show up multiple times and was wondering if I could kill these processes while still having the raspberry pi operational. I read that snapd manages and maintains snap packages automatically, but do I actually need this running while I am not installing any packages.

I am looking for a list (or documentation) for said required processes.

I am asking this primarily because I think there are processes not necessary to running the Pi that are running and taking resources away from my programs and causing issues.

Edit - Define Proper Operation:

If I kill a process that does not cause the Pi to shut down, brick, require a restart, damage the Pi's hardware, permanently change any software, or permanently change the raspbian OS I would like to kill that process.

If killing a process would require a fresh OS install to get the Pi working again I consider that a required process.

If killing a process means requiring a reboot to restart the process I consider that a required process.

If killing a process only requires manually restarting the process I do not consider that a required process.

4
  • 1
    Pls define 'proper operation'.
    – Dirk
    Commented Jul 14, 2022 at 18:49
  • Do you ACTUALLY have any problems? Just leave it alone!
    – Milliways
    Commented Jul 14, 2022 at 22:39
  • that is really a linux question
    – jsotola
    Commented Jul 15, 2022 at 2:01
  • 1
    Raspbian is MEANINGLESS - it could be any of 5 families of OS spanning 10 years. Even Raspberry Pi OS is ambiguous - at last count there are 8 and there are significant differences between Buster & Bullseye.
    – Milliways
    Commented Jul 15, 2022 at 2:19

1 Answer 1

4

A number of issues with killing random stuff that you don't know what it is...

Each process running is doing something. If you kill it, whatever that something is won't be working anymore. So before you start killing random things, you should find out what they are doing and what service they are providing.

Many processes are started by and monitored by systemd, so if you kill them, systemd will just restart them. So killing them might not just disrupt what they are doing, but it might be useless as they might be restarted.

You specifically ask about snapd. No, snapd is not just used to install snap files. It maintains the snap environment, so all snap based software would malfunction if you killed snapd. If you want to find out if you really need it, run snap list to find out what snaps you have installed. If you don't need any of them, you could probably uninstall snapd. (apt remove snapd)

You say that you have multiple 'python' processes. This doesn't really say much, because python is an interpreter, so the real program running is a python program whose name you haven't mentioned. Many parts of linux are written in python, so killing those could cause many problems.

Rather than killing random processes you found, a better approach to sliming down your system would be to start by looking at what services systemd is starting using systemctl list-unit-files and browse through the enabled services and determine what each one does. For instance, the command systemctl status apache2.service would tell you if that service is running, and the Docs: line has a link you can look at if you don't know what that service is. If you decide you don't want a service, you can temporarily stop it with systemctl stop ... or permanently with systemctl disable --now ...

You could also outright remove software you don't need with apt remove... but you should also carefully read what else gets removed before you tell it to go ahead and do it to make sure you are not doing something silly like removing your entire graphical interface software suite or something else you care about. You can find what package a file is installed by with dpkg -S /path/to/file and get a description of the package with apt show packagename... so you can pick through packages to see what they do before you remove them.

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