From owner-freebsd-questions@FreeBSD.ORG Fri Aug 22 17:04:05 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 DCB7F1065688 for ; Fri, 22 Aug 2008 17:04:05 +0000 (UTC) (envelope-from cswiger@mac.com) Received: from asmtpout021.mac.com (asmtpout021.mac.com [17.148.16.96]) by mx1.freebsd.org (Postfix) with ESMTP id C9CB78FC0C for ; Fri, 22 Aug 2008 17:04:05 +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 asmtp021.mac.com (Sun Java(tm) System Messaging Server 6.3-7.03 (built Aug 7 2008; 32bit)) with ESMTPSA id <0K6000GHXI2L8680@asmtp021.mac.com> for freebsd-questions@freebsd.org; Fri, 22 Aug 2008 10:03:58 -0700 (PDT) Message-id: <69AD26A6-BFB2-4502-AFA8-CA9D9DE7EE59@mac.com> From: Chuck Swiger To: Wojciech Puchar In-reply-to: <20080822152455.D35191@wojtek.tensor.gdynia.pl> Date: Fri, 22 Aug 2008 10:03:57 -0700 References: <20080821230022.W3189@wojtek.tensor.gdynia.pl> <7C5EDEE9-0577-45D1-9982-3850AC1A1E12@mac.com> <20080822152455.D35191@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 17:04:06 -0000 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