3

I ran systemctl --user disable tracker-miner-fs.service expecting to see some changes in the filesystem and in the status output, but

XUb ~$ systemctl --user disable tracker-miner-fs.service 
XUb ~$ systemctl --user status tracker-miner-fs.service 
● tracker-miner-fs.service - Tracker file system data miner
     Loaded: loaded (/usr/lib/systemd/user/tracker-miner-fs.service; enabled; vendor preset: enabled)
...

The service seems to be enabled via /etc/systemd/user/:

$ find `systemd-analyze --user unit-paths` 2>/dev/null  | grep tracker
/etc/systemd/user/default.target.wants/tracker-miner-fs.service
/etc/systemd/user/default.target.wants/tracker-extract.service
...

So how can I disable vendor-shipped user services, preferably as a user (on an individual basis) or as root (for all users)?

1 Answer 1

2

You can disable the globally-enabled user service for all users by running (as root):

systemctl --global disable tracker-miner-fs.service

I'm not aware of a way to disable a globally-enabled user service for an individual user, although you could prevent the service from being run by masking it:

systemctl --user mask tracker-miner-fs.service

If you still wanted to be able to start the service manually, you could create a copy with a different name. (I realize that's probably not ideal. I'm not aware of a better solution.)

4
  • That's what I ended up doing... So basically systemctl --user disable is meaningless, as there is no place for systemd to save the per-user dis/en-abled status?
    – usretc
    Commented Jan 30, 2021 at 8:30
  • 1
    @AldIn systemctl --user disable can remove symlinks created by systemctl --user enable (i.e. disable non-globals), but I agree it is less useful than it could be, and that per-user disabling of globals would be useful. The current behavior is also confusing, as noted in systemd/systemd#18271 (which is how I came across your question).
    – Kevinoid
    Commented Jan 30, 2021 at 13:39
  • A similar question: how to stop a user service for all users? When uninstalling a package with a user service I can globally disable it and stop for a current user but can't figure out how to stop for all users who are online in the the system Commented Mar 10 at 11:05
  • 1
    @SergeyPonomarev Perhaps unix.stackexchange.com/a/654846 answers your question? If not, I'd encourage you to ask the question as a question, rather than a comment to an answer, so you can get better answers and others can benefit.
    – Kevinoid
    Commented Mar 10 at 16:33

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .