0

My question is ideological, I want my system to be lightweight but over time I accumulate services that I need from time to time but not always.

I was reading this. Why would services like postgres, docker, apache run on every boot? Would make sense for server distros but not for personal machines.

I know it's probably the decision of the developers of the software, not the distro, but it's kind of annoying and your system doesn't feel lightweight when you know there's postgres in the background. Turning this off is trivial but it's non-trivial to keep track that your system isn't running something like docker engine when you don't need it. Windows manages this better (even though it's overall slower)

So I'm thinking maybe I have misconceptions:

  1. Are the services actually running or are they just ready to run? I.e do they actually consume power and compute when I'm not using them?

  2. Is there something that I'm missing on how to manage this?

  3. Are service and systemctl the right tools to manage this?

  4. Same problem with packages, I install a package and its dependencies and now I don't know what's going to be running as a service in the background, am I just missing how to use apt?

  5. Is there a way to have a default configuration that the user services have to be run explicitly unless otherwise stated?

  • apt remove packages you don't need. systemctl disable services that you do not want to start automatically. Everything is under you control. – FedKad Oct 30 '23 at 08:52
  • All programs mentioned in your post are not part of the standard installation of Ubuntu. So it was your decision to install them. All progams mentioned are typically programs for servers, which is mainly the reason why the start together with the system. You can disable the corresponding services using systemctl and start the programs manually, no problem with that. But if you want a "lightweight" system, the question is more like why you install a heavy-weigth RDBMS server and a heavy-weight webserver? – noisefloor Oct 30 '23 at 09:16
  • Ubuntu is much more than a Desktop distro. It's a multiuser distro. It's a massively-popular enterprise-grade server distro. And and a tiny appliance distro. And ports of it are a Phone distro. All from the same package archive. If you add server packages, they will behave like a server. – user535733 Oct 30 '23 at 10:15

1 Answers1

0

"Are the services actually running or are they just ready to run? I.e do they actually consume power and compute when I'm not using them?"

  • See whether a service is running using systemctl status <service_name>
  • See if a service is hogging resources using top

"I install a package and its dependencies and now I don't know what's going to be running as a service in the background"

It's up to you, the human, to do your research before installing software and to monitor your software after installation. That responsibility cannot be delegated to apt. Apt is merely a tool to keep track of repositories and dependencies.

In many cases (including databases and webservers) there may be smaller and lighter tools that meet your needs.

"Is there a way to have a default configuration that the user services have to be run explicitly unless otherwise stated?"

There is no use case for unskilled Ubuntu users that involves installing packages that they don't subsequently use. The Ubuntu developers are clear that packages must be fully-functional upon install. There is no apt flag to disable package functionality. (What a mess that would cause!)

The tools to control systemd-compatible services are simple: Merely systemctl disable <service_name> services that you don't want to autostart. Or uninstall those packages.

user535733
  • 62,253