Zotero is a reference manager and it comes with a WebExtension for browsers to make some tasks easier. The extension communicates with the main program through HTTP and this means that zotero must run at all times for this to work.

This also means that every time I log in I have to start zotero or be friendly reminded that ``zotero is not running’’. Through some poking around I found out that zotero is just a very customized Firefox and it support headless mode so I can run the zotero app without showing a window.

This means I can start it as soon as I log in using a systemd user service if I pass it the correct flags to the command. A systemctl --user enable --now zotero.service later I finally don’t have to think about zotero any more because it will always be there in the background.

The only issue is that now launching the GUI will complain that ``zotero is already running’’ but I will take that over the alternative.

As a reference for those like me here is my full systemd unit definition. It is placed at ~/.config/systemd/user/zotero.service so that systemd may pick it up as a user service and it is managed through the same set of service commands. You can start, stop, enable, status, reload it but it’s just for some rare moments.

As with all service units enable should be called with --now to actually start it now and not at the next login and you should make this unit WantedBy the default target so that systemd will start it when you log in.

# ~/.config/systemd/user/zotero.service
[Unit]
Description=Run zotero in background

[Service]
# instead of calling /opt/zotero/zotero we can provide our
# options for starting a headless process
ExecStart=/opt/zotero/zotero-bin -app /opt/zotero/application.ini --headless

[Install]
# actually starts this service when I log in
WantedBy=default.target