Am 22.12.20 um 14:17 schrieb Mantas Mikulėnas:
As a special case, when a target has Wants= for some unit, it will
automatically add an After= as well. (So from your unit's point of view,
you have [Install] WantedBy=network-online.target, so you can imagine
that you automatically have a
Am 22.12.20 um 12:17 schrieb Ronald Wimmer:
On a server running OL 7.9 with SystemD 219 we have a custom SystemD
service we have something like
[Unit]
Requires=network.target docker.service
[Service]
Restart=always
RestartSec=10
TimeoutSec=300
WorkingDirectory=/data/someapplication
In addition to what Mantas said, I'd suggest reading man systemd.special.
and https://www.freedesktop.org/wiki/Software/systemd/NetworkTarget/
This should give you an idea what network-online.target is supposed to be.
It's not a target to hook arbitrary services into (via WantedBy).
Your service
On Tue, Dec 22, 2020 at 1:36 PM Ronald Wimmer wrote:
> On a server running OL 7.9 with SystemD 219 we have a custom SystemD
> service we have something like
>
>
> [Unit]
> Requires=network.target docker.service
>
> [Service]
> Restart=always
> RestartSec=10
> TimeoutSec=300
>