Date: Fri, 22 Aug 2008 15:28:53 +0200 (CEST) From: Wojciech Puchar <wojtek@wojtek.tensor.gdynia.pl> To: Chuck Swiger <cswiger@mac.com> Cc: freebsd-questions@freebsd.org Subject: Re: rtprio + su - doesn't work Message-ID: <20080822152455.D35191@wojtek.tensor.gdynia.pl> In-Reply-To: <7C5EDEE9-0577-45D1-9982-3850AC1A1E12@mac.com> References: <20080821230022.W3189@wojtek.tensor.gdynia.pl> <7C5EDEE9-0577-45D1-9982-3850AC1A1E12@mac.com>
next in thread | previous in thread | raw e-mail | index | archive | help
>> 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20080822152455.D35191>