3

TLDR:

How to have an /etc/xdg/autostart/app.desktop service wait for a systemd service?

Long:

I have an app started by /etc/xdg/autostart/app.desktop that requires a systemd service to be started first.

I would like to avoid some sleep/wait/custom code if there is an existing tool for such purposes.

Is there some kind of wait_for_service_to_be_running <service-name> (systemd) command line tool?

1 Answer 1

-1

Create yourservice.service file, place it into /etc/systemd/system/ and run systemctl start yourservice by your .desktop file.

[Unit]
Requires=somesystemd.service
After=somesystemd.service

[Service]
ExecStart=/path/to/yourservice

Or you can replace app.desktop with systemd configuration. Create replacement.service as above with additional section:

[Install]
WantedBy=multi-user.target

Then run it with systemctl enable replacement.service.

Systemd service - what is `multi-user.target` can give more details.

4

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .