Thanks for the reply, Mantas! On Tue, Aug 6, 2019 at 2:24 PM Mantas Mikulėnas <graw...@gmail.com> wrote:
> On Tue, Aug 6, 2019 at 10:08 PM Matt Zagrabelny <mzagr...@d.umn.edu> > wrote: > >> Greetings, >> >> I am trying to write a service file for a tool called devilspie2. >> >> % systemctl --user cat devilspie.service >> # /home/mzagrabe/.config/systemd/user/devilspie.service >> [Unit] >> Description=devilspie >> >> [Service] >> ExecStart=/usr/bin/devilspie2 >> >> [Install] >> WantedBy=default.target >> >> which I enabled via: >> >> % systemctl --user enable devilspie.service >> >> but it is not successfully starting on boot/login: >> > > >> It looks like devilspie2 does not successfully start under a user systemd >> instance due to "cannot open display". >> >> Since I log in via lightdm I am wondering what I am missing. >> > > > Well, "on boot/login" actually happens before the X display (Xorg) is > launched. Even without linger mode, the --user default.target is started > before the session processes themselves (it's done right after lightdm does > the password check, more or less); at that point in time --user doesn't > know your $DISPLAY or $XAUTHORITY yet, and there's no Xorg yet anyway – > there's no display to open. > > >> >> Any ideas or pointers on how to properly start devilspie2 under a user >> systemd instance? >> > > Remove it from default.target and place a `systemctl --user start > devilspie2` in your session's normal autostart files (e.g. > ~/.config/autostart/*.desktop for GNOME). > Sure. I'm using that right now. I thought it might be nice to just be able to have the distro provide the service file and then the users could: systemctl --user enable devilspie2 ...but if there is no service that devilspie2 can wait for, then the sessions "auto started" applications is an okay alternative. Thanks again! -m
_______________________________________________ systemd-devel mailing list systemd-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/systemd-devel