Browse Source

Restart batman daemon on failure

Bob Mottram 8 years ago
parent
commit
6863f6413b
1 changed files with 5 additions and 1 deletions
  1. 5
    1
      src/freedombone-image-customise

+ 5
- 1
src/freedombone-image-customise View File

@@ -551,12 +551,16 @@ function mesh_batman {
551 551
 	BATMAN_DAEMON=$rootdir/etc/systemd/system/batman.service
552 552
 	echo '[Unit]' > $BATMAN_DAEMON
553 553
 	echo 'Description=B.A.T.M.A.N. Advanced' >> $BATMAN_DAEMON
554
+	echo 'After=network.target' >> $BATMAN_DAEMON
554 555
 	echo '' >> $BATMAN_DAEMON
555 556
 	echo '[Service]' >> $BATMAN_DAEMON
556 557
 	echo 'Type=oneshot' >> $BATMAN_DAEMON
558
+	echo 'RemainAfterExit=yes' >> $BATMAN_DAEMON
557 559
 	echo "ExecStart=/var/lib/batman start" >> $BATMAN_DAEMON
558 560
 	echo "ExecStop=/var/lib/batman stop" >> $BATMAN_DAEMON
559
-	echo 'RemainAfterExit=yes' >> $BATMAN_DAEMON
561
+	echo 'Restart=on-failure' >> $BATMAN_DAEMON
562
+	echo 'SuccessExitStatus=3 4' >> $BATMAN_DAEMON
563
+	echo 'RestartForceExitStatus=3 4' >> $BATMAN_DAEMON
560 564
 	echo '' >> $BATMAN_DAEMON
561 565
 	echo '# Allow time for the server to start/stop' >> $BATMAN_DAEMON
562 566
 	echo 'TimeoutSec=300' >> $BATMAN_DAEMON