From owner-freebsd-questions@FreeBSD.ORG Tue Nov 16 15:56:34 2004 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id DC90D16A4CE for ; Tue, 16 Nov 2004 15:56:34 +0000 (GMT) Received: from dan.emsphone.com (dan.emsphone.com [199.67.51.101]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8781C43D49 for ; Tue, 16 Nov 2004 15:56:34 +0000 (GMT) (envelope-from dan@dan.emsphone.com) Received: (from dan@localhost) by dan.emsphone.com (8.13.1/8.13.1) id iAGFuXIk032305 for freebsd-questions@freebsd.org; Tue, 16 Nov 2004 09:56:33 -0600 (CST) (envelope-from dan) Date: Tue, 16 Nov 2004 09:56:33 -0600 From: Dan Nelson To: freebsd-questions@freebsd.org Message-ID: <20041116155632.GD80412@dan.emsphone.com> References: <20041116144450.GA70461@weller-fahy.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20041116144450.GA70461@weller-fahy.com> X-OS: FreeBSD 5.3-STABLE X-message-flag: Outlook Error User-Agent: Mutt/1.5.6i Subject: Re: Question about nice X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Nov 2004 15:56:35 -0000 In the last episode (Nov 16), David J. Weller-Fahy said: > I've set a very few commands as NOPASSWD in sudo, and run them from > my normal user's crontab. I've seen some examples of crontab's that > use nice, but none that use sudo and nice. That led me to a few > questions. All paths have been stripped stripped - sudo and isoqlog > are in > /usr/local/bin, nice is in /usr/bin. > > 1. I understand nice is useful if you need to run a program at a > certain priority. Is nice useful when not passing a priority? If > so, what is the difference between the following two commands (in > terms of priority level)? > > nice isoqlog > isoqlog man nice: The nice utility runs utility at an altered scheduling priority, by incrementing its `nice'' value by the specified increment, or a default value of 10. > 2. If it is useful to run nice without passing a priority, then are > the following two commands equivalent? If not, which one would be > preferred and why? > > nice sudo isoqlog > sudo nice isoqlog > > I've been reading a bit, but haven't found a definite answer yet. My > feeling is that the answer to number one (first portion) is no, and > thus the answer to number 2 (first portion) is no. I'd be happy to be > proven wrong, though. ;] The first may take longer to execute on a busy machine, since sudo itself is running at a lower priority. The 2nd may be a security hazard, depending on whether you allowed "nice isoqlog" or just "nice" (with any command) in your sudo config file. -- Dan Nelson dnelson@allantgroup.com