Purge /dev/shm when we start the stack up
This makes it so restarting the service to pick up a config change just
works even if the shm files change size. There are no real good use
cases for preserving messages in the queues across a full stack restart.
Change-Id: I8b40463c466736f867fab7facf29929d9bc73fda
Signed-off-by: Austin Schuh <austin.linux@gmail.com>
diff --git a/aos/starter/starter.sh b/aos/starter/starter.sh
index 2db812a..7a25fc7 100755
--- a/aos/starter/starter.sh
+++ b/aos/starter/starter.sh
@@ -10,6 +10,7 @@
elif [[ "$(hostname)" == "pi-"* ]]; then
# We have systemd configured to handle restarting, so just exec.
export PATH="${PATH}:/home/pi/robot_code"
+ rm -rf /dev/shm/aos
exec starterd
else
ROBOT_CODE="${HOME}/robot_code"
@@ -18,5 +19,6 @@
cd "${ROBOT_CODE}"
export PATH="${PATH}:${ROBOT_CODE}"
while true; do
- starterd 2>&1
+ rm -rf /dev/shm/aos
+ starterd 2>&1
done