1
0
mirror of https://github.com/systemd/systemd.git synced 2024-12-23 21:35:11 +03:00
systemd/test/testsuite-03.units/fails-on-restart-restartdirect.service
Richard Phibel e568fea9fc service: add new RestartMode option
When this option is set to direct, the service restarts without entering a failed
state. Dependent units are not notified of transitory failure.

This is useful for the following use case:

We have a target with Requires=my-service, After=my-service.
my-service.service is a oneshot service and has Restart=on-failure in
its definition.

my-service.service can get stuck for various reasons and time out, in
which case it is restarted. Currently, when it fails the first time, the
target fails, even though my-service is restarted.

The behavior we're looking for is that until my-service is not restarted
anymore, the target stays pending waiting for my-service.service to
start successfully or fail without being restarted anymore.
2023-07-06 14:33:52 +02:00

12 lines
201 B
Desktop File

# SPDX-License-Identifier: LGPL-2.1-or-later
[Unit]
Description=Fail on restart
StartLimitIntervalSec=1m
StartLimitBurst=3
[Service]
Type=oneshot
ExecStart=false
Restart=on-failure
RestartMode=direct