rtprio + su - doesn't work

Wojciech Puchar wojtek at wojtek.tensor.gdynia.pl
Fri Aug 22 13:29:04 UTC 2008


>> tu run (at startup) asterisk PBX as user centrala with realtime priority.
>> 
>> asterisk is started, but without realtime priority.
>
> Yes, you'd be running the su process with realtime priority.  :-)

and su forks shell and asterisk - isn't it?

>
>> how to do this right?
>> 
>> i run asterisk as user (not root), but this server is used to other things, 
>> so asterisk must have absolute priority over other things.
>> now i have to do this manually by searching for asterisk's PID and doing
>
>> 
>> rtprio 31 -PID
>
> Well, you have to run rtprio as root, or else make it setuid-root (which 
> probably isn't a great idea).  Presumably this thing has a startup script 
> which runs it, and it probably creates a PID file under /var/run which you 
> could use to adjust the priority during system startup via:
>
> rtprio 31 -`cat /var/run/asterix.pid`

did this

/usr/bin/su centrala -c \
"/usr/local/sbin/asterisk -C /centrala/etc/asterisk.conf"
/bin/sleep 5
/usr/sbin/rtprio 31 -`cat /centrala/run/asterisk.pid`


works fine, but looks like workaround for me not proper solution?
am i wrong? thank you for explanation why it doesn't work directly

 						Wojtek


More information about the freebsd-questions mailing list