You'll find that the service will start automatically without linger on
a qube boot.
You can make it start just a little earlier by writing the linger file
from rc.local.
So in rc.local
mkdir -p /var/lib/systemd/linger
touch /var/lib/systemd/linger/user
With a simple logging service, and comparing against journalctl output
it looks as if the service starts just a little earlier:
Jun 07 02:04:46 tester dbus[459]: [system] Successfully activated service 'org.freedesktop.systemd1'
Jun 07 02:04:46 tester systemd[1]: Started Avahi mDNS/DNS-SD Stack.
Jun 07 02:04:46 tester systemd[1]: Started WPA supplicant.
Jun 07 02:04:46 tester systemd[1]: Started Make remote CUPS printers available locally.
Jun 07 02:04:46 tester systemd[1]: Starting IIO Sensor Proxy service...
Jun 07 02:04:46 tester systemd[1]: Starting Network Service...
Jun 07 02:04:46 tester systemd[1]: Starting Qubes remote exec agent...
Jun 07 02:04:46 tester systemd[1]: Started System Logging Service.
Jun 07 02:04:46 tester systemd[1]: Started Provide limited super user privileges to specific users.
Jun 07 02:04:46 tester systemd[1]: Started Qubes memory information reporter.
Jun 07 02:04:46 tester systemd[1]: Started Restore /etc/resolv.conf if the system crashed before the ppp link was shut down.
Jun 07 02:04:46 tester systemd[1]: Started Qubes base firewall settings.
Jun 07 02:04:46 tester systemd[1]: Started LSB: Start/stop xen driver domain daemon.
Jun 07 02:04:46 tester systemd[1]: Started Qubes remote exec agent.
Jun 07 02:04:46 tester systemd[1]: Started IIO Sensor Proxy service.
Jun 07 02:04:46 tester systemd-logind[451]: New seat seat0.
Jun 07 02:04:46 tester systemd-networkd[492]: Enumeration completed
Jun 07 02:04:46 tester systemd[1]: Starting Daily apt activities...
Jun 07 02:04:46 tester systemd[1]: Started Network Service.
Jun 07 02:04:46 tester systemd[1]: Started Login Service.
Jun 07 02:04:46 tester systemd[1]: Reached target Network.
Jun 07 02:04:46 tester systemd[1]: Starting Permit User Sessions...
Jun 07 02:04:46 tester systemd[1]: Starting Network Name Resolution...
Jun 07 02:04:46 tester systemd[1]: Started Permit User Sessions. ***STARTS HERE WITH LINGER????***
Jun 07 02:04:46 tester systemd-resolved[504]: Positive Trust Anchors:
Jun 07 02:04:46 tester systemd-resolved[504]: . IN DS 19036 8 2 49aac11d7b6f6446702e54a1607371607a1a41855200fd2ce1cdde32f24e8fb5
Jun 07 02:04:46 tester systemd-resolved[504]: Negative trust anchors: 10.in-addr.arpa 16.172.in-addr.arpa 17.172.in-addr.arpa 18.172.in-addr.a
Jun 07 02:04:46 tester systemd-resolved[504]: Using system hostname 'tester'.
Jun 07 02:04:46 tester systemd-resolved[504]: Switching to system DNS server 10.137.3.1.
Jun 07 02:04:46 tester systemd[1]: Started Network Name Resolution.
Jun 07 02:04:46 tester mount-dirs.sh[436]: tune2fs 1.43 (17-May-2016)
Jun 07 02:04:46 tester mount-dirs.sh[436]: Setting reserved blocks percentage to 0% (0 blocks)
Jun 07 02:04:46 tester kernel: EXT4-fs (xvdb): mounted filesystem with ordered data mode. Opts: discard
Jun 07 02:04:46 tester systemd[1]: Started Initialize and mount /rw and /home.
Jun 07 02:04:46 tester systemd[1]: Starting Qubes GUI Agent...
Jun 07 02:04:46 tester systemd[1]: Starting Qubes misc post-boot actions...
Jun 07 02:04:46 tester systemd[1]: Started Qubes GUI Agent.
Jun 07 02:04:46 tester qubes-gui[554]: Waiting on /var/run/xf86-qubes-socket socket...
Jun 07 02:04:47 tester su[563]: Successful su for user by root ***STARTS HERE WITHOUT LINGER***
Jun 07 02:04:47 tester su[563]: + ??? root:user
Jun 07 02:04:47 tester su[563]: pam_unix(su:session): session opened for user user by (uid=0)
I havent compared this against a vanilla Debian system, but I wouldnt
have thought there would be much difference.
unman