Systemctl cannot find running service

I am running etesync-dav (https://aur.archlinux.org/packages/etesync-dav/) on my MNJ-KDE, and setting it up with some apps can be a problmem, so I need to check whether or not it is running. Th terminal output is confusing:

[ben@paul-mnj ~]$ etesync-dav
[2020-11-26 00:54:40 +0100] [8122] [CRITICAL] An exception occurred during server startup: Failed to start server '[localhost]:37358': [Errno 98] Address already in use // <= this hints at the service already running, but why not just say so directly?
[ben@paul-mnj ~]$ systemctl status etesync-dav
Unit etesync-dav.service could not be found.
[ben@paul-mnj ~]$ sudo systemctl status etesync-dav
Unit etesync-dav.service could not be found.

Also, I know for a fact it is running, because it is syncing new events I enter in Thunderbird.
Also, /usr/lib/systemd/user/etesync-dav.service exists.
…but systemctl seems to think it doesn’t exist. Am I just getting the command wrong?

I’m sorry for this dumb post, but then again it might help someone:
This command needs the --user flag:

[ben@paul-mnj ~]$ systemctl status --user etesync-dav.service
● etesync-dav.service - Cal/CardDAV frontend for Etesync
     Loaded: loaded (/usr/lib/systemd/user/etesync-dav.service; disabled; vendor preset: enabled)
     Active: inactive (dead)

…which, I don’t understand why, but it’s probably the developer’s decision that I need to ask him about.
Also, systemd is kinda being a jerk for saying that service doesn’t exist just because I didn’t mention it’s a per-user one. Feel free to comment if you can shed some light on this behavior!

never heard of a service requiring the “–user” flag before.

thanks for sharing this insight. i have learned something today!

It appears to be a caldav service; if it ran as a system service, then not only yours, but the info from ‘the_significant_other_of_bennypr0fane’s’ would be an intertwined mess.

@excalibur1234: run:

systemctl --user list-unit-files

I have services, slices, sockets, targets and timers. :slight_smile:

1 Like

i still have different results for using “–user” flag or not. please look at the “pikaur-cache.timer”:

~ > systemctl --user list-unit-files | grep ".timer"                                                                                                                                                                                                                                                    
pikaur-cache.timer                                                                         disabled  enabled      
systemd-tmpfiles-clean.timer                                                               disabled  enabled      
------------------------------------------------                                                                                                                                                                                                                                                         
~ > systemctl list-unit-files --all | grep ".timer"                                                                                                                                                                                                                                                     
btrfs-scrub@.timer                         disabled        disabled     
e2scrub_all.timer                          disabled        disabled     
fstrim.timer                               enabled         disabled     
logrotate.timer                            disabled        disabled     
man-db.timer                               disabled        disabled     
mdadm-last-resort@.timer                   static          -
my-rsync.timer                             enabled         disabled
paccache.timer                             disabled        disabled
shadow.timer                               static          -
systemd-tmpfiles-clean.timer               static          -
xfs_scrub_all.timer                        disabled        disabled
------------------------------------------------
~ > systemctl list-timers
NEXT                        LEFT          LAST                        PASSED        UNIT                         ACTIVATES
Fri 2020-12-11 16:07:17 CET 4h 15min left Fri 2020-12-11 11:07:04 CET 44min ago     my-rsync.timer               my-rsync.service
Sat 2020-12-12 00:00:00 CET 12h left      Fri 2020-12-11 00:00:00 CET 11h ago       logrotate.timer              logrotate.service
Sat 2020-12-12 00:00:00 CET 12h left      Fri 2020-12-11 00:00:00 CET 11h ago       man-db.timer                 man-db.service
Sat 2020-12-12 00:00:00 CET 12h left      Fri 2020-12-11 00:00:00 CET 11h ago       shadow.timer                 shadow.service
Sat 2020-12-12 10:52:04 CET 23h left      Fri 2020-12-11 10:52:04 CET 59min ago     systemd-tmpfiles-clean.timer systemd-tmpfiles-clean.service
Mon 2020-12-14 01:07:22 CET 2 days left   Wed 2020-12-09 21:41:27 CET 1 day 14h ago fstrim.timer                 fstrim.service

6 timers listed.
Pass --all to see loaded but inactive timers, too.
------------------------------------------------
~ > systemctl list-timers --all
NEXT                        LEFT          LAST                        PASSED        UNIT                         ACTIVATES
Fri 2020-12-11 16:07:17 CET 4h 14min left Fri 2020-12-11 11:07:04 CET 45min ago     my-rsync.timer               my-rsync.service
Sat 2020-12-12 00:00:00 CET 12h left      Fri 2020-12-11 00:00:00 CET 11h ago       logrotate.timer              logrotate.service
Sat 2020-12-12 00:00:00 CET 12h left      Fri 2020-12-11 00:00:00 CET 11h ago       man-db.timer                 man-db.service
Sat 2020-12-12 00:00:00 CET 12h left      Fri 2020-12-11 00:00:00 CET 11h ago       shadow.timer                 shadow.service
Sat 2020-12-12 10:52:04 CET 22h left      Fri 2020-12-11 10:52:04 CET 1h 0min ago   systemd-tmpfiles-clean.timer systemd-tmpfiles-clean.service
Mon 2020-12-14 01:07:22 CET 2 days left   Wed 2020-12-09 21:41:27 CET 1 day 14h ago fstrim.timer                 fstrim.service

6 timers listed.

seeing “pikaur-cache.timer” only as a result of the command you quoted (including the “–user” flag) and no other commands, i find this behavior very strange.

as @bennypr0fane stated, there seem to be some systemd services/timers/etc which require the “–user” flag to show up.
i cannot explain this behavior either.

The --user option is used to “Talk to the service manager of the calling user, rather than the service manager of the system.”

This is a very important difference.

The Output of

systemctl list-timers 

and

systemctl --user list-timers

shows the timers of two different systemd instances.

There are many differences between this two instances and of course both are separated. A main difference is that the system instance can start units for every user and the default is root. The systemd user instance can only start units as the user of this systemd user instance. Also this unit starts, if enabled, only after the user logs in. If a user logs out completely, all running units and timers are stopped and killed. The config files for units and timers are stored in different folders, but this is kind of obvious.

4 Likes

SystemdGenie --> graphical.