Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 22 Aug 2008 10:03:57 -0700
From:      Chuck Swiger <cswiger@mac.com>
To:        Wojciech Puchar <wojtek@wojtek.tensor.gdynia.pl>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: rtprio + su - doesn't work
Message-ID:  <69AD26A6-BFB2-4502-AFA8-CA9D9DE7EE59@mac.com>
In-Reply-To: <20080822152455.D35191@wojtek.tensor.gdynia.pl>
References:  <20080821230022.W3189@wojtek.tensor.gdynia.pl> <7C5EDEE9-0577-45D1-9982-3850AC1A1E12@mac.com> <20080822152455.D35191@wojtek.tensor.gdynia.pl>

next in thread | previous in thread | raw e-mail | index | archive | help
On Aug 22, 2008, at 6:28 AM, Wojciech Puchar wrote:
>>> 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?

That's right.  RT priority isn't inherited by children processes, or  
so it seems.

[ ... ]
>>> 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

Very few people do anything with RT priorities, in part because Unix  
was designed to maximize workload throughput originally in a batch- 
processing context.  People who need hard realtime tend to use more  
specialized systems and hardware designed for realtime tasks (ie,  
bounded interrupt service times and the like)...

-- 
-Chuck




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?69AD26A6-BFB2-4502-AFA8-CA9D9DE7EE59>