[systemd-devel] devilspie2 user service issues

Matt Zagrabelny mzagrabe at d.umn.edu
Tue Aug 6 20:13:54 UTC 2019


Thanks for the reply, Mantas!

On Tue, Aug 6, 2019 at 2:24 PM Mantas Mikulėnas <grawity at gmail.com> wrote:

> 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).
>

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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/systemd-devel/attachments/20190806/78ccf489/attachment.html>


More information about the systemd-devel mailing list