From owner-freebsd-hackers@FreeBSD.ORG Fri Oct 16 00:07:33 2009 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BB088106566B for ; Fri, 16 Oct 2009 00:07:33 +0000 (UTC) (envelope-from decado@gmail.com) Received: from mail-ew0-f218.google.com (mail-ew0-f218.google.com [209.85.219.218]) by mx1.freebsd.org (Postfix) with ESMTP id 4B5C98FC13 for ; Fri, 16 Oct 2009 00:07:32 +0000 (UTC) Received: by ewy18 with SMTP id 18so1367293ewy.43 for ; Thu, 15 Oct 2009 17:07:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:subject:references:in-reply-to :x-enigmail-version:content-type:content-transfer-encoding; bh=iMUa6F2NpZr0rFltqWMRWczbETR5pXbwEQeEhzJsWfA=; b=HeWhVZ3Ms2ls/fpv3pgJrsbNpd47bL/nuEpyvLMl+EPAGA3Xj3pRLrw9xuk3JThuyT vy/jBWhV/20rHtfVbzpSGCYsI6WTrgf5x2/4OBWc5fWcbWBaairGFM8PbVSYVT5qBsKu ipLHuZlFTQJAiZugbUVr2hTHguPCp1XcNK7is= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:x-enigmail-version:content-type :content-transfer-encoding; b=Zovjd6rjO3lHuhaPQ3+bUawL//W7BRnjQEriAv8cW/jxUk8t+6H6CIlQ2Myyeuaw6w S8Lyt5gXIrx4Xnw0yi02ei+wYnWQ/gr5dTTyGzJ9MNvvSiIewSaw6Uf1iU9fulWEvd9+ ponPlU7GzJftEZIzcnbKFPhb0xPMjDzaFUZtM= Received: by 10.216.88.8 with SMTP id z8mr389498wee.109.1255649724209; Thu, 15 Oct 2009 16:35:24 -0700 (PDT) Received: from ?192.168.1.200? (ppp118-209-107-207.lns20.mel4.internode.on.net [118.209.107.207]) by mx.google.com with ESMTPS id i6sm1190251gve.17.2009.10.15.16.35.20 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 15 Oct 2009 16:35:22 -0700 (PDT) Message-ID: <4AD7BF94.908@gmail.com> Date: Fri, 16 Oct 2009 10:34:28 +1000 From: "Andrew D. Boyd" User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: freebsd-hackers@freebsd.org References: <86d44vqs9l.fsf@kopusha.onet> In-Reply-To: <86d44vqs9l.fsf@kopusha.onet> X-Enigmail-Version: 0.96.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: crashtar X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Oct 2009 00:07:33 -0000 Mikolaj Golub wrote: > On Sat, 10 Oct 2009 12:34:05 +0200 (CEST) Alexander Best wrote: > > AB> thanks. this is a cool script and very useful indeed. only thing you might > AB> want to do is check for root privileges at the beginning to avoid nasty error > AB> messages like. > > AB> awk: can't open file /var/crash/info.0 > AB> source line number 12 > > In some cases you might not need root privileges. E.g. on some servers I don't > have root but SA gives me read access to crashdumps. In this case if the > script had a check for root privileges I would not be able to use it. > > Actually as for me the message looks informative enough, it says that we have > some problems with accessing crash dump files, so permissions should be > checked. > Instead of checking for root you could check if the file is readable: if [ -r FILE ] and then print an error message. Although the awk error message is sufficient some people might find this helpful. Regards, Andrew