diff --git a/src/main/groovy/edu/wpi/first/gradlerio/frc/FRCNativeArtifact.groovy b/src/main/groovy/edu/wpi/first/gradlerio/frc/FRCNativeArtifact.groovy index 326e8b92..81e4a179 100644 --- a/src/main/groovy/edu/wpi/first/gradlerio/frc/FRCNativeArtifact.groovy +++ b/src/main/groovy/edu/wpi/first/gradlerio/frc/FRCNativeArtifact.groovy @@ -40,6 +40,10 @@ class FRCNativeArtifact extends NativeArtifact { def binFile = PathUtils.combine(ctx.workingDir, filename ?: file.get().name) ctx.execute("chmod +x /home/lvuser/robotCommand; chown lvuser /home/lvuser/robotCommand") ctx.execute("chmod +x \"${binFile}\"; chown lvuser \"${binFile}\"") + // Let user program set RT thread priorities by making CAP_SYS_NICE + // permitted, inheritable, and effective. See "man 7 capabilities" + // for docs on capabilities and file capability sets. + ctx.execute("setcap cap_sys_nice+eip \"${binFile}\"") ctx.execute("sync") ctx.execute("ldconfig") ctx.execute(". /etc/profile.d/natinst-path.sh; /usr/local/frc/bin/frcKillRobot.sh -t -r 2> /dev/null")