Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 21 Aug 2008 17:28:21 -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:  <7C5EDEE9-0577-45D1-9982-3850AC1A1E12@mac.com>
In-Reply-To: <20080821230022.W3189@wojtek.tensor.gdynia.pl>
References:  <20080821230022.W3189@wojtek.tensor.gdynia.pl>

next in thread | previous in thread | raw e-mail | index | archive | help
On Aug 21, 2008, at 2:04 PM, Wojciech Puchar wrote:
> i run such command
>
> /usr/sbin/rtprio 31 /usr/bin/su centrala -c \
> "/usr/local/bin/asterisk -C /centrala/etc/asterisk.conf"
>
> 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.  :-)

> 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`

-- 
-Chuck




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?7C5EDEE9-0577-45D1-9982-3850AC1A1E12>