From owner-freebsd-questions@FreeBSD.ORG Fri Aug 22 13:29:04 2008 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5B5631065676 for ; Fri, 22 Aug 2008 13:29:04 +0000 (UTC) (envelope-from wojtek@wojtek.tensor.gdynia.pl) Received: from wojtek.tensor.gdynia.pl (wojtek.tensor.gdynia.pl [IPv6:2001:4070:101:2::1]) by mx1.freebsd.org (Postfix) with ESMTP id 47AF48FC27 for ; Fri, 22 Aug 2008 13:29:02 +0000 (UTC) (envelope-from wojtek@wojtek.tensor.gdynia.pl) Received: from wojtek.tensor.gdynia.pl (localhost [IPv6:::1]) by wojtek.tensor.gdynia.pl (8.14.2/8.14.2) with ESMTP id m7MDStgr035197; Fri, 22 Aug 2008 15:28:55 +0200 (CEST) (envelope-from wojtek@wojtek.tensor.gdynia.pl) Received: from localhost (wojtek@localhost) by wojtek.tensor.gdynia.pl (8.14.2/8.14.2/Submit) with ESMTP id m7MDSrs9035194; Fri, 22 Aug 2008 15:28:55 +0200 (CEST) (envelope-from wojtek@wojtek.tensor.gdynia.pl) Date: Fri, 22 Aug 2008 15:28:53 +0200 (CEST) From: Wojciech Puchar To: Chuck Swiger In-Reply-To: <7C5EDEE9-0577-45D1-9982-3850AC1A1E12@mac.com> Message-ID: <20080822152455.D35191@wojtek.tensor.gdynia.pl> References: <20080821230022.W3189@wojtek.tensor.gdynia.pl> <7C5EDEE9-0577-45D1-9982-3850AC1A1E12@mac.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: freebsd-questions@freebsd.org Subject: Re: rtprio + su - doesn't work X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Aug 2008 13:29:04 -0000 >> 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