I have a linux application which loads *.so libraries using a modified rpath
(set during installation). It also needs to run with realtime priority.
To get realtime priority it does this:
sched_param sched;
sched.sched_priority = 70;
sched_setscheduler(getpid(), SCHED_FIFO, &sched);
However sched_setscheduler
is a privilaged method, protected by the CAP_SYS_NICE
capability. Therefore, to get realtime priority without running as root, I add setcap
to my postinst
:
setcap cap_sys_nice+ep /path/to/myapp
However, linux decides that programs should not be allowed to load libraries from rpath
if they have extra capabilities.
Is there a way for me to set my own priority and load rpath libraries?
Note: I'd prefer to do this in the application or in the postinst
. I'd like to avoid deploying scripts as the only way to launch the application. I know sudo chrt -f -p 70 $!
could do it from a script.