"espanso.service" Keeps Trying to Restart Even Though I Have Removed It

Preface

I tried to get Espanso working but unfortunately I wasn’t successful. So I decided to leave it for now and removed it from my configuration.nix and did nixos-rebuild. These were the Nix options that I removed almost a month ago now:

services.espanso.package = pkgs.espanso-wayland;
services.espanso.enable = true;

Problem

Though, recently I noticed in journalctl that espanso service has been trying to start over and over again. The following output keeps repeating:

$ journalctl --since "1 min ago"
Aug 16 10:14:39 nixos systemd[2032]: Started espanso.
Aug 16 10:14:39 nixos (-wrapped)[92462]: espanso.service: Unable to locate executable '/nix/store/nzzpjb14gqk4q24dgv>
Aug 16 10:14:39 nixos (-wrapped)[92462]: espanso.service: Failed at step EXEC spawning /nix/store/nzzpjb14gqk4q24dgv>
Aug 16 10:14:39 nixos systemd[2032]: espanso.service: Main process exited, code=exited, status=203/EXEC
Aug 16 10:14:39 nixos systemd[2032]: espanso.service: Failed with result 'exit-code'.
Aug 16 10:14:42 nixos systemd[2032]: espanso.service: Scheduled restart job, restart counter is at 3584.

how can this be possible? didn’t I remove the service from my system when I removed it from my configuration.nix and did nixos-rebuild? How can I stop and remove espanso.service?

Other Information

I tried to see if the “espanso.service” is running in my system but it wasn’t. so I am not sure how the service could be running?:

$ systemctl --type=service --state=running
  UNIT                          LOAD   ACTIVE SUB     DESCRIPTION                                       
  accounts-daemon.service       loaded active running Accounts Service
  acpid.service                 loaded active running ACPI Daemon
  avahi-daemon.service          loaded active running Avahi mDNS/DNS-SD Stack
  UNIT                          LOAD   ACTIVE SUB     DESCRIPTION                                       
  accounts-daemon.service       loaded active running Accounts Service
  acpid.service                 loaded active running ACPI Daemon
  avahi-daemon.service          loaded active running Avahi mDNS/DNS-SD Stack
  bluetooth.service             loaded active running Bluetooth service
  bolt.service                  loaded active running Thunderbolt system service
  colord.service                loaded active running Manage, Install and Generate Color Profiles
  cups-browsed.service          loaded active running CUPS Remote Printer Discovery
  cups.service                  loaded active running CUPS Scheduler
  dbus.service                  loaded active running D-Bus System Message Bus
  display-manager.service       loaded active running Display Manager
  getty@tty1.service            loaded active running Getty on tty1
  ModemManager.service          loaded active running Modem Manager
  NetworkManager.service        loaded active running Network Manager
  nix-daemon.service            loaded active running Nix Daemon
  nscd.service                  loaded active running Name Service Cache Daemon (nsncd)
  polkit.service                loaded active running Authorization Manager
  power-profiles-daemon.service loaded active running Power Profiles daemon
  rtkit-daemon.service          loaded active running RealtimeKit Scheduling Policy Service
  systemd-journald.service      loaded active running Journal Service
  systemd-logind.service        loaded active running User Login Management
  systemd-machined.service      loaded active running Virtual Machine and Container Registration Service
  systemd-oomd.service          loaded active running Userspace Out-Of-Memory (OOM) Killer
  systemd-timesyncd.service     loaded active running Network Time Synchronization
  systemd-udevd.service         loaded active running Rule-based Manager for Device Events and Files
  udisks2.service               loaded active running Disk Manager
  upower.service                loaded active running Daemon for power management
  user@1000.service             loaded active running User Manager for UID 1000
  waydroid-container.service    loaded active running Waydroid Container
  wpa_supplicant.service        loaded active running WPA supplicant

Is your system time correct?

yup, I just checked it and it is correct~

It may be installed as a user service, which you would find in ~/.config/systemd, since espanso allows for generating and installing its own user service from the CLI. You can also check if it’s a user service by running systemctl --user and seeing if it appears in that list.

2 Likes

nixos-rebuild what?

I use flakes so this is what I use for building my system~

$ sudo nixos-rebuild switch --flake .

Thank you! That solved it!

# your command shows espanso.service is running
$ systemctl --user | grep espanso
  espanso.service                               loaded active running espanso

# Showing status of the espanso.service
$ systemctl --user status espanso.service
● espanso.service - espanso
     Loaded: loaded (/home/abdulla/.config/systemd/user/espanso.service; enabled; preset: enabled)
     Active: activating (auto-restart) (Result: exit-code) since Sat 2024-08-17 09:23:29 +03; 1s ago
 Invocation: 60e1be64190e4f998e02fa799b04d399
    Process: 47322 ExecStart=/nix/store/nzzpjb14gqk4q24dgv9025z28cfwyids-espanso-2.2-unstable-2024-05-14/bin/.espans>
   Main PID: 47322 (code=exited, status=203/EXEC)
   Mem peak: 1.4M
        CPU: 9ms

# Stopping and disabling the espanso.service
$ systemctl --user stop espanso.service
$ systemctl --user disable espanso.service
Removed '/home/abdulla/.config/systemd/user/default.target.wants/espanso.service'.

After that I just removed the espanso.service file from ~/.config/systemd/user as you mentioned.

And checking the journalctl --since "1 min ago" and no messages espanso.service appears! Thank you @pyrox !

By the way, did I take the right steps? or maybe some redundant steps?

2 Likes

I don’t see any redundant steps, those would be the ones I would have taken! Glad to have helped!

1 Like