From owner-freebsd-questions@FreeBSD.ORG Fri Aug 22 00:28:22 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 48CDA1065671 for ; Fri, 22 Aug 2008 00:28:22 +0000 (UTC) (envelope-from cswiger@mac.com) Received: from asmtpout016.mac.com (asmtpout016.mac.com [17.148.16.91]) by mx1.freebsd.org (Postfix) with ESMTP id 338308FC28 for ; Fri, 22 Aug 2008 00:28:22 +0000 (UTC) (envelope-from cswiger@mac.com) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Received: from cswiger1.apple.com ([17.227.140.124]) by asmtp016.mac.com (Sun Java(tm) System Messaging Server 6.3-7.03 (built Aug 7 2008; 32bit)) with ESMTPSA id <0K5Z004KJ7Z94810@asmtp016.mac.com> for freebsd-questions@freebsd.org; Thu, 21 Aug 2008 17:28:22 -0700 (PDT) Message-id: <7C5EDEE9-0577-45D1-9982-3850AC1A1E12@mac.com> From: Chuck Swiger To: Wojciech Puchar In-reply-to: <20080821230022.W3189@wojtek.tensor.gdynia.pl> Date: Thu, 21 Aug 2008 17:28:21 -0700 References: <20080821230022.W3189@wojtek.tensor.gdynia.pl> X-Mailer: Apple Mail (2.928.1) 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 00:28:22 -0000 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