On Sun, Jun 05, 2016 at 03:36:22PM +0000, Patrick Schleizer wrote: > Unman: > > On Sat, Jun 04, 2016 at 01:17:03PM +0000, Patrick Schleizer wrote: > >> Using Debian templates? Then I don't think anyone on the internet > >> explained yet how to do that or there might be a bug in Debian. Bug report: > >> > >> https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=820111 > >> > >> Cheers, > >> Patrick > >> > > This works for me: > > > > loginctrl enable-linger user > > I guess you mean loginctl not loginctrl. > > What this command does is apparently doing is creating an empty file: > /var/lib/systemd/linger/user > > This is not great in context of Qubes, since that file is in /var and > not persistent by default in TemplateBasedVMs. > > Do you think this can be configured using a proper config file also? > > Apart from this, thanks a lot, it works for me also! > > Cheers, > Patrick > > > Drop the service file in .config/systemd/user > > > > systemctl --user enable foo > > ` > > In your service file in the [Install] section: > > WantedBy=default.target works fine. > > > > See if that works for you. > > > > unman > > >
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 -- You received this message because you are subscribed to the Google Groups "qubes-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/qubes-users/20160607013233.GA27041%40thirdeyesecurity.org. For more options, visit https://groups.google.com/d/optout.
