[systemd-devel] devilspie2 user service issues

Mantas Mikulėnas grawity at gmail.com
Tue Aug 6 19:23:57 UTC 2019


On Tue, Aug 6, 2019 at 10:08 PM Matt Zagrabelny <mzagrabe at 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).

-- 
Mantas Mikulėnas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/systemd-devel/attachments/20190806/3e4d35bd/attachment-0001.html>


More information about the systemd-devel mailing list