Sample Header Ad - 728x90

How to permanently disable autostarting of applications on Linux/Debian?

4 votes
1 answer
2667 views
Many GNU/Linux distros come with autostarts configured that are not needed for most users and are a privacy and security risk (even if small). In principle, it makes sense to only autostart things one actually needs to reduce the likelihood of crashes, the number of irrelevant log entries, the hardware resource consumption, and the attack surface (for example due to potential vulnerabilities in any of the software or ports they listen on). A problem is that when upgrading packages or the distro like Debian, the autostart could be enabled again. What is the best way to **permanently** disable autostarting *without* removing the package (which often isn't even possible anyway as the autostarting package comes shipped with some other needed package). At various questions each about one particular undesired by-default-autostarting software different methods to disable the autostart have been recommended: * Removing (or moving) the file in the autostart folder like so for the Orca screenreader sudo rm /etc/xdg/autostart/orca-autostart.desktop * Something like systemctl --user disable at-spi-dbus-bus.service as recommended here for the screenreader KDE Accessible or for the geolocation tracker geoclue-demo-agent.desktop * Removing the executable flag so it needs to first be manually set (with +x) whenever one wants to run the app like sudo chmod -x /usr/lib/x86_64-linux-gnu/libexec/kdeconnectd && pkill kdeconnectd as recommended here for the wireless communication listener KDE Connect * Copying the .desktop file to the .config folder and changing things so that it doesn't autostart (ironically that makes it show up in KDE's System Settings->Autostart while it wasn't shown there before ) for example like so cp /etc/xdg/autostart/org.kde.kalendarac.desktop ~/.config/autostart and then changing crc:General:Autostart:true to false :false in the file in ~/.config as recommended here for Calendar Reminders or adding Hidden=true to that file as recommended here * Renaming the file in /etc/xdg/autostart/to filename.desktop.disabled * Removing it from the D-Bus autostart services /usr/share/dbus-1/services/ or putting a modified version into ~/.local/share/dbus-1/services/ * A combination of the above such as removing the file from the autostart folder but leaving a .config file that should disable the autostart if it gets restored by some upgrade (especially a distro upgrade). Now I don't know which way to use and all the ones I tried seem to get reset after an upgrade. The .desktop file can get overwritten if the package gets upgraded.
Asked by mYnDstrEAm (4708 rep)
Apr 9, 2024, 04:46 PM
Last activity: Apr 11, 2024, 05:58 PM