Make starter restart correctly on pi's
This configures systemd much better so it automatically restarts and
gets the kill signals right.
Change-Id: I43576758f1b137ca24ad1ee960dd8715143aa7e6
Signed-off-by: Austin Schuh <austin.linux@gmail.com>
diff --git a/y2020/vision/rootfs/frc971.service b/y2020/vision/rootfs/frc971.service
index bf42652..e7b8d7c 100644
--- a/y2020/vision/rootfs/frc971.service
+++ b/y2020/vision/rootfs/frc971.service
@@ -2,8 +2,16 @@
Description=Start up 971 robot code
[Service]
-Type=oneshot
-ExecStart=su pi -c /home/pi/robot_code/starter.sh
+User=pi
+Group=pi
+Type=simple
+WorkingDirectory=/home/pi/robot_code
+ExecStart=/home/pi/robot_code/starter.sh
+KillMode=mixed
+TimeoutStopSec=10
+
+Restart=always
+RestartSec=5s
[Install]
WantedBy=multi-user.target