this post was submitted on 29 Aug 2026
39 points (100.0% liked)

Linux

67365 readers
435 users here now

From Wikipedia, the free encyclopedia

Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).

Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word "Linux" in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.

Rules

Related Communities

Community icon by Alpár-Etele Méder, licensed under CC BY 3.0

founded 7 years ago
MODERATORS
 

Every time when i poweron the pc, some proccess are started with the system. Some of them are Anydesk and SQL. I had disable sql from start alongside the system with systemctl disable mysql, so i think that i need to do the same with anydesk. But why these programs make this? Even if i dont start the app/program, they will be there, eating resources from the start... WHY THIS HAPPEN?!?!

Edit: Something i forgot to put: why they have root permissions? this happen no wonder the system i install these programms, they have the same behaviour

top 10 comments
sorted by: hot top controversial new old
[–] zombiebikini@lemmy.zip 27 points 3 days ago

Those processes are server processes and they are supposed to always run in the background. In that way they are ready to be accessed by client software immediately. For why they are root: often but not always servers need elevated privileges, e.g. to open ports below 1024 or read restricted files.

[–] talkingpumpkin@lemmy.world 18 points 3 days ago

Most probably those services are started because some other service depends on them.

After running systemctl disable someservice the service someservice is not "disabled" in the sense that it can't be started, it merely isn't started automatically at startup. If you want to make a service not startable, use systemctl mask (or, you know, uninstall/delete it?).

systemctl list-dependencies --reverse mysql.service should list the services that depend on mysql.service.

[–] InnerScientist@lemmy.world 10 points 3 days ago

systemctl list-dependencies --reverse anydesk should show if any other services depend on them

[–] floquant@lemmy.dbzer0.com 3 points 2 days ago* (last edited 2 days ago) (1 children)

Whether a system(d) service is activated by default after you install a package is a distro-specific choice. I know Debian and derivatives do, so it will be started at the next reboot; while Arch and derivatives don't, requiring an explicit systemctl enable [--now] something.service to run it. The devs of the distro try to pick what they think their userbase wants and after the initial decision is taken it's not a behaviour that can be changed lightly.

Regarding running as root, sometimes it's just the default configuration that can be changed to a dedicated user, other times it's required by the privileges they use (e.g. if they need to open a port below 1024)

[–] maxihuenu@lemmy.ml 1 points 2 days ago

that is a nice thing to know. Thank you

[–] thingsiplay@lemmy.ml 7 points 3 days ago

This is where the server/client concept comes from. Some server software runs in the background and wait for access from an external client software. Then it works on the server and produces and output for the client. This way the entire server does not need to start run and stop for every single request. I mean you don't start and close every time you click on a new link on the website, right? So your PC runs all the time. And that's similar to how MySQL operates. It starts a server in the background and then waits for any application to use it. So this is totally normal.

Now because lot of people don't want to start the server process "by hand", they put it in autostart, so it starts with your system. If you don't want it to autostart, maybe there is a way of configuring it so you have to start it manually each time you want to use it. But I cannot assist with that help, just wanted to explain why that is on a high level.

[–] eager_eagle@lemmy.world 4 points 3 days ago (1 children)

systemctl list-unit-files --state=enabled to check everything enabled that you might want to disable

as for running as root, AFAIK all systemd services run as root, unless they're defined at the user-level; but IME setting services at the user level usually means a more involved setup to make sure PATH and env vars are correct.

[–] bjoern_tantau@swg-empire.de 4 points 3 days ago* (last edited 3 days ago) (1 children)

Well behaved services would usually run on a special user that exists just for that service. Either systemd would run the service using the specified user or the service would start as root to do privileged operations like opening specific ports and then run subprocesses as the more limited user.

[–] SteveTech@aussie.zone 6 points 3 days ago* (last edited 3 days ago)

Systemd can also create a temporary user, with DynamicUser. But I so very rarely see that being used.

the service would start as root to do privileged operations like opening specific ports

You can also add the CAP_NET_BIND_SERVICE capability to do this without root.

IMO, there's usually no reason to use root in a systemd service, it's just ignorant developers.

[–] artwork@lemmy.world 4 points 3 days ago* (last edited 3 days ago)

Wonderful day!

May I ask how did you install these programs?

For example, AnyDesk. The underlying service might be installed from the official repository DEB package.
As we may see, in the following package:
- https://deb.anydesk.com/pool/main/a/anydesk/anydesk_8.0.4_amd64.deb

There's a standard "postinst" script inside that installs the service:

"postinst" preview

#!/bin/bash

set -e

command_exists()
{
        command -v "$1" > /dev/null 2>&1
}

if [ "$1" = configure ]; then

        INITSYS=$(ls -al /proc/1/exe | awk -F' ' '{print $NF}' | awk -F'/' '{print $NF}')

        if [ "systemd" == "$INITSYS" ]; then
                if [ -e /etc/systemd/system/anydesk.service ]; then
                        rm /etc/systemd/system/anydesk.service
                fi
                cp /usr/share/anydesk/files/systemd/anydesk.service /etc/systemd/system/anydesk.service
                systemctl daemon-reload
                deb-systemd-invoke enable anydesk
                deb-systemd-invoke start anydesk
        elif [ "init" == "$INITSYS" ]; then
                if [ -e /etc/init.d/anydesk ]; then
                        rm /etc/init.d/anydesk
                fi
                chmod +x /usr/share/anydesk/files/init/anydesk
                ln -s /usr/share/anydesk/files/init/anydesk /etc/init.d/anydesk
                update-rc.d anydesk defaults
                invoke-rc.d anydesk start
        fi

        command_exists update-menus && update-menus
        command_exists update-desktop-database && update-desktop-database
        command_exists xdg-desktop-menu && xdg-desktop-menu forceupdate
fi

Since the script is copied into "system" path (not the User's "/etc/systemd/user/*"), it is executed by "root" by default, unless specifically specified in the service itself (e.g., directive "User=").

Just in case, "enabling" in marvelous Systemd means merely a symlink added to the directory the OS probes on boot. You should see the symlink location on service '(dis-)enabling".