Behavior of RestartSec= & Restart= parameters

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

 

I had a query on RestartSec= & Restart= parameters and how they work with StartLimitInterval= & StartLimitBurst= parameters.

 

I have a socket-service pair (say test.socket & test.service)

 

test.socket

[Unit]

Description=Test socket

 

[Socket]

ListenDatagram=123

Accept=No

 

[Install]

WantedBy=sockets.target

 

test.service

[Unit]

Description=test service

Requires=test.socket

 

[Service]

Type=simple

ExecStart=/bin/mytest

StandardInput=socket

 

[Install]

WantedBy=multi-user.target

 

 

I see that the test.socket fails with following error,

systemd[1]: test.service: Start request repeated too quickly.

systemd[1]: test.service: Failed with result 'exit-code'.

systemd[1]: Failed to start test service.

systemd[1]: test.socket: Failed with result 'service-start-limit-hit'.

 

The test.socket fails after trying to start test.service for 5 times.

I think this this is due to the default values of StartLimitInterval= & StartLimitBurst= which are 10sec and 5 respectively.

The test.service restart is attempted even though there is no “Restart=” parameter is specified in the file.

So, this means StartLimitInterval= & StartLimitBurst= are not dependent on “Restart=” parameter? Is my understanding correct ?

 

Is there a way to add a delay before attempting to restart the service without specifying “Restart=” parameter?

As per my understanding “RestartSec=” works only when “Restart=” parameter is set to some value.

 

Thanks & Regards,

Hari.

 

 

 

 

 

_______________________________________________
systemd-devel mailing list
systemd-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/systemd-devel

[Index of Archives]     [LARTC]     [Bugtraq]     [Yosemite Forum]     [Photo]

  Powered by Linux