Start irq_affinity and run starterd as root
irq_affinity needs to run as root, but all our software needs to run as
the pi. Setup starter to run as root, and then have it start everything
as the pi user.
Change-Id: I2d09c33345f125ba47bf8d89b921ef5b45aa2826
Signed-off-by: Austin Schuh <austin.linux@gmail.com>
diff --git a/aos/starter/starter.sh b/aos/starter/starter.sh
index 9bc7605..d4281c5 100755
--- a/aos/starter/starter.sh
+++ b/aos/starter/starter.sh
@@ -14,7 +14,7 @@
# We have systemd configured to handle restarting, so just exec.
export PATH="${PATH}:/home/pi/bin"
rm -rf /dev/shm/aos
- exec starterd
+ exec starterd --user=pi
else
ROBOT_CODE="${HOME}/bin"
fi
diff --git a/aos/starter/starterd.cc b/aos/starter/starterd.cc
index f284819..54f1bb4 100644
--- a/aos/starter/starterd.cc
+++ b/aos/starter/starterd.cc
@@ -31,7 +31,7 @@
constexpr int kUnchanged = -1;
if (setresgid(/* ruid */ gid, /* euid */ gid,
/* suid */ kUnchanged) != 0) {
- PLOG(FATAL) << "Failed to change GID to " << FLAGS_user;
+ PLOG(FATAL) << "Failed to change GID to " << FLAGS_user << ", group " << gid;
}
if (setresuid(/* ruid */ uid, /* euid */ uid,