TLDR:
How to have a /etc/xdg/autostart/app.desktop service wait for a systemd service?
Long:
qubes-whonix-firewall.service runs enable-firewall and conditionally creates the /var/run/qubes-service/whonix-secure-proxy status file.
/etc/xdg/autostart/qubes-whonixsetup.desktop runs /usr/lib/qubes-whonix/qubes-whonixsetup. Sometimes /etc/xdg/autostart/qubes-whonixsetup.desktop runs faster than qubes-whonix-firewall.service. The status file does not exist at that point, which results in an "This TemplateVM needs a Whonix-Gateway NetVM" error popup.
I would like to avoid some sleep/wait/custom code if there is an existing tool for such purposes.
References:
- https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=820111
- https://github.com/systemd/systemd/issues/3513
- https://lists.freedesktop.org/archives/systemd-devel/2016-June/036923.html
- https://groups.google.com/d/msg/qubes-users/Verq_0ceE04/rRqEiYrzPwAJ
- https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=764678
- https://lists.freedesktop.org/archives/systemd-devel/2017-February/038361.html
- https://lists.freedesktop.org/archives/systemd-devel/2017-February/038361.html
- https://github.com/systemd/systemd/issues/5462
- https://lists.freedesktop.org/archives/systemd-devel/2017-February/038365.html
- https://github.com/systemd/systemd/issues/5481
A systemd --user instance knows nothing about the systemd --system instance. I.e. a systemd --user instance cannot reference After=some-system.service. Source:
https://lists.freedesktop.org/archives/systemd-devel/2017-February/038361.html
So we cannot use qubes-whonixsetup.service After=qubes-gui-agent.service.
systemd feature request - systemd --user instance ability to reference systemd --system services with After= etc.:
https://github.com/systemd/systemd/issues/5462