Add restart-on-failure in service file 26/192726/3
authorPaweł Szewczyk <p.szewczyk@samsung.com>
Thu, 8 Nov 2018 17:22:52 +0000 (18:22 +0100)
committerPaweł Szewczyk <p.szewczyk@samsung.com>
Thu, 15 Nov 2018 16:29:08 +0000 (17:29 +0100)
To prevent socket from closing functionfs endpoints descriptors, the
service should not fail definitely. This patch make it restart on its
own on failure.
To prevent fast restarting in case of repeating failure, the delay is
added to the restart mechanism.

Change-Id: I3db100c6dda88a605f7fbb6e35dc8783cd4d4252
Signed-off-by: Paweł Szewczyk <p.szewczyk@samsung.com>
mtp-responder.service
mtp-responder.socket

index 69433c4..c8fae61 100755 (executable)
@@ -1,5 +1,6 @@
 [Unit]
 Description=MTP responder
+StartLimitIntervalSec=0
 
 [Service]
 User=network_fw
@@ -11,3 +12,5 @@ KillMode=process
 SmackProcessLabel=System
 USBFunctionDescriptors=/etc/mtp-responder/descs
 USBFunctionStrings=/etc/mtp-responder/strs
+RestartSec=3
+Restart=on-failure
index e430830..c5e9d1c 100755 (executable)
@@ -4,3 +4,4 @@ Description=MTP responder functionfs socket
 [Socket]
 ListenUSBFunction=/dev/usb-funcs/mtp/default
 Service=mtp-responder.service
+TriggerLimitIntervalSec=0