From owner-freebsd-questions@FreeBSD.ORG Fri Dec 7 10:34:52 2012 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 36D1078D for ; Fri, 7 Dec 2012 10:34:52 +0000 (UTC) (envelope-from vagner@bsdway.ru) Received: from bsdway.ru (bsdway.ru [62.109.17.46]) by mx1.freebsd.org (Postfix) with ESMTP id A15B58FC0C for ; Fri, 7 Dec 2012 10:34:51 +0000 (UTC) Received: from localhost (off-40.addr.fotocdn.net [193.105.179.40]) (authenticated bits=0) by bsdway.ru (8.14.4/8.14.5) with ESMTP id qB7AYkfs005360 for ; Fri, 7 Dec 2012 13:34:47 +0300 (MSK) (envelope-from vagner@bsdway.ru) Date: Fri, 7 Dec 2012 14:34:46 +0400 From: Vagner To: freebsd-questions@freebsd.org Subject: Re: Login class and limit Message-ID: <20121207103446.GA26864@vagner-wrk.bsdway.ru> Mail-Followup-To: freebsd-questions@freebsd.org References: <20121206143201.GB42583@vagner-wrk.bsdway.ru> <37A52274-D877-4AED-82F3-CF058DEC9DBE@mac.com> <20121206203638.GA4540@vagner-wrk.bsdway.ru> <444njy6bna.fsf@lowell-desk.lan> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <444njy6bna.fsf@lowell-desk.lan> User-Agent: Mutt/1.5.21 (2010-09-15) X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bsdway.ru [62.109.17.46]); Fri, 07 Dec 2012 13:34:48 +0300 (MSK) X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Dec 2012 10:34:52 -0000 On 17:47 Thu 06 Dec , Lowell Gilbert wrote: > Vagner writes: > > > On 06:53 Thu 06 Dec , Charles Swiger wrote: > > >> "su -", "su -l", and "sudo -i" provide a login shell, which gets the > >> limits setup by login.conf. Normally daemons are started at boot > >> via rc mechanism (or perhaps get spawned from inetd) and do not > >> have a login shell associated with them to setup the limits. > >> > >> Either use one of the su/sudo flavors I mention above, or "/bin/sh -l" > >> to provide a login env to the process? > > > > ie means to implement restrictions limits(1) and login.conf(5) for daemons is not possible? > > It's possible, but you would have to use a login shell, which is usually > inconvenient for a daemon (not having an attached terminal for I/O). > > The usual way to do this is to start the daemon in a script that > explicitly sets the limits with /usr/bin/limits (or maybe ulimit, but > limits(1) seems more common). Several ports do this, for example. > Thx for all! I try starting daemon with explicitly sets from rc script. Thanks again! -- Respectfully, Stanislav Putrya System administrator FotoStrana.Ru Ltd. ICQ IM: 328585847 Jabber-GoogleTalk: root.vagner mob.phone SPB: +79215788755 mob.phone RND: +79525600664 email: vagner@bsdway.ru email: putrya@playform.ru email: root.vagner@gmail.com site: bsdway.ru site: fotostrana.ru ---------------------------------------- ( ) ASCII ribbon campaign X - against HTML, vCards and / \ - proprietary attachments in e-mail