From owner-freebsd-hackers@FreeBSD.ORG Sun Oct 3 00:19:54 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6707016A4CE; Sun, 3 Oct 2004 00:19:54 +0000 (GMT) Received: from VARK.MIT.EDU (VARK.MIT.EDU [18.95.3.179]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9946243D1D; Sun, 3 Oct 2004 00:19:53 +0000 (GMT) (envelope-from das@FreeBSD.ORG) Received: from VARK.MIT.EDU (localhost [127.0.0.1]) by VARK.MIT.EDU (8.13.1/8.12.10) with ESMTP id i930K8AE003127; Sat, 2 Oct 2004 20:20:08 -0400 (EDT) (envelope-from das@FreeBSD.ORG) Received: (from das@localhost) by VARK.MIT.EDU (8.13.1/8.12.10/Submit) id i930K8W8003126; Sat, 2 Oct 2004 20:20:08 -0400 (EDT) (envelope-from das@FreeBSD.ORG) Date: Sat, 2 Oct 2004 20:20:08 -0400 From: David Schultz To: Giorgos Keramidas Message-ID: <20041003002007.GA3070@VARK.MIT.EDU> Mail-Followup-To: Giorgos Keramidas , Garance A Drosihn , freebsd-hackers@FreeBSD.ORG, Lee Harr References: <20041002175704.GB2230@gothmog.gr> <20041002230226.GC1381@gothmog.gr> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20041002230226.GC1381@gothmog.gr> cc: Lee Harr cc: freebsd-hackers@FreeBSD.ORG cc: Garance A Drosihn Subject: Re: Protection from the dreaded "rm -fr /" X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Oct 2004 00:19:54 -0000 On Sun, Oct 03, 2004, Giorgos Keramidas wrote: > On 2004-10-02 17:22, Garance A Drosihn wrote: > > At 8:57 PM +0300 10/2/04, Giorgos Keramidas wrote: > > >On 2004-10-02 21:23, Lee Harr wrote: > > >> How about: > > >> chflags sunlnk / > > >> ? > > > > > >Setting sunlink on / will only protect the / directory, not its > > >descendants, so you don't gain much. > > > > We could add a new flag "srunlnk", or maybe even "srm-r". The "rm" > > command will always have to stat() the file it is given (just to > > see if it is a directory), so it could check to see if this flag > > is turned on. If it is turned on, then 'rm' could refuse to honor > > any '-rf' request on that directory. [...] > > Hmmm. This sounds much better indeed :-) Give a choice between an elegant 50-line solution involving kernel changes and a somewhat inelegant but complete 3-line solution, I have to say I'd opt for the 3-line solution... From owner-freebsd-hackers@FreeBSD.ORG Sun Oct 3 00:53:16 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3BD7E16A4CE for ; Sun, 3 Oct 2004 00:53:16 +0000 (GMT) Received: from wjv.com (fl-65-40-24-38.sta.sprint-hsd.net [65.40.24.38]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6ECA243D2F for ; Sun, 3 Oct 2004 00:53:15 +0000 (GMT) (envelope-from bv@bilver.wjv.com) Received: from bilver.wjv.com (localhost.wjv.com [127.0.0.1]) by wjv.com (8.12.11/8.12.11) with ESMTP id i930rEE8081714 for ; Sat, 2 Oct 2004 20:53:14 -0400 (EDT) (envelope-from bv@bilver.wjv.com) Received: (from bv@localhost) by bilver.wjv.com (8.12.11/8.12.11/Submit) id i930rEtj081713 for freebsd-hackers@freebsd.org; Sat, 2 Oct 2004 20:53:14 -0400 (EDT) (envelope-from bv) Date: Sat, 2 Oct 2004 20:53:14 -0400 From: Bill Vermillion To: freebsd-hackers@freebsd.org Message-ID: <20041003005314.GA81602@wjv.com> References: <20041003002004.68D8416A4E1@hub.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20041003002004.68D8416A4E1@hub.freebsd.org> Organization: W.J.Vermillion / Orlando - Winter Park ReplyTo: bv@wjv.com User-Agent: Mutt/1.5.6i Subject: Re: Protecting from the dreaded "rm -fr /" X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: bv@wjv.com List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Oct 2004 00:53:16 -0000 On Sun, Oct 03, 2004 at 00:20 , Men gasped, women fainted, and small children were reduced to tears as freebsd-hackers-request@freebsd.org confessed to all: > > Message: 2 > Date: Sat, 2 Oct 2004 22:43:49 +1000 > From: Peter Jeremy > Subject: Re: Protection from the dreaded "rm -fr /" > To: Giorgos Keramidas > Cc: freebsd-hackers@freebsd.org > Message-ID: <20041002124349.GA21569@cirb503493.alcatel.com.au> > Content-Type: text/plain; charset=us-ascii > On Sat, 2004-Oct-02 11:51:43 +0300, Giorgos Keramidas wrote: > >The reason I liked this idea is that root has zillions of other > >ways to destroy an entire system, but not many of them are > >likely to be the result of mistyping a single character as > >shown below: > > # rm -fr / home/someuser/* > I've had a customer write a cronjob that did almost exactly this. > He managed to 'test' it on all the (redundant) production systems > as well as the test model. We were only called in when he found > that there were some unexpected console messages and the systems > wouldn't boot when he pressed the reset button. Luckily it > managed to kill itself before it destroyed all the evidence (since > the culprit initially denied doing anything). > Based on that, I'm definitely in favour of some anti-foot-shooting > measures. > I don't think it should fail quietly: If I ask the computer to do > something (stupid or not), it should either do it or tell me that it > hasn't done it. Failing to do what I ask and not telling me means > that I can't trust the computer - I have to double-check that the > files I wanted to delete have actually gone away. You can always trust the computer to do exactly what you tell it to, even if what you told it to was not what you wanted it to do. If you customer tested the program on non production machines and it failed on the production machine then it was obvious the customer made the mistake of re-creating the crontab line instead of copying it over. The way to keep from shooting yourself in the foot is 1) always check with an 'ls' argument before doing any exterme wildcarding and if you like what you see use your shell editing to change 'ls' to 'rm'. 2) is to let the end user know that certain things are very dangerous and they could destory their system, 3) have automated and verified backups run on the complet system every night. I've been using Unix too long to want to see this behaviour changed, and I'll use the same argument that others do when they advise against aliasing rm to rm -i. If you know that you can't shoot yourself in the foot, you will not treat rm as if it were a loaded automatic pistol and you don't reinforce your double checking. Then one day you go to a machine that doesn't have the safety-net and you make a mistake and it won't be recoverable. If we could arrange to change all the rm's on all the Unix machines in the world at the same - maybe then I'd go for it :-) Bill -- Bill Vermillion - bv @ wjv . com From owner-freebsd-hackers@FreeBSD.ORG Sun Oct 3 01:26:17 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id F2FA716A4CE for ; Sun, 3 Oct 2004 01:26:16 +0000 (GMT) Received: from harmony.village.org (rover.village.org [168.103.84.182]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4BCC143D2D for ; Sun, 3 Oct 2004 01:26:16 +0000 (GMT) (envelope-from imp@bsdimp.com) Received: from localhost (harmony.village.org [10.0.0.6]) by harmony.village.org (8.13.1/8.13.1) with ESMTP id i931P9wU069168; Sat, 2 Oct 2004 19:25:11 -0600 (MDT) (envelope-from imp@bsdimp.com) Date: Sat, 02 Oct 2004 19:26:37 -0600 (MDT) Message-Id: <20041002.192637.35050666.imp@bsdimp.com> To: sean-freebsd@farley.org From: "M. Warner Losh" In-Reply-To: <20041002102430.Y5481@thor.farley.org> References: <20041002081928.GA21439@gothmog.gr> <200410021123.59811.max@love2party.net> <20041002102430.Y5481@thor.farley.org> X-Mailer: Mew version 3.3 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit cc: freebsd-hackers@freebsd.org Subject: Re: Protection from the dreaded "rm -fr /" X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Oct 2004 01:26:17 -0000 In message: <20041002102430.Y5481@thor.farley.org> Sean Farley writes: : Why not default on? root will not run 'rm -rf /' on purpose very often. : Once will be enough. :) Also, when and why would someone want to do : this? Please consider chroots. Root many want to do this in a chroot. I'd prefer at the very least rm -rff / to work. Warner From owner-freebsd-hackers@FreeBSD.ORG Sun Oct 3 01:26:17 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 91CC216A4CE for ; Sun, 3 Oct 2004 01:26:17 +0000 (GMT) Received: from harmony.village.org (rover.village.org [168.103.84.182]) by mx1.FreeBSD.org (Postfix) with ESMTP id 37C4D43D2D for ; Sun, 3 Oct 2004 01:26:17 +0000 (GMT) (envelope-from imp@bsdimp.com) Received: from localhost (harmony.village.org [10.0.0.6]) by harmony.village.org (8.13.1/8.13.1) with ESMTP id i931MrW5069133; Sat, 2 Oct 2004 19:22:56 -0600 (MDT) (envelope-from imp@bsdimp.com) Date: Sat, 02 Oct 2004 19:24:14 -0600 (MDT) Message-Id: <20041002.192414.94755346.imp@bsdimp.com> To: jonny@jonny.eng.br From: "M. Warner Losh" In-Reply-To: <415EC35E.6050602@jonny.eng.br> References: <415EC35E.6050602@jonny.eng.br> X-Mailer: Mew version 3.3 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable cc: hackers@freebsd.org Subject: Re: Probing PCI devices not detected by BIOS X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Oct 2004 01:26:17 -0000 In message: <415EC35E.6050602@jonny.eng.br> Jo=E3o Carlos Mendes Lu=EDs writes: : My problem: I have an old ASUS P2B-DS motherboard based server, = and want to = : use a Realtek 8169 Gigabit LAN Card with it. But the BIOS does not d= etect the = : LAN card, I don't know why. If I put the card in another computer, i= t is = : detected perfectly. Unless this is a hardware incompatibility proble= m, I would = : expect FreeBSD to do a better job than the old BIOS. Chances are good that you might have a problem. I have a few devices that don't appear on one of my machines because the machines are too old and not compliant with the latest PCI standards. I also have one cardbus card that refuses to work on some machine due to, I think, bad (no?) 3.3V power. Warner From owner-freebsd-hackers@FreeBSD.ORG Sun Oct 3 01:29:18 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2C63716A4CE for ; Sun, 3 Oct 2004 01:29:18 +0000 (GMT) Received: from harmony.village.org (rover.village.org [168.103.84.182]) by mx1.FreeBSD.org (Postfix) with ESMTP id B31B643D2F for ; Sun, 3 Oct 2004 01:29:17 +0000 (GMT) (envelope-from imp@bsdimp.com) Received: from localhost (harmony.village.org [10.0.0.6]) by harmony.village.org (8.13.1/8.13.1) with ESMTP id i931SMBD069214; Sat, 2 Oct 2004 19:28:25 -0600 (MDT) (envelope-from imp@bsdimp.com) Date: Sat, 02 Oct 2004 19:29:51 -0600 (MDT) Message-Id: <20041002.192951.35870461.imp@bsdimp.com> To: tillman@seekingfire.com From: "M. Warner Losh" In-Reply-To: <20041002210554.GS35869@seekingfire.com> References: <20041002175517.GA2230@gothmog.gr> <20041002204851.K24332@fw.reifenberger.com> <20041002210554.GS35869@seekingfire.com> X-Mailer: Mew version 3.3 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit cc: freebsd-hackers@freebsd.org Subject: Re: Protection from the dreaded "rm -fr /" X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Oct 2004 01:29:18 -0000 In message: <20041002210554.GS35869@seekingfire.com> Tillman Hodgson writes: : It'll never work, though, that's the thing. At some point it'll rm : something it itself needs and error out. There isn't a way to use `rm : -rf /` that /doesn't/ result in foot-shooting. No. You are wrong. if you rm -rf in a chroot, then it won't result in foot shooting, necessarily, like it would outside a chroot. Warner From owner-freebsd-hackers@FreeBSD.ORG Sun Oct 3 01:29:21 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id BF1A816A4DE for ; Sun, 3 Oct 2004 01:29:21 +0000 (GMT) Received: from harmony.village.org (rover.village.org [168.103.84.182]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4E22943D46 for ; Sun, 3 Oct 2004 01:29:21 +0000 (GMT) (envelope-from imp@bsdimp.com) Received: from localhost (harmony.village.org [10.0.0.6]) by harmony.village.org (8.13.1/8.13.1) with ESMTP id i931PqwG069174; Sat, 2 Oct 2004 19:25:56 -0600 (MDT) (envelope-from imp@bsdimp.com) Date: Sat, 02 Oct 2004 19:27:21 -0600 (MDT) Message-Id: <20041002.192721.110809394.imp@bsdimp.com> To: tillman@seekingfire.com From: "M. Warner Losh" In-Reply-To: <20041002165155.GP35869@seekingfire.com> References: <200410021123.59811.max@love2party.net> <20041002102430.Y5481@thor.farley.org> <20041002165155.GP35869@seekingfire.com> X-Mailer: Mew version 3.3 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit cc: freebsd-hackers@freebsd.org Subject: Re: Protection from the dreaded "rm -fr /" X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Oct 2004 01:29:22 -0000 In message: <20041002165155.GP35869@seekingfire.com> Tillman Hodgson writes: : On Sat, Oct 02, 2004 at 10:42:16AM -0500, Sean Farley wrote: : > Why not default on? root will not run 'rm -rf /' on purpose very often. : > Once will be enough. :) Also, when and why would someone want to do : > this? : : Exactly. Who would expect `rm -rf /` to actually succeed? It's not only : dangerous, it doesn't work in a useful way ;-) I would. I would expect it to work in a chroot I no longer wanted, for example. Warner From owner-freebsd-hackers@FreeBSD.ORG Sun Oct 3 01:44:42 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 80A8C16A4CE for ; Sun, 3 Oct 2004 01:44:42 +0000 (GMT) Received: from error404.nls.net (error404.nls.net [216.144.36.24]) by mx1.FreeBSD.org (Postfix) with ESMTP id 18DC043D5C for ; Sun, 3 Oct 2004 01:44:42 +0000 (GMT) (envelope-from ketrien@error404.nls.net) Received: from [192.168.0.100] (eiterra.achedra.org [192.168.0.100]) by error404.nls.net (8.12.10/8.12.10) with ESMTP id i931iYqP011763; Sat, 2 Oct 2004 21:44:34 -0400 (EDT) (envelope-from ketrien@error404.nls.net) Message-ID: <415F5968.5070904@error404.nls.net> Date: Sat, 02 Oct 2004 21:44:08 -0400 From: "Ketrien I. Saihr-Kesenchedra" User-Agent: Mozilla Thunderbird 0.7.3 (Windows/20040803) X-Accept-Language: en-us, en MIME-Version: 1.0 To: "M. Warner Losh" , freebsd-hackers@freebsd.org References: <415EC35E.6050602@jonny.eng.br> <20041002.192414.94755346.imp@bsdimp.com> In-Reply-To: <20041002.192414.94755346.imp@bsdimp.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit Subject: Re: Probing PCI devices not detected by BIOS X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Oct 2004 01:44:42 -0000 M. Warner Losh wrote: >In message: <415EC35E.6050602@jonny.eng.br> > João Carlos Mendes Luís writes: >: My problem: I have an old ASUS P2B-DS motherboard based server, and want to >: use a Realtek 8169 Gigabit LAN Card with it. But the BIOS does not detect the >: LAN card, I don't know why. If I put the card in another computer, it is >: detected perfectly. Unless this is a hardware incompatibility problem, I would >: expect FreeBSD to do a better job than the old BIOS. > >Chances are good that you might have a problem. I have a few devices >that don't appear on one of my machines because the machines are too >old and not compliant with the latest PCI standards. I also have one >cardbus card that refuses to work on some machine due to, I think, bad >(no?) 3.3V power. > > There are currently three PCI standards, not including PCI-X. PCI2.1, PCI2.2, PCI2.3. (Again, not including PCI-X, this is only 32bit/33MHz.) On top of this, you have three voltage standards; PCI 5V, PCI3.3V, and PCI-Universal (3.3/5.) These are the -keying- of the slots. So I got out the PCI 2.3 specs, go to pp185. A PCI 2.3 slot is keyed at the front (towards the front of the case), as the P2B-DS is, and is 5V. A PCI 3.3V slot is keyed towards the rear (towards the I/O panel). Then there's PCI Universal; this a card-only specification, which has a double-keyed card (keyed front -and- rear) to be inserted in 3.3V or 5V slot. A universally keyed card should support either 3.3V -or- 5V normally. The Realtek 8169's I've seen are keyed universal, but is specifically a PCI 2.2 or later 3.3V card. A universal keyed PCB is apparently cheaper to make than a properly keyed card. The Asus P2B-DS is, as far as I have been able to find, a PCI 2.1 board. -ksaihr From owner-freebsd-hackers@FreeBSD.ORG Sun Oct 3 01:53:35 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 494BF16A4CF for ; Sun, 3 Oct 2004 01:53:35 +0000 (GMT) Received: from kane.otenet.gr (kane.otenet.gr [195.170.0.27]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4A42443D1D for ; Sun, 3 Oct 2004 01:53:34 +0000 (GMT) (envelope-from keramida@freebsd.org) Received: from gothmog.gr (patr530-b221.otenet.gr [212.205.244.229]) i931rN9T010655; Sun, 3 Oct 2004 04:53:24 +0300 Received: from gothmog.gr (gothmog [127.0.0.1]) by gothmog.gr (8.13.1/8.13.1) with ESMTP id i931rL5V003287; Sun, 3 Oct 2004 04:53:21 +0300 (EEST) (envelope-from keramida@freebsd.org) Received: (from giorgos@localhost) by gothmog.gr (8.13.1/8.13.1/Submit) id i931rLfv003286; Sun, 3 Oct 2004 04:53:21 +0300 (EEST) (envelope-from keramida@freebsd.org) Date: Sun, 3 Oct 2004 04:53:21 +0300 From: Giorgos Keramidas To: "M. Warner Losh" Message-ID: <20041003015321.GA3190@gothmog.gr> References: <20041002175517.GA2230@gothmog.gr> <20041002204851.K24332@fw.reifenberger.com> <20041002210554.GS35869@seekingfire.com> <20041002.192951.35870461.imp@bsdimp.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20041002.192951.35870461.imp@bsdimp.com> cc: freebsd-hackers@freebsd.org Subject: Re: Protection from the dreaded "rm -fr /" X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Oct 2004 01:53:35 -0000 On 2004-10-02 19:29, "M. Warner Losh" wrote: > In message: <20041002210554.GS35869@seekingfire.com> > Tillman Hodgson writes: > : It'll never work, though, that's the thing. At some point it'll rm > : something it itself needs and error out. There isn't a way to use `rm > : -rf /` that /doesn't/ result in foot-shooting. > > No. You are wrong. if you rm -rf in a chroot, then it won't result > in foot shooting, necessarily, like it would outside a chroot. Since a chroot can always be rm -fr deleted from outside the chroot, this isn't really a great problem, is it? From owner-freebsd-hackers@FreeBSD.ORG Sun Oct 3 01:54:08 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id DB98C16A4CE; Sun, 3 Oct 2004 01:54:08 +0000 (GMT) Received: from dignus.com (client196-2.dsl.intrex.net [209.42.196.2]) by mx1.FreeBSD.org (Postfix) with ESMTP id 72D2843D2F; Sun, 3 Oct 2004 01:54:08 +0000 (GMT) (envelope-from rivers@dignus.com) Received: from lakes.dignus.com (lakes.dignus.com [10.1.0.3]) by dignus.com (8.12.9p2/8.12.9) with ESMTP id i931rsdT018045; Sat, 2 Oct 2004 21:53:54 -0400 (EDT) (envelope-from rivers@dignus.com) Received: (from rivers@localhost) by lakes.dignus.com (8.11.6/8.11.3) id i931sR348272; Sat, 2 Oct 2004 21:54:27 -0400 (EDT) (envelope-from rivers) Date: Sat, 2 Oct 2004 21:54:27 -0400 (EDT) From: Thomas David Rivers Message-Id: <200410030154.i931sR348272@lakes.dignus.com> To: drosih@rpi.edu, freebsd-hackers@freebsd.org, keramida@freebsd.org In-Reply-To: <20041002230226.GC1381@gothmog.gr> X-Spam-Status: No, hits=-5.6 required=5.0 tests=AWL,BAYES_01,IN_REP_TO version=2.55 X-Spam-Checker-Version: SpamAssassin 2.55 (1.174.2.19-2003-05-19-exp) cc: missive@hotmail.com Subject: Re: Protection from the dreaded "rm -fr /" X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Oct 2004 01:54:09 -0000 Everyone, If I'm remembering correctly - the historical way to do this is to alias the "rm" command to something that else that checks the arguments and complains appropriately (and then executes /bin/rm.) Typically with just a shell alias. That keeps you from accidently doing something. Just thinking that putting extra "smarts" into a utility isn't the typical "UNIXy" way to do this. Let each tool do the one thing it does really well.. 'rm' removes; let it remove. I think, in the old "UNIX Review" magazine (what - almost 15+ years ago now?) There was a couple of examples of this. - Dave Rivers - -- rivers@dignus.com Work: (919) 676-0847 Get your mainframe programming tools at http://www.dignus.com From owner-freebsd-hackers@FreeBSD.ORG Sun Oct 3 02:07:53 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 11A3C16A4CE; Sun, 3 Oct 2004 02:07:53 +0000 (GMT) Received: from harmony.village.org (rover.village.org [168.103.84.182]) by mx1.FreeBSD.org (Postfix) with ESMTP id A857A43D2F; Sun, 3 Oct 2004 02:07:52 +0000 (GMT) (envelope-from imp@bsdimp.com) Received: from localhost (harmony.village.org [10.0.0.6]) by harmony.village.org (8.13.1/8.13.1) with ESMTP id i9325GWW069780; Sat, 2 Oct 2004 20:05:19 -0600 (MDT) (envelope-from imp@bsdimp.com) Date: Sat, 02 Oct 2004 20:06:45 -0600 (MDT) Message-Id: <20041002.200645.21077766.imp@bsdimp.com> To: keramida@freebsd.org From: "M. Warner Losh" In-Reply-To: <20041003015321.GA3190@gothmog.gr> References: <20041002210554.GS35869@seekingfire.com> <20041002.192951.35870461.imp@bsdimp.com> <20041003015321.GA3190@gothmog.gr> X-Mailer: Mew version 3.3 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit cc: freebsd-hackers@freebsd.org Subject: Re: Protection from the dreaded "rm -fr /" X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Oct 2004 02:07:53 -0000 In message: <20041003015321.GA3190@gothmog.gr> Giorgos Keramidas writes: : On 2004-10-02 19:29, "M. Warner Losh" wrote: : > In message: <20041002210554.GS35869@seekingfire.com> : > Tillman Hodgson writes: : > : It'll never work, though, that's the thing. At some point it'll rm : > : something it itself needs and error out. There isn't a way to use `rm : > : -rf /` that /doesn't/ result in foot-shooting. : > : > No. You are wrong. if you rm -rf in a chroot, then it won't result : > in foot shooting, necessarily, like it would outside a chroot. : : Since a chroot can always be rm -fr deleted from outside the chroot, : this isn't really a great problem, is it? You miss the point. You said it was always a foot-shooting move. I gave you a concrete example of where it wasn't a foot-shooting move (or even when you could use newfs instead). You reply with a workaround (which may be a valid way to deal, maybe not). My point still stands: it isn't always a foot-shooting move. It isn't a valid work around if you want to delete the chroot from inside the chroot... Warner From owner-freebsd-hackers@FreeBSD.ORG Sun Oct 3 02:11:32 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9F74716A4CE for ; Sun, 3 Oct 2004 02:11:32 +0000 (GMT) Received: from mxb.saturn-tech.com (mxb.saturn-tech.com [207.229.19.99]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5921343D39 for ; Sun, 3 Oct 2004 02:11:32 +0000 (GMT) (envelope-from drussell@saturn-tech.com) Received: from mxb.saturn-tech.com (localhost [127.0.0.1]) by mxb.saturn-tech.com (8.12.3/8.12.3) with ESMTP id i932EIKt090304; Sat, 2 Oct 2004 20:14:18 -0600 (MDT) (envelope-from drussell@saturn-tech.com) Received: from localhost (drussell@localhost)i932EIZC090301; Sat, 2 Oct 2004 20:14:18 -0600 (MDT) (envelope-from drussell@saturn-tech.com) X-Authentication-Warning: mxb.saturn-tech.com: drussell owned process doing -bs Date: Sat, 2 Oct 2004 20:14:18 -0600 (MDT) From: Doug Russell To: Thomas David Rivers In-Reply-To: <200410030154.i931sR348272@lakes.dignus.com> Message-ID: <20041002201312.E90087-100000@mxb.saturn-tech.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: freebsd-hackers@freebsd.org Subject: Re: Protection from the dreaded "rm -fr /" X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Oct 2004 02:11:32 -0000 On Sat, 2 Oct 2004, Thomas David Rivers wrote: > If I'm remembering correctly - the historical way to > do this is to alias the "rm" command to something that > else that checks the arguments and complains appropriately > (and then executes /bin/rm.) Typically with just a shell This would be a much, much better approach. Later...... From owner-freebsd-hackers@FreeBSD.ORG Sun Oct 3 03:09:48 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2DB7F16A4CE for ; Sun, 3 Oct 2004 03:09:48 +0000 (GMT) Received: from mail.seekingfire.com (coyote.seekingfire.com [24.72.10.212]) by mx1.FreeBSD.org (Postfix) with ESMTP id D8E6743D1D for ; Sun, 3 Oct 2004 03:09:47 +0000 (GMT) (envelope-from tillman@seekingfire.com) Received: by mail.seekingfire.com (Postfix, from userid 500) id 13BD82D6; Sat, 2 Oct 2004 21:09:47 -0600 (CST) Date: Sat, 2 Oct 2004 21:09:46 -0600 From: Tillman Hodgson To: freebsd-hackers@freebsd.org Message-ID: <20041003030946.GV35869@seekingfire.com> References: <20041002175517.GA2230@gothmog.gr> <20041002204851.K24332@fw.reifenberger.com> <20041002210554.GS35869@seekingfire.com> <20041002.192951.35870461.imp@bsdimp.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20041002.192951.35870461.imp@bsdimp.com> X-Habeas-SWE-1: winter into spring X-Habeas-SWE-2: brightly anticipated X-Habeas-SWE-3: like Habeas SWE (tm) X-Habeas-SWE-4: Copyright 2002 Habeas (tm) X-Habeas-SWE-5: Sender Warranted Email (SWE) (tm). The sender of this X-Habeas-SWE-6: email in exchange for a license for this Habeas X-Habeas-SWE-7: warrant mark warrants that this is a Habeas Compliant X-Habeas-SWE-8: Message (HCM) and not spam. Please report use of this X-Habeas-SWE-9: mark in spam to . X-GPG-Key-ID: 828AFC7B X-GPG-Fingerprint: 5584 14BA C9EB 1524 0E68 F543 0F0A 7FBC 828A FC7B X-GPG-Key: http://www.seekingfire.com/gpg_key.asc X-Urban-Legend: There is lots of hidden information in headers User-Agent: Mutt/1.5.6i Subject: Re: Protection from the dreaded "rm -fr /" X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Oct 2004 03:09:48 -0000 On Sat, Oct 02, 2004 at 07:29:51PM -0600, M. Warner Losh wrote: > In message: <20041002210554.GS35869@seekingfire.com> > Tillman Hodgson writes: > : It'll never work, though, that's the thing. At some point it'll rm > : something it itself needs and error out. There isn't a way to use `rm > : -rf /` that /doesn't/ result in foot-shooting. > > No. You are wrong. if you rm -rf in a chroot, then it won't result > in foot shooting, necessarily, like it would outside a chroot. If you're chrooted, where is the rm binary and associated libraries? They're in the chroot, in a branch off hte virtual / tree root. `rm -rf /`, even in chroot, won't delete everything that the command looks like it will. At the very least the final unlink, that of / itself, will likely result in undefined behaviour. Where do the dev's go if there's no / to root them in? etc etc. -T -- "Waking a person unnecessarily should not be considered a capital crime. For a first offense, that is." -- Robert Heinlein From owner-freebsd-hackers@FreeBSD.ORG Sun Oct 3 03:12:13 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id EB1DC16A4CE for ; Sun, 3 Oct 2004 03:12:13 +0000 (GMT) Received: from mail.seekingfire.com (coyote.seekingfire.com [24.72.10.212]) by mx1.FreeBSD.org (Postfix) with ESMTP id C38DE43D3F for ; Sun, 3 Oct 2004 03:12:13 +0000 (GMT) (envelope-from tillman@seekingfire.com) Received: by mail.seekingfire.com (Postfix, from userid 500) id 7DE8A2D6; Sat, 2 Oct 2004 21:12:13 -0600 (CST) Date: Sat, 2 Oct 2004 21:12:13 -0600 From: Tillman Hodgson To: freebsd-hackers@freebsd.org Message-ID: <20041003031213.GW35869@seekingfire.com> References: <200410030154.i931sR348272@lakes.dignus.com> <20041002201312.E90087-100000@mxb.saturn-tech.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20041002201312.E90087-100000@mxb.saturn-tech.com> X-Habeas-SWE-1: winter into spring X-Habeas-SWE-2: brightly anticipated X-Habeas-SWE-3: like Habeas SWE (tm) X-Habeas-SWE-4: Copyright 2002 Habeas (tm) X-Habeas-SWE-5: Sender Warranted Email (SWE) (tm). The sender of this X-Habeas-SWE-6: email in exchange for a license for this Habeas X-Habeas-SWE-7: warrant mark warrants that this is a Habeas Compliant X-Habeas-SWE-8: Message (HCM) and not spam. Please report use of this X-Habeas-SWE-9: mark in spam to . X-GPG-Key-ID: 828AFC7B X-GPG-Fingerprint: 5584 14BA C9EB 1524 0E68 F543 0F0A 7FBC 828A FC7B X-GPG-Key: http://www.seekingfire.com/gpg_key.asc X-Urban-Legend: There is lots of hidden information in headers User-Agent: Mutt/1.5.6i Subject: Re: Protection from the dreaded "rm -fr /" X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Oct 2004 03:12:14 -0000 On Sat, Oct 02, 2004 at 08:14:18PM -0600, Doug Russell wrote: > > On Sat, 2 Oct 2004, Thomas David Rivers wrote: > > > If I'm remembering correctly - the historical way to > > do this is to alias the "rm" command to something that > > else that checks the arguments and complains appropriately > > (and then executes /bin/rm.) Typically with just a shell > > This would be a much, much better approach. For those cases where what is being removed makes sense, I agree. / is a special case, I maintain that the behaviour of `rm -rf` is, by necessity, undefined and unpredictable. `rm` shouldn't be allowed to do it any more than 'rm' should be used to remove user accounts simply because they both invovle "removing" something. Newfs is the tool for the job in this case. -T -- "Great spirits have always found violent opposition from mediocrities. The latter cannot understand it when a man does not thoughtlessly submit to hereditary prejudices but honestly and courageously uses his intelligence." -- Albert Einstein From owner-freebsd-hackers@FreeBSD.ORG Sun Oct 3 06:31:30 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 55D6116A4CE; Sun, 3 Oct 2004 06:31:30 +0000 (GMT) Received: from VARK.MIT.EDU (VARK.MIT.EDU [18.95.3.179]) by mx1.FreeBSD.org (Postfix) with ESMTP id 07B7743D1D; Sun, 3 Oct 2004 06:31:30 +0000 (GMT) (envelope-from das@FreeBSD.ORG) Received: from VARK.MIT.EDU (localhost [127.0.0.1]) by VARK.MIT.EDU (8.13.1/8.12.10) with ESMTP id i936VfkF004972; Sun, 3 Oct 2004 02:31:41 -0400 (EDT) (envelope-from das@FreeBSD.ORG) Received: (from das@localhost) by VARK.MIT.EDU (8.13.1/8.12.10/Submit) id i936VfYa004971; Sun, 3 Oct 2004 02:31:41 -0400 (EDT) (envelope-from das@FreeBSD.ORG) Date: Sun, 3 Oct 2004 02:31:41 -0400 From: David Schultz To: "M. Warner Losh" Message-ID: <20041003063141.GA4817@VARK.MIT.EDU> Mail-Followup-To: "M. Warner Losh" , keramida@FreeBSD.ORG, freebsd-hackers@FreeBSD.ORG References: <20041002210554.GS35869@seekingfire.com> <20041002.192951.35870461.imp@bsdimp.com> <20041003015321.GA3190@gothmog.gr> <20041002.200645.21077766.imp@bsdimp.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20041002.200645.21077766.imp@bsdimp.com> cc: freebsd-hackers@FreeBSD.ORG cc: keramida@FreeBSD.ORG Subject: Re: Protection from the dreaded "rm -fr /" X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Oct 2004 06:31:30 -0000 On Sat, Oct 02, 2004, M. Warner Losh wrote: > In message: <20041003015321.GA3190@gothmog.gr> > Giorgos Keramidas writes: > : On 2004-10-02 19:29, "M. Warner Losh" wrote: > : > In message: <20041002210554.GS35869@seekingfire.com> > : > Tillman Hodgson writes: > : > : It'll never work, though, that's the thing. At some point it'll rm > : > : something it itself needs and error out. There isn't a way to use `rm > : > : -rf /` that /doesn't/ result in foot-shooting. > : > > : > No. You are wrong. if you rm -rf in a chroot, then it won't result > : > in foot shooting, necessarily, like it would outside a chroot. > : > : Since a chroot can always be rm -fr deleted from outside the chroot, > : this isn't really a great problem, is it? > > You miss the point. > > You said it was always a foot-shooting move. I gave you a concrete > example of where it wasn't a foot-shooting move (or even when you > could use newfs instead). You reply with a workaround (which may be a > valid way to deal, maybe not). My point still stands: it isn't always > a foot-shooting move. This is the only convincing argument against the proposed change that I've heard yet. I was assuming that doing this would cause something (e.g. the shell) to blow up even within a chroot, but I guess that isn't true, since all of the needed inodes will still be referenced until the shell exits. I guess to make this feature justifiable under the ``you are definitely trying to shoot yourself in the foot'' criterion, it would need to be disabled in chrooted environments. AFAIK, there isn't a simple way to detect chrootedness from userland, so this is starting to sound like a much larger kludge than I originally thought... From owner-freebsd-hackers@FreeBSD.ORG Sun Oct 3 07:35:33 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id AF67816A4CE for ; Sun, 3 Oct 2004 07:35:33 +0000 (GMT) Received: from bloodwood.hunterlink.net.au (smtp-local.hunterlink.net.au [203.12.144.17]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2497543D39 for ; Sun, 3 Oct 2004 07:35:32 +0000 (GMT) (envelope-from boris@brooknet.com.au) Received: from [61.8.33.151] (ppp2197.dyn.pacific.net.au [61.8.33.151]) i937X7Sp008333 for ; Sun, 3 Oct 2004 17:33:08 +1000 From: Sam Lawrance To: freebsd-hackers@freebsd.org In-Reply-To: <20041003063141.GA4817@VARK.MIT.EDU> References: <20041002210554.GS35869@seekingfire.com> <20041002.192951.35870461.imp@bsdimp.com> <20041003015321.GA3190@gothmog.gr> <20041002.200645.21077766.imp@bsdimp.com> <20041003063141.GA4817@VARK.MIT.EDU> Content-Type: text/plain Message-Id: <1096789071.718.75.camel@dirk.no.domain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.6 Date: Sun, 03 Oct 2004 17:37:52 +1000 Content-Transfer-Encoding: 7bit Subject: Re: Protection from the dreaded "rm -fr /" X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Oct 2004 07:35:33 -0000 The problem can be solved by installing only slow disks and mounting filesystems in sync mode. As it takes so long to delete files in this environment, you have plenty of time to hit ctrl-c when you realise what you've done. ;) From owner-freebsd-hackers@FreeBSD.ORG Sun Oct 3 11:08:17 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 66D2C16A4CE for ; Sun, 3 Oct 2004 11:08:17 +0000 (GMT) Received: from sardine.webcom.it (gen053.n002.c03.escapebox.net [213.73.82.53]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2678543D48 for ; Sun, 3 Oct 2004 11:08:17 +0000 (GMT) (envelope-from "") Received: from [213.140.22.73] (helo=brian) by webcom.it with asmtp (Exim 3.36 #1) id 1CE4Dw-000DkS-00 for freebsd-hackers@freebsd.org; Sun, 03 Oct 2004 11:08:16 +0000 Resent-From: andrea@webcom.it Resent-Date: Sun, 3 Oct 2004 13:08:15 +0200 Resent-Message-ID: <20041003110815.GB624@webcom.it> Resent-To: freebsd-hackers@freebsd.org Date: Sun, 3 Oct 2004 13:02:33 +0200 From: Andrea Campi To: "Bruce R. Montague" Message-ID: <20041003110233.GA624@webcom.it> References: <200410020334.i923YbYB000383@mail.cruzio.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200410020334.i923YbYB000383@mail.cruzio.com> User-Agent: Mutt/1.5.6i Received: from andrea by webcom.it with asmtp (Exim 3.36 #1) id 1CE4Dw-000DkS-00; Sun, 03 Oct 2004 11:08:16 +0000 cc: freebsd-hackers@freebsd.org cc: durham@jcdurham.com Subject: Re: Sudden Reboots X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Oct 2004 11:08:17 -0000 On Fri, Oct 01, 2004 at 08:34:37PM -0700, Bruce R. Montague wrote: > proposed. Instead of having a page table entry for > each page of virtual address space, these systems > have the equivalent of a page table entry for each > page of _physical_ memory. All addresses are effectively [...] > disk-block. This requires more expensive hardware > then a simple addition, but such systems only require > a page table entry for every page of physical memory. > These systems have been built from early days, but > are typically not competitive with VM systems that > require simple addition. (I think the IBM AS/400 is > the only widely-used commercial hardware using this > approach) At some point address space growth, cheap > associative lookup memories, and required page table > size may make this approach competitive. Actually, all Power and PowerPC chips have this... It's one of the reasons why IBM servers based on these chips can boast very low overheads in several areas. Bye, Andrea -- The best things in life are free, but the expensive ones are still worth a look. From owner-freebsd-hackers@FreeBSD.ORG Sat Oct 2 16:00:23 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7831816A4CE for ; Sat, 2 Oct 2004 16:00:23 +0000 (GMT) Received: from mail.devrandom.org.uk (mail.devrandom.org.uk [84.92.10.242]) by mx1.FreeBSD.org (Postfix) with ESMTP id A973843D48 for ; Sat, 2 Oct 2004 16:00:22 +0000 (GMT) (envelope-from howells@kde.org) Received: from localhost (frodo [192.168.1.8]) by mail.devrandom.org.uk (Postfix) with ESMTP id DC4B9AF1C for ; Sat, 2 Oct 2004 18:02:12 +0100 (BST) Received: from mail.devrandom.org.uk ([192.168.1.8]) by localhost (frodo [192.168.1.8]) (amavisd-new, port 10024) with ESMTP id 05236-08 for ; Sat, 2 Oct 2004 18:02:11 +0100 (BST) Received: from [192.168.1.176] (unknown [192.168.1.176]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (No client certificate requested) by mail.devrandom.org.uk (Postfix) with ESMTP id E7303AF11 for ; Sat, 2 Oct 2004 18:02:11 +0100 (BST) From: Chris Howells Organization: K Desktop Environment To: freebsd-hackers@freebsd.org Date: Sat, 2 Oct 2004 17:00:16 +0100 User-Agent: KMail/1.7.50 References: <20041002081928.GA21439@gothmog.gr> <20041002102918.W22102@fw.reifenberger.com> <20041002085143.GA52519@gothmog.gr> In-Reply-To: <20041002085143.GA52519@gothmog.gr> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart3889712.7A2sp9VzqV"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit Message-Id: <200410021700.20149.howells@kde.org> X-Virus-Scanned: by amavisd-new at devrandom.org.uk X-Mailman-Approved-At: Sun, 03 Oct 2004 12:07:45 +0000 Subject: Re: Protection from the dreaded "rm -fr /" X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 02 Oct 2004 16:00:23 -0000 --nextPart3889712.7A2sp9VzqV Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On Saturday 02 October 2004 09:51, Giorgos Keramidas wrote: > Yes, so? =A0Does it mean we should always point guns at our feet and hope > that we don't accidentally pull the trigger because some unlucky event > made us jump a bit up? It just seems pointless to prevent yourself shooting yourself with a pistol= ,=20 when you can still shoot yourself with the rifle, machine gun... =2D-=20 Cheers, Chris Howells -- chris@chrishowells.co.uk, howells@kde.org Web: http://chrishowells.co.uk, PGP ID: 0x33795A2C KDE/Qt/C++/PHP Developer: http://www.kde.org --nextPart3889712.7A2sp9VzqV Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.6 (FreeBSD) iD8DBQBBXtCUF8Iu1zN5WiwRAsARAKCFl2scyOm0qF3T0KV/va8Fq/WcfgCdF/9Y DfzsC/2bwwKEeqGYKrSINnM= =Z0VB -----END PGP SIGNATURE----- --nextPart3889712.7A2sp9VzqV-- From owner-freebsd-hackers@FreeBSD.ORG Sat Oct 2 22:56:58 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D2CC716A4CE for ; Sat, 2 Oct 2004 22:56:58 +0000 (GMT) Received: from delight.idiom.com (delight.idiom.com [216.240.32.16]) by mx1.FreeBSD.org (Postfix) with ESMTP id BEE6243D45 for ; Sat, 2 Oct 2004 22:56:58 +0000 (GMT) (envelope-from mwm-dated-1097621817.827330@mired.org) Received: from idiom.com (idiom.com [216.240.32.1]) by delight.idiom.com (Postfix) with ESMTP id AFBD215524E for ; Sat, 2 Oct 2004 15:56:58 -0700 (PDT) Received: from mired.org (mwm@idiom [216.240.32.1]) by idiom.com (8.12.11/8.12.11) with SMTP id i92MuvfU091039 for ; Sat, 2 Oct 2004 15:56:57 -0700 (PDT) (envelope-from mwm-dated-1097621817.827330@mired.org) Received: (qmail 2370 invoked by uid 100); 2 Oct 2004 22:56:57 -0000 Received: by guru.mired.org (tmda-sendmail, from uid 100); Sat, 02 Oct 2004 17:56:56 -0500 (CDT) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <16735.12854.834510.62812@guru.mired.org> Date: Sat, 2 Oct 2004 17:56:54 -0500 To: Giorgos Keramidas In-Reply-To: <20041002081928.GA21439@gothmog.gr> References: <20041002081928.GA21439@gothmog.gr> X-Mailer: VM 7.17 under 21.1 (patch 14) "Cuyahoga Valley" XEmacs Lucid X-Primary-Address: mwm@mired.org X-face: "5Mnwy%?j>IIV\)A=):rjWL~NB2aH[}Yq8Z=u~vJ`"(,&SiLvbbz2W`; h9L,Yg`+vb1>RG% *h+%X^n0EZd>TM8_IB;a8F?(Fb"lw'IgCoyM.[Lg#r\ X-Delivery-Agent: TMDA/1.0.3 (Seattle Slew) From: Mike Meyer X-Mailman-Approved-At: Sun, 03 Oct 2004 12:07:45 +0000 cc: freebsd-hackers@FreeBSD.org Subject: Re: Protection from the dreaded "rm -fr /" X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 02 Oct 2004 22:56:58 -0000 In <20041002081928.GA21439@gothmog.gr>, Giorgos Keramidas typed: > John Beck, who works for Sun, has posted an entry in his blog yesterday > about "rm -fr /" protection, which I liked a lot: > http://blogs.sun.com/roller/page/jbeck/20041001#rm_rf_protection > > His idea was remarkably simple, so I went ahead and wrote this patch for > rm(1) of FreeBSD: Aw, but watching how systems fail when you do "rm -rf /" after you take them out of service is so entertaining. http://www.mired.org/consulting.html Independent Network/Unix/Perforce consultant, email for more information. From owner-freebsd-hackers@FreeBSD.ORG Sat Oct 2 23:00:26 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id DD68116A4CF for ; Sat, 2 Oct 2004 23:00:26 +0000 (GMT) Received: from delight.idiom.com (delight.idiom.com [216.240.32.16]) by mx1.FreeBSD.org (Postfix) with ESMTP id A6E5C43D49 for ; Sat, 2 Oct 2004 23:00:26 +0000 (GMT) (envelope-from mwm-dated-1097622024.01bc05@mired.org) Received: from idiom.com (idiom.com [216.240.32.1]) by delight.idiom.com (Postfix) with ESMTP id 04C61153F97 for ; Sat, 2 Oct 2004 16:00:25 -0700 (PDT) Received: from mired.org (mwm@idiom [216.240.32.1]) by idiom.com (8.12.11/8.12.11) with SMTP id i92N0OrI096096 for ; Sat, 2 Oct 2004 16:00:24 -0700 (PDT) (envelope-from mwm-dated-1097622024.01bc05@mired.org) Received: (qmail 2498 invoked by uid 100); 2 Oct 2004 23:00:24 -0000 Received: by guru.mired.org (tmda-sendmail, from uid 100); Sat, 02 Oct 2004 18:00:22 -0500 (CDT) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <16735.13061.592435.41234@guru.mired.org> Date: Sat, 2 Oct 2004 18:00:21 -0500 To: Ryan Sommers In-Reply-To: <415E6C4A.1010804@gamersimpact.com> References: <20041002081928.GA21439@gothmog.gr> <20041002083336.GA10355@k7.mavetju> <415E6C4A.1010804@gamersimpact.com> X-Mailer: VM 7.17 under 21.1 (patch 14) "Cuyahoga Valley" XEmacs Lucid X-Primary-Address: mwm@mired.org X-face: "5Mnwy%?j>IIV\)A=):rjWL~NB2aH[}Yq8Z=u~vJ`"(,&SiLvbbz2W`; h9L,Yg`+vb1>RG% *h+%X^n0EZd>TM8_IB;a8F?(Fb"lw'IgCoyM.[Lg#r\ X-Delivery-Agent: TMDA/1.0.3 (Seattle Slew) From: Mike Meyer X-Mailman-Approved-At: Sun, 03 Oct 2004 12:07:45 +0000 cc: freebsd-hackers@FreeBSD.org cc: Edwin Groothuis cc: Giorgos Keramidas Subject: Re: Protection from the dreaded "rm -fr /" X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 02 Oct 2004 23:00:27 -0000 In <415E6C4A.1010804@gamersimpact.com>, Ryan Sommers typed: > Edwin Groothuis wrote: > >On Sat, Oct 02, 2004 at 11:19:28AM +0300, Giorgos Keramidas wrote: > >I'm not so much worried about 'rm -rf /', but I'm more worried about > >"rm -rf *" in my home directory. It happened once because I was too > >happy switching directories before realising what I was doing in > >the wrong directory. > If you use tcsh for your shell add: > > set rmstar > > to your .cshrc file. Then anytime you use '*' as an argument to rm it > will ask you if you are sure you want to do that. zsh does this by default as well. http://www.mired.org/consulting.html Independent Network/Unix/Perforce consultant, email for more information. From owner-freebsd-hackers@FreeBSD.ORG Sun Oct 3 17:38:19 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0788D16A4CE for ; Sun, 3 Oct 2004 17:38:19 +0000 (GMT) Received: from harmony.village.org (rover.village.org [168.103.84.182]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0D8BC43D41 for ; Sun, 3 Oct 2004 17:38:18 +0000 (GMT) (envelope-from imp@bsdimp.com) Received: from localhost (harmony.village.org [10.0.0.6]) by harmony.village.org (8.13.1/8.13.1) with ESMTP id i93HaGx0077468; Sun, 3 Oct 2004 11:36:20 -0600 (MDT) (envelope-from imp@bsdimp.com) Date: Sun, 03 Oct 2004 11:37:39 -0600 (MDT) Message-Id: <20041003.113739.95785967.imp@bsdimp.com> To: tillman@seekingfire.com From: "M. Warner Losh" In-Reply-To: <20041003030946.GV35869@seekingfire.com> References: <20041002210554.GS35869@seekingfire.com> <20041002.192951.35870461.imp@bsdimp.com> <20041003030946.GV35869@seekingfire.com> X-Mailer: Mew version 3.3 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit cc: freebsd-hackers@freebsd.org Subject: Re: Protection from the dreaded "rm -fr /" X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Oct 2004 17:38:19 -0000 In message: <20041003030946.GV35869@seekingfire.com> Tillman Hodgson writes: : On Sat, Oct 02, 2004 at 07:29:51PM -0600, M. Warner Losh wrote: : > In message: <20041002210554.GS35869@seekingfire.com> : > Tillman Hodgson writes: : > : It'll never work, though, that's the thing. At some point it'll rm : > : something it itself needs and error out. There isn't a way to use `rm : > : -rf /` that /doesn't/ result in foot-shooting. : > : > No. You are wrong. if you rm -rf in a chroot, then it won't result : > in foot shooting, necessarily, like it would outside a chroot. : : If you're chrooted, where is the rm binary and associated libraries? : They're in the chroot, in a branch off hte virtual / tree root. rm doesn't have to live in the chroot. Consider chroot /some/path/to/a/chroot rm -rf / in this case, everything under the /some/path/to/a/chroot would be removed. However, the rm that's running is outside of the chroot. This is typically how chroot commands are run, often from shell scripts. : `rm -rf /`, even in chroot, won't delete everything that the command : looks like it will. It can delete just about everything, see above. : At the very least the final unlink, that of / : itself, will likely result in undefined behaviour. Purhaps, but that's not rm's job: to protect you from something that might be undefined. unlink(2) is undefined for remote file systems as well. Maybe it will work, maybe it won't. : Where do the dev's : go if there's no / to root them in? etc etc. Doesn't matter. Irrelevant. The chroot might not have a devfs mounted in it, or any dev nodes at all. /dev isn't required for most operations. Warner From owner-freebsd-hackers@FreeBSD.ORG Sun Oct 3 18:15:02 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 36E4E16A4CE for ; Sun, 3 Oct 2004 18:15:02 +0000 (GMT) Received: from bogslab.ucdavis.edu (bogslab.ucdavis.edu [169.237.68.34]) by mx1.FreeBSD.org (Postfix) with ESMTP id 09B2943D45 for ; Sun, 3 Oct 2004 18:15:02 +0000 (GMT) (envelope-from gkshenaut@ucdavis.edu) Received: from [198.137.203.49] (merlin.bogs.org [198.137.203.49]) by bogslab.ucdavis.edu (8.12.8/8.12.8) with ESMTP id i93IF0uU013752 for ; Sun, 3 Oct 2004 11:15:01 -0700 (PDT) Mime-Version: 1.0 (Apple Message framework v619) In-Reply-To: <20041003.113739.95785967.imp@bsdimp.com> References: <20041002210554.GS35869@seekingfire.com> <20041002.192951.35870461.imp@bsdimp.com> <20041003030946.GV35869@seekingfire.com> <20041003.113739.95785967.imp@bsdimp.com> Content-Type: text/plain; charset=US-ASCII; format=flowed Message-Id: <20A89EEC-1568-11D9-867A-000A9590A44E@ucdavis.edu> Content-Transfer-Encoding: 7bit From: Greg Shenaut Date: Sun, 3 Oct 2004 11:14:55 -0700 To: freebsd-hackers@freebsd.org X-Mailer: Apple Mail (2.619) Subject: Re: Protection from the dreaded "rm -fr /" X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Oct 2004 18:15:02 -0000 The "rm -fr /" is not dreaded. What is dreaded is running that command and other equally dangerous "rm" variants by mistake. Usually, the mistake comes from not paying attention to what you are typing or where you are in the directory hierarchy (for example, "rm -rf *" is probably much more likely than "rm -rf /" and can be equally destructive if run in the wrong directory). One practical solution to this "problem" is to train people not to use the "rm" command, in favor of some other command--say, "del"--with no "recursive", "force", or other options. For example, !#/bin/sh rm -- $* would probably be close to what is needed by a /usr/bin/del command. For most users, there would be no "rm" command, just as there is currently no "dd" or "mknod" command. If someone does the research to discover rm(1), and if they make the decision to use it by default instead of "del", then there's nothing anyone can do to protect them. But if "del" is advertised as the "safer" version of "rm", and it is recommended to users that it be the default, with "rm" reserved for special, extreme cases, then I think you will get the desired result, with zero breakage of existing scripts & conventions. Greg Shenaut From owner-freebsd-hackers@FreeBSD.ORG Sun Oct 3 18:20:07 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id AE64E16A4CE for ; Sun, 3 Oct 2004 18:20:07 +0000 (GMT) Received: from cruzio.com (dsl3-63-249-85-132.cruzio.com [63.249.85.132]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7825743D3F for ; Sun, 3 Oct 2004 18:20:07 +0000 (GMT) (envelope-from brucem@mail.cruzio.com) Received: from mail.cruzio.com (localhost [127.0.0.1]) by cruzio.com (8.12.10/8.12.10) with ESMTP id i93ILEC1000361; Sun, 3 Oct 2004 11:21:14 -0700 (PDT) (envelope-from brucem@mail.cruzio.com) Received: (from brucem@localhost) by mail.cruzio.com (8.12.10/8.12.10/Submit) id i93ILEro000360; Sun, 3 Oct 2004 11:21:14 -0700 (PDT) (envelope-from brucem) Date: Sun, 3 Oct 2004 11:21:14 -0700 (PDT) From: "Bruce R. Montague" Message-Id: <200410031821.i93ILEro000360@mail.cruzio.com> To: andrea@webcom.it cc: freebsd-hackers@freebsd.org cc: durham@jcdurham.com Subject: Re: Sudden Reboots X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Oct 2004 18:20:07 -0000 Hi, Andrea, regarding inverted page tables: > Actually, all Power and PowerPC chips have this... Thanks for pointing that out. I believe the entire line of IBM virtual memory hardware that supports IBM's form of "inverted page tables" is all directly related, if not the same, and descends from the never-completed 1970s-era IBM "Future System" (FS) project. Or perhaps it was a version redone for the System/38 that used lessons learned from the FS? Is this right? The AS/400 has successfully used this architecture for a long time. Most of the other systems that have used this architecture (RT, RS) seem to have never quite caught on. Is this VM unit and the Power/PowerPC's the same? They "cheat" a bit with a hash table to keep the cost of the associative memory down; perhaps increasing its size is the natural evolution of this VM architecture? Are there any "true" single-level store OSes running on this inverted PT hardware? (That is, where RAM is literally treated as just an "invisible" performance cache for a secondary-storage primary memory.) I assume the OS/400 is, but maybe an expert knows for sure? OS/400 runs on modern AS/400's which use the PowerPC, unless I'm mistaken... Sorry to have so many questions and no answers, hopefully the coffee will kick in soon. The FS apparently was IBM's biggest failure; some say it had a lot to do with the growth of silicon valley. A history of the IBM "Future System" and the technologies it spawned would be very interesting. There seems to be little info on it around: www.cs.clemson.edu/~mark/fs.html - bruce From owner-freebsd-hackers@FreeBSD.ORG Sun Oct 3 18:29:08 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C5BFB16A4CE for ; Sun, 3 Oct 2004 18:29:08 +0000 (GMT) Received: from woozle.rinet.ru (woozle.rinet.ru [195.54.192.68]) by mx1.FreeBSD.org (Postfix) with ESMTP id C4EAF43D3F for ; Sun, 3 Oct 2004 18:29:07 +0000 (GMT) (envelope-from marck@rinet.ru) Received: from localhost (localhost [127.0.0.1]) by woozle.rinet.ru (8.13.1/8.13.1) with ESMTP id i93ISv6e015435; Sun, 3 Oct 2004 22:28:57 +0400 (MSD) (envelope-from marck@rinet.ru) Date: Sun, 3 Oct 2004 22:28:57 +0400 (MSD) From: Dmitry Morozovsky To: "M. Warner Losh" In-Reply-To: <20041003.113739.95785967.imp@bsdimp.com> Message-ID: <20041003222523.J9166@woozle.rinet.ru> References: <20041002210554.GS35869@seekingfire.com> <20041002.192951.35870461.imp@bsdimp.com> <20041003.113739.95785967.imp@bsdimp.com> X-NCC-RegID: ru.rinet MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: freebsd-hackers@freebsd.org Subject: Re: Protection from the dreaded "rm -fr /" X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Oct 2004 18:29:08 -0000 On Sun, 3 Oct 2004, M. Warner Losh wrote: [snip] MWL> rm doesn't have to live in the chroot. Consider MWL> chroot /some/path/to/a/chroot rm -rf / MWL> in this case, everything under the /some/path/to/a/chroot would be MWL> removed. However, the rm that's running is outside of the chroot. Not to be too nit-picking, but this is not true, as far as I can understand chroot(8) and chroot(2) ;-) However, since rm is usually statically linked and/or all needed code segments are referenced during rm work are loaded/referenced, this operation finishes successfully (just checked on 4-STABLE and -CURRENT). ... and no, I do *NOT* want to participate in this bikesched color discussion! ;-P Sincerely, D.Marck [DM5020, MCK-RIPE, DM3-RIPN] ------------------------------------------------------------------------ *** Dmitry Morozovsky --- D.Marck --- Wild Woozle --- marck@rinet.ru *** ------------------------------------------------------------------------ From owner-freebsd-hackers@FreeBSD.ORG Sun Oct 3 18:40:32 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 03AE716A4CE for ; Sun, 3 Oct 2004 18:40:32 +0000 (GMT) Received: from smtp812.mail.ukl.yahoo.com (smtp812.mail.ukl.yahoo.com [217.12.12.202]) by mx1.FreeBSD.org (Postfix) with SMTP id 3133E43D54 for ; Sun, 3 Oct 2004 18:40:31 +0000 (GMT) (envelope-from Thomas.Sparrevohn@btinternet.com) Received: from unknown (HELO w2fzz0vc01.aah-go-on.com) (thomas.sparrevohn@hg1.btinternet.com@81.157.227.120 with plain) by smtp812.mail.ukl.yahoo.com with SMTP; 3 Oct 2004 18:40:30 -0000 From: Thomas Sparrevohn To: freebsd-hackers@freebsd.org Date: Sun, 3 Oct 2004 19:39:56 +0100 User-Agent: KMail/1.7 References: <20041002210554.GS35869@seekingfire.com> <20041003.113739.95785967.imp@bsdimp.com> <20041003222523.J9166@woozle.rinet.ru> In-Reply-To: <20041003222523.J9166@woozle.rinet.ru> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200410031939.56433.Thomas.Sparrevohn@btinternet.com> Subject: Re: Protection from the dreaded "rm -fr /" X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Thomas.Sparrevohn@btinternet.com List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Oct 2004 18:40:32 -0000 A simple and pragmatic solution is to use alias in what ever shell you are using e.g. alias rm to rm -i. There used to be a simple "delete" command or script that basically moved all files into a ".deleted" directory insted of actually deleting the files - From a practical point of view it does the trick because it forces anybody to use the escaped version if they really want to delete the files. From owner-freebsd-hackers@FreeBSD.ORG Sun Oct 3 20:34:09 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 689CB16A4CE for ; Sun, 3 Oct 2004 20:34:09 +0000 (GMT) Received: from smtp.des.no (flood.des.no [217.116.83.31]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2CC2343D2D for ; Sun, 3 Oct 2004 20:34:09 +0000 (GMT) (envelope-from des@des.no) Received: by smtp.des.no (Pony Express, from userid 666) id 0D91F5312; Sun, 3 Oct 2004 22:34:08 +0200 (CEST) Received: from dwp.des.no (des.no [80.203.228.37]) by smtp.des.no (Pony Express) with ESMTP id B09CC5313; Sun, 3 Oct 2004 22:34:00 +0200 (CEST) Received: by dwp.des.no (Postfix, from userid 2602) id 8E19EB860; Sun, 3 Oct 2004 22:34:00 +0200 (CEST) To: "M. Warner Losh" References: <20041002210554.GS35869@seekingfire.com> <20041002.192951.35870461.imp@bsdimp.com> <20041003030946.GV35869@seekingfire.com> <20041003.113739.95785967.imp@bsdimp.com> From: des@des.no (=?iso-8859-1?q?Dag-Erling_Sm=F8rgrav?=) Date: Sun, 03 Oct 2004 22:34:00 +0200 In-Reply-To: <20041003.113739.95785967.imp@bsdimp.com> (M. Warner Losh's message of "Sun, 03 Oct 2004 11:37:39 -0600 (MDT)") Message-ID: User-Agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Spam-Checker-Version: SpamAssassin 2.64 (2004-01-11) on flood.des.no X-Spam-Level: X-Spam-Status: No, hits=0.0 required=5.0 tests=AWL autolearn=no version=2.64 cc: freebsd-hackers@freebsd.org Subject: Re: Protection from the dreaded "rm -fr /" X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Oct 2004 20:34:09 -0000 "M. Warner Losh" writes: > rm doesn't have to live in the chroot. Consider > chroot /some/path/to/a/chroot rm -rf / > in this case, everything under the /some/path/to/a/chroot would be > removed. However, the rm that's running is outside of the chroot. Wrong, and I'd be interested to hear how you think chroot(8) would pull that off if it were the case. DES --=20 Dag-Erling Sm=F8rgrav - des@des.no From owner-freebsd-hackers@FreeBSD.ORG Sun Oct 3 21:59:42 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 995A116A4CE; Sun, 3 Oct 2004 21:59:42 +0000 (GMT) Received: from smradoch.ath.cx (r2g224.chello.upc.cz [62.245.70.224]) by mx1.FreeBSD.org (Postfix) with ESMTP id C6F2F43D3F; Sun, 3 Oct 2004 21:59:41 +0000 (GMT) (envelope-from neuhauser@chello.cz) Received: by smradoch.ath.cx (Postfix, from userid 1001) id D98441F87BEE; Sun, 3 Oct 2004 23:59:39 +0200 (CEST) Date: Sun, 3 Oct 2004 23:59:39 +0200 From: Roman Neuhauser To: Giorgos Keramidas Message-ID: <20041003215939.GB951@isis.wad.cz> Mail-Followup-To: Giorgos Keramidas , freebsd-hackers@freebsd.org References: <20041002175704.GB2230@gothmog.gr> <20041002230226.GC1381@gothmog.gr> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20041002230226.GC1381@gothmog.gr> User-Agent: Mutt/1.5.6i cc: freebsd-hackers@freebsd.org Subject: Re: Protection from the dreaded "rm -fr /" X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Oct 2004 21:59:42 -0000 # keramida@freebsd.org / 2004-10-03 02:02:26 +0300: > On 2004-10-02 17:22, Garance A Drosihn wrote: > > At 8:57 PM +0300 10/2/04, Giorgos Keramidas wrote: > > >On 2004-10-02 21:23, Lee Harr wrote: > > >> How about: > > >> chflags sunlnk / > > >> ? > > > > > >Setting sunlink on / will only protect the / directory, not its > > >descendants, so you don't gain much. > > > > We could add a new flag "srunlnk", or maybe even "srm-r". The "rm" > > command will always have to stat() the file it is given (just to > > see if it is a directory), so it could check to see if this flag > > is turned on. If it is turned on, then 'rm' could refuse to honor > > any '-rf' request on that directory. [...] > > Hmmm. This sounds much better indeed :-) have rm -r[f] behave just like find $@ -flags +sunlnk -prune -o -delete (I hope this is correct; if not: if the file has sunlnk among its chflags, skip it and its descendants) this is something I would, if not like, at least tolerate. specialcasing / stinks. it reminds me of all the RHEL machines I deal with at work that have alias rm rm -i, and I can only thank my luck this hasn't costed me an arm; ls | while read f; do rm -i $f; done is very dangerous, at least in bash. I have once deleted parts of my ~ with rm -fr *, but rm -fr / never happened to me, prolly because of my strong dependence on the shell completion. (I hope I'm not too drunk.) -- If you cc me or remove the list(s) completely I'll most likely ignore your message. see http://www.eyrie.org./~eagle/faqs/questions.html From owner-freebsd-hackers@FreeBSD.ORG Mon Oct 4 01:38:21 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9AE0A16A4CE for ; Mon, 4 Oct 2004 01:38:21 +0000 (GMT) Received: from harmony.village.org (rover.village.org [168.103.84.182]) by mx1.FreeBSD.org (Postfix) with ESMTP id ED81943D41 for ; Mon, 4 Oct 2004 01:38:20 +0000 (GMT) (envelope-from imp@bsdimp.com) Received: from localhost (harmony.village.org [10.0.0.6]) by harmony.village.org (8.13.1/8.13.1) with ESMTP id i941c0ZF082137; Sun, 3 Oct 2004 19:38:00 -0600 (MDT) (envelope-from imp@bsdimp.com) Date: Sun, 03 Oct 2004 19:39:32 -0600 (MDT) Message-Id: <20041003.193932.78732524.imp@bsdimp.com> To: des@des.no From: "M. Warner Losh" In-Reply-To: References: <20041003030946.GV35869@seekingfire.com> <20041003.113739.95785967.imp@bsdimp.com> X-Mailer: Mew version 3.3 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable cc: freebsd-hackers@freebsd.org Subject: Re: Protection from the dreaded "rm -fr /" X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Oct 2004 01:38:21 -0000 In message: des@des.no (Dag-Erling Sm=F8rgrav) writes: : "M. Warner Losh" writes: : > rm doesn't have to live in the chroot. Consider : > chroot /some/path/to/a/chroot rm -rf / : > in this case, everything under the /some/path/to/a/chroot would be : > removed. However, the rm that's running is outside of the chroot. : = : Wrong, and I'd be interested to hear how you think chroot(8) would : pull that off if it were the case. I was confused. Warner From owner-freebsd-hackers@FreeBSD.ORG Mon Oct 4 08:10:42 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 46D9716A4CE for ; Mon, 4 Oct 2004 08:10:42 +0000 (GMT) Received: from storm.uk.FreeBSD.org (storm.uk.FreeBSD.org [194.242.157.42]) by mx1.FreeBSD.org (Postfix) with ESMTP id B081043D1F for ; Mon, 4 Oct 2004 08:10:41 +0000 (GMT) (envelope-from mark@grondar.org) Received: from storm.uk.FreeBSD.org (uucp@localhost [127.0.0.1]) by storm.uk.FreeBSD.org (8.13.1/8.13.1) with ESMTP id i948AAi0067645; Mon, 4 Oct 2004 09:10:10 +0100 (BST) (envelope-from mark@grondar.org) Received: (from uucp@localhost)i948AAeS067644; Mon, 4 Oct 2004 09:10:10 +0100 (BST) (envelope-from mark@grondar.org) Received: from grondar.org (localhost [127.0.0.1])i9488gal006311; Mon, 4 Oct 2004 09:08:42 +0100 (BST) (envelope-from mark@grondar.org) Message-Id: <200410040808.i9488gal006311@grimreaper.grondar.org> To: Thomas David Rivers From: Mark Murray In-Reply-To: Your message of "Sat, 02 Oct 2004 21:54:27 EDT." <200410030154.i931sR348272@lakes.dignus.com> Date: Mon, 04 Oct 2004 09:08:41 +0100 Sender: mark@grondar.org cc: freebsd-hackers@FreeBSD.ORG Subject: Re: Protection from the dreaded "rm -fr /" X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Oct 2004 08:10:42 -0000 Thomas David Rivers writes: > If I'm remembering correctly - the historical way to > do this is to alias the "rm" command to something that > else that checks the arguments and complains appropriately > (and then executes /bin/rm.) Typically with just a shell > alias. That keeps you from accidently doing something. Yeah. $ alias rm="rm -i" and you get the annoying "confirm all deletes" behaviour. > Just thinking that putting extra "smarts" into a utility > isn't the typical "UNIXy" way to do this. Let each tool > do the one thing it does really well.. 'rm' removes; let > it remove. Right. There are SO many special cases here that rm cannot possibly catch them all: # cd / ; rm -rf foo/ * ^ This space is a typo. > I think, in the old "UNIX Review" magazine (what - almost > 15+ years ago now?) There was a couple of examples of this. Many others as well. "Windows' job is to prevent you from shooting yourself in the foot. With UNIX, the idea is to make damn sure that there is a hole in your foot with the greatest possible efficiency." (Paraphrased) I've typed "rm -rf *" in the wrong place. ONCE. I learned Unix-fu from that experience. Now, if I type "rm ", I wake up. M -- Mark Murray iumop ap!sdn w,I idlaH From owner-freebsd-hackers@FreeBSD.ORG Mon Oct 4 09:40:22 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id BF66016A4E9 for ; Mon, 4 Oct 2004 09:40:22 +0000 (GMT) Received: from acampi.inet.it (acampi.inet.it [213.92.1.165]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3F15943D39 for ; Mon, 4 Oct 2004 09:40:22 +0000 (GMT) (envelope-from andrea@acampi.inet.it) Received: by acampi.inet.it (Postfix, from userid 1000) id 01721B; Mon, 4 Oct 2004 11:40:20 +0200 (CEST) Date: Mon, 4 Oct 2004 11:40:20 +0200 From: Andrea Campi To: "Bruce R. Montague" Message-ID: <20041004094020.GA31042@webcom.it> References: <200410031821.i93ILEro000360@mail.cruzio.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200410031821.i93ILEro000360@mail.cruzio.com> User-Agent: Mutt/1.5.6i cc: freebsd-hackers@freebsd.org cc: durham@jcdurham.com Subject: Re: Sudden Reboots X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Oct 2004 09:40:23 -0000 On Sun, Oct 03, 2004 at 11:21:14AM -0700, Bruce R. Montague wrote: > > Actually, all Power and PowerPC chips have this... > > Thanks for pointing that out. I believe the entire > line of IBM virtual memory hardware that supports > IBM's form of "inverted page tables" is all directly > related, if not the same, and descends from the > never-completed 1970s-era IBM "Future System" (FS) > project. Or perhaps it was a version redone for the > System/38 that used lessons learned from the FS? Is > this right? The AS/400 has successfully used this > architecture for a long time. Most of the other Don't know. I'm old enough to have worked on those beasts (started out on S/32 and S/36 actually), but I didn't really know them under the hoods. > seem to have never quite caught on. Is this VM unit > and the Power/PowerPC's the same? They "cheat" a bit > with a hash table to keep the cost of the associative > memory down; perhaps increasing its size is the > natural evolution of this VM architecture? Are there > any "true" single-level store OSes running on this > inverted PT hardware? (That is, where RAM is literally This is what I have, and indeed they use hashing: "The RS/6000 uses two types of virtual address. There is a single, flat, system virtual address space with 52-bit addresses. [...] Each process uses 32-bit addresses, and the per-process address space maps into parts of the system address space, [...] The 32-bit process virtual address is divided into 3 parts--a 4-bit segment ID, a 16-bit page index, and a 12-bit offset in the page. Thus the address space comprises 16 segments, and each segment is 256 megabytes in size. [[Incidentally, this is quite a big tradeoff, since it means you only have about 10 segments available, which translates in mmap and shared memory are, ahem, interesting to use on AIX.]] The RS/6000 has 16 segment registers, which are loaded with segment descriptors of the current process. [...] [...] The segment ID identifies the segment register, which is 32 bits in size. It contains a 24-bit segment index, which forms the 24 high-order bits of the system virtual address. This is combined with the 16-bit virtual page index from the process virtual address to form the virtual page number in the system address space. This must be further translated to obtain the physical page number. [...] it maintains an inverted page table called the page frame table (PFT), with one entry for each physical page. The system uses a hashing technique to transalate virtual addresss [...] A data structure called the hash anchor table (HAT) contains information used to convert a system virtual page number to a hash value, which points to a linked list of PFT entries." Source: Uresh Vahalia, Unix Internals: The New Frontier (which by the way I highly recommend regardless of the amount of Unix knowledge). However, as the book points out, the process is slow, so the chip relies on two optimizations: "[...] The RS/6000 maintains two separate TLBs--a 32-entry instruction TLB and a 128-entry data TLB. [[In case of a TLB miss]] the RS/6000 has separate data and instructions caches. The data cache is 32 or 64 kilobytes in size, and the instruction cache is 8 or 32 kilobyes [...] These caches are virtually addressed; therefor, address translation is not required when there is a cache hit." Note that all sizes are severely outdated, and given that the reference Vahalia gives is dated 1994, I suspect they are based on the original POWER CPU. I know for sure recent POWER4 and high-end PowerPC chips (such as the one Apple calls G5) have a lot more. > OS/400 is, but maybe an expert knows for sure? OS/400 > runs on modern AS/400's which use the PowerPC, unless > I'm mistaken... Sorry to have so many questions and > no answers, hopefully the coffee will kick in soon. You are right, AS/400 have been running on POWER or PowerPC for a while now. One of the main advantages to having a HAL that presents a virtual architecture to the OS. Bye, Andrea -- Reboot America. From owner-freebsd-hackers@FreeBSD.ORG Mon Oct 4 10:15:30 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3F6FD16A515; Mon, 4 Oct 2004 10:15:30 +0000 (GMT) Received: from plab.ku.dk (plab.ku.dk [130.225.107.20]) by mx1.FreeBSD.org (Postfix) with ESMTP id 96E5243D1F; Mon, 4 Oct 2004 10:15:14 +0000 (GMT) (envelope-from dk@plab.ku.dk) Received: from plab.ku.dk (localhost [127.0.0.1]) by plab.ku.dk (Postfix) with SMTP id AA8E655518; Mon, 4 Oct 2004 12:15:12 +0200 (CEST) Received: by plab.ku.dk (Postfix, from userid 1003) id 0942E55517; Mon, 4 Oct 2004 12:15:12 +0200 (CEST) Mime-version: 1.0 Content-type: text/plain; charset="koi8-r" Content-transfer-encoding: 8bit Keywords: 2001334874 X-Comment-To: Giorgos Keramidas Sender: dk@plab.ku.dk To: Giorgos Keramidas References: <20041002081928.GA21439@gothmog.gr> <20041002102918.W22102@fw.reifenberger.com> <20041002085143.GA52519@gothmog.gr> From: Dmitry Karasik In-Reply-To: Giorgos Keramidas's message of "Sat, 2 Oct 2004 11:51:43 +0300" Date: 04 Oct 2004 12:15:11 +0200 Message-ID: <84ekke3i34.fsf@plab.ku.dk> Lines: 28 X-Mailer: Gnus v5.7/Emacs 20.7 cc: freebsd-hackers@freebsd.org Subject: Re: Protection from the dreaded "rm -fr /" X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Oct 2004 10:15:30 -0000 Hi Giorgos! On 02 Oct 04 at 10:51, "Giorgos" (Giorgos Keramidas) wrote: Giorgos> The reason I liked this idea is that root has zillions of other Giorgos> ways to destroy an entire system, but not many of them are likely Giorgos> to be the result of mistyping a single character as shown below: Giorgos> # rm -fr / home/someuser/* I just wonder, if 'rm' is so fearful to you, why bother changing rm(1)? Write a simple wrapper around, as many sysadmins do for their needs, and use it instead of rm. #!/usr/bin/perl -w for (@ARGV) {die "$_ is a boo-boo!\n" if m/^\//} exit system 'rm' , @ARGV; -- Sincerely, Dmitry Karasik --- catpipe Systems ApS *BSD solutions, consulting, development www.catpipe.net +45 7021 0050 From owner-freebsd-hackers@FreeBSD.ORG Mon Oct 4 10:27:51 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A222616A4CF for ; Mon, 4 Oct 2004 10:27:51 +0000 (GMT) Received: from dave.horsfall.org (mrdavi2.lnk.telstra.net [139.130.75.233]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7406043D2F for ; Mon, 4 Oct 2004 10:27:49 +0000 (GMT) (envelope-from dave@horsfall.org) Received: from localhost (dave@localhost) by dave.horsfall.org (8.11.4/8.11.4) with ESMTP id i94ARk419076 for ; Mon, 4 Oct 2004 20:27:46 +1000 (EST) Date: Mon, 4 Oct 2004 20:27:45 +1000 (EST) From: Dave Horsfall To: freebsd-hackers@freebsd.org In-Reply-To: <84ekke3i34.fsf@plab.ku.dk> Message-ID: References: <20041002081928.GA21439@gothmog.gr> <20041002102918.W22102@fw.reifenberger.com> <20041002085143.GA52519@gothmog.gr> <84ekke3i34.fsf@plab.ku.dk> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Subject: Re: Protection from the dreaded "rm -fr /" X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Oct 2004 10:27:51 -0000 On Mon, 4 Oct 2004, Dmitry Karasik wrote: > I just wonder, if 'rm' is so fearful to you, why bother changing rm(1)? > Write a simple wrapper around, as many sysadmins do for their needs, and > use it instead of rm. Precisely. This is -hackers; why do we need to be protected from ourselves? You typed it, you suffer the consequences (and you'll think very carefully before hitting RETURN next time). Or don't you trust those to whom you have given root access? I can't believe we're having this conversation. -- Dave From owner-freebsd-hackers@FreeBSD.ORG Mon Oct 4 10:49:55 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 38E5D16A4CE for ; Mon, 4 Oct 2004 10:49:55 +0000 (GMT) Received: from aiolos.otenet.gr (aiolos.otenet.gr [195.170.0.23]) by mx1.FreeBSD.org (Postfix) with ESMTP id 865A443D49 for ; Mon, 4 Oct 2004 10:49:54 +0000 (GMT) (envelope-from keramida@freebsd.org) Received: from orion.daedalusnetworks.priv (host5.bedc.ondsl.gr [62.103.39.229])i94AnqS4029859; Mon, 4 Oct 2004 13:49:52 +0300 Received: from orion.daedalusnetworks.priv (orion [127.0.0.1]) i94AnpdG004406; Mon, 4 Oct 2004 13:49:51 +0300 (EEST) (envelope-from keramida@freebsd.org) Received: (from keramida@localhost)i94AnpR6004405; Mon, 4 Oct 2004 13:49:51 +0300 (EEST) (envelope-from keramida@freebsd.org) Date: Mon, 4 Oct 2004 13:49:51 +0300 From: Giorgos Keramidas To: Dmitry Karasik Message-ID: <20041004104951.GA4301@orion.daedalusnetworks.priv> References: <20041002081928.GA21439@gothmog.gr> <20041002102918.W22102@fw.reifenberger.com> <20041002085143.GA52519@gothmog.gr> <84ekke3i34.fsf@plab.ku.dk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <84ekke3i34.fsf@plab.ku.dk> cc: freebsd-hackers@freebsd.org Subject: Re: Protection from the dreaded "rm -fr /" X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Oct 2004 10:49:55 -0000 On 2004-10-04 12:15, Dmitry Karasik wrote: > On 02 Oct 04 at 10:51, "Giorgos" (Giorgos Keramidas) wrote: > Giorgos> The reason I liked this idea is that root has zillions of other > Giorgos> ways to destroy an entire system, but not many of them are likely > Giorgos> to be the result of mistyping a single character as shown below: > > Giorgos> # rm -fr / home/someuser/* > > I just wonder, if 'rm' is so fearful to you, why bother changing rm(1)? > Write a simple wrapper around, as many sysadmins do for their needs, > and use it instead of rm. > > #!/usr/bin/perl -w > for (@ARGV) {die "$_ is a boo-boo!\n" if m/^\//} > exit system 'rm' , @ARGV; I've lost interest in making any sort of changes to rm(1) after the first dozen or so of messages like this one. Has nobody else seen the logical fallacy of keeping rm(1) unchanged "in order to avoid changes that might not be there in the next system" and suggesting a "locally customized hack like a shell/perl/whatever wrapper" as a better alternative? The shell wrapper will not be there in the next system either. Introducing local incompatibilities and hacks like a perl script wrapper of rm(1) is highly unportable. Simply switching between two different machines will bite you in more dangerous ways than the current version of rm(1) that is part of the system, once you start depending on the local hack you have in one of the machines. Why this is deemed better than something that is part of the source (tunable or not), is far beyond me. Having said that, I'm not going to post about this topic in -hackers anymore (or any other list, for that matter). The arguments against the change have not been very true, coherent or satisfactory, but the general sentiment seems to be that people want rm(1) unchanged. Unchanged it will be, then. Thanks to all who posted on the thread. I didn't intend to start a flamewar of some sort, but I did. I apologize for wasting everyone's time & bandwidth. - Giorgos From owner-freebsd-hackers@FreeBSD.ORG Mon Oct 4 11:52:33 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id AF87816A4CE; Mon, 4 Oct 2004 11:52:33 +0000 (GMT) Received: from kweetal.tue.nl (kweetal.tue.nl [131.155.3.6]) by mx1.FreeBSD.org (Postfix) with ESMTP id 440AF43D2F; Mon, 4 Oct 2004 11:52:33 +0000 (GMT) (envelope-from stijn@pcwin002.win.tue.nl) Received: by kweetal.tue.nl (Postfix, from userid 40) id 2DB1513B6A1; Mon, 4 Oct 2004 13:52:32 +0200 (CEST) Received: from pcwin002.win.tue.nl (pcwin002.win.tue.nl [131.155.71.72]) by kweetal.tue.nl (Postfix) with ESMTP id 0721913B9E9; Mon, 4 Oct 2004 13:52:28 +0200 (CEST) Received: (from stijn@localhost) by pcwin002.win.tue.nl (8.13.1/8.13.1/Submit) id i94BcFsP001328; Mon, 4 Oct 2004 13:38:15 +0200 (CEST) (envelope-from stijn) Date: Mon, 4 Oct 2004 13:38:15 +0200 From: Stijn Hoop To: Giorgos Keramidas Message-ID: <20041004113815.GI62157@pcwin002.win.tue.nl> Mail-Followup-To: Stijn Hoop , Giorgos Keramidas , Dmitry Karasik , freebsd-hackers@freebsd.org References: <20041002081928.GA21439@gothmog.gr> <20041002102918.W22102@fw.reifenberger.com> <20041002085143.GA52519@gothmog.gr> <84ekke3i34.fsf@plab.ku.dk> <20041004104951.GA4301@orion.daedalusnetworks.priv> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20041004104951.GA4301@orion.daedalusnetworks.priv> User-Agent: Mutt/1.4.2.1i X-Bright-Idea: Let's abolish HTML mail! X-Spam-Checker-Version: SpamAssassin 2.63 (2004-01-11) on kweetal.tue.nl X-Spam-DCC: : kweetal.tue.nl 1074; Body=1 Fuz1=1 Fuz2=1 X-Spam-Status: No, hits=-4.9 required=6.3 tests=BAYES_00 autolearn=ham version=2.63 X-Spam-Level: cc: freebsd-hackers@freebsd.org Subject: Re: Protection from the dreaded "rm -fr /" X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Oct 2004 11:52:33 -0000 On Mon, Oct 04, 2004 at 01:49:51PM +0300, Giorgos Keramidas wrote: > I've lost interest in making any sort of changes to rm(1) after the first > dozen or so of messages like this one. Don't get too disappointed: http://www.freebsd.org/cgi/cvsweb.cgi/src/bin/rm/rm.c.diff?r1=1.48&r2=1.49 changes by des@. --Stijn -- Nostalgia ain't what it used to be. From owner-freebsd-hackers@FreeBSD.ORG Mon Oct 4 12:34:01 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id DB43C16A4CE for ; Mon, 4 Oct 2004 12:34:01 +0000 (GMT) Received: from shrike.submonkey.net (cpc2-cdif3-6-0-cust204.cdif.cable.ntl.com [81.103.67.204]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7EF9043D5D for ; Mon, 4 Oct 2004 12:34:01 +0000 (GMT) (envelope-from setantae@submonkey.net) Received: from setantae by shrike.submonkey.net with local (Exim 4.42 (FreeBSD)) id 1CES2S-0007br-5b; Mon, 04 Oct 2004 13:34:00 +0100 Date: Mon, 4 Oct 2004 13:34:00 +0100 From: Ceri Davies To: Dave Horsfall Message-ID: <20041004123400.GF2493@submonkey.net> Mail-Followup-To: Ceri Davies , Dave Horsfall , freebsd-hackers@freebsd.org References: <20041002081928.GA21439@gothmog.gr> <20041002102918.W22102@fw.reifenberger.com> <20041002085143.GA52519@gothmog.gr> <84ekke3i34.fsf@plab.ku.dk> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="cuksurJxElusDw39" Content-Disposition: inline In-Reply-To: X-PGP: finger ceri@FreeBSD.org User-Agent: Mutt/1.5.6i Sender: Ceri Davies cc: freebsd-hackers@freebsd.org Subject: Re: Protection from the dreaded "rm -fr /" X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Oct 2004 12:34:02 -0000 --cuksurJxElusDw39 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Oct 04, 2004 at 08:27:45PM +1000, Dave Horsfall wrote: > On Mon, 4 Oct 2004, Dmitry Karasik wrote: >=20 > > I just wonder, if 'rm' is so fearful to you, why bother changing rm(1)? > > Write a simple wrapper around, as many sysadmins do for their needs, and > > use it instead of rm. >=20 > Precisely. >=20 > This is -hackers; why do we need to be protected from ourselves? All the world is not -hackers. Ceri --=20 I hear thought presenting the problem. -- dadadodo -c 1 Mail/trhodes --cuksurJxElusDw39 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.6 (FreeBSD) iD8DBQFBYUM3ocfcwTS3JF8RAkWcAJ9MOtk4QdDyGg9AKTsfYWuc6xDnwACeICuu CIlyiEwBc68TYclZDBGaT2M= =6428 -----END PGP SIGNATURE----- --cuksurJxElusDw39-- From owner-freebsd-hackers@FreeBSD.ORG Mon Oct 4 12:43:46 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D221416A4CF for ; Mon, 4 Oct 2004 12:43:46 +0000 (GMT) Received: from spider.deepcore.dk (cpe.atm2-0-53484.0x50a6c9a6.abnxx9.customer.tele.dk [80.166.201.166]) by mx1.FreeBSD.org (Postfix) with ESMTP id 33D7443D49 for ; Mon, 4 Oct 2004 12:43:46 +0000 (GMT) (envelope-from sos@DeepCore.dk) Received: from [172.18.2.1] (axiell-gw1.novi.dk [130.225.63.24]) by spider.deepcore.dk (8.12.11/8.12.10) with ESMTP id i94Chglo042370 for ; Mon, 4 Oct 2004 14:43:44 +0200 (CEST) (envelope-from sos@DeepCore.dk) Message-ID: <41614579.7090508@DeepCore.dk> Date: Mon, 04 Oct 2004 14:43:37 +0200 From: =?ISO-8859-1?Q?S=F8ren_Schmidt?= User-Agent: Mozilla Thunderbird 0.7.2 (X11/20040802) X-Accept-Language: en-us, en MIME-Version: 1.0 To: freebsd-hackers@freebsd.org References: <20041002081928.GA21439@gothmog.gr> <20041002102918.W22102@fw.reifenberger.com> <20041002085143.GA52519@gothmog.gr> <84ekke3i34.fsf@plab.ku.dk> <20041004123400.GF2493@submonkey.net> In-Reply-To: <20041004123400.GF2493@submonkey.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: quoted-printable X-mail-scanned: by DeepCore Virus & Spam killer v1.4 Subject: Re: Protection from the dreaded "rm -fr /" X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Oct 2004 12:43:47 -0000 Ceri Davies wrote: > On Mon, Oct 04, 2004 at 08:27:45PM +1000, Dave Horsfall wrote: >=20 >>On Mon, 4 Oct 2004, Dmitry Karasik wrote: >> >> >>>I just wonder, if 'rm' is so fearful to you, why bother changing rm(1)= ? >>>Write a simple wrapper around, as many sysadmins do for their needs, a= nd >>>use it instead of rm. >> >>Precisely. >> >>This is -hackers; why do we need to be protected from ourselves? >=20 >=20 > All the world is not -hackers. I have more than enough bikeshedwood now to get past the winter, could=20 we stop this now please ? --=20 -S=F8ren From owner-freebsd-hackers@FreeBSD.ORG Mon Oct 4 17:39:44 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1866F16A4CE for ; Mon, 4 Oct 2004 17:39:44 +0000 (GMT) Received: from mta2.rdslink.ro (emta2.rdslink.ro [193.231.236.63]) by mx1.FreeBSD.org (Postfix) with ESMTP id 84B8643D2D for ; Mon, 4 Oct 2004 17:39:42 +0000 (GMT) (envelope-from dr.clau@rdslink.ro) Received: (qmail 28101 invoked from network); 4 Oct 2004 17:34:06 -0000 Received: from unknown (HELO mail.rdslink.ro) (193.231.236.20) by emta2.rdslink.ro with SMTP; 4 Oct 2004 17:34:06 -0000 Received: (qmail 5285 invoked from network); 4 Oct 2004 17:39:20 -0000 Received: from unknown (HELO ?82.79.29.15?) (82.79.29.15) by mail.rdslink.ro with SMTP; 4 Oct 2004 17:39:20 -0000 Message-ID: <41618AC7.1040808@rdslink.ro> Date: Mon, 04 Oct 2004 20:39:19 +0300 From: Claudiu Dragalina-Paraipan User-Agent: Mozilla Thunderbird 0.7.3 (X11/20041001) X-Accept-Language: en-us, en MIME-Version: 1.0 To: freebsd-hackers@freebsd.org Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Subject: 2 inet connections X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Oct 2004 17:39:44 -0000 Hi, I have this situation: 2 inet connection at 2 different ISP, one with 2Mbps and one with 128kbps; and a big NATed network behind it, and a small group of real addresses. I want to do this: use the first connection as "primary" connection, and if this fails, go to the second connection, as a backup. The problem is that none of the ISP will help me in any way, so I have to find a solution by my own. I am trying to avoid the making of a software that watches the connections and "declare" a line dead when no TCP connection can be made, thus switching to the secondary/backup line. I realize that there is no way of using the group of real addresses on the backup line, since they are not routed, but this is not of such importance. I need only to provide Internet connection for the NATed network. So... can someone provide me with some good practical advice for this situation ? NOTE: I want to use FreeBSD for this, so FreeBSD specific advices are welcome. In fact I don't even think of other solution. I realize that this is not a very common situation, and I hope I have explained it sufficiently clear. Thank you very much. Best regards, -- Claudiu Dragalina-Paraipan e-mail: dr.clau@rdslink.ro From owner-freebsd-hackers@FreeBSD.ORG Mon Oct 4 17:46:58 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 98A1A16A4CE for ; Mon, 4 Oct 2004 17:46:58 +0000 (GMT) Received: from smtpq1.home.nl (smtpq1.home.nl [213.51.128.196]) by mx1.FreeBSD.org (Postfix) with ESMTP id 35CDD43D3F for ; Mon, 4 Oct 2004 17:46:58 +0000 (GMT) (envelope-from dodell@sitetronics.com) Received: from [213.51.128.133] (port=50387 helo=smtp2.home.nl) by smtpq1.home.nl with esmtp (Exim 4.30) id 1CEWvI-0004oL-On; Mon, 04 Oct 2004 19:46:56 +0200 Received: from cc740438-a.deven1.ov.home.nl ([82.75.136.183]:4567) by smtp2.home.nl with esmtp (Exim 4.30) id 1CEWvH-0003T0-P6; Mon, 04 Oct 2004 19:46:55 +0200 Message-ID: <41618C8F.6090703@sitetronics.com> Date: Mon, 04 Oct 2004 19:46:55 +0200 From: "Devon H. O'Dell" User-Agent: Mozilla Thunderbird 0.8 (Windows/20040913) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Claudiu Dragalina-Paraipan References: <41618AC7.1040808@rdslink.ro> In-Reply-To: <41618AC7.1040808@rdslink.ro> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-AtHome-MailScanner-Information: Please contact support@home.nl for more information X-AtHome-MailScanner: Found to be clean cc: freebsd-hackers@freebsd.org Subject: Re: 2 inet connections X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Oct 2004 17:46:58 -0000 Claudiu Dragalina-Paraipan wrote: > Hi, > > I have this situation: 2 inet connection at 2 different ISP, one with > 2Mbps and one with 128kbps; and a big NATed network behind it, and a > small group of real addresses. > I want to do this: use the first connection as "primary" connection, and > if this fails, go to the second connection, as a backup. > The problem is that none of the ISP will help me in any way, so I have > to find a solution by my own. > > I am trying to avoid the making of a software that watches the > connections and "declare" a line dead when no TCP connection can be > made, thus switching to the secondary/backup line. > I realize that there is no way of using the group of real addresses on > the backup line, since they are not routed, but this is not of such > importance. I need only to provide Internet connection for the NATed > network. > > So... can someone provide me with some good practical advice for this > situation ? > > NOTE: > I want to use FreeBSD for this, so FreeBSD specific advices are welcome. > In fact I don't even think of other solution. > > I realize that this is not a very common situation, and I hope I have > explained it sufficiently clear. > > Thank you very much. > > Best regards, You might want to look at various patches for FreeBSD multipath routing that are available via the mailing lists. They're pretty easy to find with a search for FreeBSD Multimath routing via google. --Devon From owner-freebsd-hackers@FreeBSD.ORG Mon Oct 4 17:49:39 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 083C716A4CE for ; Mon, 4 Oct 2004 17:49:39 +0000 (GMT) Received: from w2xo.jcdurham.com (18.gibs5.xdsl.nauticom.net [209.195.184.19]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7086F43D58 for ; Mon, 4 Oct 2004 17:49:38 +0000 (GMT) (envelope-from durham@jcdurham.com) Received: from tiltdown.pgh.nepinc.com (pgh.nepinc.com [66.207.129.50]) by w2xo.jcdurham.com (8.12.11/8.11.6) with ESMTP id i94HnbJ4097249 for ; Mon, 4 Oct 2004 13:49:37 -0400 (EDT) (envelope-from durham@jcdurham.com) From: Jim Durham To: freebsd-hackers@freebsd.org Date: Mon, 4 Oct 2004 13:49:36 -0400 User-Agent: KMail/1.7 References: <200409301003.00492.durham@jcdurham.com> In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200410041349.36314.durham@jcdurham.com> Subject: Re: Sudden Reboots X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Oct 2004 17:49:39 -0000 On Saturday 02 October 2004 06:42 pm, Mike Tancsa wrote: > On Fri, 1 Oct 2004 21:50:26 -0500, in sentex.lists.freebsd.hackers you > > wrote: > >On Oct 1, 2004, at 7:23 PM, Jim Durham wrote: > >> These are very rare.... except they seem to happen about once a day > >> for a > >> while and then stop... very strange.. > >> > >>> and usually caused by hardware problems (e.g. faulty power supply, > >>> overheating CPU, bad RAM). > >> > >> Possible, but if so, the hardware fixed itself on the first two boxes I > >> mentioned. > > > >All of this can be bad, or not quite bad -- just not healthy -- > >hardware. Say a power supply that can't supply reliable +5, when the > >line voltage drops a tad while all the disks are being hammered. It > >can be a nightmare to figure out. Setup crash dumps, but also make > >sure that the UPS the box is attached to isn't having problems. If > >it's not on conditioned power, fix that. > > Also, a lot of older UPSes do not have any AVR (automatic voltage > regulation). This in conjunction with a marginal power supply can > cause problems like you describe. One of our POPs are in an area that > has seen tremendous residential and industrial growth putting a strain > on the local power. Prior to some major upgrades from the local > utility company, we would see street power dropping below 100V during > peak usage coming from the street and our APCs that have "smart boost" > would all kick in to compensate. Also, the UPS can just be "bad" over > time. > > As others have said, its pretty rare that reboots do not leave a crash > dump behind when its a software issue. At the very least, enable crash > dumps on your machines in question. See the man page for dumpon. At > least this way you can narrow down the odds as to whether or not its > pointing to a hardware or software issue. > > ---Mike I will do that. However, there is something really weird about this after watching it for a few days now that I'd like to tell about.. The reboots started out happening at 5.15 pm or so. I had them unplug the server completely from AC and restart it and now it's happening withing a few minutes of 12:40pm every day. The 'last' command output is the only thing showing anything log-wise. Look at this: reboot ~ Mon Oct 4 12:33 reboot ~ Sun Oct 3 12:37 reboot ~ Sat Oct 2 12:42 reboot ~ Fri Oct 1 12:45 Looks like it's creeping 3 minutes earlier every day. Of course, the fsck time is involved, but probably that is about the same every time. I don't have documentation any more, but the one server I remember noting the time when it was doing this before did it at 5:15 or so every morning. This sure doesn't sound like hardware to me unless it's something to do with the motherboard clock. I can't think of anything in hardware that would cycle like this. I remember having an AM radio transmitter back in my youth that would blow HV rectifiers every day at the same time and we traced it to an industrial plant pulling a breaker on the same line as us, but this server is on a UPS and the time keeps creeping by 3 minutes. Really strange. I will try crashdump. -Jim From owner-freebsd-hackers@FreeBSD.ORG Mon Oct 4 19:03:38 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id BB7ED16A4CE for ; Mon, 4 Oct 2004 19:03:38 +0000 (GMT) Received: from mxb.saturn-tech.com (mxb.saturn-tech.com [207.229.19.99]) by mx1.FreeBSD.org (Postfix) with ESMTP id 00DAE43D1F for ; Mon, 4 Oct 2004 19:03:36 +0000 (GMT) (envelope-from drussell@saturn-tech.com) Received: from mxb.saturn-tech.com (localhost [127.0.0.1]) by mxb.saturn-tech.com (8.12.3/8.12.3) with ESMTP id i94J6QKt001233; Mon, 4 Oct 2004 13:06:26 -0600 (MDT) (envelope-from drussell@saturn-tech.com) Received: from localhost (drussell@localhost)i94J6Pbt001230; Mon, 4 Oct 2004 13:06:25 -0600 (MDT) (envelope-from drussell@saturn-tech.com) X-Authentication-Warning: mxb.saturn-tech.com: drussell owned process doing -bs Date: Mon, 4 Oct 2004 13:06:25 -0600 (MDT) From: Doug Russell To: Jim Durham In-Reply-To: <200410041349.36314.durham@jcdurham.com> Message-ID: <20041004130415.G1034-100000@mxb.saturn-tech.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: freebsd-hackers@freebsd.org Subject: Re: Sudden Reboots X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Oct 2004 19:03:38 -0000 On Mon, 4 Oct 2004, Jim Durham wrote: > The reboots started out happening at 5.15 pm or so. I had them unplug the > server completely from AC and restart it and now it's happening withing a few > minutes of 12:40pm every day. > > The 'last' command output is the only thing showing anything log-wise. Look at > this: > > reboot ~ Mon Oct 4 12:33 > reboot ~ Sun Oct 3 12:37 > reboot ~ Sat Oct 2 12:42 > reboot ~ Fri Oct 1 12:45 That is strange.... What is that machine doing at that time? Does it start a backup job, or any kind of maintenance at that time? Anything at all? I'd monitor what the heck the machine is doing to some remote machine and see what goes on when it dies. Later....... From owner-freebsd-hackers@FreeBSD.ORG Mon Oct 4 20:04:03 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A208616A4CE for ; Mon, 4 Oct 2004 20:04:03 +0000 (GMT) Received: from w2xo.jcdurham.com (18.gibs5.xdsl.nauticom.net [209.195.184.19]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1EB7743D31 for ; Mon, 4 Oct 2004 20:04:03 +0000 (GMT) (envelope-from durham@jcdurham.com) Received: from tiltdown.pgh.nepinc.com (pgh.nepinc.com [66.207.129.50]) by w2xo.jcdurham.com (8.12.11/8.11.6) with ESMTP id i94K42nA001854 for ; Mon, 4 Oct 2004 16:04:02 -0400 (EDT) (envelope-from durham@jcdurham.com) From: Jim Durham To: freebsd-hackers@freebsd.org Date: Mon, 4 Oct 2004 16:04:00 -0400 User-Agent: KMail/1.7 References: <20041004130415.G1034-100000@mxb.saturn-tech.com> In-Reply-To: <20041004130415.G1034-100000@mxb.saturn-tech.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200410041604.00507.durham@jcdurham.com> Subject: Re: Sudden Reboots X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Oct 2004 20:04:03 -0000 On Monday 04 October 2004 03:06 pm, Doug Russell wrote: > On Mon, 4 Oct 2004, Jim Durham wrote: > > The reboots started out happening at 5.15 pm or so. I had them unplug the > > server completely from AC and restart it and now it's happening withing a > > few minutes of 12:40pm every day. > > > > The 'last' command output is the only thing showing anything log-wise. > > Look at this: > > > > reboot ~ Mon Oct 4 12:33 > > reboot ~ Sun Oct 3 12:37 > > reboot ~ Sat Oct 2 12:42 > > reboot ~ Fri Oct 1 12:45 > > That is strange.... > What is that machine doing at that time? Does it start a backup job, or > any kind of maintenance at that time? Anything at all? > > I'd monitor what the heck the machine is doing to some remote machine and > see what goes on when it dies. > > Later....... Well... I'm trying to do too many things at the same time and not thinking. I thought about it and also ran 'last -f /var/log/wmtp.1' and found the whole sequence...and added my recent reboot info to the top and here is what I got. reboot ~ Mon Oct 4 14:54 reboot ~ Mon Oct 4 12:33 reboot ~ Sun Oct 3 12:37 reboot ~ Sat Oct 2 12:42 reboot ~ Fri Oct 1 12:45 reboot ~ Thu Sep 30 12:33 reboot ~ Thu Sep 30 08:54 reboot ~ Wed Sep 29 08:41 reboot ~ Tue Sep 28 17:20 reboot ~ Mon Sep 27 17:28 reboot ~ Sun Sep 26 17:28 reboot ~ Sat Sep 25 17:37 reboot ~ Fri Sep 24 17:38 reboot ~ Thu Sep 23 17:42 reboot ~ Wed Sep 22 17:50 reboot ~ Tue Sep 21 17:52 reboot ~ Mon Sep 20 17:57 reboot ~ Sun Sep 19 17:57 reboot ~ Sat Sep 18 17:56 Now, the machine was powered down on Sept 17 because of an all-day power failure. It started doing this on the 18th ,starting at 5:56pm and working earlier until Sept 29, when I upgraded from 4.9 to 4.10 p3. Then it started rebooting at 8:45 aprox and I had the customer shut down the machine completely on the 30th and remove the AC from the rear connector and wait a few minutes and bring it back up. That's when it started rebooting at 12:30 or so. Googling for "Freebsd reboots at same time every day" will produce hits on people with the same problem so this is not just me. I checked crontab, etc and there's nothing coinciding and also, apparently every time you reboot the machine, the cycle changes, so how can it be an external event? Boy...I'm confused... 8-) There was one Google posting that maintained that this one guy fixed it by removing IPV6 from the kernel. I'm trying this at the moment. Of course, I had to reboot to change the kernel, so the times will probably change if it keeps rebooting. It also just hit me that the time doesn't change much if the machine reboots itself, but changes if you upgrade or do a controlled reboot. Wow... -- -Jim From owner-freebsd-hackers@FreeBSD.ORG Mon Oct 4 20:43:41 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0AFBD16A4CE for ; Mon, 4 Oct 2004 20:43:41 +0000 (GMT) Received: from adsl-68-76-19-75.dsl.klmzmi.ameritech.net (adsl-68-76-19-75.dsl.klmzmi.ameritech.net [68.76.19.75]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4969543D1D for ; Mon, 4 Oct 2004 20:43:40 +0000 (GMT) (envelope-from luke@foolishgames.com) Received: from [192.168.0.50] (24.176.8.69.kzo.mi.chartermi.net [24.176.8.69]) (authenticated bits=0)ESMTP id i94KmOMu062094; Mon, 4 Oct 2004 16:48:24 -0400 (EDT) (envelope-from luke@foolishgames.com) X-Authentication-Warning: adsl-68-76-19-75.dsl.klmzmi.ameritech.net: Host 24.176.8.69.kzo.mi.chartermi.net [24.176.8.69] claimed to be [192.168.0.50] Message-Id: <0B6E1D1F-1646-11D9-BFC0-000A95EFF4CA@foolishgames.com> X-Habeas-Swe-6: email in exchange for a license for this Habeas X-Habeas-Swe-3: like Habeas SWE (tm) Date: Mon, 4 Oct 2004 16:43:27 -0400 X-Habeas-Swe-8: Message (HCM) and not spam. Please report use of this From: Lucas Holt X-Habeas-Swe-5: Sender Warranted Email (SWE) (tm). The sender of this X-Habeas-Swe-2: brightly anticipated In-Reply-To: <200410041604.00507.durham@jcdurham.com> References: <20041004130415.G1034-100000@mxb.saturn-tech.com> <200410041604.00507.durham@jcdurham.com> To: Jim Durham X-Habeas-Swe-7: warrant mark warrants that this is a Habeas Compliant Mime-Version: 1.0 (Apple Message framework v619) X-Habeas-Swe-4: Copyright 2002 Habeas (tm) Content-Type: text/plain; charset=US-ASCII; format=flowed X-Habeas-Swe-1: winter into spring Content-Transfer-Encoding: 7bit X-Habeas-Swe-9: mark in spam to . X-Mailer: Apple Mail (2.619) X-Virus-Scanned: clamd / ClamAV version 0.75.1, clamav-milter version 0.75c clamav-milter version 0.75c on adsl-68-76-19-75.dsl. X-Virus-Status: Clean cc: freebsd-hackers@freebsd.org Subject: Re: Sudden Reboots X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Oct 2004 20:43:41 -0000 I had a problem like this only it was a weekly occurrence. I tracked it down to the network card driver. After swapping out the network card with a different brand/chipset, the problem was resolved. In my case, i had entries in the log related to an overflowed buffer. Packet sizes were very large and like clockwork based on traffic patterns the machine rebooted weekly. This happened to me on 5.21 release. i never got around to looking at the driver code as I talked my employer into buying a 3com card :) Lucas Holt Luke@FoolishGames.com ________________________________________________________ FoolishGames.com (Jewel Fan Site) JustJournal.com (Free blogging) From owner-freebsd-hackers@FreeBSD.ORG Mon Oct 4 21:29:58 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C02E016A4CE for ; Mon, 4 Oct 2004 21:29:58 +0000 (GMT) Received: from obsecurity.dyndns.org (CPE0050040655c8-CM00111ae02aac.cpe.net.cable.rogers.com [69.194.102.143]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1EA7B43D3F for ; Mon, 4 Oct 2004 21:29:58 +0000 (GMT) (envelope-from kris@obsecurity.org) Received: by obsecurity.dyndns.org (Postfix, from userid 1000) id 25B815138B; Mon, 4 Oct 2004 14:31:05 -0700 (PDT) Date: Mon, 4 Oct 2004 14:31:05 -0700 From: Kris Kennaway To: Lucas Holt Message-ID: <20041004213104.GA564@xor.obsecurity.org> References: <20041004130415.G1034-100000@mxb.saturn-tech.com> <200410041604.00507.durham@jcdurham.com> <0B6E1D1F-1646-11D9-BFC0-000A95EFF4CA@foolishgames.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="x+6KMIRAuhnl3hBn" Content-Disposition: inline In-Reply-To: <0B6E1D1F-1646-11D9-BFC0-000A95EFF4CA@foolishgames.com> User-Agent: Mutt/1.4.2.1i cc: freebsd-hackers@freebsd.org cc: Jim Durham Subject: Re: Sudden Reboots X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Oct 2004 21:29:58 -0000 --x+6KMIRAuhnl3hBn Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Oct 04, 2004 at 04:43:27PM -0400, Lucas Holt wrote: > I had a problem like this only it was a weekly occurrence. I tracked=20 > it down to the network card driver. After swapping out the network=20 > card with a different brand/chipset, the problem was resolved. In my=20 > case, i had entries in the log related to an overflowed buffer. Packet= =20 > sizes were very large and like clockwork based on traffic patterns the=20 > machine rebooted weekly. This happened to me on 5.21 release. >=20 > i never got around to looking at the driver code as I talked my=20 > employer into buying a 3com card :) Or it could be a broken card. Hardware does strange things when it breaks, you know ;-) Kris --x+6KMIRAuhnl3hBn Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.6 (FreeBSD) iD8DBQFBYcEYWry0BWjoQKURAqMVAJ9O3e9JD8Est4XF6mUW5Bd9q7iSOwCfRGgj BqHKpXchJIbd7jsSfWxjKEs= =NI1T -----END PGP SIGNATURE----- --x+6KMIRAuhnl3hBn-- From owner-freebsd-hackers@FreeBSD.ORG Tue Oct 5 00:39:35 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id B9A0516A4CE for ; Tue, 5 Oct 2004 00:39:35 +0000 (GMT) Received: from grummit.biaix.org (86.Red-213-97-212.pooles.rima-tde.net [213.97.212.86]) by mx1.FreeBSD.org (Postfix) with SMTP id 1357343D2D for ; Tue, 5 Oct 2004 00:39:34 +0000 (GMT) (envelope-from lists-freebsd-hackers@biaix.org) Received: (qmail 54591 invoked by uid 1000); 5 Oct 2004 00:37:24 -0000 Date: Tue, 5 Oct 2004 02:37:24 +0200 From: Joan Picanyol To: freebsd-net@freebsd.org, freebsd-hackers@freebsd.org Message-ID: <20041005003724.GA51251@grummit.biaix.org> Mail-Followup-To: freebsd-net@freebsd.org, freebsd-hackers@freebsd.org, lists-freebsd-hackers@biaix.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.1i Subject: NFS locking issues: Portmapper failure X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Oct 2004 00:39:35 -0000 [please honour Mail-Followup-To:, not subscribed to all lists] Hi, This is a respost of http://docs.freebsd.org/cgi/mid.cgi?20040930172241.GA2882 with some additional information; since I got no response, I'm trying better luck here. Short version: rpc.lockd does not start on a 5.3-BETA6 client against a 4.10-p3 server, the error message is: rpc.lockd: 100024 RPC: Port mapper failure Everything looks ok on the server: 281,p0,0$ uname -srn FreeBSD grummit.biaix.org 4.10-RELEASE-p3 283,p0,0$ sockstat -4 | egrep 'rpc|portmap|nfs|mount' root rpc.stat 114 3 udp4 *:739 *:* root rpc.stat 114 4 tcp4 *:635 *:* root rpc.lock 112 3 udp4 *:844 *:* root rpc.lock 112 4 tcp4 *:628 *:* root nfsd 106 3 tcp4 *:2049 *:* root mountd 104 3 udp4 *:849 *:* root mountd 104 4 tcp4 *:647 *:* daemon portmap 100 3 udp4 *:111 *:* daemon portmap 100 4 tcp4 *:111 *:* And from the client: 319,p0,0$ uname -srn FreeBSD calvin.biaix.org 5.3-BETA6 320,p0,0$ rpcinfo -s grummit program version(s) netid(s) service owner 100000 2 udp,tcp portmapper unknown 100004 2,1 tcp,udp ypserv unknown 100005 1,3 tcp,udp mountd unknown 100003 3,2 tcp,udp nfs unknown 100021 4,3,1 tcp,udp nlockmgr unknown 100024 1 tcp,udp status unknown And I can telnet to the portmapper and nlockmgr ports from calvin to grummit (no firewall/hosts.allow issues). I haven't been able to obtain any debug output from rpc*, only these messages. A datapoint is that even though I get many messages like nfs server grummit:/fs/home/mount: not responding whenever I start gnome, I can still do a 'ls /home'. In the ps output I can see lots of process with "pages locked in core". I have a tcpdump available (server-side) if anyone is interested. This is not related to mpsafenet. What else should I look at to try to locate the issue? tks -- pica From owner-freebsd-hackers@FreeBSD.ORG Tue Oct 5 01:16:41 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E5E9516A4CE for ; Tue, 5 Oct 2004 01:16:41 +0000 (GMT) Received: from mail.devrandom.org.uk (mail.devrandom.org.uk [84.92.10.242]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2035643D55 for ; Tue, 5 Oct 2004 01:16:41 +0000 (GMT) (envelope-from lists@chrishowells.co.uk) Received: from localhost (frodo [192.168.1.8]) by mail.devrandom.org.uk (Postfix) with ESMTP id 1D214AFE5 for ; Mon, 4 Oct 2004 14:29:11 +0100 (BST) Received: from mail.devrandom.org.uk ([192.168.1.8]) by localhost (frodo [192.168.1.8]) (amavisd-new, port 10024) with ESMTP id 75450-09 for ; Mon, 4 Oct 2004 14:29:08 +0100 (BST) Received: from [192.168.1.176] (unknown [192.168.1.176]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (No client certificate requested) by mail.devrandom.org.uk (Postfix) with ESMTP id 0E76BAFCF for ; Mon, 4 Oct 2004 14:29:08 +0100 (BST) From: Chris Howells Organization: K Desktop Environment To: freebsd-hackers@freebsd.org Date: Mon, 4 Oct 2004 13:26:47 +0100 User-Agent: KMail/1.7.50 References: <200410040808.i9488gal006311@grimreaper.grondar.org> In-Reply-To: <200410040808.i9488gal006311@grimreaper.grondar.org> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart1682926.m4AtDa1FI6"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit Message-Id: <200410041326.51591.lists@chrishowells.co.uk> X-Virus-Scanned: by amavisd-new at devrandom.org.uk Subject: Re: Protection from the dreaded "rm -fr /" X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Oct 2004 01:16:42 -0000 --nextPart1682926.m4AtDa1FI6 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On Monday 04 October 2004 09:08, Mark Murray wrote: > Yeah. > > $ alias rm=3D"rm -i" > > and you get the annoying =A0"confirm all deletes" behaviour. Remember that -r over-rides -i, so the warning does not appear: bash-2.05b$ mkdir blah bash-2.05b$ rm -irf blah bash-2.05b$ mkdir blah bash-2.05b$ rm -if blah rm: blah: is a directory bash-2.05b$ rm -ir blah remove blah? y bash-2.05b$ =2D-=20 Cheers, Chris Howells -- chris@chrishowells.co.uk, howells@kde.org Web: http://chrishowells.co.uk, PGP ID: 0x33795A2C KDE/Qt/C++/PHP Developer: http://www.kde.org --nextPart1682926.m4AtDa1FI6 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.6 (FreeBSD) iD4DBQBBYUGLF8Iu1zN5WiwRAoQLAJiJT8HymFa//OgkvCCdDdBpFeYtAJ4xCj/x a+HNjgVv2rm9B9d2XL0zLA== =chBQ -----END PGP SIGNATURE----- --nextPart1682926.m4AtDa1FI6-- From owner-freebsd-hackers@FreeBSD.ORG Tue Oct 5 02:33:34 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0608A16A4CE; Tue, 5 Oct 2004 02:33:34 +0000 (GMT) Received: from sccrmhc11.comcast.net (sccrmhc11.comcast.net [204.127.202.55]) by mx1.FreeBSD.org (Postfix) with ESMTP id 586AB43D45; Tue, 5 Oct 2004 02:33:33 +0000 (GMT) (envelope-from apeiron@comcast.net) Received: from prophecy.dyndns.org ([68.83.169.224]) by comcast.net (sccrmhc11) with SMTP id <2004100502333201100k3f8ve> (Authid: apeiron); Tue, 5 Oct 2004 02:33:32 +0000 From: Christopher Nehren To: Brooks Davis In-Reply-To: <200410042335.i94NZDaL098088@repoman.freebsd.org> References: <200410042335.i94NZDaL098088@repoman.freebsd.org> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-MNYVu67lJ24XRDHJwvoD" Date: Mon, 04 Oct 2004 22:33:25 -0400 Message-Id: <1096943605.1096.26.camel@prophecy.dyndns.org> Mime-Version: 1.0 X-Mailer: Evolution 2.0.0FreeBSD GNOME Team Port cc: FreeBSD Hackers List Subject: Re: cvs commit: src/usr.sbin/newsyslog newsyslog.8 newsyslog.c X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Oct 2004 02:33:34 -0000 --=-MNYVu67lJ24XRDHJwvoD Content-Type: multipart/mixed; boundary="=-JrOftsEojimomdtCtk8j" --=-JrOftsEojimomdtCtk8j Content-Type: text/plain Content-Transfer-Encoding: quoted-printable On Mon, 2004-10-04 at 23:35 +0000, Brooks Davis wrote: > brooks 2004-10-04 23:35:13 UTC >=20 > FreeBSD src repository >=20 > Modified files: > usr.sbin/newsyslog newsyslog.8 newsyslog.c=20 > Log: > Add a new -d argument which is used to specify an alternate root for lo= g > files similar to DESTDIR in the BSD make process. This only affects lo= g > file paths not config file (-f) or archive directory (-a) paths. Excellent idea. This will cut down on a lot of verbosity in the newsyslog.conf file. However, perhaps the accompanying patch is a better implementation. It allows both relative and absolute path names to be listed, so that logs which are stored in a chroot'd environment (think BIND 9) can be specified along with logs specified with the -d option. I'll admit right now that my C is nothing near as good as I'd like it to be (though I have been reading my Deitel book), but I have tested this and it does what I want it to do. Also, while I'm here, is there any plan to port this to RELENG_5? --=-JrOftsEojimomdtCtk8j Content-Description: Content-Disposition: inline; filename=newsyslog.c.patch Content-Type: text/x-patch; charset=ISO-8859-1 Content-Transfer-Encoding: base64 LS0tIC91c3IvaG9tZS9hcGVpcm9uL25ld3N5c2xvZy5jCU1vbiBPY3QgIDQgMjE6Mjc6MzggMjAw NA0KKysrIG5ld3N5c2xvZy5jCU1vbiBPY3QgIDQgMjE6NDQ6MTEgMjAwNA0KQEAgLTM0MCw3ICsz NDAsNyBAQA0KIAlpZiAodGVtcHdvcmsgPT0gTlVMTCkNCiAJCWVycigxLCAibWFsbG9jIG9mIGNv bmZfZW50cnkgZm9yICVzIiwgZm5hbWUpOw0KIA0KLQlpZiAoZGVzdGRpciA9PSBOVUxMKQ0KKwlp ZiAoZGVzdGRpciA9PSBOVUxMIHx8IGZuYW1lWzBdID09ICcvJykNCiAJCXRlbXB3b3JrLT5sb2cg PSBzdHJkdXAoZm5hbWUpOw0KIAllbHNlDQogCQlhc3ByaW50ZigmdGVtcHdvcmstPmxvZywgIiVz JXMiLCBkZXN0ZGlyLCBmbmFtZSk7DQo= --=-JrOftsEojimomdtCtk8j-- --=-MNYVu67lJ24XRDHJwvoD Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.6 (FreeBSD) iD8DBQBBYgf1k/lo7zvzJioRAna9AJsF/gVqHyRf9TyxBqGPwU61npw89wCfaVG7 OmJH8Omg5Kc64sFoCnTXsEc= =n3SF -----END PGP SIGNATURE----- --=-MNYVu67lJ24XRDHJwvoD-- From owner-freebsd-hackers@FreeBSD.ORG Tue Oct 5 03:13:37 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7822C16A4CE; Tue, 5 Oct 2004 03:13:37 +0000 (GMT) Received: from smtp4.server.rpi.edu (smtp4.server.rpi.edu [128.113.2.4]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2684A43D2D; Tue, 5 Oct 2004 03:13:37 +0000 (GMT) (envelope-from gad@FreeBSD.org) Received: from [128.113.24.47] (gilead.netel.rpi.edu [128.113.24.47]) by smtp4.server.rpi.edu (8.13.0/8.13.0) with ESMTP id i953DWLQ013203; Mon, 4 Oct 2004 23:13:32 -0400 Mime-Version: 1.0 X-Sender: gad@gilead.netel.rpi.edu (Unverified) Message-Id: In-Reply-To: <1096943605.1096.26.camel@prophecy.dyndns.org> References: <200410042335.i94NZDaL098088@repoman.freebsd.org> <1096943605.1096.26.camel@prophecy.dyndns.org> Date: Mon, 4 Oct 2004 23:13:31 -0400 To: Christopher Nehren , Brooks Davis From: Garance A Drosehn Content-Type: text/plain; charset="us-ascii" ; format="flowed" X-CanItPRO-Stream: default X-RPI-SA-Score: undef - spam-scanning disabled X-Scanned-By: CanIt (www . canit . ca) cc: FreeBSD Hackers List Subject: Re: cvs commit: src/usr.sbin/newsyslog newsyslog.8 newsyslog.c X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Oct 2004 03:13:37 -0000 At 10:33 PM -0400 10/4/04, Christopher Nehren wrote: >On Mon, 2004-10-04 at 23:35 +0000, Brooks Davis wrote: >> brooks 2004-10-04 23:35:13 UTC >> >> FreeBSD src repository >> >> Modified files: >> usr.sbin/newsyslog newsyslog.8 newsyslog.c >> Log: > > Add a new -d argument which is used to specify an alternate root > > for log files similar to DESTDIR in the BSD make process. This > > only affects log file paths not config file (-f) or archive > > directory (-a) paths. > >Excellent idea. This will cut down on a lot of verbosity in the >newsyslog.conf file. However, perhaps the accompanying patch is >a better implementation. It allows both relative and absolute path >names to be listed, ... I think your goal is very different from what Brooks wants to do. He is not trying to cut down any verbosity in the /etc/newsyslog.conf file, he is trying to make it possible to easily redirect the file. If I understand what you want to do, I would prefer to implement it in a different manner. >Also, while I'm here, is there any plan to port this to RELENG_5? I will MFC it if Brooks doesn't, but I do not think it needs to be done right now. I would prefer to wait until after 5.3-RELEASE is official. -- Garance Alistair Drosehn = gad@gilead.netel.rpi.edu Senior Systems Programmer or gad@FreeBSD.org Rensselaer Polytechnic Institute; Troy, NY; USA From owner-freebsd-hackers@FreeBSD.ORG Tue Oct 5 14:49:16 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id EF7B216A4CE for ; Tue, 5 Oct 2004 14:49:16 +0000 (GMT) Received: from odin.ac.hmc.edu (Odin.AC.HMC.Edu [134.173.32.75]) by mx1.FreeBSD.org (Postfix) with ESMTP id CF2DF43D2D for ; Tue, 5 Oct 2004 14:49:16 +0000 (GMT) (envelope-from brdavis@odin.ac.hmc.edu) Received: from odin.ac.hmc.edu (localhost.localdomain [127.0.0.1]) by odin.ac.hmc.edu (8.13.0/8.13.0) with ESMTP id i95EsF6L012537; Tue, 5 Oct 2004 07:54:15 -0700 Received: (from brdavis@localhost) by odin.ac.hmc.edu (8.13.0/8.13.0/Submit) id i95EsFJG012536; Tue, 5 Oct 2004 07:54:15 -0700 Date: Tue, 5 Oct 2004 07:54:15 -0700 From: Brooks Davis To: Christopher Nehren Message-ID: <20041005145415.GB2520@odin.ac.hmc.edu> References: <200410042335.i94NZDaL098088@repoman.freebsd.org> <1096943605.1096.26.camel@prophecy.dyndns.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="OwLcNYc0lM97+oe1" Content-Disposition: inline In-Reply-To: <1096943605.1096.26.camel@prophecy.dyndns.org> User-Agent: Mutt/1.4.1i X-Virus-Scanned: by amavisd-new X-Spam-Status: No, hits=0.0 required=8.0 tests=none autolearn=no version=2.63 X-Spam-Checker-Version: SpamAssassin 2.63 (2004-01-11) on odin.ac.hmc.edu cc: FreeBSD Hackers List Subject: Re: cvs commit: src/usr.sbin/newsyslog newsyslog.8 newsyslog.c X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Oct 2004 14:49:17 -0000 --OwLcNYc0lM97+oe1 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Oct 04, 2004 at 10:33:25PM -0400, Christopher Nehren wrote: > On Mon, 2004-10-04 at 23:35 +0000, Brooks Davis wrote: > > brooks 2004-10-04 23:35:13 UTC > >=20 > > FreeBSD src repository > >=20 > > Modified files: > > usr.sbin/newsyslog newsyslog.8 newsyslog.c=20 > > Log: > > Add a new -d argument which is used to specify an alternate root for = log > > files similar to DESTDIR in the BSD make process. This only affects = log > > file paths not config file (-f) or archive directory (-a) paths. >=20 > Excellent idea. This will cut down on a lot of verbosity in the > newsyslog.conf file. However, perhaps the accompanying patch is a better > implementation. It allows both relative and absolute path names to be > listed, so that logs which are stored in a chroot'd environment (think > BIND 9) can be specified along with logs specified with the -d option. > I'll admit right now that my C is nothing near as good as I'd like it to > be (though I have been reading my Deitel book), but I have tested this > and it does what I want it to do. This is not my intent. If anything, the opposite should be implemented because you'll get non-sensical paths from relative paths otherwise. Are relative paths currently supported? They don't seem to make much sense, though maybe on the command line. My initial goal was to make it possiable to use newsyslog to create log files in the src/etc/Makefile distribution target rather the current method which hard codes a copy of the information stored in newsyslog.conf in the Makefile. > Also, while I'm here, is there any plan to port this to RELENG_5? Yes, I plan MFC at some point. I doubt it will be done for 5.3 at this point. -- Brooks --=20 Any statement of the form "X is the one, true Y" is FALSE. PGP fingerprint 655D 519C 26A7 82E7 2529 9BF0 5D8E 8BE9 F238 1AD4 --OwLcNYc0lM97+oe1 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (GNU/Linux) iD8DBQFBYrWWXY6L6fI4GtQRAuFfAJwPRtkvzEgAaMdDFS7tikewmeqa3gCeKNtE ctZOg4OCVsGw2avK2ZBVFHk= =pGOc -----END PGP SIGNATURE----- --OwLcNYc0lM97+oe1-- From owner-freebsd-hackers@FreeBSD.ORG Tue Oct 5 15:37:08 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0F11816A4CE; Tue, 5 Oct 2004 15:37:08 +0000 (GMT) Received: from mail.wolves.k12.mo.us (duey.wolves.k12.mo.us [207.160.214.9]) by mx1.FreeBSD.org (Postfix) with ESMTP id ABC7043D2D; Tue, 5 Oct 2004 15:37:07 +0000 (GMT) (envelope-from cdillon@wolves.k12.mo.us) Received: from localhost (localhost [127.0.0.1]) by mail.wolves.k12.mo.us (Postfix) with ESMTP id EC9DF1FE25; Tue, 5 Oct 2004 10:37:06 -0500 (CDT) Received: from mail.wolves.k12.mo.us ([127.0.0.1]) by localhost (mail.wolves.k12.mo.us [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 46112-01-37; Tue, 5 Oct 2004 10:37:04 -0500 (CDT) Received: by mail.wolves.k12.mo.us (Postfix, from userid 1001) id E9D9B1FE22; Tue, 5 Oct 2004 10:37:04 -0500 (CDT) Received: from localhost (localhost [127.0.0.1]) by mail.wolves.k12.mo.us (Postfix) with ESMTP id E79721A904; Tue, 5 Oct 2004 10:37:04 -0500 (CDT) Date: Tue, 5 Oct 2004 10:37:04 -0500 (CDT) From: Chris Dillon To: Greg Black In-Reply-To: Message-ID: <20041005103123.C46325@duey.wolves.k12.mo.us> References: <20041002081928.GA21439@gothmog.gr> <200410021123.59811.max@love2party.net> <20041002083336.GA10355@k7.mavetju> <20041002101842.GA23272@gothmog.gr> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Virus-Scanned: by amavisd-new at wolves.k12.mo.us cc: Max Laier cc: Ryan Sommers cc: Giorgos Keramidas cc: freebsd-hackers@freebsd.org Subject: Re: Protection from the dreaded "rm -fr /" X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Oct 2004 15:37:08 -0000 On Sat, 2 Oct 2004, Greg Black wrote: > As for protecting against "rm -rf / foo" as a typo for "rm -rf > /foo", I don't mind if we offer protection against that; but I see > no reason at all to "protect" root from "rm -rf /". It's fair to > say that somebody who types that means it, and it's fair to go as > far as we can in satisfying it. I think you just nailed it on the head right here... if you say "rm -rf /" you probably mean it, but if you say "rm -rf / foo" you probably oopsed (pretty good bet, since rm / makes asking to rm foo redundant). How about checking if there is more than one argument, and if one of those arguments is "/", fail. If there is only one argument, even if it is "/", assume the user knows what he is doing and proceed normally. -- Chris Dillon - cdillon(at)wolves.k12.mo.us FreeBSD: The fastest, most open, and most stable OS on the planet - Available for IA32, IA64, AMD64, PC98, Alpha, and UltraSPARC architectures - PowerPC, ARM, MIPS, and S/390 under development - http://www.freebsd.org Q: Because it reverses the logical flow of conversation. A: Why is putting a reply at the top of the message frowned upon? From owner-freebsd-hackers@FreeBSD.ORG Tue Oct 5 16:03:27 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 39E4F16A4CE; Tue, 5 Oct 2004 16:03:27 +0000 (GMT) Received: from athena.softcardsystems.com (mail.softcardsystems.com [12.34.136.114]) by mx1.FreeBSD.org (Postfix) with ESMTP id BA57D43D41; Tue, 5 Oct 2004 16:03:26 +0000 (GMT) (envelope-from sah@softcardsystems.com) Received: from athena (athena [12.34.136.114])i95H2ErI011534; Tue, 5 Oct 2004 12:02:14 -0500 Date: Tue, 5 Oct 2004 12:02:14 -0500 (EST) From: Sam X-X-Sender: sah@athena To: Chris Dillon In-Reply-To: <20041005103123.C46325@duey.wolves.k12.mo.us> Message-ID: References: <20041002081928.GA21439@gothmog.gr> <200410021123.59811.max@love2party.net> <20041002101842.GA23272@gothmog.gr> <20041005103123.C46325@duey.wolves.k12.mo.us> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed cc: Max Laier cc: Giorgos Keramidas cc: freebsd-hackers@freebsd.org cc: Ryan Sommers Subject: Re: Protection from the dreaded "rm -fr /" X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Oct 2004 16:03:27 -0000 >> As for protecting against "rm -rf / foo" as a typo for "rm -rf /foo", I >> don't mind if we offer protection against that; but I see no reason at all >> to "protect" root from "rm -rf /". It's fair to say that somebody who >> types that means it, and it's fair to go as far as we can in satisfying it. > > I think you just nailed it on the head right here... if you say "rm -rf /" > you probably mean it, but if you say "rm -rf / foo" you probably oopsed > (pretty good bet, since rm / makes asking to rm foo redundant). How about > checking if there is more than one argument, and if one of those arguments is > "/", fail. If there is only one argument, even if it is "/", assume the user > knows what he is doing and proceed normally. Why not let -i override -f? Then the usual alias bit works fine for those who want it. For times when you really want the -f, you can type /bin/rm -rf. Or `which rm` -rf. Or put it in a shell script and call it rmf. There are a lot of ways to skin this properly without resorting to hacks making the tool smarter than the user. Sam From owner-freebsd-hackers@FreeBSD.ORG Wed Oct 6 00:12:55 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 41ABE16A4CE for ; Wed, 6 Oct 2004 00:12:55 +0000 (GMT) Received: from rosebud.otenet.gr (rosebud.otenet.gr [195.170.0.26]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6CB7943D2F for ; Wed, 6 Oct 2004 00:12:54 +0000 (GMT) (envelope-from keramida@freebsd.org) Received: from gothmog.gr (patr530-b147.otenet.gr [212.205.244.155]) i960Cqqt015922 for ; Wed, 6 Oct 2004 03:12:53 +0300 Received: from gothmog.gr (gothmog [127.0.0.1]) by gothmog.gr (8.13.1/8.13.1) with ESMTP id i960CneS001578 for ; Wed, 6 Oct 2004 03:12:49 +0300 (EEST) (envelope-from keramida@freebsd.org) Received: (from giorgos@localhost) by gothmog.gr (8.13.1/8.13.1/Submit) id i960Cn0H001577 for freebsd-hackers@freebsd.org; Wed, 6 Oct 2004 03:12:49 +0300 (EEST) (envelope-from keramida@freebsd.org) Date: Wed, 6 Oct 2004 03:12:48 +0300 From: Giorgos Keramidas To: freebsd-hackers@freebsd.org Message-ID: <20041006001248.GC1471@gothmog.gr> References: <20041002081928.GA21439@gothmog.gr> <200410021123.59811.max@love2party.net> <20041002081928.GA21439@gothmog.gr> <20041002083336.GA10355@k7.mavetju> <415E6C4A.1010804@gamersimpact.com> <20041002101842.GA23272@gothmog.gr> <20041005103123.C46325@duey.wolves.k12.mo.us> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20041005103123.C46325@duey.wolves.k12.mo.us> Subject: Re: Protection from the dreaded "rm -fr /" X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Oct 2004 00:12:55 -0000 On 2004-10-05 10:37, Chris Dillon wrote: > I think you just nailed it on the head right here... if you say "rm > -rf /" you probably mean it, but if you say "rm -rf / foo" you > probably oopsed (pretty good bet, since rm / makes asking to rm foo > redundant). How about checking if there is more than one argument, > and if one of those arguments is "/", fail. If there is only one > argument, even if it is "/", assume the user knows what he is doing > and proceed normally. I no longer have any interest in working towards any sort of change related to this thread. Please do not Cc: me when replying. Thanks, Giorgos From owner-freebsd-hackers@FreeBSD.ORG Wed Oct 6 00:42:39 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3ACDD16A4CE for ; Wed, 6 Oct 2004 00:42:39 +0000 (GMT) Received: from aiolos.otenet.gr (aiolos.otenet.gr [195.170.0.23]) by mx1.FreeBSD.org (Postfix) with ESMTP id 760C543D49 for ; Wed, 6 Oct 2004 00:42:38 +0000 (GMT) (envelope-from keramida@freebsd.org) Received: from gothmog.gr (patr530-a203.otenet.gr [212.205.215.203]) i960gaWk003093 for ; Wed, 6 Oct 2004 03:42:36 +0300 Received: from gothmog.gr (gothmog [127.0.0.1]) by gothmog.gr (8.13.1/8.13.1) with ESMTP id i960gYfq002020 for ; Wed, 6 Oct 2004 03:42:34 +0300 (EEST) (envelope-from keramida@freebsd.org) Received: (from giorgos@localhost) by gothmog.gr (8.13.1/8.13.1/Submit) id i960gXvd002019 for freebsd-hackers@freebsd.org; Wed, 6 Oct 2004 03:42:33 +0300 (EEST) (envelope-from keramida@freebsd.org) Date: Wed, 6 Oct 2004 03:42:33 +0300 From: Giorgos Keramidas To: freebsd-hackers@freebsd.org Message-ID: <20041006004233.GI1471@gothmog.gr> References: <20041002081928.GA21439@gothmog.gr> <200410021123.59811.max@love2party.net> <20041002081928.GA21439@gothmog.gr> <20041002083336.GA10355@k7.mavetju> <415E6C4A.1010804@gamersimpact.com> <20041002101842.GA23272@gothmog.gr> <20041005103123.C46325@duey.wolves.k12.mo.us> <20041006001248.GC1471@gothmog.gr> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20041006001248.GC1471@gothmog.gr> Subject: Re: Protection from the dreaded "rm -fr /" X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Oct 2004 00:42:39 -0000 On 2004-10-06 03:12, Giorgos Keramidas wrote: > On 2004-10-05 10:37, Chris Dillon wrote: > > I no longer have any interest in working towards any sort of change > related to this thread. Please do not Cc: me when replying. I'm not picking on Chris Dillon here. It's more like a request to trim my address from replies to this thread, from now on. Thanks to all who have discussed this with me. From owner-freebsd-hackers@FreeBSD.ORG Wed Oct 6 01:31:00 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id BF81916A4CE for ; Wed, 6 Oct 2004 01:31:00 +0000 (GMT) Received: from apollo.backplane.com (apollo.backplane.com [216.240.41.2]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9DAE943D48 for ; Wed, 6 Oct 2004 01:31:00 +0000 (GMT) (envelope-from dillon@apollo.backplane.com) Received: from apollo.backplane.com (localhost [127.0.0.1]) i961V0vA047975 for ; Tue, 5 Oct 2004 18:31:00 -0700 (PDT) (envelope-from dillon@apollo.backplane.com) Received: (from dillon@localhost) by apollo.backplane.com (8.12.9p2/8.12.9/Submit) id i961V0pw047974; Tue, 5 Oct 2004 18:31:00 -0700 (PDT) (envelope-from dillon) Date: Tue, 5 Oct 2004 18:31:00 -0700 (PDT) From: Matthew Dillon Message-Id: <200410060131.i961V0pw047974@apollo.backplane.com> To: freebsd-hackers@freebsd.org References: <20041002081928.GA21439@gothmog.gr> <200410021123.59811.max@love2party.net> <20041002083336.GA10355@k7.mavetju> <20041002101842.GA23272@gothmog.gr> <20041005103123.C46325@duey.wolves.k12.mo.us> Subject: Re: Protection from the dreaded "rm -fr /" X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Oct 2004 01:31:00 -0000 Yow. 78 messages and counting. Er, 79 now. I'll bet poor Giorgos wishes he never started this thread! Get ready..... get set.... DIVE! A good friend of mine has, for at least the last two decades, used something along the lines of: if ( $?prompt ) then alias rm 'mv \!* $HOME/misc/trash' endif However, it seems that the correct solution is to create a new option, -I, which puts rm into 'idiot user mode' and has all the desired confirmation effects listed in this thread and none of the undesired effects such as -i returns. Then if anyone wants to use it they can just create an alias similar to the above for -I and poof, problem solved. It's fairly easy to detect '*' and ask for confirmation, and also easy to ask for a single confirmation on a directory (not ask again for any recursion). Then you guys can argue over whether the alias should appear in the system-wide default csh.cshrc and friends, rather then argue over the destruction of rm's basic nature. I will only point out that 'rm' is used fairly universally in scripts and there are obviously things other then '/' that you would want to ask confirmation for that just as obviously cannot be made default operation for rm. -Matt Matthew Dillon From owner-freebsd-hackers@FreeBSD.ORG Wed Oct 6 01:57:17 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E326916A4CE for ; Wed, 6 Oct 2004 01:57:16 +0000 (GMT) Received: from apollo.backplane.com (apollo.backplane.com [216.240.41.2]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9C03B43D39 for ; Wed, 6 Oct 2004 01:57:16 +0000 (GMT) (envelope-from dillon@apollo.backplane.com) Received: from apollo.backplane.com (localhost [127.0.0.1]) i961vGvA048096 for ; Tue, 5 Oct 2004 18:57:16 -0700 (PDT) (envelope-from dillon@apollo.backplane.com) Received: (from dillon@localhost) by apollo.backplane.com (8.12.9p2/8.12.9/Submit) id i961vGTF048095; Tue, 5 Oct 2004 18:57:16 -0700 (PDT) (envelope-from dillon) Date: Tue, 5 Oct 2004 18:57:16 -0700 (PDT) From: Matthew Dillon Message-Id: <200410060157.i961vGTF048095@apollo.backplane.com> To: freebsd-hackers@freebsd.org References: <20041002081928.GA21439@gothmog.gr> <200410021123.59811.max@love2party.net> <20041002083336.GA10355@k7.mavetju> <20041002101842.GA23272@gothmog.gr> <200410060131.i961V0pw047974@apollo.backplane.com> Subject: rm -I patch (Re: Protection from the dreaded "rm -fr /") X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Oct 2004 01:57:17 -0000 I think I'll commit something like this to DragonFly (you might get patch errors w/ FreeBSD but this is the basic idea). -Matt Index: rm.1 =================================================================== RCS file: /cvs/src/bin/rm/rm.1,v retrieving revision 1.2 diff -u -r1.2 rm.1 --- rm.1 17 Jun 2003 04:22:50 -0000 1.2 +++ rm.1 6 Oct 2004 01:34:12 -0000 @@ -81,6 +81,11 @@ option overrides any previous .Fl f options. +.It Fl I +Request confirmation once if more then three files are being removed or if a +directory is being recursively removed. This is a less intrusive dumb-user +option then +.Fl i .It Fl P Overwrite regular files before deleting them. Files are overwritten three times, first with the byte pattern 0xff, Index: rm.c =================================================================== RCS file: /cvs/src/bin/rm/rm.c,v retrieving revision 1.3 diff -u -r1.3 rm.c --- rm.c 30 Aug 2004 19:27:21 -0000 1.3 +++ rm.c 6 Oct 2004 01:52:46 -0000 @@ -51,9 +51,11 @@ #include int dflag, eval, fflag, iflag, Pflag, vflag, Wflag, stdin_ok; +int rflag, Iflag; uid_t uid; int check(char *, char *, struct stat *); +int check2(char **); void checkdot(char **); void rm_file(char **); void rm_overwrite(char *, struct stat *); @@ -70,7 +72,7 @@ int main(int argc, char *argv[]) { - int ch, rflag; + int ch; char *p; /* @@ -94,7 +96,7 @@ } Pflag = rflag = 0; - while ((ch = getopt(argc, argv, "dfiPRrvW")) != -1) + while ((ch = getopt(argc, argv, "dfiIPRrvW")) != -1) switch(ch) { case 'd': dflag = 1; @@ -107,6 +109,9 @@ fflag = 0; iflag = 1; break; + case 'I': + Iflag = 1; + break; case 'P': Pflag = 1; break; @@ -138,6 +143,10 @@ if (*argv) { stdin_ok = isatty(STDIN_FILENO); + if (Iflag) { + if (check2(argv) == 0) + exit (1); + } if (rflag) rm_tree(argv); else @@ -442,6 +451,47 @@ return (first == 'y' || first == 'Y'); } +int +check2(char **argv) +{ + struct stat st; + int first; + int ch; + int fcount = 0; + int dcount = 0; + int i; + + for (i = 0; argv[i]; ++i) { + if (lstat(argv[i], &st) == 0) { + if (S_ISDIR(st.st_mode)) + ++dcount; + else + ++fcount; + } + } + first = 0; + while (first != 'n' && first != 'N' && first != 'y' && first != 'Y') { + if (dcount && fcount && rflag) { + fprintf(stderr, + "recursively remove %d dirs and %d files? ", + dcount, fcount); + } else if (dcount && rflag) { + fprintf(stderr, + "recursively remove %d dirs? ", dcount); + } else if (dcount + fcount > 3) { + fprintf(stderr, "remove %d files? ", dcount + fcount); + } else { + return(1); + } + fflush(stderr); + + first = ch = getchar(); + while (ch != '\n' && ch != EOF) + ch = getchar(); + } + return (first == 'y' || first == 'Y'); +} + #define ISDOT(a) ((a)[0] == '.' && (!(a)[1] || ((a)[1] == '.' && !(a)[2]))) void checkdot(char **argv) From owner-freebsd-hackers@FreeBSD.ORG Wed Oct 6 06:40:06 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2651116A4CE for ; Wed, 6 Oct 2004 06:40:06 +0000 (GMT) Received: from apollo.backplane.com (apollo.backplane.com [216.240.41.2]) by mx1.FreeBSD.org (Postfix) with ESMTP id 08B9943D31 for ; Wed, 6 Oct 2004 06:40:06 +0000 (GMT) (envelope-from dillon@apollo.backplane.com) Received: from apollo.backplane.com (localhost [127.0.0.1]) i966e5vA049350 for ; Tue, 5 Oct 2004 23:40:05 -0700 (PDT) (envelope-from dillon@apollo.backplane.com) Received: (from dillon@localhost) by apollo.backplane.com (8.12.9p2/8.12.9/Submit) id i966e5Zb049349; Tue, 5 Oct 2004 23:40:05 -0700 (PDT) (envelope-from dillon) Date: Tue, 5 Oct 2004 23:40:05 -0700 (PDT) From: Matthew Dillon Message-Id: <200410060640.i966e5Zb049349@apollo.backplane.com> To: freebsd-hackers@freebsd.org References: <20041002081928.GA21439@gothmog.gr> <200410021123.59811.max@love2party.net> <20041002083336.GA10355@k7.mavetju> <20041002101842.GA23272@gothmog.gr> <200410060157.i961vGTF048095@apollo.backplane.com> Subject: Re: rm -I patch (Re: Protection from the dreaded "rm -fr /") X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Oct 2004 06:40:06 -0000 Here is the final commit I made to DFly. I cleaned up the confirmation message somewhat to make it more useful and correct the grammer. I'm not saying that this should or should not be done in FreeBSD, but I cannot think of any negatives and the -I option does allow for a far more sophisticated check then just '/' and a far less annoying confirmation then -i. http://www.dragonflybsd.org/cvsweb/src/bin/rm/rm.1.diff?r1=1.2&r2=1.3&f=u http://www.dragonflybsd.org/cvsweb/src/bin/rm/rm.c.diff?r1=1.3&r2=1.4&f=u http://www.dragonflybsd.org/cvsweb/src/etc/csh.cshrc.diff?r1=1.2&r2=1.3&f=u http://www.dragonflybsd.org/cvsweb/src/etc/profile.diff?r1=1.2&r2=1.3&f=u -Matt From owner-freebsd-hackers@FreeBSD.ORG Wed Oct 6 12:28:27 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2E10816A4CE for ; Wed, 6 Oct 2004 12:28:27 +0000 (GMT) Received: from niked.office.suresupport.com (niked.office.suresupport.com [213.145.98.14]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1EDB343D58 for ; Wed, 6 Oct 2004 12:28:24 +0000 (GMT) (envelope-from nike_d@cytexbg.com) Received: from niked.office.suresupport.com (localhost [127.0.0.1]) i96CU4ug026752 for ; Wed, 6 Oct 2004 15:30:07 +0300 (EEST) (envelope-from nike_d@cytexbg.com) Message-ID: X-Mailer: http://www.courier-mta.org/cone/ From: Niki Denev To: hackers@freebsd.org Date: Wed, 06 Oct 2004 15:30:05 +0300 Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=_mimegpg-niked.office.suresupport.com-26649-1097065805-0001"; micalg=pgp-sha1; protocol="application/pgp-signature" Subject: attaching ugen(4) on multi interface USB devices X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Oct 2004 12:28:27 -0000 This is a MIME GnuPG-signed message. If you see this text, it means that your E-mail or Usenet software does not support MIME signed messages. --=_mimegpg-niked.office.suresupport.com-26649-1097065805-0001 Content-Type: text/plain; format=flowed; charset="US-ASCII" Content-Disposition: inline Content-Transfer-Encoding: 7bit Hello everyone!, The last 1-2 days i've been trying to make some userspace OBEX utilities to work with a USB based Nokia GSM phone and doing this i discovered something that confuses me a little: The phone in question is Nokia 6230 and it has an USB interface. The phone has 11 interface descriptors, 2 of them are used for the Modem and CM over data. Judging from the windows drivers it seems that four of the other interfaces are OBEX compatible. But if i kldload umodem and plug the phone it detects only one ucom(4). and if i plug the phone without any u* modules loaded the kernel attaches ugen0 only. >From what i understand it attaches the ugen0 using the info in the first interface descriptor in the device. Wouldn't it be more usefull for the kernel to attach ugen for every unknown interface in a device. For example when attaching the phone with umodem loaded, i will get the ucom(4) device and the other unrecognised interfaces will show up as ugens ? What do you think about that? P.S.: anyone know some good way to list the attached usb devices beyond usbdevs? It seems that the information that can be gathered from usbdevs is very limited. For example 'lsusb' in linux can show much more info. What do you think about that too? Thanks in advance for any info and/or flames :) --niki --=_mimegpg-niked.office.suresupport.com-26649-1097065805-0001 Content-Type: application/pgp-signature Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (FreeBSD) iD8DBQBBY+VNHNAJ/fLbfrkRAgpqAJ9+X03U6d7AiEjXNcx6fJ3GHu9nWQCggChE tAEZPCuEXFWEClLH44n+dCc= =+oe1 -----END PGP SIGNATURE----- --=_mimegpg-niked.office.suresupport.com-26649-1097065805-0001-- From owner-freebsd-hackers@FreeBSD.ORG Wed Oct 6 10:03:53 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id DF2B216A4CE for ; Wed, 6 Oct 2004 10:03:53 +0000 (GMT) Received: from mx1.mail.ru (mx1.mail.ru [194.67.23.121]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9F4EE43D4C for ; Wed, 6 Oct 2004 10:03:53 +0000 (GMT) (envelope-from cr0t@bk.ru) Received: from [83.149.19.2] (port=59933 helo=172.16.79.96) by mx1.mail.ru with esmtp id 1CF8eD-000DHF-00 for freebsd-hackers@freebsd.org; Wed, 06 Oct 2004 14:03:52 +0400 Date: Wed, 6 Oct 2004 14:03:29 +0400 From: "bk.ru" X-Mailer: The Bat! (v2.00.6) Business X-Priority: 3 (Normal) Message-ID: <167940343.20041006140329@bk.ru> To: freebsd-hackers@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Spam: Probable Spam X-Mailman-Approved-At: Wed, 06 Oct 2004 12:35:12 +0000 Subject: help with porting from NetBSD X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: "bk.ru" List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Oct 2004 10:03:54 -0000 --[ Hello everyone, First of all sorry for my english... I need some help with porting kernel drivers from NetBSD to FreeBSD (usb irda driver for my Tekram dongle)... Can you help me with some docs, some kind of tutorials or faqs, or something else with this subject, please? Because i didn't find anything about it when googling... P.S. Please CC to me.. ---------------------------[]--------------------------- --[ Cool life for you, --[ bk.ru mailto:cr0t@bk.ru ...::: Russian Saratov Linux User Group :::... ...::: FreeBSD - rulezzz :::... From owner-freebsd-hackers@FreeBSD.ORG Wed Oct 6 12:49:39 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A59FA16A4CE for ; Wed, 6 Oct 2004 12:49:39 +0000 (GMT) Received: from srv1.cosmo-project.de (srv1.cosmo-project.de [213.83.6.106]) by mx1.FreeBSD.org (Postfix) with ESMTP id E974243D4C for ; Wed, 6 Oct 2004 12:49:38 +0000 (GMT) (envelope-from ticso@cicely12.cicely.de) Received: from cicely5.cicely.de (cicely5.cicely.de [IPv6:3ffe:400:8d0:301:200:92ff:fe9b:20e7]) (authenticated bits=0) i96CnXaI046782 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=OK); Wed, 6 Oct 2004 14:49:35 +0200 (CEST) (envelope-from ticso@cicely12.cicely.de) Received: from cicely12.cicely.de (cicely12.cicely.de [IPv6:3ffe:400:8d0:301::12]) by cicely5.cicely.de (8.12.10/8.12.10) with ESMTP id i96CnKsu060406 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 6 Oct 2004 14:49:21 +0200 (CEST) (envelope-from ticso@cicely12.cicely.de) Received: from cicely12.cicely.de (localhost [127.0.0.1]) by cicely12.cicely.de (8.12.11/8.12.11) with ESMTP id i96CnKBJ060315; Wed, 6 Oct 2004 14:49:20 +0200 (CEST) (envelope-from ticso@cicely12.cicely.de) Received: (from ticso@localhost) by cicely12.cicely.de (8.12.11/8.12.11/Submit) id i96CnKuf060314; Wed, 6 Oct 2004 14:49:20 +0200 (CEST) (envelope-from ticso) Date: Wed, 6 Oct 2004 14:49:20 +0200 From: Bernd Walter To: Niki Denev Message-ID: <20041006124919.GZ15371@cicely12.cicely.de> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Operating-System: FreeBSD cicely12.cicely.de 5.2-CURRENT alpha User-Agent: Mutt/1.5.6i X-Spam-Status: No, hits=-4.9 required=3.0 tests=BAYES_00 autolearn=ham version=2.61 X-Spam-Report: * -4.9 BAYES_00 BODY: Bayesian spam probability is 0 to 1% * [score: 0.0000] X-Spam-Checker-Version: SpamAssassin 2.61 (1.212.2.1-2003-12-09-exp) on cicely5.cicely.de cc: hackers@freebsd.org Subject: Re: attaching ugen(4) on multi interface USB devices X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: ticso@cicely.de List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Oct 2004 12:49:39 -0000 On Wed, Oct 06, 2004 at 03:30:05PM +0300, Niki Denev wrote: > > Hello everyone!, > > The last 1-2 days i've been trying to make some userspace OBEX utilities to > work with a USB based Nokia GSM phone and doing this i discovered something > that confuses me a little: > The phone in question is Nokia 6230 and it has an USB interface. > The phone has 11 interface descriptors, > 2 of them are used for the Modem and CM over data. > Judging from the windows drivers it seems that four of the other interfaces > are OBEX compatible. > But if i kldload umodem and plug the phone it detects only one ucom(4). > and if i plug the phone without any u* modules loaded the kernel attaches > ugen0 only. > >From what i understand it attaches the ugen0 using the info in the first > interface descriptor in the device. > Wouldn't it be more usefull for the kernel to attach ugen for every unknown > interface in a device. > For example when attaching the phone with umodem loaded, i will get > the ucom(4) device and the other unrecognised interfaces will show up as > ugens ? > What do you think about that? ugen attaches to the whole device and supporting all interfaces in one driver instance. If you already an interface driver atatched then ugen fails to attach the whole device. 11 interface descriptors sounds unlikely to be correct - it's more likely that some of them are alternative configurations and a device or interface can only be in a single configuration at a given time. You can switch between alternative configurations via ugen. I don't know about OBEX, but why don't you just create an interface class driver that attaches to OBEX interfaces - writing USB drivers is not very difficult if you know USB and a few kernel basics. > P.S.: anyone know some good way to list the attached usb devices beyond > usbdevs? > It seems that the information that can be gathered from usbdevs is very > limited. For example 'lsusb' in linux can show much more info. What do you > think about that too? I like usbctl from NetBSDs usbutils. An older port draft is available under: http://www.cosmo-project.de/~bernd/usbutil.tgz It will also show you the interface configurations with all alternatives. -- B.Walter BWCT http://www.bwct.de bernd@bwct.de info@bwct.de From owner-freebsd-hackers@FreeBSD.ORG Wed Oct 6 13:42:21 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4A15316A4CE for ; Wed, 6 Oct 2004 13:42:21 +0000 (GMT) Received: from hak.cnd.mcgill.ca (hak.cnd.McGill.CA [132.216.11.133]) by mx1.FreeBSD.org (Postfix) with ESMTP id AE56B43D4C for ; Wed, 6 Oct 2004 13:42:20 +0000 (GMT) (envelope-from mat@hak.cnd.mcgill.ca) Received: from hak.cnd.mcgill.ca (localhost [127.0.0.1]) by hak.cnd.mcgill.ca (8.12.9/8.12.8) with ESMTP id i96Dmo1M091732; Wed, 6 Oct 2004 09:48:50 -0400 (EDT) (envelope-from mat@hak.cnd.mcgill.ca) Received: (from mat@localhost) by hak.cnd.mcgill.ca (8.12.9/8.12.8/Submit) id i96Dmn5h091731; Wed, 6 Oct 2004 09:48:49 -0400 (EDT) Date: Wed, 6 Oct 2004 09:48:49 -0400 From: Mathew Kanner To: Niki Denev Message-ID: <20041006134849.GA87467@cnd.mcgill.ca> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.1i Organization: I speak for myself, operating in Montreal, CANADA X-Spam-Status: No, hits=0.0 required=5.0 tests=none autolearn=no version=2.62 X-Spam-Checker-Version: SpamAssassin 2.62 (2004-01-11) on hak.cnd.mcgill.ca cc: hackers@freebsd.org Subject: Re: attaching ugen(4) on multi interface USB devices X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Oct 2004 13:42:21 -0000 On Oct 06, Niki Denev wrote: > The last 1-2 days i've been trying to make some userspace OBEX utilities to > work with a USB based Nokia GSM phone and doing this i discovered something > that confuses me a little: > The phone in question is Nokia 6230 and it has an USB interface. > The phone has 11 interface descriptors, > 2 of them are used for the Modem and CM over data. > Judging from the windows drivers it seems that four of the other interfaces > are OBEX compatible. > But if i kldload umodem and plug the phone it detects only one ucom(4). > and if i plug the phone without any u* modules loaded the kernel attaches > ugen0 only. > >From what i understand it attaches the ugen0 using the info in the first > interface descriptor in the device. > Wouldn't it be more usefull for the kernel to attach ugen for every unknown > interface in a device. > For example when attaching the phone with umodem loaded, i will get > the ucom(4) device and the other unrecognised interfaces will show up as > ugens ? > What do you think about that? > > > P.S.: anyone know some good way to list the attached usb devices beyond > usbdevs? > It seems that the information that can be gathered from usbdevs is very > limited. For example 'lsusb' in linux can show much more info. What do you > think about that too? > > > Thanks in advance for any info and/or flames :) I seem to recall a problem with ugen that it doesn't discover endpoints on alt-interfaces. I've posted patches to this mailing list to work around the problem. --Mat -- Canada is a country whose main exports are hockey players and cold fronts. Our main imports are baseball players and acid rain. - Pierre Elliott Trudeau From owner-freebsd-hackers@FreeBSD.ORG Wed Oct 6 14:28:35 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 53D3116A4CE for ; Wed, 6 Oct 2004 14:28:35 +0000 (GMT) Received: from bragi.msys.ch (bragi.msys.ch [157.161.101.6]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4E2B443D45 for ; Wed, 6 Oct 2004 14:28:34 +0000 (GMT) (envelope-from marc@msys.ch) Received: from [192.168.1.26] (idun [157.161.101.130])i96ESWVp005596 for ; Wed, 6 Oct 2004 16:28:32 +0200 Mime-Version: 1.0 (Apple Message framework v619) Content-Transfer-Encoding: 7bit Message-Id: Content-Type: text/plain; charset=US-ASCII; format=flowed To: freebsd-hackers@freebsd.org From: Marc Balmer Date: Wed, 6 Oct 2004 16:28:32 +0200 X-Mailer: Apple Mail (2.619) Subject: syslog() reentrant when compiling with -pthread? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Oct 2004 14:28:35 -0000 Hi I am a long time Unix developer but new with FreeBSD. I worked the last years mostly with OpenBSD. First I am overwhelmed by the number of mailing lists you guys provide. Second I am not sure if I picked the right one ;-) So please direct me to the right place if this list is only for discussion of FreeBSD system development... My question regarding thread-safeness of syslog(): On OpenBSD I used syslog_r() to do thread safe logging (the software in question is a sendmail milter, which runs multithreaded). FreeBSD does not have these functions, but the cc man page states that compiling with "-pthread" links in the thread safe libc_r library instead of libc. As syslog() seems to part of libc on FreeBSD, is it safe to assume that syslog() is indeed thread safe on FreeBSD when compiling with the -pthread switch? Thanks, Marc Balmer From owner-freebsd-hackers@FreeBSD.ORG Wed Oct 6 14:48:06 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2C0F016A4CE for ; Wed, 6 Oct 2004 14:48:06 +0000 (GMT) Received: from dan.emsphone.com (dan.emsphone.com [199.67.51.101]) by mx1.FreeBSD.org (Postfix) with ESMTP id D337543D5A for ; Wed, 6 Oct 2004 14:48:05 +0000 (GMT) (envelope-from dan@dan.emsphone.com) Received: (from dan@localhost) by dan.emsphone.com (8.12.11/8.12.11) id i96Em1oY057109; Wed, 6 Oct 2004 09:48:01 -0500 (CDT) (envelope-from dan) Date: Wed, 6 Oct 2004 09:48:00 -0500 From: Dan Nelson To: Marc Balmer Message-ID: <20041006144800.GB87201@dan.emsphone.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-OS: FreeBSD 5.3-BETA7 X-message-flag: Outlook Error User-Agent: Mutt/1.5.6i cc: freebsd-hackers@freebsd.org Subject: Re: syslog() reentrant when compiling with -pthread? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Oct 2004 14:48:06 -0000 In the last episode (Oct 06), Marc Balmer said: > I am a long time Unix developer but new with FreeBSD. I worked the > last years mostly with OpenBSD. First I am overwhelmed by the number > of mailing lists you guys provide. Second I am not sure if I picked > the right one ;-) So please direct me to the right place if this list > is only for discussion of FreeBSD system development... > > My question regarding thread-safeness of syslog(): On OpenBSD I used > syslog_r() to do thread safe logging (the software in question is a > sendmail milter, which runs multithreaded). FreeBSD does not have > these functions, but the cc man page states that compiling with > "-pthread" links in the thread safe libc_r library instead of libc. > As syslog() seems to part of libc on FreeBSD, is it safe to assume > that syslog() is indeed thread safe on FreeBSD when compiling with > the -pthread switch? The only unsafe part is openlog(), so set that up before you start any threads and you'll be okay. Once the log fd is opened, the syslog() call looks to be thread-safe. Everything in there is done with local variables and atomic writes. -- Dan Nelson dnelson@allantgroup.com From owner-freebsd-hackers@FreeBSD.ORG Wed Oct 6 15:07:19 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id DB8F016A4CE for ; Wed, 6 Oct 2004 15:07:19 +0000 (GMT) Received: from dan.emsphone.com (dan.emsphone.com [199.67.51.101]) by mx1.FreeBSD.org (Postfix) with ESMTP id 85CB743D2F for ; Wed, 6 Oct 2004 15:07:19 +0000 (GMT) (envelope-from dan@dan.emsphone.com) Received: (from dan@localhost) by dan.emsphone.com (8.12.11/8.12.11) id i96F7I9L098875; Wed, 6 Oct 2004 10:07:18 -0500 (CDT) (envelope-from dan) Date: Wed, 6 Oct 2004 10:07:18 -0500 From: Dan Nelson To: Marc Balmer Message-ID: <20041006150718.GC87201@dan.emsphone.com> References: <20041006144800.GB87201@dan.emsphone.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20041006144800.GB87201@dan.emsphone.com> X-OS: FreeBSD 5.3-BETA7 X-message-flag: Outlook Error User-Agent: Mutt/1.5.6i cc: freebsd-hackers@freebsd.org Subject: Re: syslog() reentrant when compiling with -pthread? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Oct 2004 15:07:20 -0000 In the last episode (Oct 06), Dan Nelson said: > > My question regarding thread-safeness of syslog(): On OpenBSD I > > used syslog_r() to do thread safe logging (the software in question > > is a sendmail milter, which runs multithreaded). FreeBSD does not > > have these functions, but the cc man page states that compiling > > with "-pthread" links in the thread safe libc_r library instead of > > libc. As syslog() seems to part of libc on FreeBSD, is it safe to > > assume that syslog() is indeed thread safe on FreeBSD when > > compiling with the -pthread switch? > > The only unsafe part is openlog(), so set that up before you start > any threads and you'll be okay. Once the log fd is opened, the > syslog() call looks to be thread-safe. Everything in there is done > with local variables and atomic writes. I just noticed your email address :) smtp-vilter 1.1.5 works just fine on FreeBSD with plain syslog with this port Makefile addition: # Use regular syslog instead of openbsd's syslog_r interface. post-patch: @${FIND} ${WRKSRC} -name '*.[ch]' | ${XARGS} ${REINPLACE_CMD} \ -e 's/syslog_r(\(.*\), &sdata,/syslog(\1,/' \ -e '/SYSLOG_DATA_INIT/d' \ -e 's/openlog_r(\(.*\),\(.*\),\(.*\),.*)/openlog(\1,\2,\3)/' \ -e 's/closelog_r(.*)/closelog()/' FreeBSD should probably make syslog completely thread-safe, though. Just adding a mutex around the open/close operations would be enough. It looks like that's what Solaris does. The only place you really need syslog_r afaik is if you want to open multiple log handles at different facilities or levels at the same time. -- Dan Nelson dnelson@allantgroup.com From owner-freebsd-hackers@FreeBSD.ORG Wed Oct 6 17:17:54 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 485F916A4CE for ; Wed, 6 Oct 2004 17:17:54 +0000 (GMT) Received: from mproxy.gmail.com (rproxy.gmail.com [64.233.170.194]) by mx1.FreeBSD.org (Postfix) with ESMTP id EFC8843D31 for ; Wed, 6 Oct 2004 17:17:53 +0000 (GMT) (envelope-from rdormer@gmail.com) Received: by mproxy.gmail.com with SMTP id 74so442277rnk for ; Wed, 06 Oct 2004 10:17:53 -0700 (PDT) Received: by 10.38.165.18 with SMTP id n18mr1427836rne; Wed, 06 Oct 2004 10:17:53 -0700 (PDT) Received: by 10.38.76.31 with HTTP; Wed, 6 Oct 2004 10:17:53 -0700 (PDT) Message-ID: <3174add60410061017599f991e@mail.gmail.com> Date: Wed, 6 Oct 2004 13:17:53 -0400 From: Robert Dormer To: freebsd-hackers@freebsd.org In-Reply-To: Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit References: Subject: Re: syslog() reentrant when compiling with -pthread? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Robert Dormer List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Oct 2004 17:17:54 -0000 For what it's worth, I've used syslog to the *console* before, in a multithreaded network daemon. No problems encountered. On Wed, 6 Oct 2004 16:28:32 +0200, Marc Balmer wrote: > Hi > > I am a long time Unix developer but new with FreeBSD. I worked the last > years mostly with OpenBSD. First I am overwhelmed by the number of > mailing lists you guys provide. Second I am not sure if I picked the > right one ;-) So please direct me to the right place if this list is > only for discussion of FreeBSD system development... > > My question regarding thread-safeness of syslog(): On OpenBSD I used > syslog_r() to do thread safe logging (the software in question is a > sendmail milter, which runs multithreaded). FreeBSD does not have > these functions, but the cc man page states that compiling with > "-pthread" links in the thread safe libc_r library instead of libc. As > syslog() seems to part of libc on FreeBSD, is it safe to assume that > syslog() is indeed thread safe on FreeBSD when compiling with the > -pthread switch? > > Thanks, > Marc Balmer > > _______________________________________________ > freebsd-hackers@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-hackers > To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org" > From owner-freebsd-hackers@FreeBSD.ORG Wed Oct 6 17:35:26 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0036816A4CE for ; Wed, 6 Oct 2004 17:35:25 +0000 (GMT) Received: from mail.vicor-nb.com (bigwoop.vicor-nb.com [208.206.78.2]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9C70D43D58 for ; Wed, 6 Oct 2004 17:35:21 +0000 (GMT) (envelope-from julian@elischer.org) Received: from elischer.org (julian.vicor-nb.com [208.206.78.97]) by mail.vicor-nb.com (Postfix) with ESMTP id 86A577A403; Wed, 6 Oct 2004 10:35:21 -0700 (PDT) Message-ID: <41642CD9.7020302@elischer.org> Date: Wed, 06 Oct 2004 10:35:21 -0700 From: Julian Elischer User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.3.1) Gecko/20030516 X-Accept-Language: en, hu MIME-Version: 1.0 To: Marc Balmer References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit cc: freebsd-hackers@freebsd.org Subject: Re: syslog() reentrant when compiling with -pthread? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Oct 2004 17:35:26 -0000 you probably want Threads@freebsd.org Marc Balmer wrote: > Hi > > I am a long time Unix developer but new with FreeBSD. I worked the > last years mostly with OpenBSD. First I am overwhelmed by the number > of mailing lists you guys provide. Second I am not sure if I picked > the right one ;-) So please direct me to the right place if this list > is only for discussion of FreeBSD system development... > > My question regarding thread-safeness of syslog(): On OpenBSD I used > syslog_r() to do thread safe logging (the software in question is a > sendmail milter, which runs multithreaded). FreeBSD does not have > these functions, but the cc man page states that compiling with > "-pthread" links in the thread safe libc_r library instead of libc. > As syslog() seems to part of libc on FreeBSD, is it safe to assume > that syslog() is indeed thread safe on FreeBSD when compiling with the > -pthread switch? > > Thanks, > Marc Balmer > > _______________________________________________ > freebsd-hackers@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-hackers > To unsubscribe, send any mail to > "freebsd-hackers-unsubscribe@freebsd.org" From owner-freebsd-hackers@FreeBSD.ORG Wed Oct 6 18:41:26 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from green.homeunix.org (freefall.freebsd.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id B1D9716A4CE; Wed, 6 Oct 2004 18:41:25 +0000 (GMT) Received: from green.homeunix.org (green@localhost [127.0.0.1]) by green.homeunix.org (8.13.1/8.13.1) with ESMTP id i96IfLLD064863; Wed, 6 Oct 2004 14:41:21 -0400 (EDT) (envelope-from green@green.homeunix.org) Received: (from green@localhost) by green.homeunix.org (8.13.1/8.13.1/Submit) id i96IfE8V064862; Wed, 6 Oct 2004 14:41:14 -0400 (EDT) (envelope-from green) Date: Wed, 6 Oct 2004 14:41:14 -0400 From: Brian Fundakowski Feldman To: Mathew Kanner Message-ID: <20041006184114.GL47017@green.homeunix.org> References: <20041006134849.GA87467@cnd.mcgill.ca> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20041006134849.GA87467@cnd.mcgill.ca> User-Agent: Mutt/1.5.6i cc: hackers@freebsd.org Subject: Re: attaching ugen(4) on multi interface USB devices X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Oct 2004 18:41:26 -0000 On Wed, Oct 06, 2004 at 09:48:49AM -0400, Mathew Kanner wrote: > On Oct 06, Niki Denev wrote: > > The last 1-2 days i've been trying to make some userspace OBEX utilities to > > work with a USB based Nokia GSM phone and doing this i discovered something > > that confuses me a little: > > The phone in question is Nokia 6230 and it has an USB interface. > > The phone has 11 interface descriptors, > > 2 of them are used for the Modem and CM over data. > > Judging from the windows drivers it seems that four of the other interfaces > > are OBEX compatible. > > But if i kldload umodem and plug the phone it detects only one ucom(4). > > and if i plug the phone without any u* modules loaded the kernel attaches > > ugen0 only. > > >From what i understand it attaches the ugen0 using the info in the first > > interface descriptor in the device. > > Wouldn't it be more usefull for the kernel to attach ugen for every unknown > > interface in a device. > > For example when attaching the phone with umodem loaded, i will get > > the ucom(4) device and the other unrecognised interfaces will show up as > > ugens ? > > What do you think about that? > > > > > > P.S.: anyone know some good way to list the attached usb devices beyond > > usbdevs? > > It seems that the information that can be gathered from usbdevs is very > > limited. For example 'lsusb' in linux can show much more info. What do you > > think about that too? > > > > > > Thanks in advance for any info and/or flames :) > > I seem to recall a problem with ugen that it doesn't discover > endpoints on alt-interfaces. I've posted patches to this mailing list > to work around the problem. It doesn't work when you call USB_SET_ALTINTERFACE then USB_SET_CONFIG? -- Brian Fundakowski Feldman \'[ FreeBSD ]''''''''''\ <> green@FreeBSD.org \ The Power to Serve! \ Opinions expressed are my own. \,,,,,,,,,,,,,,,,,,,,,,\ From owner-freebsd-hackers@FreeBSD.ORG Wed Oct 6 19:33:54 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 660EB16A4CE for ; Wed, 6 Oct 2004 19:33:54 +0000 (GMT) Received: from server.rucus.ru.ac.za (server.rucus.ru.ac.za [146.231.115.1]) by mx1.FreeBSD.org (Postfix) with SMTP id 56E7D43D2F for ; Wed, 6 Oct 2004 19:33:52 +0000 (GMT) (envelope-from oxo@rucus.ru.ac.za) Received: (qmail 53422 invoked from network); 6 Oct 2004 19:33:50 -0000 Received: from shell-em0.rucus.ru.ac.za (oxo@10.0.0.1) by server-em0.rucus.ru.ac.za with QMQP; 6 Oct 2004 19:33:50 -0000 Date: Wed, 6 Oct 2004 21:33:50 +0200 From: John Oxley To: hackers@FreeBSD.org Message-ID: <20041006193350.GA8867@rucus.ru.ac.za> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.2.1i Subject: Where to start for someone new to kernel coding X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Oct 2004 19:33:54 -0000 Hi, I am on this list so there is no need to cc me. I want to extend the disk quota system: - Implement a user space daemon to control it. - Pass control from the kernel to the user space daemon. By doing this, you can have much finer grained control over disk quota's, such as controling directories for users as opposed to file systems, setting quotas on what files reside in a directory as opposed to by UID etc. Is this at all possible, and if so, where should I start looking for coding with the kernel. I already have a fair experience in coding with C. -John -- /~\ The ASCII ASCII stupid question, get a EBCDIC ANSI. \ / Ribbon Campaign John Oxley X Against HTML http://oxo.rucus.net/ / \ Email! oxo rucus.net "Personally, I'd rather pay for my freedom than live in a bitmapped, pop-up-happy dungeon like NT." -- Thomas Scoville From owner-freebsd-hackers@FreeBSD.ORG Wed Oct 6 19:49:42 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id B116716A4CE for ; Wed, 6 Oct 2004 19:49:42 +0000 (GMT) Received: from smtp809.mail.ukl.yahoo.com (smtp809.mail.ukl.yahoo.com [217.12.12.199]) by mx1.FreeBSD.org (Postfix) with SMTP id 047E343D1F for ; Wed, 6 Oct 2004 19:49:42 +0000 (GMT) (envelope-from Thomas.Sparrevohn@btinternet.com) Received: from unknown (HELO w2fzz0vc01.aah-go-on.com) (thomas.sparrevohn@hg1.btinternet.com@81.157.165.54 with plain) by smtp809.mail.ukl.yahoo.com with SMTP; 6 Oct 2004 19:49:39 -0000 From: Thomas Sparrevohn To: freebsd-hackers@freebsd.org Date: Wed, 6 Oct 2004 20:49:09 +0100 User-Agent: KMail/1.7 References: <20041002081928.GA21439@gothmog.gr> <20041005103123.C46325@duey.wolves.k12.mo.us> <200410060131.i961V0pw047974@apollo.backplane.com> In-Reply-To: <200410060131.i961V0pw047974@apollo.backplane.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200410062049.10154.Thomas.Sparrevohn@btinternet.com> Subject: Re: Protection from the dreaded "rm -fr /" X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Thomas.Sparrevohn@btinternet.com List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Oct 2004 19:49:42 -0000 On Wednesday 06 October 2004 02:31, Matthew Dillon wrote: The university I used to work for had something like it and it got 99% of the cases > Yow. 78 messages and counting. Er, 79 now. I'll bet poor Giorgos > wishes he never started this thread! Get ready..... get set.... DIVE! > > A good friend of mine has, for at least the last two decades, used > something along the lines of: > > if ( $?prompt ) then > alias rm 'mv \!* $HOME/misc/trash' > endif > > However, it seems that the correct solution is to create a new option, > -I, which puts rm into 'idiot user mode' and has all the desired > confirmation effects listed in this thread and none of the undesired > effects such as -i returns. Then if anyone wants to use it they > can just create an alias similar to the above for -I and poof, problem > solved. It's fairly easy to detect '*' and ask for confirmation, > and also easy to ask for a single confirmation on a directory (not > ask again for any recursion). > > Then you guys can argue over whether the alias should appear in the > system-wide default csh.cshrc and friends, rather then argue over > the destruction of rm's basic nature. I will only point out that 'rm' > is used fairly universally in scripts and there are obviously things > other then '/' that you would want to ask confirmation for that just > as obviously cannot be made default operation for rm. > > -Matt > Matthew Dillon > > _______________________________________________ > freebsd-hackers@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-hackers > To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org" From owner-freebsd-hackers@FreeBSD.ORG Wed Oct 6 20:44:05 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3887916A4D3 for ; Wed, 6 Oct 2004 20:44:05 +0000 (GMT) Received: from hanoi.cronyx.ru (hanoi.cronyx.ru [144.206.181.53]) by mx1.FreeBSD.org (Postfix) with ESMTP id 84C1543D3F for ; Wed, 6 Oct 2004 20:44:02 +0000 (GMT) (envelope-from rik@cronyx.ru) Received: (from root@localhost) by hanoi.cronyx.ru id i96Kf1If004487 for hackers@FreeBSD.org.checked; (8.12.8/vak/2.1) Thu, 7 Oct 2004 00:41:01 +0400 (MSD) (envelope-from rik@cronyx.ru) Received: from cronyx.ru (hanoi.cronyx.ru [144.206.181.53]) by hanoi.cronyx.ru with ESMTP id i96KdVbJ004432 for ; (8.12.8/vak/2.1) Thu, 7 Oct 2004 00:40:31 +0400 (MSD) (envelope-from rik@cronyx.ru) Message-ID: <41645625.3020209@cronyx.ru> Date: Thu, 07 Oct 2004 00:31:33 +0400 From: Roman Kurakin User-Agent: Mozilla/5.0 (X11; U; Linux i686; ru-RU; rv:1.2.1) Gecko/20030426 X-Accept-Language: ru-ru, en MIME-Version: 1.0 To: hackers@FreeBSD.org Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Subject: Printing from kernel X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Oct 2004 20:44:05 -0000 Hi, I have some problems with printing from kernel. At first I think that my problems was cause I use printf, but changed all of them to log cause it safe to use from interrupt handlers. The situation become better but I still observe system lockup in case I output some debug information from my driver. Also I have some problems with system console via com port. Instead of messages from kernel I see the first letter of the month name. Could anybody comment my observation? Does anybody saw anything like this? Oh, I forget to say I observe that with both Current and Releng5, SMP. Also I can't trigger NMI so I can't see the point of lockup. rik From owner-freebsd-hackers@FreeBSD.ORG Wed Oct 6 23:34:49 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 34B8516A4CE for ; Wed, 6 Oct 2004 23:34:49 +0000 (GMT) Received: from gw.catspoiler.org (217-ip-163.nccn.net [209.79.217.163]) by mx1.FreeBSD.org (Postfix) with ESMTP id A751F43D48 for ; Wed, 6 Oct 2004 23:34:48 +0000 (GMT) (envelope-from truckman@FreeBSD.org) Received: from FreeBSD.org (mousie.catspoiler.org [192.168.101.2]) by gw.catspoiler.org (8.13.1/8.13.1) with ESMTP id i96NOc4b056930; Wed, 6 Oct 2004 16:24:42 -0700 (PDT) (envelope-from truckman@FreeBSD.org) Message-Id: <200410062324.i96NOc4b056930@gw.catspoiler.org> Date: Wed, 6 Oct 2004 16:24:38 -0700 (PDT) From: Don Lewis To: rik@cronyx.ru In-Reply-To: <41645625.3020209@cronyx.ru> MIME-Version: 1.0 Content-Type: TEXT/plain; charset=us-ascii cc: hackers@FreeBSD.org Subject: Re: Printing from kernel X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Oct 2004 23:34:49 -0000 On 7 Oct, Roman Kurakin wrote: > Hi, > > I have some problems with printing from kernel. > At first I think that my problems was cause I use printf, > but changed all of them to log cause it safe to use from > interrupt handlers. The situation become better but I still > observe system lockup in case I output some debug information > from my driver. > > Also I have some problems with system console via com > port. Instead of messages from kernel I see the first letter > of the month name. This is a bug in syslogd related to non-blocking I/O that bde and I discussed quite a while back, though we never figured out a proper fix. I recently made the interesting discovery that the same problem isn't present on sparc64. I think it'll start working again if you restart syslogd. > Could anybody comment my observation? Does anybody > saw anything like this? > > Oh, I forget to say I observe that with both Current > and Releng5, SMP. Also I can't trigger NMI so I can't see the > point of lockup. I generally use printf for this sort of thing, and I was going to suggest that you take a look at the KTR stuff, but that won't help if the machine totally locks up so that you can't get to the KTR buffer. I think you'll have trouble getting close to the bug if you use log because of the log latency from the generation of the message, passing it through syslogd, and back to the kernel to be printed. From owner-freebsd-hackers@FreeBSD.ORG Wed Oct 6 23:43:25 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 476E916A4CE for ; Wed, 6 Oct 2004 23:43:25 +0000 (GMT) Received: from blackwater.lemis.com (wantadilla.lemis.com [192.109.197.135]) by mx1.FreeBSD.org (Postfix) with ESMTP id C09BC43D4C for ; Wed, 6 Oct 2004 23:43:23 +0000 (GMT) (envelope-from grog@lemis.com) Received: by blackwater.lemis.com (Postfix, from userid 1004) id 966028565F; Thu, 7 Oct 2004 08:39:54 +0930 (CST) Date: Thu, 7 Oct 2004 08:39:54 +0930 From: Greg 'groggy' Lehey To: Roman Kurakin Message-ID: <20041006230954.GO1350@wantadilla.lemis.com> References: <41645625.3020209@cronyx.ru> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="MM5RgFPKyuP3gDcV" Content-Disposition: inline In-Reply-To: <41645625.3020209@cronyx.ru> User-Agent: Mutt/1.4.2.1i Organization: The FreeBSD Project Phone: +61-8-8388-8286 Fax: +61-8-8388-8725 Mobile: +61-418-838-708 WWW-Home-Page: http://www.FreeBSD.org/ X-PGP-Fingerprint: 9A1B 8202 BCCE B846 F92F 09AC 22E6 F290 507A 4223 cc: hackers@FreeBSD.org Subject: Re: Printing from kernel X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Oct 2004 23:43:25 -0000 --MM5RgFPKyuP3gDcV Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Thursday, 7 October 2004 at 0:31:33 +0400, Roman Kurakin wrote: > Hi, > > I have some problems with printing from kernel. > At first I think that my problems was cause I use printf, > but changed all of them to log cause it safe to use from > interrupt handlers. The situation become better but I still > observe system lockup in case I output some debug information > from my driver. About the only thing I can think is that you're doing this in some area where it's unsafe to print, probably holding a lock that's needed in the print routines. > Also I have some problems with system console via com > port. Instead of messages from kernel I see the first letter > of the month name. > > Could anybody comment my observation? Without more detail, it's impossible to help. > Does anybody saw anything like this? No. printf() is widely used in the kernel. > Oh, I forget to say I observe that with both Current > and Releng5, SMP. Also I can't trigger NMI so I can't see the > point of lockup. Take a look at your code and check what locks you're holding. Also, if this is only for debugging, you should be using the kernel debugger. Greg -- See complete headers for address and phone numbers. --MM5RgFPKyuP3gDcV Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.6 (FreeBSD) iD8DBQFBZHtCIubykFB6QiMRAgrXAJ40ABfpO+8zaPfgAUU+o/FfsJLlOACgofdD U5eauZVejXjRf612kQW/zQU= =xUSo -----END PGP SIGNATURE----- --MM5RgFPKyuP3gDcV-- From owner-freebsd-hackers@FreeBSD.ORG Thu Oct 7 05:20:56 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2CF2D16A4CE for ; Thu, 7 Oct 2004 05:20:56 +0000 (GMT) Received: from bragi.msys.ch (bragi.msys.ch [157.161.101.6]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8DC2A43D60 for ; Thu, 7 Oct 2004 05:20:55 +0000 (GMT) (envelope-from marc@msys.ch) Received: from [192.168.17.16] (merlin.etc.msys.ch [213.189.137.178]) i975KkVp009463; Thu, 7 Oct 2004 07:20:46 +0200 In-Reply-To: <20041006144800.GB87201@dan.emsphone.com> References: <20041006144800.GB87201@dan.emsphone.com> Mime-Version: 1.0 (Apple Message framework v619) Content-Type: text/plain; charset=US-ASCII; format=flowed Message-Id: Content-Transfer-Encoding: 7bit From: Marc Balmer Date: Thu, 7 Oct 2004 07:20:45 +0200 To: Dan Nelson X-Mailer: Apple Mail (2.619) cc: freebsd-hackers@freebsd.org Subject: Re: syslog() reentrant when compiling with -pthread? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Oct 2004 05:20:56 -0000 Am 06.10.2004 um 16:48 schrieb Dan Nelson: > The only unsafe part is openlog(), so set that up before you start any > threads and you'll be okay. Once the log fd is opened, the syslog() > call looks to be thread-safe. Everything in there is done with local > variables and atomic writes. At least on OpenBSD I can use "%m" in the syslog() format string. This results in a call to strerror(), which is not thread safe, AFAIK. This probably is true for FreeBSD as well, so we have the following three conditions for thread safe syslog(): 1) openlog() must be called before any threads that use syslog() are started. 2) The first argument to openlog() must not be NULL. 3) The "%m" Format String must not be used in syslog() calls. Any comments? - Marc From owner-freebsd-hackers@FreeBSD.ORG Thu Oct 7 05:45:22 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id DF79D16A4CE for ; Thu, 7 Oct 2004 05:45:22 +0000 (GMT) Received: from dan.emsphone.com (dan.emsphone.com [199.67.51.101]) by mx1.FreeBSD.org (Postfix) with ESMTP id 99B4243D46 for ; Thu, 7 Oct 2004 05:45:22 +0000 (GMT) (envelope-from dan@dan.emsphone.com) Received: (from dan@localhost) by dan.emsphone.com (8.12.11/8.12.11) id i975jMci022871; Thu, 7 Oct 2004 00:45:22 -0500 (CDT) (envelope-from dan) Date: Thu, 7 Oct 2004 00:45:22 -0500 From: Dan Nelson To: Marc Balmer Message-ID: <20041007054521.GA7104@dan.emsphone.com> References: <20041006144800.GB87201@dan.emsphone.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-OS: FreeBSD 5.3-BETA7 X-message-flag: Outlook Error User-Agent: Mutt/1.5.6i cc: freebsd-hackers@freebsd.org Subject: Re: syslog() reentrant when compiling with -pthread? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Oct 2004 05:45:23 -0000 In the last episode (Oct 07), Marc Balmer said: > At least on OpenBSD I can use "%m" in the syslog() format string. > This results in a call to strerror(), which is not thread safe, > AFAIK. This probably is true for FreeBSD as well, so we have the > following three conditions for thread safe syslog(): > > 1) openlog() must be called before any threads that use syslog() are started. > 2) The first argument to openlog() must not be NULL. > 3) The "%m" Format String must not be used in syslog() calls. 4) make syslog() use strerror_r() Actually, for known errno values, strerror() is thread-safe on FreeBSD. It just returns a pointer into sys_errlist[]. For invalid values it stuffs "Unknown error: ##" into a static buffer and returns a pointer to that. I'll update the PR to make syslog call strerror_r(). http://www.freebsd.org/cgi/query-pr.cgi?pr=standards/72394 -- Dan Nelson dnelson@allantgroup.com From owner-freebsd-hackers@FreeBSD.ORG Thu Oct 7 06:35:40 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A9BA016A4CE for ; Thu, 7 Oct 2004 06:35:40 +0000 (GMT) Received: from spider.deepcore.dk (cpe.atm2-0-53484.0x50a6c9a6.abnxx9.customer.tele.dk [80.166.201.166]) by mx1.FreeBSD.org (Postfix) with ESMTP id DE9FA43D54 for ; Thu, 7 Oct 2004 06:35:39 +0000 (GMT) (envelope-from sos@DeepCore.dk) Received: from [194.192.25.143] (laptop.deepcore.dk [194.192.25.143]) by spider.deepcore.dk (8.12.11/8.12.10) with ESMTP id i976ZTAT079560; Thu, 7 Oct 2004 08:35:31 +0200 (CEST) (envelope-from sos@DeepCore.dk) Message-ID: <4164E3A9.2050209@DeepCore.dk> Date: Thu, 07 Oct 2004 08:35:21 +0200 From: =?ISO-8859-1?Q?S=F8ren_Schmidt?= User-Agent: Mozilla Thunderbird 0.7.2 (X11/20040802) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Roman Kurakin References: <41645625.3020209@cronyx.ru> In-Reply-To: <41645625.3020209@cronyx.ru> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: quoted-printable X-mail-scanned: by DeepCore Virus & Spam killer v1.4 cc: hackers@freebsd.org Subject: Re: Printing from kernel X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Oct 2004 06:35:40 -0000 Roman Kurakin wrote: > Hi, >=20 > I have some problems with printing from kernel. > At first I think that my problems was cause I use printf, > but changed all of them to log cause it safe to use from > interrupt handlers. The situation become better but I still > observe system lockup in case I output some debug information > from my driver. Yes its a known problem, if you output "enough" from the kernel the=20 console will eventually lockup, its been so for ages, and I dont think=20 anyone really have been looking into it. --=20 -S=F8ren From owner-freebsd-hackers@FreeBSD.ORG Thu Oct 7 09:30:10 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5CA9716A4CF for ; Thu, 7 Oct 2004 09:30:10 +0000 (GMT) Received: from comsys.ntu-kpi.kiev.ua (comsys.ntu-kpi.kiev.ua [194.125.244.127]) by mx1.FreeBSD.org (Postfix) with ESMTP id DEF0043D2F for ; Thu, 7 Oct 2004 09:30:07 +0000 (GMT) (envelope-from simon@comsys.ntu-kpi.kiev.ua) Received: from pm514-9.comsys.ntu-kpi.kiev.ua (pm514-9.comsys.ntu-kpi.kiev.ua [10.18.54.109]) (authenticated bits=0)i97CbBeo031015 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Thu, 7 Oct 2004 12:37:11 GMT Received: by pm514-9.comsys.ntu-kpi.kiev.ua (Postfix, from userid 1000) id 8F5F6A7; Thu, 7 Oct 2004 12:29:52 +0300 (EEST) Date: Thu, 7 Oct 2004 12:29:52 +0300 From: Andrey Simonenko To: hackers@freebsd.org Message-ID: <20041007092952.GA658@pm514-9.comsys.ntu-kpi.kiev.ua> References: <20041006193350.GA8867@rucus.ru.ac.za> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20041006193350.GA8867@rucus.ru.ac.za> User-Agent: Mutt/1.4.2.1i Subject: Re: Where to start for someone new to kernel coding X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Oct 2004 09:30:10 -0000 On Wed, Oct 06, 2004 at 09:33:50PM +0200, John Oxley wrote: > > I want to extend the disk quota system: > - Implement a user space daemon to control it. > - Pass control from the kernel to the user space daemon. [skipped] > Is this at all possible, and if so, where should I start looking for > coding with the kernel. Quota checks are implemented in chk*() functions from the sys/ufs/ufs/ufs_quota.c file. If you want to implement your idea as a replacement of existing QUOTA, then you need to modify this file and probably some others. It is also possible to change addresses of these functions, but this is a hack. Another way is using stackable VFS or MAC framework. In these approaches your module will have control before actual FS code is called. And a module can decide what to do: use already loaded own quota policy in the kernel or send a message to a process, which will decide what to do and send a reply back to your module. From owner-freebsd-hackers@FreeBSD.ORG Thu Oct 7 11:04:07 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 058C716A4CE for ; Thu, 7 Oct 2004 11:04:07 +0000 (GMT) Received: from w2xo.jcdurham.com (18.gibs5.xdsl.nauticom.net [209.195.184.19]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4B17643D45 for ; Thu, 7 Oct 2004 11:04:06 +0000 (GMT) (envelope-from durham@w2xo.jcdurham.com) Received: from w2xo.jcdurham.com (localhost [127.0.0.1]) by w2xo.jcdurham.com (8.12.11/8.11.6) with ESMTP id i97B4524048268 for ; Thu, 7 Oct 2004 07:04:05 -0400 (EDT) (envelope-from durham@w2xo.jcdurham.com) Received: from localhost (localhost [[UNIX: localhost]]) by w2xo.jcdurham.com (8.12.11/8.12.9/Submit) id i97B44XZ048267 for freebsd-hackers@freebsd.org; Thu, 7 Oct 2004 07:04:04 -0400 (EDT) (envelope-from durham) From: Jim Durham To: freebsd-hackers@freebsd.org Date: Thu, 7 Oct 2004 07:04:04 -0400 User-Agent: KMail/1.6.2 References: <20041004130415.G1034-100000@mxb.saturn-tech.com> <200410041604.00507.durham@jcdurham.com> In-Reply-To: <200410041604.00507.durham@jcdurham.com> MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <200410070704.04654.durham@jcdurham.com> Subject: Re: Sudden Reboots X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Oct 2004 11:04:07 -0000 On Monday 04 October 2004 04:04 pm, Jim Durham wrote: > On Monday 04 October 2004 03:06 pm, Doug Russell wrote: > > On Mon, 4 Oct 2004, Jim Durham wrote: > > > The reboots started out happening at 5.15 pm or so. I had them unplug > > > the server completely from AC and restart it and now it's happening > > > withing a few minutes of 12:40pm every day. > > > > > > The 'last' command output is the only thing showing anything log-wise. > > > Look at this: > > > > > > reboot ~ Mon Oct 4 12:33 > > > reboot ~ Sun Oct 3 12:37 > > > reboot ~ Sat Oct 2 12:42 > > > reboot ~ Fri Oct 1 12:45 > > > > That is strange.... > > What is that machine doing at that time? Does it start a backup job, or > > any kind of maintenance at that time? Anything at all? > > > > I'd monitor what the heck the machine is doing to some remote machine and > > see what goes on when it dies. > > > > Later....... > > Well... I'm trying to do too many things at the same time and not thinking. > I thought about it and also ran 'last -f /var/log/wmtp.1' and found the > whole sequence...and added my recent reboot info to the top and here is > what I got. > > > reboot ~ Mon Oct 4 14:54 > reboot ~ Mon Oct 4 12:33 > reboot ~ Sun Oct 3 12:37 > reboot ~ Sat Oct 2 12:42 > reboot ~ Fri Oct 1 12:45 > reboot ~ Thu Sep 30 12:33 > reboot ~ Thu Sep 30 08:54 > reboot ~ Wed Sep 29 08:41 > reboot ~ Tue Sep 28 17:20 > reboot ~ Mon Sep 27 17:28 > reboot ~ Sun Sep 26 17:28 > reboot ~ Sat Sep 25 17:37 > reboot ~ Fri Sep 24 17:38 > reboot ~ Thu Sep 23 17:42 > reboot ~ Wed Sep 22 17:50 > reboot ~ Tue Sep 21 17:52 > reboot ~ Mon Sep 20 17:57 > reboot ~ Sun Sep 19 17:57 > reboot ~ Sat Sep 18 17:56 > > Now, the machine was powered down on Sept 17 because of an all-day power > failure. It started doing this on the 18th ,starting at 5:56pm and working > earlier until Sept 29, when I upgraded from 4.9 to 4.10 p3. Then it started > rebooting at 8:45 aprox and I had the customer shut down the machine > completely on the 30th and remove the AC from the rear connector and wait a > few minutes and bring it back up. That's when it started rebooting at 12:30 > or so. > > Googling for "Freebsd reboots at same time every day" will produce hits > on people with the same problem so this is not just me. > > I checked crontab, etc and there's nothing coinciding and also, apparently > every time you reboot the machine, the cycle changes, so how can it be an > external event? Boy...I'm confused... 8-) > > There was one Google posting that maintained that this one guy fixed it by > removing IPV6 from the kernel. I'm trying this at the moment. Of course, I > had to reboot to change the kernel, so the times will probably change if it > keeps rebooting. > > It also just hit me that the time doesn't change much if the machine > reboots itself, but changes if you upgrade or do a controlled reboot. > Wow... This is a followup posting on the above problem.. After removing IPV6 from the kernel and recompiling ,(note that I had recompiled the kernel earlier during this troubleshooting series with no effect) , the problem has gone away. The machine has been up for over 2 days with no reboots. So, to recap: Machine reboots at aprox 23hrs 57 minutes of uptime at ~12:30pm.. Upgraded to latest 4.10p3 sources. Still reboots at 23hrs 57mins, but at different time of day, ~8:15am. Unplugged machine totally from AC and restarted. Still reboots at 23:57 intervals, but time is now changed again, ~2:55pm. Recompiled kernel, removing IPV6. Problem stops. Up now for over 2 days for first time in weeks. Note1: The 23:57 is the usual interval. Sometimes it varied by a few minutes. Note2: 'healthd' showed normal operation of Power Supply with no log entries. Note3: The IPV6 idea was gleaned from a Google search of earlier postings on same problem. Note4: Another posting claimed a cure of this problem by changing network card. Observation: When the machine reboots itself, the time of the reboots seems to stay very close to 23:57 intervals. When you reboot on command, the interval stays the same, but the time of day changes, and does not coincide with the commanded reboot time. I have no conclusion about this. Thanks to all who made suggestions. -Jim Durham From owner-freebsd-hackers@FreeBSD.ORG Thu Oct 7 11:54:09 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id F190E16A50B for ; Thu, 7 Oct 2004 11:54:08 +0000 (GMT) Received: from expert.ukrtel.net (expert.ukrtel.net [195.5.6.10]) by mx1.FreeBSD.org (Postfix) with ESMTP id F25C643D49 for ; Thu, 7 Oct 2004 11:54:07 +0000 (GMT) (envelope-from astesin@ukrtelecom.net) Received: from hoexc010.ho.ukrtelecom.net (scan.ukrtel.net [195.5.6.3]) by expert.ukrtel.net (Netscape Messaging Server 3.5) with ESMTP id AAA4392; Thu, 7 Oct 2004 14:50:21 +0300 Received: by hoexc010.ukrtelecom.net with Internet Mail Service (5.5.2653.19) id <4N0C4PWY>; Thu, 7 Oct 2004 13:53:53 +0200 Message-ID: <1152675CA9EDD71187130002B3CE5ADA0DC810D6@hoexc010.ukrtelecom.net> From: astesin@ukrtelecom.net To: durham@jcdurham.com, freebsd-hackers@freebsd.org Date: Thu, 7 Oct 2004 13:53:49 +0200 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2653.19) Content-Type: text/plain; charset="iso-8859-1" Subject: Re: Sudden Reboots X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Oct 2004 11:54:09 -0000 Can this be some kind of misbehaved hardware watchdog (say, built into motherboard or network card)? > So, to recap: > > Machine reboots at aprox 23hrs 57 minutes of uptime at > ~12:30pm.. Upgraded to latest 4.10p3 sources. Still reboots > at 23hrs 57mins, but at different time of day, ~8:15am. > Unplugged machine totally from AC and restarted. Still > reboots at 23:57 intervals, but time is now changed again, > ~2:55pm. Recompiled kernel, removing IPV6. Problem stops. Up > now for over 2 days for first time in weeks. > > Note1: The 23:57 is the usual interval. Sometimes it varied > by a few minutes. > Note2: 'healthd' showed normal operation of Power Supply > with no log entries. > Note3: The IPV6 idea was gleaned from a Google search of > earlier postings on same problem. > Note4: Another posting claimed a cure of this problem by > changing network card. > > Observation: When the machine reboots itself, the time of the > reboots seems to > stay very close to 23:57 intervals. When you reboot on > command, the interval > stays the same, but the time of day changes, and does not > coincide with the > commanded reboot time. I have no conclusion about this. > > Thanks to all who made suggestions. > > -Jim Durham From owner-freebsd-hackers@FreeBSD.ORG Wed Oct 6 14:45:06 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id EC24416A4CE for ; Wed, 6 Oct 2004 14:45:06 +0000 (GMT) Received: from tower.berklix.org (bsd.bsn.com [194.221.32.7]) by mx1.FreeBSD.org (Postfix) with ESMTP id EC8C343D1D for ; Wed, 6 Oct 2004 14:45:05 +0000 (GMT) (envelope-from jhs@flat.berklix.net) Received: from js.berklix.net (pD9E4DF91.dip.t-dialin.net [217.228.223.145]) (authenticated bits=0) by tower.berklix.org (8.12.9p2/8.12.9) with ESMTP id i96Ej2hB066075; Wed, 6 Oct 2004 16:45:03 +0200 (CEST) (envelope-from jhs@flat.berklix.net) Received: from laps.jhs.private (laps.jhs.private [192.168.91.56]) by js.berklix.net (8.12.11/8.12.11) with ESMTP id i96E1RBo002535; Wed, 6 Oct 2004 16:01:28 +0200 (CEST) (envelope-from jhs@flat.berklix.net) Received: from laps.jhs.private (localhost [127.0.0.1]) by laps.jhs.private (8.13.1/8.13.1) with ESMTP id i96E1Rqg003851; Wed, 6 Oct 2004 16:01:27 +0200 (CEST) (envelope-from jhs@laps.jhs.private) Received: (from jhs@localhost) by laps.jhs.private (8.13.1/8.13.1/Submit) id i96E1QfJ003850; Wed, 6 Oct 2004 16:01:26 +0200 (CEST) (envelope-from jhs) Date: Wed, 6 Oct 2004 16:01:26 +0200 (CEST) Message-Id: <200410061401.i96E1QfJ003850@laps.jhs.private> To: freebsd-hackers@freebsd.org From: "Julian Stacey" Organization: http://berklix.com/~jhs/ Fcc: sent-mail User-agent: EXMH http://beedub.com/exmh/ on FreeBSD http://freebsd.org X-Mailman-Approved-At: Thu, 07 Oct 2004 12:07:22 +0000 cc: jhs@berklix.com Subject: fsck: How to reduce memory usage - to avoid out of swap on boot ? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Oct 2004 14:45:07 -0000 On 4.10-RELEASE with real memory = 10485760 (10240K bytes) & big disc partition: disklabel ad0s1 sectors/unit: 160071597 # size offset fstype [fsize bsize bps/cpg] h: 156613309 3458288 4.2BSD 2048 16384 89 # (Cyl. 215*- 9963*) On a dirty reboot, fsck hangs single user saying: out of swap space. This on an embedded headless host, delivered to remote sites. Plugging in a monitor card is problematic, so it needs to come up multi user & net reachable. Options: - Split the partition in several. - Ugly, Maybe I could remerge them with ccd or vinum?] not tried those before, but still an ugly solution. - More memory: Mainboard has 2M & just 1 slot, currently with an 8M RAM, but I'm looking for a 16M slice & will see if mboard accepts it & if fsck considers that enough. ( After forcing it multiuser I saw: # UID PID PPID CPU PRI NI VSZ RSS WCHAN STAT TT TIME COMMAND # 0 455 419 113 42 0 7064 1820 - R+ p1 2:42.52 fsck -y /usr1& for comparison on another 4.10-RELEASE box with an 18G drive it grew to # 0 625 553 0 -6 0 7580 7448 physst DL+ p0 0:12.50 fsck -y /usr3 (Could man fsck document roughly how much ram needed for what size disc ? ) - Add ,noato to /etc/fstab & manually fsck & mount /usr1 from rc.local (I imagine swapinfo by then reports more swap available) - ugly. & I think Ive tried that before somewhere else recently, (on 5-current admittedly) I recall no clean bit caused a hang, even thouth ,noauto - /usr/src/sbin/fsck/fsck.h, maybe I could eg halve one or both of these: #define MAXBUFSPACE 40*1024 /* maximum space to allocate to buffers */ #define INOBUFSIZE 56*1024 /* size of buffer to read inodes in pass1 */ I quickly paged through all of /usr/src/sbin/fsck/ but didnt see much else likely. Any suggestion what to hack ? Must be some define type `take so much RAM' lines in there :-) PS I think it's pass1 that's running out of swap, but maybe pass2, I can't check till backup complete. Ideas ? - Julian Stacey. Unix,C,Net & Sys. Eng. Consultant, Munich. http://berklix.com Mail Ascii; Html deleted as Spam. Ihr Rauch = mein allergischer Kopfschmerz. From owner-freebsd-hackers@FreeBSD.ORG Thu Oct 7 09:40:40 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 67DD516A4CE for ; Thu, 7 Oct 2004 09:40:40 +0000 (GMT) Received: from rosebud.otenet.gr (rosebud.otenet.gr [195.170.0.26]) by mx1.FreeBSD.org (Postfix) with ESMTP id E244043D48 for ; Thu, 7 Oct 2004 09:40:35 +0000 (GMT) (envelope-from keramida@ceid.upatras.gr) Received: from orion.daedalusnetworks.priv (host5.bedc.ondsl.gr [62.103.39.229])i979ePiY007781; Thu, 7 Oct 2004 12:40:25 +0300 Received: from orion.daedalusnetworks.priv (orion [127.0.0.1]) i979eO9V055434; Thu, 7 Oct 2004 12:40:24 +0300 (EEST) (envelope-from keramida@ceid.upatras.gr) Received: (from keramida@localhost)i979eOUk055425; Thu, 7 Oct 2004 12:40:24 +0300 (EEST) (envelope-from keramida@ceid.upatras.gr) Date: Thu, 7 Oct 2004 12:40:24 +0300 From: Giorgos Keramidas To: Marc Balmer Message-ID: <20041007094024.GA916@orion.daedalusnetworks.priv> References: <20041006144800.GB87201@dan.emsphone.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Mailman-Approved-At: Thu, 07 Oct 2004 12:07:22 +0000 cc: freebsd-hackers@FreeBSD.org cc: Dan Nelson Subject: Re: syslog() reentrant when compiling with -pthread? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Oct 2004 09:40:40 -0000 On 2004-10-07 07:20, Marc Balmer wrote: > > 1) openlog() must be called before any threads that use syslog() are > started. > 2) The first argument to openlog() must not be NULL. > 3) The "%m" Format String must not be used in syslog() calls. Can (3) this be solved by changing all the calls to strerror() with equivalent calls to strerror_r() in the syslog() implementation? From owner-freebsd-hackers@FreeBSD.ORG Thu Oct 7 13:20:35 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D560316A4CE for ; Thu, 7 Oct 2004 13:20:35 +0000 (GMT) Received: from niked.office.suresupport.com (niked.office.suresupport.com [213.145.98.14]) by mx1.FreeBSD.org (Postfix) with ESMTP id E111443D53 for ; Thu, 7 Oct 2004 13:20:34 +0000 (GMT) (envelope-from nike_d@cytexbg.com) Received: from niked.office.suresupport.com (localhost [127.0.0.1]) i97DMCug030422; Thu, 7 Oct 2004 16:22:12 +0300 (EEST) (envelope-from nike_d@cytexbg.com) References: <20041006124919.GZ15371@cicely12.cicely.de> Message-ID: X-Mailer: http://www.courier-mta.org/cone/ From: Niki Denev To: ticso@cicely.de Date: Thu, 07 Oct 2004 16:22:12 +0300 Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=_mimegpg-niked.office.suresupport.com-30337-1097155332-0001"; micalg=pgp-sha1; protocol="application/pgp-signature" cc: hackers@freebsd.org Subject: Re: attaching ugen(4) on multi interface USB devices X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Oct 2004 13:20:35 -0000 This is a MIME GnuPG-signed message. If you see this text, it means that your E-mail or Usenet software does not support MIME signed messages. --=_mimegpg-niked.office.suresupport.com-30337-1097155332-0001 Content-Type: text/plain; format=flowed; charset="US-ASCII" Content-Disposition: inline Content-Transfer-Encoding: 7bit Bernd Walter writes: > On Wed, Oct 06, 2004 at 03:30:05PM +0300, Niki Denev wrote: >> >> Hello everyone!, >> >> The last 1-2 days i've been trying to make some userspace OBEX utilities to >> work with a USB based Nokia GSM phone and doing this i discovered something >> that confuses me a little: >> The phone in question is Nokia 6230 and it has an USB interface. >> The phone has 11 interface descriptors, >> 2 of them are used for the Modem and CM over data. >> Judging from the windows drivers it seems that four of the other interfaces >> are OBEX compatible. >> But if i kldload umodem and plug the phone it detects only one ucom(4). >> and if i plug the phone without any u* modules loaded the kernel attaches >> ugen0 only. >> >From what i understand it attaches the ugen0 using the info in the first >> interface descriptor in the device. >> Wouldn't it be more usefull for the kernel to attach ugen for every unknown >> interface in a device. >> For example when attaching the phone with umodem loaded, i will get >> the ucom(4) device and the other unrecognised interfaces will show up as >> ugens ? >> What do you think about that? > > ugen attaches to the whole device and supporting all interfaces in one > driver instance. thanks, i saw this in the ugen(4) manpage. it seems that i haven't noticed it before :( > If you already an interface driver atatched then ugen fails to attach > the whole device. well, i think that this can be a problem sometimes. actually i don't need kernel driver for obex devices, because everyting can and will be probably better done in the userland via ugen. but this means that the phone modem and obex interfaces can't be used together. why not having a ugen(4) for every USB device? even it is supported? it probably won't harm anyone, but will make possible accessing parts of the device that are otherwise hidden. > 11 interface descriptors sounds unlikely to be correct - it's more > likely that some of them are alternative configurations and a device > or interface can only be in a single configuration at a given time. > You can switch between alternative configurations via ugen. > It seems that this is the way that the CDC WMC (wireless mobile communication) devices are made. At least that is what i understand when reading some of the specifications published at usb.org > I don't know about OBEX, but why don't you just create an interface > class driver that attaches to OBEX interfaces - writing USB drivers is > not very difficult if you know USB and a few kernel basics. > I've done some testing in this area and i've made a driver based on ucom/umodem that attaches to OBEX devices. (only attaches at the moment). And here i discovered that usbdevs can't show more than 4 interfaces on USB device. I tracked down this to USB_MAX_DEVNAMES=4. Is there a reason for this to be set this low? >> P.S.: anyone know some good way to list the attached usb devices beyond >> usbdevs? >> It seems that the information that can be gathered from usbdevs is very >> limited. For example 'lsusb' in linux can show much more info. What do you >> think about that too? > > I like usbctl from NetBSDs usbutils. > An older port draft is available under: > http://www.cosmo-project.de/~bernd/usbutil.tgz > It will also show you the interface configurations with all > alternatives. usbctl and friends are nice! :) i would love to see them in freebsd by default :) P.S.:yesterday i have managed to panic my 6.0-current kernel with usbctl, but i'm not sure if this is related to changes that i have done. i will cvsup to clean any problems in my source/rebuild and then report if there are problems. > > -- > B.Walter BWCT http://www.bwct.de > bernd@bwct.de info@bwct.de > thanks! --niki --=_mimegpg-niked.office.suresupport.com-30337-1097155332-0001 Content-Type: application/pgp-signature Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (FreeBSD) iD8DBQBBZUMEHNAJ/fLbfrkRAvZIAJ9ajMrfzURfg+9cYORcFMIzUkjqlgCglc83 vy29ThFoLwbpS0PJ8+TghGs= =1gQo -----END PGP SIGNATURE----- --=_mimegpg-niked.office.suresupport.com-30337-1097155332-0001-- From owner-freebsd-hackers@FreeBSD.ORG Thu Oct 7 13:42:57 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5641116A4CE for ; Thu, 7 Oct 2004 13:42:57 +0000 (GMT) Received: from srv1.cosmo-project.de (srv1.cosmo-project.de [213.83.6.106]) by mx1.FreeBSD.org (Postfix) with ESMTP id 80CD843D4C for ; Thu, 7 Oct 2004 13:42:56 +0000 (GMT) (envelope-from ticso@cicely12.cicely.de) Received: from cicely5.cicely.de (cicely5.cicely.de [IPv6:3ffe:400:8d0:301:200:92ff:fe9b:20e7]) (authenticated bits=0) i97DgpaI098327 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=OK); Thu, 7 Oct 2004 15:42:53 +0200 (CEST) (envelope-from ticso@cicely12.cicely.de) Received: from cicely12.cicely.de (cicely12.cicely.de [IPv6:3ffe:400:8d0:301::12]) by cicely5.cicely.de (8.12.10/8.12.10) with ESMTP id i97Dg2su069786 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 7 Oct 2004 15:42:03 +0200 (CEST) (envelope-from ticso@cicely12.cicely.de) Received: from cicely12.cicely.de (localhost [127.0.0.1]) by cicely12.cicely.de (8.12.11/8.12.11) with ESMTP id i97Dg2qr066698; Thu, 7 Oct 2004 15:42:02 +0200 (CEST) (envelope-from ticso@cicely12.cicely.de) Received: (from ticso@localhost) by cicely12.cicely.de (8.12.11/8.12.11/Submit) id i97Dg1xv066697; Thu, 7 Oct 2004 15:42:02 +0200 (CEST) (envelope-from ticso) Date: Thu, 7 Oct 2004 15:42:01 +0200 From: Bernd Walter To: Niki Denev Message-ID: <20041007134200.GI15371@cicely12.cicely.de> References: <20041006124919.GZ15371@cicely12.cicely.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Operating-System: FreeBSD cicely12.cicely.de 5.2-CURRENT alpha User-Agent: Mutt/1.5.6i X-Spam-Status: No, hits=-4.9 required=3.0 tests=BAYES_00 autolearn=ham version=2.61 X-Spam-Report: * -4.9 BAYES_00 BODY: Bayesian spam probability is 0 to 1% * [score: 0.0000] X-Spam-Checker-Version: SpamAssassin 2.61 (1.212.2.1-2003-12-09-exp) on cicely5.cicely.de cc: hackers@freebsd.org cc: ticso@cicely.de Subject: Re: attaching ugen(4) on multi interface USB devices X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: ticso@cicely.de List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Oct 2004 13:42:57 -0000 On Thu, Oct 07, 2004 at 04:22:12PM +0300, Niki Denev wrote: > Bernd Walter writes: > >On Wed, Oct 06, 2004 at 03:30:05PM +0300, Niki Denev wrote: > >If you already an interface driver atatched then ugen fails to attach > >the whole device. > > well, i think that this can be a problem sometimes. Yes - this is very often a problem :( > actually i don't need kernel driver for obex devices, because everyting can > and will be probably better done in the userland via ugen. > but this means that the phone modem and obex interfaces can't be used > together. Exactly that's the reason why you want a obex kernel driver. That doesn't mean it has to provide more functionality then ugen and you can still do the processing in userland. > why not having a ugen(4) for every USB device? even it is supported? > it probably won't harm anyone, but will make possible accessing parts of > the device that are otherwise hidden. It can harm. Say you have other drivers attached and ugen switches the configuration of the device/interface that the other driver(s) uses. Many safety checks need to added to ugen for this. Copy the ugen driver to uobex, swtich it to be an interface level driver and strip the functionality down to what you really need. > >11 interface descriptors sounds unlikely to be correct - it's more > >likely that some of them are alternative configurations and a device > >or interface can only be in a single configuration at a given time. > >You can switch between alternative configurations via ugen. > > > > It seems that this is the way that the CDC WMC (wireless mobile > communication) devices are made. > At least that is what i understand when reading some of the specifications > published at usb.org Well - as I already wrote - I know almost nothing about this type of devices, but it still sound unlikely to be correct to what I know about USB - that doesn't mean it can't be correct. > >I don't know about OBEX, but why don't you just create an interface > >class driver that attaches to OBEX interfaces - writing USB drivers is > >not very difficult if you know USB and a few kernel basics. > > > > I've done some testing in this area and i've made a driver based on > ucom/umodem that attaches to OBEX devices. (only attaches at the moment). > And here i discovered that usbdevs can't show more than 4 interfaces on USB > device. I tracked down this to USB_MAX_DEVNAMES=4. > Is there a reason for this to be set this low? As I already wrote - 11 interfaces is very unusual and therfor you usually don't have that many drivers attached as well. Raise the limit if you need - or better make it a kernel tunable and document that your OBEX driver needs at least 11. -- B.Walter BWCT http://www.bwct.de bernd@bwct.de info@bwct.de From owner-freebsd-hackers@FreeBSD.ORG Thu Oct 7 16:20:07 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 10D7116A4CE for ; Thu, 7 Oct 2004 16:20:07 +0000 (GMT) Received: from hanoi.cronyx.ru (hanoi.cronyx.ru [144.206.181.53]) by mx1.FreeBSD.org (Postfix) with ESMTP id 376D643D55 for ; Thu, 7 Oct 2004 16:20:06 +0000 (GMT) (envelope-from rik@cronyx.ru) Received: (from root@localhost) by hanoi.cronyx.ru id i97GH4Au088411 for hackers@freebsd.org.checked; (8.12.8/vak/2.1) Thu, 7 Oct 2004 20:17:04 +0400 (MSD) (envelope-from rik@cronyx.ru) Received: from cronyx.ru (hi.cronyx.ru [144.206.181.94]) by hanoi.cronyx.ru with ESMTP id i97GE2KG088289; (8.12.8/vak/2.1) Thu, 7 Oct 2004 20:14:02 +0400 (MSD) (envelope-from rik@cronyx.ru) Message-ID: <41656BF8.1000703@cronyx.ru> Date: Thu, 07 Oct 2004 20:16:56 +0400 From: Roman Kurakin User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.6b) Gecko/20031208 X-Accept-Language: en-us, en MIME-Version: 1.0 To: =?ISO-8859-1?Q?S=F8ren_Schmidt?= References: <41645625.3020209@cronyx.ru> <4164E3A9.2050209@DeepCore.dk> In-Reply-To: <4164E3A9.2050209@DeepCore.dk> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit cc: hackers@freebsd.org Subject: Re: Printing from kernel X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Oct 2004 16:20:07 -0000 Søren Schmidt wrote: > Roman Kurakin wrote: > >> Hi, >> >> I have some problems with printing from kernel. >> At first I think that my problems was cause I use printf, >> but changed all of them to log cause it safe to use from >> interrupt handlers. The situation become better but I still >> observe system lockup in case I output some debug information >> from my driver. > > Yes its a known problem, if you output "enough" from the kernel the > console will eventually lockup, its been so for ages, and I dont think > anyone really have been looking into it. I didn't saw it before, only now after moving from Giant, but probably some system changes affect this. Hm. may be I need to try some old versions to check for this. I'll try to dig this. This was the only eye in kernel I use for ages. rik From owner-freebsd-hackers@FreeBSD.ORG Thu Oct 7 16:29:15 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id B554E16A4CE for ; Thu, 7 Oct 2004 16:29:15 +0000 (GMT) Received: from hanoi.cronyx.ru (hanoi.cronyx.ru [144.206.181.53]) by mx1.FreeBSD.org (Postfix) with ESMTP id 159AF43D1F for ; Thu, 7 Oct 2004 16:29:09 +0000 (GMT) (envelope-from rik@cronyx.ru) Received: (from root@localhost) by hanoi.cronyx.ru id i97GQ6uL088744 for hackers@FreeBSD.org.checked; (8.12.8/vak/2.1) Thu, 7 Oct 2004 20:26:06 +0400 (MSD) (envelope-from rik@cronyx.ru) Received: from cronyx.ru (hi.cronyx.ru [144.206.181.94]) by hanoi.cronyx.ru with ESMTP id i97GJdKG088495; (8.12.8/vak/2.1) Thu, 7 Oct 2004 20:23:40 +0400 (MSD) (envelope-from rik@cronyx.ru) Message-ID: <41656D4A.3030406@cronyx.ru> Date: Thu, 07 Oct 2004 20:22:34 +0400 From: Roman Kurakin User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.6b) Gecko/20031208 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Don Lewis References: <200410062324.i96NOc4b056930@gw.catspoiler.org> In-Reply-To: <200410062324.i96NOc4b056930@gw.catspoiler.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit cc: hackers@FreeBSD.org Subject: Re: Printing from kernel X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Oct 2004 16:29:15 -0000 Don Lewis wrote: >On 7 Oct, Roman Kurakin wrote: > > >>Hi, >> >> I have some problems with printing from kernel. >>At first I think that my problems was cause I use printf, >>but changed all of them to log cause it safe to use from >>interrupt handlers. The situation become better but I still >>observe system lockup in case I output some debug information >>from my driver. >> >> Also I have some problems with system console via com >>port. Instead of messages from kernel I see the first letter >>of the month name. >> >> > >This is a bug in syslogd related to non-blocking I/O that bde and I >discussed quite a while back, though we never figured out a proper fix. >I recently made the interesting discovery that the same problem isn't >present on sparc64. > >I think it'll start working again if you restart syslogd. > > From my observation I didn't came to conclusion that this could be due to syslog, but I'll check this. >> Could anybody comment my observation? Does anybody >>saw anything like this? >> >> Oh, I forget to say I observe that with both Current >>and Releng5, SMP. Also I can't trigger NMI so I can't see the >>point of lockup. >> >> > >I generally use printf for this sort of thing, and I was going to >suggest that you take a look at the KTR stuff, but that won't help if >the machine totally locks up so that you can't get to the KTR buffer. > >I think you'll have trouble getting close to the bug if you use log >because of the log latency from the generation of the message, passing >it through syslogd, and back to the kernel to be printed. > > I'll try to think up how to see where I have my problems. If you plan to work on this problems we could join our efforts, rik >_______________________________________________ >freebsd-hackers@freebsd.org mailing list >http://lists.freebsd.org/mailman/listinfo/freebsd-hackers >To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org" > > > > From owner-freebsd-hackers@FreeBSD.ORG Thu Oct 7 16:35:07 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1BDBB16A4CE for ; Thu, 7 Oct 2004 16:35:07 +0000 (GMT) Received: from hanoi.cronyx.ru (hanoi.cronyx.ru [144.206.181.53]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4DC0743D4C for ; Thu, 7 Oct 2004 16:35:06 +0000 (GMT) (envelope-from rik@cronyx.ru) Received: (from root@localhost) by hanoi.cronyx.ru id i97GW7W3088996 for hackers@FreeBSD.org.checked; (8.12.8/vak/2.1) Thu, 7 Oct 2004 20:32:07 +0400 (MSD) (envelope-from rik@cronyx.ru) Received: from cronyx.ru (hi.cronyx.ru [144.206.181.94]) by hanoi.cronyx.ru with ESMTP id i97GQaKG088763; (8.12.8/vak/2.1) Thu, 7 Oct 2004 20:29:18 +0400 (MSD) (envelope-from rik@cronyx.ru) Message-ID: <41656EEB.5050602@cronyx.ru> Date: Thu, 07 Oct 2004 20:29:31 +0400 From: Roman Kurakin User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.6b) Gecko/20031208 X-Accept-Language: en-us, en MIME-Version: 1.0 To: "Greg 'groggy' Lehey" References: <41645625.3020209@cronyx.ru> <20041006230954.GO1350@wantadilla.lemis.com> In-Reply-To: <20041006230954.GO1350@wantadilla.lemis.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit cc: hackers@FreeBSD.org Subject: Re: Printing from kernel X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Oct 2004 16:35:07 -0000 Greg 'groggy' Lehey wrote: >On Thursday, 7 October 2004 at 0:31:33 +0400, Roman Kurakin wrote: > > >>Hi, >> >> I have some problems with printing from kernel. >>At first I think that my problems was cause I use printf, >>but changed all of them to log cause it safe to use from >>interrupt handlers. The situation become better but I still >>observe system lockup in case I output some debug information >>from my driver. >> >> >About the only thing I can think is that you're doing this in some >area where it's unsafe to print, probably holding a lock that's needed >in the print routines. > > I have the same idea but I cant't get which one. >> Also I have some problems with system console via com >>port. Instead of messages from kernel I see the first letter >>of the month name. >> >> Could anybody comment my observation? >> >> >Without more detail, it's impossible to help. > > >>Does anybody saw anything like this? >> >> > >No. printf() is widely used in the kernel. > > I know. But it seems that log is more safer ... >> Oh, I forget to say I observe that with both Current >>and Releng5, SMP. Also I can't trigger NMI so I can't see the >>point of lockup. >> >> > >Take a look at your code and check what locks you're holding. Also, >if this is only for debugging, you should be using the kernel >debugger. > > It is used not only for debugging by myself, part of this output is my eye on users side. But for now, most of output is locking debugging. rik >Greg >-- >See complete headers for address and phone numbers. > > From owner-freebsd-hackers@FreeBSD.ORG Thu Oct 7 17:56:17 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 634AF16A4CE for ; Thu, 7 Oct 2004 17:56:17 +0000 (GMT) Received: from salmon.maths.tcd.ie (salmon.maths.tcd.ie [134.226.81.11]) by mx1.FreeBSD.org (Postfix) with SMTP id 6953D43D45 for ; Thu, 7 Oct 2004 17:56:16 +0000 (GMT) (envelope-from dwmalone@maths.tcd.ie) Received: from walton.maths.tcd.ie by salmon.maths.tcd.ie with SMTP id ; 7 Oct 2004 18:56:15 +0100 (BST) Date: Thu, 7 Oct 2004 18:56:15 +0100 From: David Malone To: Julian Stacey Message-ID: <20041007175615.GA64782@walton.maths.tcd.ie> References: <200410061401.i96E1QfJ003850@laps.jhs.private> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200410061401.i96E1QfJ003850@laps.jhs.private> User-Agent: Mutt/1.5.6i Sender: dwmalone@maths.tcd.ie cc: freebsd-hackers@freebsd.org cc: jhs@berklix.com Subject: Re: fsck: How to reduce memory usage - to avoid out of swap on boot ? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Oct 2004 17:56:17 -0000 On Wed, Oct 06, 2004 at 04:01:26PM +0200, Julian Stacey wrote: > - /usr/src/sbin/fsck/fsck.h, maybe I could eg halve one or both of these: > #define MAXBUFSPACE 40*1024 /* maximum space to allocate to buffers */ > #define INOBUFSIZE 56*1024 /* size of buffer to read inodes in pass1 */ > I quickly paged through all of /usr/src/sbin/fsck/ but didnt see > much else likely. Any suggestion what to hack ? Must be some > define type `take so much RAM' lines in there :-) I'd guess these might help. Recently there have been some improvements to the speed of fsck that involve using more memory - you probably want to disable these if you're running with such a small amount of memory. David. From owner-freebsd-hackers@FreeBSD.ORG Thu Oct 7 18:00:10 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id BB5C216A4CE for ; Thu, 7 Oct 2004 18:00:10 +0000 (GMT) Received: from mail01.stbernard.com (mail01.stbernard.com [199.245.188.4]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9BED243D4C for ; Thu, 7 Oct 2004 18:00:10 +0000 (GMT) (envelope-from khall@stbernard.com) X-MimeOLE: Produced By Microsoft Exchange V6.0.6375.0 content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Date: Thu, 7 Oct 2004 11:00:06 -0700 Message-ID: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: BTX scripting help Thread-Index: AcSsl3pQifvrjz8IRAu2D8e4JDiE+g== From: "Kelly Hall" To: Subject: BTX scripting help X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Oct 2004 18:00:10 -0000 Hi Folks, =20 I'm trying to automate a sequence of BTX commands and I'm hitting some snags. I've got some minor forth experience, but it isn't enough. =20 My machine uses the standard bootloader and doesn't present a menu for the user. By default, the machine boots a standard kernel and fs-image file and everything is happy. Sometimes, though, I want my users to be able to boot an alternate kernel and fs-image. To do this, what they do now is: - wait for the default kernel to start loading - hit the space bar - BTX breaks out and gives them a prompt - they type four commands: - unload - load /kernel - load -t md_image /altfs-image - boot I'd like to replace those four commands with one command to make things nicer for them. =20 So I tried to define the obvious forth word: : altboot unload load /kernel load -t md_image /altfs-image boot ; which fails to compile because /kernel isn't a word. These all compile, but reboot when invoked : altboot unload s" /kernel" load ; \ reboots the box : altboot unload load s" /kernel" ; \ reboots the box : altboot unload ." /kernel" load ; \ reboots the box : altboot unload load ." /kernel" ; \ reboots the box =20 I'm stumped. Any suggestions? =20 Kelly From owner-freebsd-hackers@FreeBSD.ORG Thu Oct 7 18:22:56 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 59E1416A4CF for ; Thu, 7 Oct 2004 18:22:56 +0000 (GMT) Received: from tigra.ip.net.ua (tigra.ip.net.ua [82.193.96.10]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8222143D68 for ; Thu, 7 Oct 2004 18:22:55 +0000 (GMT) (envelope-from ru@ip.net.ua) Received: from localhost (rocky.ip.net.ua [82.193.96.2]) by tigra.ip.net.ua (8.12.11/8.12.11) with ESMTP id i97IMsis073282; Thu, 7 Oct 2004 21:22:54 +0300 (EEST) (envelope-from ru@ip.net.ua) Received: from tigra.ip.net.ua ([82.193.96.10]) by localhost (rocky.ipnet [82.193.96.2]) (amavisd-new, port 10024) with LMTP id 53793-19; Thu, 7 Oct 2004 21:22:53 +0300 (EEST) Received: from heffalump.ip.net.ua (heffalump.ip.net.ua [82.193.96.213]) by tigra.ip.net.ua (8.12.11/8.12.11) with ESMTP id i97IMrxE073278 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 7 Oct 2004 21:22:53 +0300 (EEST) (envelope-from ru@ip.net.ua) Received: (from ru@localhost) by heffalump.ip.net.ua (8.13.1/8.13.1) id i97IMwCs084881; Thu, 7 Oct 2004 21:22:58 +0300 (EEST) (envelope-from ru) Date: Thu, 7 Oct 2004 21:22:58 +0300 From: Ruslan Ermilov To: Kelly Hall Message-ID: <20041007182258.GA84834@ip.net.ua> References: Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="nFreZHaLTZJo0R7j" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.6i X-Virus-Scanned: by amavisd-new at ip.net.ua cc: freebsd-hackers@FreeBSD.org Subject: Re: BTX scripting help X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Oct 2004 18:22:56 -0000 --nFreZHaLTZJo0R7j Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Oct 07, 2004 at 11:00:06AM -0700, Kelly Hall wrote: > Hi Folks, > =20 > I'm trying to automate a sequence of BTX commands and I'm hitting some > snags. I've got some minor forth experience, but it isn't enough. > =20 > My machine uses the standard bootloader and doesn't present a menu for > the user. By default, the machine boots a standard kernel and fs-image > file and everything is happy. Sometimes, though, I want my users to be > able to boot an alternate kernel and fs-image. To do this, what they do > now is: > - wait for the default kernel to start loading > - hit the space bar > - BTX breaks out and gives them a prompt > - they type four commands: > - unload > - load /kernel > - load -t md_image /altfs-image > - boot > I'd like to replace those four commands with one command to make things > nicer for them. > =20 > So I tried to define the obvious forth word: > : altboot unload load /kernel load -t md_image /altfs-image boot ; > which fails to compile because /kernel isn't a word. >=20 > These all compile, but reboot when invoked > : altboot unload s" /kernel" load ; \ reboots the box > : altboot unload load s" /kernel" ; \ reboots the box > : altboot unload ." /kernel" load ; \ reboots the box > : altboot unload load ." /kernel" ; \ reboots the box > =20 > I'm stumped. Any suggestions? > =20 Read the loader(8) manpage, it says: BUILTIN COMMANDS Loader's builtin commands take its parameters from the command line. Presently, the only way to call them from a script is by using evaluate on a string. : OK : altboot : s" unload" evaluate : s" load /boot/kernel/kernel" evaluate : s" lsmod" evaluate : ; : OK altboot : /boot/kernel/kernel data=3D0x5ce910+0x488e0 syms=3D[0x8+0x69798+0x8+0x564= 66] : 0xfffffc0000300000: /boot/kernel/kernel (elf kernel, 0x6d6e00) : modules: splash.1 nfsserver.1 nfs4.1 nfs.1 if_gif.1 if_faith.1 ether.1 = sysvshm.1 sysvsem.1 sysvmsg.1 cd9660.1 isa.1 pseudofs.1 procfs.1 msdosfs.1 = usb.1 random.1 ppbus.1 pci.1 null.1 mpt.1 miibus.1 mem.1 ispfw.0 isp.1 sbp.= 1 fwe.1 firewire.1 ahc.1 ahc_pci.1 ahc_isa.1 ahc_eisa.1 cam.1=20 Cheers, --=20 Ruslan Ermilov ru@FreeBSD.org FreeBSD committer --nFreZHaLTZJo0R7j Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.6 (FreeBSD) iD8DBQFBZYmCqRfpzJluFF4RAuSOAJ0W3X7xpMCEnAIfGu6/T43O38IXRACggZlc PDFL4HppaIQMRvxG8OSFPhA= =CC9K -----END PGP SIGNATURE----- --nFreZHaLTZJo0R7j-- From owner-freebsd-hackers@FreeBSD.ORG Thu Oct 7 19:30:42 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 99DC116A4CE for ; Thu, 7 Oct 2004 19:30:42 +0000 (GMT) Received: from pony1pub.arc.nasa.gov (pony1pub.arc.nasa.gov [128.102.31.41]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8E4D043D2D for ; Thu, 7 Oct 2004 19:30:42 +0000 (GMT) (envelope-from jtoung@arc.nasa.gov) Received: from mrcrab.nas.nasa.gov ([129.99.139.47] verified) by pony1pub.arc.nasa.gov (CommuniGate Pro SMTP 4.1.8) with ESMTP id 14193142 for freebsd-hackers@freebsd.org; Thu, 07 Oct 2004 12:30:37 -0700 Content-Type: text/plain; charset="us-ascii" From: Jerry Toung To: freebsd-hackers@freebsd.org Date: Thu, 7 Oct 2004 12:31:22 -0700 User-Agent: KMail/1.4.3 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Message-Id: <200410071231.22951.jtoung@arc.nasa.gov> Subject: bay area hacker needed X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: jtoung@arc.nasa.gov List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Oct 2004 19:30:42 -0000 Hello list, I have tried and done everything to have this remote debugging working, w= ith=20 no success.=20 Any BSD hacker in the bay area that know how to do this, shoot me an emai= l. I=20 will come meet you with a monetary donation if you can make this work. Thank you, Jerry. From owner-freebsd-hackers@FreeBSD.ORG Thu Oct 7 21:58:50 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C826C16A4CE for ; Thu, 7 Oct 2004 21:58:50 +0000 (GMT) Received: from beck.quonix.net (beck.quonix.net [146.145.66.90]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3665643D53 for ; Thu, 7 Oct 2004 21:58:50 +0000 (GMT) (envelope-from john@essenz.com) Received: from [192.168.1.100] (pool-141-158-247-68.phil.east.verizon.net [141.158.247.68]) by beck.quonix.net (8.12.11/8.12.11) with ESMTP id i97Lwf0r082442 for ; Thu, 7 Oct 2004 17:58:41 -0400 (EDT) Mime-Version: 1.0 (Apple Message framework v619) In-Reply-To: <200409272324.i8RNOfds008071@laps.jhs.private> References: <200409272324.i8RNOfds008071@laps.jhs.private> Content-Type: text/plain; charset=WINDOWS-1252; format=flowed Message-Id: Content-Transfer-Encoding: quoted-printable From: John Von Essen Date: Thu, 7 Oct 2004 17:49:45 -0400 To: freebsd-hackers@freebsd.org X-Mailer: Apple Mail (2.619) X-SpamAssassin-2.64-Score: 0.5/6 RCVD_IN_NJABL_DUL,RCVD_IN_SORBS_DUL X-MimeDefang-2.44: beck.quonix.net X-Scanned-By: MIMEDefang 2.44 Subject: Re: hacking SCO.... X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Oct 2004 21:58:51 -0000 Well, I eventually got this SCO system working. But today, some errors=20= appeared: 505k:unrecover error reading SCSI disk on 0 Dev =96 1/42 cha =3D 0 id =3D 0 1 on =3D 0 Block 6578 medium error unrecovered read error HTFS i/o failure occurred while trying to upgrade 1 node 26302 on=20 HTFS.=A0 Dev hd 1/42 Error log over flow block 6578 medium error unrecovered read error . Do these sound likes hardware errors for the drive or the adaptec card=20= itself? The drive is brand new (well, its actually a replacement from=20 acer with a date code on it from 1998 so it has been sitting in a box=20 for awhile). However, the card is very old too. Any ideas? -john On Sep 27, 2004, at 7:24 PM, Julian H. Stacey wrote: > John Von Essen wrote: >> Unfortunately, I have inherited a Intel P200 with SCO OpenServer = 5.0.4 >> with a 4Gb SCSI drive. > > Condolences ! SCO is Horrible to work on, & a waste of time, erase=20 > ASAP ! > > ........ >> SCO is of no help, they cant provide replacement boot floppy, only=20 >> sell >> me complete distribution version 5.0.7 for $100. > >> Any ideas on how I should go about this. All I need to do is get that >> data from the tape onto the disk and I should good to go. > >> SCO is of no help, they cant provide replacement boot floppy, only=20 >> sell >> me complete distribution version 5.0.7 for $100. > > SCO used to give away licences free for 5.0.4 &/or 5.0.5 for > restricted use. One could legally download cdrom images & burn them. > Good denough to rescue data & then erase SCO & install BSD > > If you can't rescue the data while running FreeBSD, either: > > Non Commercial solution: > Look around find someone near who has a 5.0.4 or 5 > cdrom, (maybe even SCO site somewhere) get a copy, (cdrom > contains floppy images too I recall), rescue data, delete > SCO very quickly from your machine, (before you discover > the pain of running SCO, (& if you really must run SCO then > Do get their Skunkware CDROM too (yes that's it's real name! > it's full of FSF/GNU stuff & free & makes using SCO rather > less unpleasant (not unpleasant, just rather less). > > Commercial solution. > Pay the $100, if its for a commercial job it's cheap. No > point quibbling. SCO used to cost about 2000 German > Deutschmarks, for end users, (& was the Unix I found most > crippled. BSD is cheaper, but if it's for business, & it's > their legal right, cheap enough. > > There's SCO forums somewhere, but probably the wrong route. Their > manuals used to just present work-rounds for obsolete old software > everyone else wasn't using anymore eg at one stage they were SVR3 > & all other vendors were SVR4 based. Last time I was contracted > to work on SCO, I just kept tossing more modern source eg X11R6 & > lesstif & GNU src/ on top of the base obsolete SCO, till obsolete > SCO libraries no longer broke my project. Reading SCO manuals was > a waste of time, better to just to rip it out & replace it with > better software, either per utility that annoys, or per whole OS. > > - > Julian Stacey. Unix,C,Net & Sys. Eng. Consultant, Munich. =20 > http://berklix.com > Mail in Ascii, Html dumped as Spam. Ihr Rauch =3D mein allergischer=20= > Kopfschmerz. > > From owner-freebsd-hackers@FreeBSD.ORG Fri Oct 8 00:01:43 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 87DF216A4CE for ; Fri, 8 Oct 2004 00:01:43 +0000 (GMT) Received: from skippyii.compar.com (test.compar.com [216.208.38.130]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7A39143D3F for ; Fri, 8 Oct 2004 00:01:42 +0000 (GMT) (envelope-from matt@gsicomp.on.ca) Received: from hermes (CPE00062566c7bb-CM000039c69a66.cpe.net.cable.rogers.com [69.193.82.185])i9807Vgw026446; Thu, 7 Oct 2004 20:07:32 -0400 (EDT) (envelope-from matt@gsicomp.on.ca) Message-ID: <001601c4acc9$97b0b200$1200a8c0@gsicomp.on.ca> From: "Matt Emmerton" To: "John Von Essen" , References: <200409272324.i8RNOfds008071@laps.jhs.private> Date: Thu, 7 Oct 2004 19:58:48 -0400 MIME-Version: 1.0 Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: 8bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1437 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441 Subject: Re: hacking SCO.... X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Oct 2004 00:01:43 -0000 > Well, I eventually got this SCO system working. But today, some errors > appeared: > > 505k:unrecover error reading SCSI disk on 0 Dev – 1/42 > cha = 0 id = 0 1 on = 0 > Block 6578 > medium error unrecovered read error > HTFS i/o failure occurred while trying to upgrade 1 node 26302 on > HTFS. Dev hd 1/42 > Error log over flow block 6578 medium error unrecovered read error . > > Do these sound likes hardware errors for the drive or the adaptec card > itself? The drive is brand new (well, its actually a replacement from > acer with a date code on it from 1998 so it has been sitting in a box > for awhile). However, the card is very old too. Any ideas? > > -john "medium error unrecorvered read error" really sounds like a phsycial medium (drive) error. If the controller was flaky, you'd get bus retries and stuff. -- Matt Emmerton From owner-freebsd-hackers@FreeBSD.ORG Fri Oct 8 02:48:03 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9F58316A4CE for ; Fri, 8 Oct 2004 02:48:03 +0000 (GMT) Received: from mxb.saturn-tech.com (mxb.saturn-tech.com [207.229.19.99]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0FE4943D3F for ; Fri, 8 Oct 2004 02:48:01 +0000 (GMT) (envelope-from drussell@saturn-tech.com) Received: from mxb.saturn-tech.com (localhost [127.0.0.1]) by mxb.saturn-tech.com (8.12.3/8.12.3) with ESMTP id i982olKt027648; Thu, 7 Oct 2004 20:50:47 -0600 (MDT) (envelope-from drussell@saturn-tech.com) Received: from localhost (drussell@localhost)i982okSs027645; Thu, 7 Oct 2004 20:50:47 -0600 (MDT) (envelope-from drussell@saturn-tech.com) X-Authentication-Warning: mxb.saturn-tech.com: drussell owned process doing -bs Date: Thu, 7 Oct 2004 20:50:46 -0600 (MDT) From: Doug Russell To: John Von Essen In-Reply-To: Message-ID: <20041007204943.S27627-100000@mxb.saturn-tech.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=X-UNKNOWN Content-Transfer-Encoding: QUOTED-PRINTABLE cc: freebsd-hackers@freebsd.org Subject: Re: hacking SCO.... X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Oct 2004 02:48:03 -0000 On Thu, 7 Oct 2004, John Von Essen wrote: > Well, I eventually got this SCO system working. But today, some errors > appeared: > > 505k:unrecover error reading SCSI disk on 0 Dev =96 1/42 > cha =3D 0 id =3D 0 1 on =3D 0 > Block 6578 > medium error unrecovered read error > HTFS i/o failure occurred while trying to upgrade 1 node 26302 on > HTFS.=A0 Dev hd 1/42 > Error log over flow block 6578 medium error unrecovered read error . > > Do these sound likes hardware errors for the drive or the adaptec card Drive errors. Did you do a new low-level format before you put it in service? sformat is your friend. I do the full 14 pattern tests before I put a SCSI disk in service. Later......=09=09=09=09=09 From owner-freebsd-hackers@FreeBSD.ORG Fri Oct 8 03:35:39 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id B987616A4CE for ; Fri, 8 Oct 2004 03:35:39 +0000 (GMT) Received: from harmony.village.org (rover.village.org [168.103.84.182]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1014A43D2F for ; Fri, 8 Oct 2004 03:35:39 +0000 (GMT) (envelope-from imp@bsdimp.com) Received: from localhost (harmony.village.org [10.0.0.6]) by harmony.village.org (8.13.1/8.13.1) with ESMTP id i983YViA047196; Thu, 7 Oct 2004 21:34:31 -0600 (MDT) (envelope-from imp@bsdimp.com) Date: Thu, 07 Oct 2004 21:36:13 -0600 (MDT) Message-Id: <20041007.213613.34762646.imp@bsdimp.com> To: marc@msys.ch From: "M. Warner Losh" In-Reply-To: References: <20041006144800.GB87201@dan.emsphone.com> X-Mailer: Mew version 3.3 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit cc: freebsd-hackers@freebsd.org cc: dnelson@allantgroup.com Subject: Re: syslog() reentrant when compiling with -pthread? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Oct 2004 03:35:39 -0000 In message: Marc Balmer writes: : Am 06.10.2004 um 16:48 schrieb Dan Nelson: : : > The only unsafe part is openlog(), so set that up before you start any : > threads and you'll be okay. Once the log fd is opened, the syslog() : > call looks to be thread-safe. Everything in there is done with local : > variables and atomic writes. : : At least on OpenBSD I can use "%m" in the syslog() format string. This : results in a call to strerror(), which is not thread safe, AFAIK. This : probably is true for FreeBSD as well, so we have the following three : conditions for thread safe syslog(): : : 1) openlog() must be called before any threads that use syslog() are : started. : 2) The first argument to openlog() must not be NULL. : 3) The "%m" Format String must not be used in syslog() calls. : : Any comments? strerror is thread safe, unless your errno is outside of the valid range. Warner From owner-freebsd-hackers@FreeBSD.ORG Thu Oct 7 17:45:09 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E8CCD16A4CE for ; Thu, 7 Oct 2004 17:45:08 +0000 (GMT) Received: from srv1.cosmo-project.de (srv1.cosmo-project.de [213.83.6.106]) by mx1.FreeBSD.org (Postfix) with ESMTP id C371B43D39 for ; Thu, 7 Oct 2004 17:45:07 +0000 (GMT) (envelope-from andreas@klemm.apsfilter.org) Received: from srv1.cosmo-project.de (localhost [IPv6:::1]) i97Hj5aI009194 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO); Thu, 7 Oct 2004 19:45:05 +0200 (CEST) (envelope-from andreas@klemm.apsfilter.org) Received: (from uucp@localhost)i97Hj5qJ009193; Thu, 7 Oct 2004 19:45:05 +0200 (CEST) (envelope-from andreas@klemm.apsfilter.org) Received: from titan.klemm.apsfilter.org (localhost.klemm.apsfilter.org [127.0.0.1]) by klemm.apsfilter.org (8.13.1/8.13.1) with ESMTP id i97HhNuZ004135; Thu, 7 Oct 2004 19:43:23 +0200 (CEST) (envelope-from andreas@titan.klemm.apsfilter.org) Received: (from andreas@localhost) by titan.klemm.apsfilter.org (8.13.1/8.13.1/Submit) id i97HhMVZ004134; Thu, 7 Oct 2004 19:43:22 +0200 (CEST) (envelope-from andreas) Date: Thu, 7 Oct 2004 19:43:22 +0200 From: Andreas Klemm To: hackers@freebsd.org Message-ID: <20041007174322.GB3414@titan.klemm.apsfilter.org> References: <20041005054213.GA11770@lesanti.hq.sinectis.com.ar> <416234B1.8020406@nuclearelephant.com> <20041005202816.GA14973@titan.klemm.apsfilter.org> <20041005205040.GH31397@lesanti.hq.sinectis.com.ar> <20041006060437.GA23364@titan.klemm.apsfilter.org> <20041006144220.GA29653@lesanti.hq.sinectis.com.ar> <20041007111139.GA16296@titan.klemm.apsfilter.org> <416579E1.8050308@nuclearelephant.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <416579E1.8050308@nuclearelephant.com> X-Operating-System: FreeBSD 5.3-BETA7 X-Disclaimer: A free society is one where it is safe to be unpopular User-Agent: Mutt/1.5.6i X-Mailman-Approved-At: Fri, 08 Oct 2004 12:06:49 +0000 cc: "Jonathan A. Zdziarski" Subject: please help with: warning: initialization makes integer from pointer X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Oct 2004 17:45:09 -0000 Dear FreeBSD hackers, could somebody please help Jonathan, the dspam owner, how to code this best under FreeBSD ? Please see his question below: On Thu, Oct 07, 2004 at 01:16:17PM -0400, Jonathan A. Zdziarski wrote: > I'm a little concerned about these warnings: > > pgsql_drv.c:873: warning: initialization makes integer from pointer > without a cast > pgsql_drv.c:874: warning: initialization makes integer from pointer > without a cast > > This could cause some problems with dspam. Is there a freeBSDish way to > do this: > > s->p_getpwnam = (struct passwd) { NULL, NULL, 0, 0, NULL, NULL, NULL }; > s->p_getpwuid = (struct passwd) { NULL, NULL, 0, 0, NULL, NULL, NULL }; > > Perhaps memset(s->p_getpwnam, 0, sizeof(struct passwd)) ? > > > >make all-recursive > >Making all in . > >[...] > > gcc -DHAVE_CONFIG_H -DLOGDIR=\"/var/mail/dspam\" > > -DCONFIG_DEFAULT=\"/etc/dspam.conf\" -D_REENTRANT > > -D_POSIX_PTHREAD_SEMANTICS -I. -I. -I. -I/usr/local/include -g -O2 -Wall > > -Wmissing-prototypes -Wmissing-declarations -MT pgsql_drv.lo -MD -MP -MF > > .deps/pgsql_drv.Tpo -c pgsql_drv.c -fPIC -DPIC -o .libs/pgsql_drv.o > >pgsql_drv.c: In function `_ds_init_storage': > >pgsql_drv.c:873: warning: initialization makes integer from pointer > >without a cast > >pgsql_drv.c:874: warning: initialization makes integer from pointer > >without a cast > >pgsql_drv.c: In function `_ds_create_signature_id': > >pgsql_drv.c:1028: warning: long unsigned int format, time_t arg (arg 4) > >pgsql_drv.c:1028: warning: long unsigned int format, time_t arg (arg 4) > >[...] int _ds_init_storage (DSPAM_CTX * CTX, void *dbh) { struct _pgsql_drv_storage *s; FILE *file; char filename[MAX_FILENAME_LENGTH]; char buffer[256]; char hostname[128] = ""; char user[64] = ""; char password[32] = ""; char db[64] = ""; int port = 5432, i = 0; // PGresult *result; /* don't init if we're already initted */ if (CTX->storage != NULL) { LOGDEBUG ("_ds_init_storage: storage already initialized"); return EINVAL; } s = malloc (sizeof (struct _pgsql_drv_storage)); if (s == NULL) { LOG (LOG_CRIT, ERROR_MEM_ALLOC); return EUNKNOWN; } s->dbh = NULL; s->control_token = 0; s->iter_user = NULL; s->iter_token = NULL; s->iter_sig = NULL; s->control_token = 0; s->control_sh = 0; s->control_ih = 0; s->dbh_attached = (dbh) ? 1 : 0; s->u_getnextuser[0] = 0; s->p_getpwnam = (struct passwd) { NULL, NULL, 0, 0, NULL, NULL, NULL }; ^^^^^^^^^^^^^^^^^^^^ ! s->p_getpwuid = (struct passwd) { NULL, NULL, 0, 0, NULL, NULL, NULL }; ^^^^^^^^^^^^^^^^^^^^ ! Andreas /// -- http://www.64bits.de http://www.apsfilter.org http://people.FreeBSD.org/~andreas From owner-freebsd-hackers@FreeBSD.ORG Fri Oct 8 12:41:22 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7EC0716A4CE for ; Fri, 8 Oct 2004 12:41:22 +0000 (GMT) Received: from bgezal.inso.tuwien.ac.at (bgezal.inso.tuwien.ac.at [128.130.59.74]) by mx1.FreeBSD.org (Postfix) with ESMTP id 14D5D43D48 for ; Fri, 8 Oct 2004 12:41:22 +0000 (GMT) (envelope-from stefan@fafoe.narf.at) Received: from fafoe.narf.at (unknown [212.186.3.235]) by bgezal.inso.tuwien.ac.at (Postfix) with ESMTP id 962402177; Fri, 8 Oct 2004 14:41:20 +0200 (CEST) Received: from wombat.fafoe.narf.at (wombat.fafoe.narf.at [192.168.1.42]) by fafoe.narf.at (Postfix) with ESMTP id 6F3DD40EE; Fri, 8 Oct 2004 14:41:14 +0200 (CEST) Received: by wombat.fafoe.narf.at (Postfix, from userid 1001) id 04F63D7; Fri, 8 Oct 2004 14:41:12 +0200 (CEST) Date: Fri, 8 Oct 2004 14:41:12 +0200 From: Stefan Farfeleder To: Andreas Klemm Message-ID: <20041008124108.GA59642@wombat.fafoe.narf.at> Mail-Followup-To: Andreas Klemm , hackers@freebsd.org, "Jonathan A. Zdziarski" References: <20041005054213.GA11770@lesanti.hq.sinectis.com.ar> <416234B1.8020406@nuclearelephant.com> <20041005202816.GA14973@titan.klemm.apsfilter.org> <20041005205040.GH31397@lesanti.hq.sinectis.com.ar> <20041006060437.GA23364@titan.klemm.apsfilter.org> <20041006144220.GA29653@lesanti.hq.sinectis.com.ar> <20041007111139.GA16296@titan.klemm.apsfilter.org> <416579E1.8050308@nuclearelephant.com> <20041007174322.GB3414@titan.klemm.apsfilter.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20041007174322.GB3414@titan.klemm.apsfilter.org> User-Agent: Mutt/1.5.6i cc: hackers@freebsd.org cc: "Jonathan A. Zdziarski" Subject: Re: please help with: warning: initialization makes integer from pointer X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Oct 2004 12:41:22 -0000 On Thu, Oct 07, 2004 at 07:43:22PM +0200, Andreas Klemm wrote: > Dear FreeBSD hackers, > > could somebody please help Jonathan, the dspam owner, how to code > this best under FreeBSD ? > s->p_getpwnam = (struct passwd) { NULL, NULL, 0, 0, NULL, NULL, NULL }; > ^^^^^^^^^^^^^^^^^^^^ ! > s->p_getpwuid = (struct passwd) { NULL, NULL, 0, 0, NULL, NULL, NULL }; > ^^^^^^^^^^^^^^^^^^^^ ! This works but might cause (harmless) warnings about missing initialisers: s->p_getpwnam = (struct passwd) { 0 }; s->p_getpwuid = (struct passwd) { 0 }; Alternatively: static struct passwd zero_pwd; s->p_getpwnam = zero_pwd; s->p_getpwuid = zero_pwd; Cheers, Stefan From owner-freebsd-hackers@FreeBSD.ORG Fri Oct 8 15:21:14 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D794216A4CE for ; Fri, 8 Oct 2004 15:21:14 +0000 (GMT) Received: from cs1.cs.huji.ac.il (cs1.cs.huji.ac.il [132.65.16.10]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8A64C43D39 for ; Fri, 8 Oct 2004 15:21:14 +0000 (GMT) (envelope-from danny@cs.huji.ac.il) Received: from pampa.cs.huji.ac.il ([132.65.80.32]) by cs1.cs.huji.ac.il with esmtp id 1CFwYS-0003No-GC; Fri, 08 Oct 2004 17:21:12 +0200 X-Mailer: exmh version 2.7.0 06/18/2004 with nmh-1.0.4 To: Andreas Klemm In-Reply-To: Message from Andreas Klemm <20041007174322.GB3414@titan.klemm.apsfilter.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Fri, 08 Oct 2004 17:21:12 +0200 From: Danny Braniss Message-Id: <20041008152114.8A64C43D39@mx1.FreeBSD.org> cc: hackers@freebsd.org cc: "Jonathan A. Zdziarski" Subject: Re: please help with: warning: initialization makes integer from pointer X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Oct 2004 15:21:15 -0000 > Dear FreeBSD hackers, > > could somebody please help Jonathan, the dspam owner, how to code > this best under FreeBSD ? > > Please see his question below: > > On Thu, Oct 07, 2004 at 01:16:17PM -0400, Jonathan A. Zdziarski wrote: > > I'm a little concerned about these warnings: > > > > pgsql_drv.c:873: warning: initialization makes integer from pointer > > without a cast > > pgsql_drv.c:874: warning: initialization makes integer from pointer > > without a cast > > > > This could cause some problems with dspam. Is there a freeBSDish way to > > do this: > > > > s->p_getpwnam = (struct passwd) { NULL, NULL, 0, 0, NULL, NULL, NULL }; > > s->p_getpwuid = (struct passwd) { NULL, NULL, 0, 0, NULL, NULL, NULL }; > > > > Perhaps memset(s->p_getpwnam, 0, sizeof(struct passwd)) ? > > > > > > >make all-recursive > > >Making all in . > > >[...] > > > gcc -DHAVE_CONFIG_H -DLOGDIR=\"/var/mail/dspam\" > > > -DCONFIG_DEFAULT=\"/etc/dspam.conf\" -D_REENTRANT > > > -D_POSIX_PTHREAD_SEMANTICS -I. -I. -I. -I/usr/local/include -g -O2 -Wall > > > -Wmissing-prototypes -Wmissing-declarations -MT pgsql_drv.lo -MD -MP -MF > > > .deps/pgsql_drv.Tpo -c pgsql_drv.c -fPIC -DPIC -o .libs/pgsql_drv.o > > >pgsql_drv.c: In function `_ds_init_storage': > > >pgsql_drv.c:873: warning: initialization makes integer from pointer > > >without a cast > > >pgsql_drv.c:874: warning: initialization makes integer from pointer > > >without a cast > > >pgsql_drv.c: In function `_ds_create_signature_id': > > >pgsql_drv.c:1028: warning: long unsigned int format, time_t arg (arg 4) > > >pgsql_drv.c:1028: warning: long unsigned int format, time_t arg (arg 4) > > >[...] > > int > _ds_init_storage (DSPAM_CTX * CTX, void *dbh) > { > struct _pgsql_drv_storage *s; > FILE *file; > char filename[MAX_FILENAME_LENGTH]; > char buffer[256]; > char hostname[128] = ""; > char user[64] = ""; > char password[32] = ""; > char db[64] = ""; > int port = 5432, i = 0; > // PGresult *result; > > /* don't init if we're already initted */ > if (CTX->storage != NULL) > { > LOGDEBUG ("_ds_init_storage: storage already initialized"); > return EINVAL; > } > > s = malloc (sizeof (struct _pgsql_drv_storage)); > if (s == NULL) > { > LOG (LOG_CRIT, ERROR_MEM_ALLOC); > return EUNKNOWN; > } > > s->dbh = NULL; > s->control_token = 0; > s->iter_user = NULL; > s->iter_token = NULL; > s->iter_sig = NULL; > s->control_token = 0; > s->control_sh = 0; > s->control_ih = 0; > s->dbh_attached = (dbh) ? 1 : 0; > s->u_getnextuser[0] = 0; > s->p_getpwnam = (struct passwd) { NULL, NULL, 0, 0, NULL, NULL, NULL }; > ^^^^^^^^^^^^^^^^^^^^ ! > s->p_getpwuid = (struct passwd) { NULL, NULL, 0, 0, NULL, NULL, NULL }; > ^^^^^^^^^^^^^^^^^^^^ ! > > > > > Andreas /// what about: s = calloc (1, sizeof (struct _pgsql_drv_storage)); if (s == NULL) { LOG (LOG_CRIT, ERROR_MEM_ALLOC); return EUNKNOWN; } if(dbh) s->dbh_attached = 1; danny From owner-freebsd-hackers@FreeBSD.ORG Fri Oct 8 15:29:06 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C9E0416A4CE for ; Fri, 8 Oct 2004 15:29:06 +0000 (GMT) Received: from dan.emsphone.com (dan.emsphone.com [199.67.51.101]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7A15D43D45 for ; Fri, 8 Oct 2004 15:29:06 +0000 (GMT) (envelope-from dan@dan.emsphone.com) Received: (from dan@localhost) by dan.emsphone.com (8.12.11/8.12.11) id i98FT5qM055134; Fri, 8 Oct 2004 10:29:05 -0500 (CDT) (envelope-from dan) Date: Fri, 8 Oct 2004 10:29:05 -0500 From: Dan Nelson To: Andreas Klemm Message-ID: <20041008152905.GA3106@dan.emsphone.com> References: <20041005054213.GA11770@lesanti.hq.sinectis.com.ar> <416234B1.8020406@nuclearelephant.com> <20041005202816.GA14973@titan.klemm.apsfilter.org> <20041005205040.GH31397@lesanti.hq.sinectis.com.ar> <20041006060437.GA23364@titan.klemm.apsfilter.org> <20041006144220.GA29653@lesanti.hq.sinectis.com.ar> <20041007111139.GA16296@titan.klemm.apsfilter.org> <416579E1.8050308@nuclearelephant.com> <20041007174322.GB3414@titan.klemm.apsfilter.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20041007174322.GB3414@titan.klemm.apsfilter.org> X-OS: FreeBSD 5.3-BETA7 X-message-flag: Outlook Error User-Agent: Mutt/1.5.6i cc: hackers@freebsd.org cc: "Jonathan A. Zdziarski" Subject: Re: please help with: warning: initialization makes integer from pointer X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Oct 2004 15:29:06 -0000 In the last episode (Oct 07), Andreas Klemm said: > Dear FreeBSD hackers, > > could somebody please help Jonathan, the dspam owner, how to code > this best under FreeBSD ? > > Please see his question below: > > On Thu, Oct 07, 2004 at 01:16:17PM -0400, Jonathan A. Zdziarski wrote: > > I'm a little concerned about these warnings: > > > > pgsql_drv.c:873: warning: initialization makes integer from pointer without a cast > > pgsql_drv.c:874: warning: initialization makes integer from pointer without a cast > > > > This could cause some problems with dspam. Is there a freeBSDish way to > > do this: > > > > s->p_getpwnam = (struct passwd) { NULL, NULL, 0, 0, NULL, NULL, NULL }; > > s->p_getpwuid = (struct passwd) { NULL, NULL, 0, 0, NULL, NULL, NULL }; > > > > Perhaps memset(s->p_getpwnam, 0, sizeof(struct passwd)) ? Yes, memset would be much more portable. I don't think there is any standard that says how many fields struct passwd has, or if they must be in any order. POSIX names only 5 required fields and no order. You could use designated initialization, but that's a C99 feature, and since you're initializing everything to zero anyway, memset is still better. -- Dan Nelson dnelson@allantgroup.com From owner-freebsd-hackers@FreeBSD.ORG Fri Oct 8 15:37:31 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3589E16A4E7 for ; Fri, 8 Oct 2004 15:37:31 +0000 (GMT) Received: from n33.kp.t-systems-sfr.com (n33.kp.t-systems-sfr.com [129.247.16.33]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3FF3E43D31 for ; Fri, 8 Oct 2004 15:37:30 +0000 (GMT) (envelope-from harti@freebsd.org) Received: from n81.sp.op.dlr.de (n81g.sp.op.dlr.de [129.247.163.1]) i98FbIU565292; Fri, 8 Oct 2004 17:37:18 +0200 Received: from zeus.nt.op.dlr.de (zeus.nt.op.dlr.de [129.247.173.3]) i98FbHI82820; Fri, 8 Oct 2004 17:37:17 +0200 Received: from beagle.kn.op.dlr.de (opkndnwsbsd178 [129.247.173.178]) by zeus.nt.op.dlr.de (8.11.7+Sun/8.9.1) with ESMTP id i98FbGe21314; Fri, 8 Oct 2004 17:37:17 +0200 (MET DST) Date: Fri, 8 Oct 2004 17:37:17 +0200 (CEST) From: Harti Brandt X-X-Sender: brandt@beagle.kn.op.dlr.de To: Dan Nelson In-Reply-To: <20041008152905.GA3106@dan.emsphone.com> Message-ID: <20041008173138.Y14215@beagle.kn.op.dlr.de> References: <20041005054213.GA11770@lesanti.hq.sinectis.com.ar> <20041005202816.GA14973@titan.klemm.apsfilter.org> <20041005205040.GH31397@lesanti.hq.sinectis.com.ar> <20041006060437.GA23364@titan.klemm.apsfilter.org> <20041006144220.GA29653@lesanti.hq.sinectis.com.ar> <416579E1.8050308@nuclearelephant.com> <20041008152905.GA3106@dan.emsphone.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: hackers@freebsd.org cc: Andreas Klemm Subject: Re: please help with: warning: initialization makes integer from pointer X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Harti Brandt List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Oct 2004 15:37:31 -0000 On Fri, 8 Oct 2004, Dan Nelson wrote: DN>In the last episode (Oct 07), Andreas Klemm said: DN>> Dear FreeBSD hackers, DN>> DN>> could somebody please help Jonathan, the dspam owner, how to code DN>> this best under FreeBSD ? DN>> DN>> Please see his question below: DN>> DN>> On Thu, Oct 07, 2004 at 01:16:17PM -0400, Jonathan A. Zdziarski wrote: DN>> > I'm a little concerned about these warnings: DN>> > DN>> > pgsql_drv.c:873: warning: initialization makes integer from pointer without a cast DN>> > pgsql_drv.c:874: warning: initialization makes integer from pointer without a cast DN>> > DN>> > This could cause some problems with dspam. Is there a freeBSDish way to DN>> > do this: DN>> > DN>> > s->p_getpwnam = (struct passwd) { NULL, NULL, 0, 0, NULL, NULL, NULL }; DN>> > s->p_getpwuid = (struct passwd) { NULL, NULL, 0, 0, NULL, NULL, NULL }; DN>> > DN>> > Perhaps memset(s->p_getpwnam, 0, sizeof(struct passwd)) ? DN> DN>Yes, memset would be much more portable. I don't think there is any DN>standard that says how many fields struct passwd has, or if they must DN>be in any order. POSIX names only 5 required fields and no order. DN> DN>You could use designated initialization, but that's a C99 feature, and DN>since you're initializing everything to zero anyway, memset is still DN>better. Memset is actually not portable if the structure contains pointers because it would initialize the pointers to 0 values not to 0 pointers. A 0 pointer not necessarily has a 0 value. A pointer can be portably be initialize to the 0-pointer only by assigning NULL (or 0) (or by assigning another pointer that is alreay initialized). If you don't want to use designated initialisation and need portability, you must either explicitely assign all the members that are definied in the standard or use: static const struct passwd passwd_0; ... s->p_getpwnam = passwd_0; ... harti From owner-freebsd-hackers@FreeBSD.ORG Fri Oct 8 16:14:42 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id AB3BF16A4CE; Fri, 8 Oct 2004 16:14:42 +0000 (GMT) Received: from ack.Berkeley.EDU (ack.Berkeley.EDU [128.32.206.66]) by mx1.FreeBSD.org (Postfix) with ESMTP id 97EFC43D31; Fri, 8 Oct 2004 16:14:42 +0000 (GMT) (envelope-from mhunter@ack.Berkeley.EDU) Received: (from mhunter@localhost) by ack.Berkeley.EDU (8.11.3/8.11.3) id i98GEgf10525; Fri, 8 Oct 2004 09:14:42 -0700 (PDT) Date: Fri, 8 Oct 2004 09:14:42 -0700 From: Mike Hunter To: Harti Brandt Message-ID: <20041008161442.GA9862@ack.Berkeley.EDU> References: <20041005054213.GA11770@lesanti.hq.sinectis.com.ar> <20041005202816.GA14973@titan.klemm.apsfilter.org> <20041005205040.GH31397@lesanti.hq.sinectis.com.ar> <20041006060437.GA23364@titan.klemm.apsfilter.org> <20041006144220.GA29653@lesanti.hq.sinectis.com.ar> <416579E1.8050308@nuclearelephant.com> <20041008152905.GA3106@dan.emsphone.com> <20041008173138.Y14215@beagle.kn.op.dlr.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20041008173138.Y14215@beagle.kn.op.dlr.de> User-Agent: Mutt/1.5.6i cc: hackers@freebsd.org Subject: Re: please help with: warning: initialization makes integer from pointer X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Oct 2004 16:14:42 -0000 On Oct 08, "Harti Brandt" wrote: > On Fri, 8 Oct 2004, Dan Nelson wrote: > > Memset is actually not portable if the structure contains pointers because > it would initialize the pointers to 0 values not to 0 pointers. A 0 > pointer not necessarily has a 0 value. A pointer can be portably be > initialize to the 0-pointer only by assigning NULL (or 0) (or by assigning > another pointer that is alreay initialized). Sick! Are there actually systems out there that don't have "all-zero" NULL pointers? You have officially shattered my previously held beliefs about the sacredness of memset :( Mike From owner-freebsd-hackers@FreeBSD.ORG Fri Oct 8 16:27:16 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 49CC016A4CE; Fri, 8 Oct 2004 16:27:16 +0000 (GMT) Received: from athena.softcardsystems.com (mail.softcardsystems.com [12.34.136.114]) by mx1.FreeBSD.org (Postfix) with ESMTP id CC72443D2D; Fri, 8 Oct 2004 16:27:13 +0000 (GMT) (envelope-from sah@softcardsystems.com) Received: from athena (athena [12.34.136.114])i98HPjP7002130; Fri, 8 Oct 2004 12:25:45 -0500 Date: Fri, 8 Oct 2004 12:25:45 -0500 (EST) From: Sam X-X-Sender: sah@athena To: Mike Hunter In-Reply-To: <20041008161442.GA9862@ack.Berkeley.EDU> Message-ID: References: <20041005054213.GA11770@lesanti.hq.sinectis.com.ar> <20041005202816.GA14973@titan.klemm.apsfilter.org> <20041005205040.GH31397@lesanti.hq.sinectis.com.ar> <20041006060437.GA23364@titan.klemm.apsfilter.org> <416579E1.8050308@nuclearelephant.com> <20041008173138.Y14215@beagle.kn.op.dlr.de> <20041008161442.GA9862@ack.Berkeley.EDU> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed cc: hackers@freebsd.org cc: Harti Brandt Subject: Re: please help with: warning: initialization makes integer from pointer X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Oct 2004 16:27:16 -0000 > Sick! > > Are there actually systems out there that don't have "all-zero" NULL pointers? > > You have officially shattered my previously held beliefs about the > sacredness of memset :( If there are, I'd be interested to know of them. Like zero'ing out bss, the definition of NULL as 0 is left as implementation specific. Try to change it, however, and see what nightmare ensues. People who argue conventions that have been around for 25 years aren't "standard" and should be "avoided" need therapy. Sam From owner-freebsd-hackers@FreeBSD.ORG Fri Oct 8 16:45:21 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id ED55216A4CF; Fri, 8 Oct 2004 16:45:21 +0000 (GMT) Received: from smtp.des.no (flood.des.no [217.116.83.31]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5296143D1D; Fri, 8 Oct 2004 16:45:21 +0000 (GMT) (envelope-from des@des.no) Received: by smtp.des.no (Pony Express, from userid 666) id E3FA45310; Fri, 8 Oct 2004 18:45:19 +0200 (CEST) Received: from dwp.des.no (des.no [80.203.228.37]) by smtp.des.no (Pony Express) with ESMTP id 02FBA530A; Fri, 8 Oct 2004 18:45:13 +0200 (CEST) Received: by dwp.des.no (Postfix, from userid 2602) id CED74B85E; Fri, 8 Oct 2004 18:45:13 +0200 (CEST) To: Mike Hunter References: <20041005054213.GA11770@lesanti.hq.sinectis.com.ar> <20041005202816.GA14973@titan.klemm.apsfilter.org> <20041005205040.GH31397@lesanti.hq.sinectis.com.ar> <20041006060437.GA23364@titan.klemm.apsfilter.org> <20041006144220.GA29653@lesanti.hq.sinectis.com.ar> <416579E1.8050308@nuclearelephant.com> <20041008152905.GA3106@dan.emsphone.com> <20041008173138.Y14215@beagle.kn.op.dlr.de> <20041008161442.GA9862@ack.Berkeley.EDU> From: des@des.no (=?iso-8859-1?q?Dag-Erling_Sm=F8rgrav?=) Date: Fri, 08 Oct 2004 18:45:13 +0200 In-Reply-To: <20041008161442.GA9862@ack.Berkeley.EDU> (Mike Hunter's message of "Fri, 8 Oct 2004 09:14:42 -0700") Message-ID: User-Agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Spam-Checker-Version: SpamAssassin 2.64 (2004-01-11) on flood.des.no X-Spam-Level: X-Spam-Status: No, hits=0.0 required=5.0 tests=AWL autolearn=no version=2.64 cc: hackers@freebsd.org cc: Harti Brandt Subject: Re: please help with: warning: initialization makes integer from pointer X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Oct 2004 16:45:22 -0000 Mike Hunter writes: > Are there actually systems out there that don't have "all-zero" NULL > pointers? Yes. None that FreeBSD runs on, though. DES --=20 Dag-Erling Sm=F8rgrav - des@des.no From owner-freebsd-hackers@FreeBSD.ORG Fri Oct 8 17:01:04 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8F2D416A4EB; Fri, 8 Oct 2004 17:01:04 +0000 (GMT) Received: from smtp.des.no (flood.des.no [217.116.83.31]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2208743D70; Fri, 8 Oct 2004 17:00:54 +0000 (GMT) (envelope-from des@des.no) Received: by smtp.des.no (Pony Express, from userid 666) id E21D05310; Fri, 8 Oct 2004 19:00:52 +0200 (CEST) Received: from dwp.des.no (des.no [80.203.228.37]) by smtp.des.no (Pony Express) with ESMTP id DD4B0530A; Fri, 8 Oct 2004 19:00:45 +0200 (CEST) Received: by dwp.des.no (Postfix, from userid 2602) id A5E51B85E; Fri, 8 Oct 2004 19:00:45 +0200 (CEST) To: Sam References: <20041005054213.GA11770@lesanti.hq.sinectis.com.ar> <20041005202816.GA14973@titan.klemm.apsfilter.org> <20041005205040.GH31397@lesanti.hq.sinectis.com.ar> <20041006060437.GA23364@titan.klemm.apsfilter.org> <416579E1.8050308@nuclearelephant.com> <20041008173138.Y14215@beagle.kn.op.dlr.de> <20041008161442.GA9862@ack.Berkeley.EDU> From: des@des.no (=?iso-8859-1?q?Dag-Erling_Sm=F8rgrav?=) Date: Fri, 08 Oct 2004 19:00:45 +0200 In-Reply-To: (sah@softcardsystems.com's message of "Fri, 8 Oct 2004 12:25:45 -0500 (EST)") Message-ID: User-Agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Spam-Checker-Version: SpamAssassin 2.64 (2004-01-11) on flood.des.no X-Spam-Level: X-Spam-Status: No, hits=0.0 required=5.0 tests=AWL autolearn=no version=2.64 cc: hackers@freebsd.org cc: Mike Hunter cc: Harti Brandt Subject: Re: please help with: warning: initialization makes integer from pointer X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Oct 2004 17:01:04 -0000 Sam writes: > If there are, I'd be interested to know of them. http://www.eskimo.com/~scs/C-faq/q5.17.html > Like zero'ing out bss, the definition of NULL as 0 is > left as implementation specific. no, zeroing out bss is (indirectly) required by the standard (ISO-IEC-9899:1999 =A76.9.2) http://www.eskimo.com/~scs/C-faq/q1.30.html DES --=20 Dag-Erling Sm=F8rgrav - des@des.no From owner-freebsd-hackers@FreeBSD.ORG Fri Oct 8 17:03:47 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C900516A4CF; Fri, 8 Oct 2004 17:03:47 +0000 (GMT) Received: from mail.auriga.ru (mail.auriga.ru [80.240.102.102]) by mx1.FreeBSD.org (Postfix) with ESMTP id B95F843D45; Fri, 8 Oct 2004 17:03:42 +0000 (GMT) (envelope-from alex.neyman@auriga.ru) Received: from localhost ([127.0.0.1] helo=vagabond.auriga.ru) by mail.auriga.ru with esmtp (Exim 4.30) id 1CFy9Y-0005tv-4W; Fri, 08 Oct 2004 21:03:36 +0400 From: Alexey Neyman Organization: Auriga To: freebsd-hackers@freebsd.org Date: Fri, 8 Oct 2004 21:03:35 +0400 User-Agent: KMail/1.6.2 References: <20041005054213.GA11770@lesanti.hq.sinectis.com.ar> <20041008161442.GA9862@ack.Berkeley.EDU> In-Reply-To: MIME-Version: 1.0 Content-Disposition: inline Message-Id: <200410082103.35732.alex.neyman@auriga.ru> X-SA-Exim-Mail-From: alex.neyman@auriga.ru Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Spam-Checker-Version: SpamAssassin 2.61 (1.212.2.1-2003-12-09-exp) on mail.auriga.ru X-Spam-Level: X-Spam-Status: No, hits=-4.9 required=5.0 tests=BAYES_00 autolearn=ham version=2.61 X-Spam-Report: * -4.9 BAYES_00 BODY: Bayesian spam probability is 0 to 1% * [score: 0.0000] X-SA-Exim-Version: 3.1 (built Wed Dec 31 15:51:03 MSK 2003) X-SA-Exim-Scanned: Yes cc: hackers@freebsd.org cc: Sam cc: Mike Hunter cc: Harti Brandt Subject: Re: please help with: warning: initialization makes integer from pointer X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Oct 2004 17:03:47 -0000 On Friday 08 October 2004 21:25, Sam wrote: > > Are there actually systems out there that don't have "all-zero" NULL pointers? > > > > You have officially shattered my previously held beliefs about the > > sacredness of memset :( > > If there are, I'd be interested to know of them. http://www.eskimo.com/~scs/C-faq/q5.17.html Regards, Alexey. -- We are intelligent and clever, though you would never call us cunning. -- Spathi, SC2 From owner-freebsd-hackers@FreeBSD.ORG Fri Oct 8 17:03:47 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C900516A4CF; Fri, 8 Oct 2004 17:03:47 +0000 (GMT) Received: from mail.auriga.ru (mail.auriga.ru [80.240.102.102]) by mx1.FreeBSD.org (Postfix) with ESMTP id B95F843D45; Fri, 8 Oct 2004 17:03:42 +0000 (GMT) (envelope-from alex.neyman@auriga.ru) Received: from localhost ([127.0.0.1] helo=vagabond.auriga.ru) by mail.auriga.ru with esmtp (Exim 4.30) id 1CFy9Y-0005tv-4W; Fri, 08 Oct 2004 21:03:36 +0400 From: Alexey Neyman Organization: Auriga To: freebsd-hackers@freebsd.org Date: Fri, 8 Oct 2004 21:03:35 +0400 User-Agent: KMail/1.6.2 References: <20041005054213.GA11770@lesanti.hq.sinectis.com.ar> <20041008161442.GA9862@ack.Berkeley.EDU> In-Reply-To: MIME-Version: 1.0 Content-Disposition: inline Message-Id: <200410082103.35732.alex.neyman@auriga.ru> X-SA-Exim-Mail-From: alex.neyman@auriga.ru Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Spam-Checker-Version: SpamAssassin 2.61 (1.212.2.1-2003-12-09-exp) on mail.auriga.ru X-Spam-Level: X-Spam-Status: No, hits=-4.9 required=5.0 tests=BAYES_00 autolearn=ham version=2.61 X-Spam-Report: * -4.9 BAYES_00 BODY: Bayesian spam probability is 0 to 1% * [score: 0.0000] X-SA-Exim-Version: 3.1 (built Wed Dec 31 15:51:03 MSK 2003) X-SA-Exim-Scanned: Yes cc: hackers@freebsd.org cc: Sam cc: Mike Hunter cc: Harti Brandt Subject: Re: please help with: warning: initialization makes integer from pointer X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Oct 2004 17:03:48 -0000 On Friday 08 October 2004 21:25, Sam wrote: > > Are there actually systems out there that don't have "all-zero" NULL pointers? > > > > You have officially shattered my previously held beliefs about the > > sacredness of memset :( > > If there are, I'd be interested to know of them. http://www.eskimo.com/~scs/C-faq/q5.17.html Regards, Alexey. -- We are intelligent and clever, though you would never call us cunning. -- Spathi, SC2 From owner-freebsd-hackers@FreeBSD.ORG Fri Oct 8 19:36:43 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 57D0A16A4CE for ; Fri, 8 Oct 2004 19:36:43 +0000 (GMT) Received: from beer.ux6.net (beer.ux6.net [64.62.253.29]) by mx1.FreeBSD.org (Postfix) with SMTP id 2616B43D41 for ; Fri, 8 Oct 2004 19:36:43 +0000 (GMT) (envelope-from miha@ghuug.org) Received: (qmail 65861 invoked by uid 113); 8 Oct 2004 12:36:43 -0700 Received: from 64.62.253.84 by beer.ux6.net (envelope-from , uid 112) with qmail-scanner-1.23 (clamdscan: 0.70. spamassassin: 2.64. Clear:RC:0(64.62.253.84):SA:0(0.0/6.0):. Processed in 3.556197 secs); 08 Oct 2004 19:36:43 -0000 X-Spam-Status: No, hits=0.0 required=6.0 Received: from unknown (HELO miha.netstream-gh.com) (miha@beer.ux6.net@64.62.253.84) by localhost with SMTP; 8 Oct 2004 12:36:39 -0700 From: "Mikhail P." To: hackers@freebsd.org Date: Fri, 8 Oct 2004 19:37:15 +0000 User-Agent: KMail/1.7 Organization: Ghana Unix Users Group MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200410081937.15068.miha@ghuug.org> Subject: ad0: FAILURE - WRITE_DMA X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: miha@ghuug.org List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Oct 2004 19:36:43 -0000 Hi, This question probably has been discussed numerous times, but I'm somewhat unsure what really causes ATA failures.. I have pretty basic server here which has two IDE drives - each is 200GB. System is FreeBSD-5.2.1-p9 That server has been setup about 9 months ago, and just about 3 months ago my logs quickly filled up with: ad0: FAILURE - WRITE_DMA status=51 error=10 LBA=268435455 Server was still running, but I was unable to write to certain files/folders on the drive - whenever I tried to access $HOME/.fetchmailrc, for example, it wouldn't read/write the file and system would fire up a message similar to above. After couple reboots, I started getting more and more of these, and server was unusable, so I had to shut down all services and mount drives read only to backup data from the drives.. At first, I thought, this could be related to poor cooling of the parts, so drives could easily overheat in the long run. After successful backup, I purchased two new drives, with two aluminum drive fans. New drives' models were identical to the old ones - ad0 ATA/ATAPI rev 6 which is Seagate's 200GB drive. I reloaded OS on the new drives, then restored all data from the old drives. All seemed to be fine for 2 months now... but today I woke up, and noticed these messages again. So now the whole situation leads me to a question - is there some issues with the ATA driver/system [or filesystem?] on FreeBSD-5.2.1? What can I do to stop these frequent failures? How do I diagnose the drives (and see whether it is really a hardware issue or something else) remotely (I don't have local access to the server - it is sitting overseas)? It seems to me that if I continue running system as now, I will have these failed drives every 1-2 months! It does not sound like a normal situation. I am running FreeBSD-5.2.1-p9, filesystem is UFS2, and all partitions [except for /] have softupdates "on". Kernel is built on GENERIC, with only added ipfw options. regards, M. From owner-freebsd-hackers@FreeBSD.ORG Fri Oct 8 22:32:37 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D8E9816A4CE for ; Fri, 8 Oct 2004 22:32:37 +0000 (GMT) Received: from whisker.bluecoat.com (whisker.bluecoat.com [216.52.23.28]) by mx1.FreeBSD.org (Postfix) with ESMTP id AD99C43D3F for ; Fri, 8 Oct 2004 22:32:37 +0000 (GMT) (envelope-from qing.li@bluecoat.com) Received: from bcs-mail.bluecoat.com (bcs-mail.bluecoat.com [216.52.23.69]) by whisker.bluecoat.com (8.13.0/8.13.0) with ESMTP id i98MWaJ4008020 for ; Fri, 8 Oct 2004 15:32:36 -0700 (PDT) X-MimeOLE: Produced By Microsoft Exchange V6.0.6487.1 content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Date: Fri, 8 Oct 2004 15:32:36 -0700 Message-ID: <00CDF9AA240E204FA6E923BD35BC643606BF68E3@bcs-mail.internal.cacheflow.com> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Bit field definition ? Thread-Index: AcSthrW22avUMPMjQymO/k2kM37dCg== From: "Li, Qing" To: X-Scanned-By: MIMEDefang 2.44 Subject: Bit field definition ? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Oct 2004 22:32:38 -0000 The bit fields "th_x2" and "th_off" in "struct tcphdr", even though defined as "u_int", actually occupies 1 byte. What's the trick ? -- Qing From owner-freebsd-hackers@FreeBSD.ORG Sat Oct 9 00:19:20 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4EDF616A4CE for ; Sat, 9 Oct 2004 00:19:20 +0000 (GMT) Received: from out001.verizon.net (out001pub.verizon.net [206.46.170.140]) by mx1.FreeBSD.org (Postfix) with ESMTP id C97C743D49 for ; Sat, 9 Oct 2004 00:19:19 +0000 (GMT) (envelope-from babkin@bellatlantic.net) Received: from bellatlantic.net ([141.153.249.79]) by out001.verizon.net (InterMail vM.5.01.06.06 201-253-122-130-106-20030910) with ESMTP id <20041009001918.ZKNL24594.out001.verizon.net@bellatlantic.net>; Fri, 8 Oct 2004 19:19:18 -0500 Sender: root@FreeBSD.ORG Message-ID: <41672E84.9DE09887@bellatlantic.net> Date: Fri, 08 Oct 2004 20:19:16 -0400 From: Sergey Babkin X-Mailer: Mozilla 4.7 [en] (X11; U; FreeBSD 4.7-RELEASE i386) X-Accept-Language: en, ru MIME-Version: 1.0 To: Doug Russell References: <20041007204943.S27627-100000@mxb.saturn-tech.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Authentication-Info: Submitted using SMTP AUTH at out001.verizon.net from [141.153.249.79] at Fri, 8 Oct 2004 19:19:17 -0500 cc: freebsd-hackers@freebsd.org cc: John Von Essen Subject: Re: hacking SCO.... X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Oct 2004 00:19:20 -0000 Doug Russell wrote: > > On Thu, 7 Oct 2004, John Von Essen wrote: > > > Well, I eventually got this SCO system working. But today, some errors > > appeared: > > > > 505k:unrecover error reading SCSI disk on 0 Dev - 1/42 > > cha = 0 id = 0 1 on = 0 > > Block 6578 > > medium error unrecovered read error > > HTFS i/o failure occurred while trying to upgrade 1 node 26302 on > > HTFS. Dev hd 1/42 > > Error log over flow block 6578 medium error unrecovered read error . > > > > Do these sound likes hardware errors for the drive or the adaptec card > > Drive errors. > Did you do a new low-level format before you put it in service? > > sformat is your friend. Try to use the "Verify" menu from the Adaptec BIOS. It finds and tries to re-map the bad sectors (it tries to preserve data during this too, unless the sector is completely unreadable). > I do the full 14 pattern tests before I put a SCSI disk in service. When a disk starts losing blocks like this, usually they only multiply over time. The best thing you can do is replace the disk and move the data before you lost more of it. -SB From owner-freebsd-hackers@FreeBSD.ORG Sat Oct 9 01:57:02 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4F3C616A4CE for ; Sat, 9 Oct 2004 01:57:02 +0000 (GMT) Received: from dan.emsphone.com (dan.emsphone.com [199.67.51.101]) by mx1.FreeBSD.org (Postfix) with ESMTP id E8DF243D2D for ; Sat, 9 Oct 2004 01:57:01 +0000 (GMT) (envelope-from dan@dan.emsphone.com) Received: (from dan@localhost) by dan.emsphone.com (8.12.11/8.12.11) id i991udox086584; Fri, 8 Oct 2004 20:56:39 -0500 (CDT) (envelope-from dan) Date: Fri, 8 Oct 2004 20:56:39 -0500 From: Dan Nelson To: "Li, Qing" Message-ID: <20041009015639.GB3106@dan.emsphone.com> References: <00CDF9AA240E204FA6E923BD35BC643606BF68E3@bcs-mail.internal.cacheflow.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <00CDF9AA240E204FA6E923BD35BC643606BF68E3@bcs-mail.internal.cacheflow.com> X-OS: FreeBSD 5.3-BETA7 X-message-flag: Outlook Error User-Agent: Mutt/1.5.6i cc: freebsd-hackers@freebsd.org Subject: Re: Bit field definition ? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Oct 2004 01:57:02 -0000 In the last episode (Oct 08), Li, Qing said: > The bit fields "th_x2" and "th_off" in "struct tcphdr", > even though defined as "u_int", actually occupies 1 byte. u_int th_x2:4, /* (unused) */ th_off:4; /* data offset */ The :4 after each variable means 4 bits long, so both fields together take up 8 bits = 1 byte. That's the whole purpose of bitfields :) -- Dan Nelson dnelson@allantgroup.com From owner-freebsd-hackers@FreeBSD.ORG Sat Oct 9 08:09:47 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 27C5716A4CE for ; Sat, 9 Oct 2004 08:09:47 +0000 (GMT) Received: from tut.by (speedy.tutby.com [195.209.41.194]) by mx1.FreeBSD.org (Postfix) with ESMTP id 510BF43D39 for ; Sat, 9 Oct 2004 08:09:46 +0000 (GMT) (envelope-from myst@tut.by) Received: from [194.158.208.14] (account myst@tut.by) by tut.by (CommuniGate Pro WebUser 4.1.8) with HTTP id 14794402 for freebsd-hackers@freebsd.org; Sat, 09 Oct 2004 11:09:44 +0300 From: Stas D.Myasnikov To: freebsd-hackers@freebsd.org X-Mailer: CommuniGate Pro WebUser Interface v.4.1.8 Date: Sat, 09 Oct 2004 11:09:44 +0300 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="KOI8-R"; format="flowed" Content-Transfer-Encoding: 8bit Subject: Hangups while using user-ppp. X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Oct 2004 08:09:47 -0000 Hello! I have an interesting problem. While I'm using user-ppp in about 2-3 minutes after start all system suddenly hangs up, but after 10-15 seconds it start running normally, and this hangup not repeat in this ppp session. What is can be? Bye. P.S. I'm using FreeBSD 5.2.1 on i386. Kernels are my own, and what is worse GENERIC. From owner-freebsd-hackers@FreeBSD.ORG Sat Oct 9 08:16:08 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 64EEB16A4CE for ; Sat, 9 Oct 2004 08:16:08 +0000 (GMT) Received: from tut.by (speedy.tutby.com [195.209.41.194]) by mx1.FreeBSD.org (Postfix) with ESMTP id B8F6C43D2D for ; Sat, 9 Oct 2004 08:16:07 +0000 (GMT) (envelope-from myst@tut.by) Received: from [194.158.208.14] (account myst@tut.by) by tut.by (CommuniGate Pro WebUser 4.1.8) with HTTP id 14796097 for freebsd-hackers@freebsd.org; Sat, 09 Oct 2004 11:16:06 +0300 From: Stas D.Myasnikov To: freebsd-hackers@freebsd.org X-Mailer: CommuniGate Pro WebUser Interface v.4.1.8 Date: Sat, 09 Oct 2004 11:16:06 +0300 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="KOI8-R"; format="flowed" Content-Transfer-Encoding: 8bit Subject: Hangups while using user-ppp. X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Oct 2004 08:16:08 -0000 Hello! I have an interesting problem. While I'm using user-ppp in about 2-3 minutes after start all system suddenly hangs up, but after 10-15 seconds it start running normally, and this hangup not repeat in this ppp session. What is can be? Bye. P.S. I'm using FreeBSD 5.2.1 on i386. Kernels are my own, and what is worse GENERIC. From owner-freebsd-hackers@FreeBSD.ORG Sat Oct 9 10:48:29 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5E0CA16A4CE for ; Sat, 9 Oct 2004 10:48:29 +0000 (GMT) Received: from mxb.saturn-tech.com (mxb.saturn-tech.com [207.229.19.99]) by mx1.FreeBSD.org (Postfix) with ESMTP id B5E9943D5C for ; Sat, 9 Oct 2004 10:48:28 +0000 (GMT) (envelope-from drussell@saturn-tech.com) Received: from mxb.saturn-tech.com (localhost [127.0.0.1]) by mxb.saturn-tech.com (8.12.3/8.12.3) with ESMTP id i99ApRuR039631; Sat, 9 Oct 2004 04:51:27 -0600 (MDT) (envelope-from drussell@saturn-tech.com) Received: from localhost (drussell@localhost)i99ApQMc039628; Sat, 9 Oct 2004 04:51:27 -0600 (MDT) (envelope-from drussell@saturn-tech.com) X-Authentication-Warning: mxb.saturn-tech.com: drussell owned process doing -bs Date: Sat, 9 Oct 2004 04:51:26 -0600 (MDT) From: Doug Russell To: Sergey Babkin In-Reply-To: <41672E84.9DE09887@bellatlantic.net> Message-ID: <20041009044403.P39589-100000@mxb.saturn-tech.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: freebsd-hackers@freebsd.org cc: John Von Essen Subject: Re: hacking SCO.... X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Oct 2004 10:48:29 -0000 On Fri, 8 Oct 2004, Sergey Babkin wrote: > Try to use the "Verify" menu from the Adaptec BIOS. It finds and tries > to re-map the bad sectors (it tries to preserve data during this too, > unless the sector is completely unreadable). The verify commands issued by the BIOS are virtually useless compared to the type of tests done my sformat. If you enable automatic read re-allocation, it is almost the same as simply reading your whole disk with dd. > > I do the full 14 pattern tests before I put a SCSI disk in service. > > When a disk starts losing blocks like this, usually they only multiply > over time. The best thing you can do is replace the disk and > move the data before you lost more of it. NO! Not necessarily! If a disk has simply grown a few new defects since it was new, it does not necessarily mean it is going to die. I have many disks that had minor bad spots on them that weren't even always found by the factory format routines, or had appeared since (due to transport, debris in the HDA, poor holding power for the magnetic fields in some area, etc). If the drive passes through a few full patern tests without problems and doesn't continue to grow new defects, it is likely just fine. I've got all kinds of old SCSI disks that were 'discarded' due to errors. Only a couple are truly dead... the rest have been running for years with no problems after making a real grown defect list from the pattern tests. This is something I learned many many years ago when running my old Miniscribe 3650s on a Perstor high density controller. It formated the drives to 31 sectors per track instead of 17. Hard on the disks, and the media, but a good drive, after being properly tested, would run flawlessly for years being hammered 24/7 on BBS machines. Got 78 megs per drive instead of 42.whatever it was. :) Later...... From owner-freebsd-hackers@FreeBSD.ORG Fri Oct 8 16:49:48 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3FB6616A4CF; Fri, 8 Oct 2004 16:49:48 +0000 (GMT) Received: from meketrex.pix.net (meketrex.pix.net [192.111.45.13]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4256B43D1F; Fri, 8 Oct 2004 16:49:47 +0000 (GMT) (envelope-from lidl@meketrex.pix.net) Received: (from lidl@localhost) by meketrex.pix.net (8.11.6/8.11.6) id i98GngF14229; Fri, 8 Oct 2004 12:49:42 -0400 (EDT) Date: Fri, 8 Oct 2004 12:49:42 -0400 From: "Kurt J. Lidl" To: Sam Message-ID: <20041008124942.A13939@pix.net> References: <20041005054213.GA11770@lesanti.hq.sinectis.com.ar> <20041005202816.GA14973@titan.klemm.apsfilter.org> <20041005205040.GH31397@lesanti.hq.sinectis.com.ar> <20041006060437.GA23364@titan.klemm.apsfilter.org> <416579E1.8050308@nuclearelephant.com> <20041008173138.Y14215@beagle.kn.op.dlr.de> <20041008161442.GA9862@ack.Berkeley.EDU> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: ; from sah@softcardsystems.com on Fri, Oct 08, 2004 at 12:25:45PM -0500 X-Mailman-Approved-At: Sat, 09 Oct 2004 13:26:06 +0000 cc: hackers@freebsd.org cc: Mike Hunter cc: Harti Brandt Subject: Re: please help with: warning: initialization makes integer from pointer X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Oct 2004 16:49:48 -0000 On Fri, Oct 08, 2004 at 12:25:45PM -0500, Sam wrote: > > Sick! > > > > Are there actually systems out there that don't have "all-zero" NULL pointers? > > > > You have officially shattered my previously held beliefs about the > > sacredness of memset :( > > If there are, I'd be interested to know of them. See the C Faq, question 1.14: http://www.lysator.liu.se/c/c-faq/c-1.html -Kurt From owner-freebsd-hackers@FreeBSD.ORG Sat Oct 9 15:01:59 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E6CDE16A4CE for ; Sat, 9 Oct 2004 15:01:59 +0000 (GMT) Received: from smtp.des.no (flood.des.no [217.116.83.31]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4D34343D3F for ; Sat, 9 Oct 2004 15:01:59 +0000 (GMT) (envelope-from des@des.no) Received: by smtp.des.no (Pony Express, from userid 666) id 3397D5310; Sat, 9 Oct 2004 17:01:58 +0200 (CEST) Received: from dwp.des.no (des.no [80.203.228.37]) by smtp.des.no (Pony Express) with ESMTP id ECFDA530A; Sat, 9 Oct 2004 17:01:50 +0200 (CEST) Received: by dwp.des.no (Postfix, from userid 2602) id BC578B85E; Sat, 9 Oct 2004 17:01:50 +0200 (CEST) To: miha@ghuug.org References: <200410081937.15068.miha@ghuug.org> From: des@des.no (=?iso-8859-1?q?Dag-Erling_Sm=F8rgrav?=) Date: Sat, 09 Oct 2004 17:01:50 +0200 In-Reply-To: <200410081937.15068.miha@ghuug.org> (Mikhail P.'s message of "Fri, 8 Oct 2004 19:37:15 +0000") Message-ID: User-Agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Spam-Checker-Version: SpamAssassin 2.64 (2004-01-11) on flood.des.no X-Spam-Level: X-Spam-Status: No, hits=0.0 required=5.0 tests=AWL autolearn=no version=2.64 cc: hackers@freebsd.org Subject: Re: ad0: FAILURE - WRITE_DMA X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Oct 2004 15:02:00 -0000 "Mikhail P." writes: > I reloaded OS on the new drives, then restored all data from the old driv= es. > All seemed to be fine for 2 months now... but today I woke up, and noticed > these messages again. A lot of them, or just one or two? Some ATA drives will spin down at regular intervals to recalibrate, and you'll get a harmless timeout if you try to write to the disk while it's doing that. DES --=20 Dag-Erling Sm=F8rgrav - des@des.no From owner-freebsd-hackers@FreeBSD.ORG Sat Oct 9 16:16:46 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id EF05616A4CE for ; Sat, 9 Oct 2004 16:16:46 +0000 (GMT) Received: from beer.ux6.net (beer.ux6.net [64.62.253.29]) by mx1.FreeBSD.org (Postfix) with SMTP id C06ED43D5E for ; Sat, 9 Oct 2004 16:16:46 +0000 (GMT) (envelope-from miha@ghuug.org) Received: (qmail 82242 invoked by uid 113); 9 Oct 2004 09:16:46 -0700 Received: from 64.62.253.84 by beer.ux6.net (envelope-from , uid 112) with qmail-scanner-1.23 (clamdscan: 0.70. spamassassin: 2.64. Clear:RC:0(64.62.253.84):SA:0(0.0/6.0):. Processed in 1.225043 secs); 09 Oct 2004 16:16:46 -0000 X-Spam-Status: No, hits=0.0 required=6.0 Received: from unknown (HELO miha.netstream-gh.com) (miha@beer.ux6.net@64.62.253.84) by localhost with SMTP; 9 Oct 2004 09:16:45 -0700 From: "Mikhail P." To: freebsd-hackers@freebsd.org Date: Sat, 9 Oct 2004 16:17:26 +0000 User-Agent: KMail/1.7 References: <200410081937.15068.miha@ghuug.org> In-Reply-To: Organization: Ghana Unix Users Group MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Message-Id: <200410091617.26794.miha@ghuug.org> cc: Dag-Erling =?iso-8859-1?q?Sm=F8rgrav?= Subject: Re: ad0: FAILURE - WRITE_DMA X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: miha@ghuug.org List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Oct 2004 16:16:47 -0000 On Saturday 09 October 2004 15:01, Dag-Erling Sm=F8rgrav wrote: > "Mikhail P." writes: > > I reloaded OS on the new drives, then restored all data from the old > > drives. All seemed to be fine for 2 months now... but today I woke up, > > and noticed these messages again. > > A lot of them, or just one or two? Some ATA drives will spin down at > regular intervals to recalibrate, and you'll get a harmless timeout if > you try to write to the disk while it's doing that. Unfortunately, all the drives (so far - four 200GB drives). I'm having the previous two drives shipped here within two weeks. Most likely these drives aren't corrupted actually.. will stress them local= ly=20 here. > > DES regards, M. From owner-freebsd-hackers@FreeBSD.ORG Sat Oct 9 16:18:52 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4201516A4CE for ; Sat, 9 Oct 2004 16:18:52 +0000 (GMT) Received: from woozle.rinet.ru (woozle.rinet.ru [195.54.192.68]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2C5E543D1F for ; Sat, 9 Oct 2004 16:18:51 +0000 (GMT) (envelope-from marck@rinet.ru) Received: from localhost (localhost [127.0.0.1]) by woozle.rinet.ru (8.13.1/8.13.1) with ESMTP id i99GIm53099084; Sat, 9 Oct 2004 20:18:48 +0400 (MSD) (envelope-from marck@rinet.ru) Date: Sat, 9 Oct 2004 20:18:48 +0400 (MSD) From: Dmitry Morozovsky To: "Mikhail P." In-Reply-To: <200410091617.26794.miha@ghuug.org> Message-ID: <20041009201807.D66778@woozle.rinet.ru> References: <200410081937.15068.miha@ghuug.org> <200410091617.26794.miha@ghuug.org> X-NCC-RegID: ru.rinet MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: freebsd-hackers@freebsd.org cc: Dag-Erling =?iso-8859-1?q?Sm=F8rgrav?= Subject: Re: ad0: FAILURE - WRITE_DMA X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Oct 2004 16:18:52 -0000 On Sat, 9 Oct 2004, Mikhail P. wrote: MP> > > I reloaded OS on the new drives, then restored all data from the old MP> > > drives. All seemed to be fine for 2 months now... but today I woke up, MP> > > and noticed these messages again. MP> > MP> > A lot of them, or just one or two? Some ATA drives will spin down at MP> > regular intervals to recalibrate, and you'll get a harmless timeout if MP> > you try to write to the disk while it's doing that. MP> MP> Unfortunately, all the drives (so far - four 200GB drives). MP> I'm having the previous two drives shipped here within two weeks. MP> Most likely these drives aren't corrupted actually.. will stress them locally MP> here. Well, I suppose Dag-Erling means 'lot of errors' as opposed to one or two raisen sporadically... Sincerely, D.Marck [DM5020, MCK-RIPE, DM3-RIPN] ------------------------------------------------------------------------ *** Dmitry Morozovsky --- D.Marck --- Wild Woozle --- marck@rinet.ru *** ------------------------------------------------------------------------ From owner-freebsd-hackers@FreeBSD.ORG Sat Oct 9 16:23:17 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 86D5C16A4CE for ; Sat, 9 Oct 2004 16:23:17 +0000 (GMT) Received: from smtp.des.no (flood.des.no [217.116.83.31]) by mx1.FreeBSD.org (Postfix) with ESMTP id DF9A743D46 for ; Sat, 9 Oct 2004 16:23:16 +0000 (GMT) (envelope-from des@des.no) Received: by smtp.des.no (Pony Express, from userid 666) id 976BF5310; Sat, 9 Oct 2004 18:23:15 +0200 (CEST) Received: from dwp.des.no (des.no [80.203.228.37]) by smtp.des.no (Pony Express) with ESMTP id AFC92530A; Sat, 9 Oct 2004 18:23:08 +0200 (CEST) Received: by dwp.des.no (Postfix, from userid 2602) id 76CB5B861; Sat, 9 Oct 2004 18:23:08 +0200 (CEST) To: miha@ghuug.org References: <200410081937.15068.miha@ghuug.org> <200410091617.26794.miha@ghuug.org> From: des@des.no (=?iso-8859-1?q?Dag-Erling_Sm=F8rgrav?=) Date: Sat, 09 Oct 2004 18:23:08 +0200 In-Reply-To: <200410091617.26794.miha@ghuug.org> (Mikhail P.'s message of "Sat, 9 Oct 2004 16:17:26 +0000") Message-ID: User-Agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Spam-Checker-Version: SpamAssassin 2.64 (2004-01-11) on flood.des.no X-Spam-Level: X-Spam-Status: No, hits=0.0 required=5.0 tests=AWL autolearn=no version=2.64 cc: freebsd-hackers@freebsd.org Subject: Re: ad0: FAILURE - WRITE_DMA X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Oct 2004 16:23:17 -0000 "Mikhail P." writes: > On Saturday 09 October 2004 15:01, Dag-Erling Sm=F8rgrav wrote: > > A lot of them, or just one or two? Some ATA drives will spin down at > > regular intervals to recalibrate, and you'll get a harmless timeout if > > you try to write to the disk while it's doing that. > Unfortunately, all the drives (so far - four 200GB drives). I meant "a lot of timeouts", not "a lot of drives". If you only get one or two timeouts per drive at regular intervals (say, once a month), they're just recalibrating and there's nothing to worry about. BTW, are you using ataidle or anything similar? DES --=20 Dag-Erling Sm=F8rgrav - des@des.no From owner-freebsd-hackers@FreeBSD.ORG Sat Oct 9 16:27:53 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 18E0716A4CE for ; Sat, 9 Oct 2004 16:27:53 +0000 (GMT) Received: from mail.freebsd.org.cn (dns3.freebsd.org.cn [61.129.66.75]) by mx1.FreeBSD.org (Postfix) with SMTP id 35B8643D53 for ; Sat, 9 Oct 2004 16:27:49 +0000 (GMT) (envelope-from delphij@frontfree.net) Received: (qmail 1848 invoked by uid 0); 9 Oct 2004 16:23:22 -0000 Received: from unknown (HELO beastie.frontfree.net) (219.239.98.7) by mail.freebsd.org.cn with SMTP; 9 Oct 2004 16:23:22 -0000 Received: from localhost (localhost.frontfree.net [127.0.0.1]) by beastie.frontfree.net (Postfix) with ESMTP id 14F5113105D for ; Sun, 10 Oct 2004 00:27:47 +0800 (CST) Received: from beastie.frontfree.net ([127.0.0.1]) by localhost (beastie.frontfree.net [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 00883-09 for ; Sun, 10 Oct 2004 00:27:42 +0800 (CST) Received: by beastie.frontfree.net (Postfix, from userid 1001) id 94739130FC7; Sun, 10 Oct 2004 00:27:41 +0800 (CST) Date: Sun, 10 Oct 2004 00:27:41 +0800 From: Xin LI To: freebsd-hackers@FreeBSD.org Message-ID: <20041009162741.GA3403@frontfree.net> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="J2SCkAp4GZ/dPZZf" Content-Disposition: inline User-Agent: Mutt/1.4.2.1i X-GPG-key-ID/Fingerprint: 0xCAEEB8C0 / 43B8 B703 B8DD 0231 B333 DC28 39FB 93A0 CAEE B8C0 X-GPG-Public-Key: http://www.delphij.net/delphij.asc X-Operating-System: FreeBSD beastie.frontfree.net 5.3-delphij FreeBSD 5.3-delphij #4: Mon Sep 13 12:44:05 CST 2004 delphij@beastie.frontfree.net:/usr/obj/usr/src/sys/BEASTIE i386 X-URL: http://www.delphij.net X-By: delphij@beastie.frontfree.net X-Location: Beijing, China X-Virus-Scanned: by amavisd-new at frontfree.net Subject: About the WARNS= knobs in our Makefiles X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Oct 2004 16:27:53 -0000 --J2SCkAp4GZ/dPZZf Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi folks, While traversing our code, I found that many of our code can survive WARNS=3D6 if they get some trivial changes. I think it would be beneficial if we have our code WARNS=3D6 clean because this will give better portability, and a more in-depth review of the code would be positive for better overral quality of them. Is there any efforts on this? Cheers, --=20 Xin LI http://www.delphij.net/ See complete headers for GPG key and other information. --J2SCkAp4GZ/dPZZf Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.6 (FreeBSD) iD8DBQFBaBF9/cVsHxFZiIoRAnfeAJ9tuEzURHEP16VW7ys/z16UfwNUEwCeJiBy txkkzBVRNPtiAKUQu8+H+PE= =EcRd -----END PGP SIGNATURE----- --J2SCkAp4GZ/dPZZf-- From owner-freebsd-hackers@FreeBSD.ORG Sat Oct 9 17:00:47 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id CAAA816A4D3 for ; Sat, 9 Oct 2004 17:00:47 +0000 (GMT) Received: from beer.ux6.net (beer.ux6.net [64.62.253.29]) by mx1.FreeBSD.org (Postfix) with SMTP id 2A5BA43D4C for ; Sat, 9 Oct 2004 17:00:27 +0000 (GMT) (envelope-from miha@ghuug.org) Received: (qmail 81605 invoked by uid 113); 9 Oct 2004 10:00:25 -0700 Received: from 64.62.253.84 by beer.ux6.net (envelope-from , uid 112) with qmail-scanner-1.23 (clamdscan: 0.70. spamassassin: 2.64. Clear:RC:0(64.62.253.84):SA:0(0.3/6.0):. Processed in 4.249043 secs); 09 Oct 2004 17:00:25 -0000 X-Spam-Status: No, hits=0.3 required=6.0 Received: from unknown (HELO miha.netstream-gh.com) (miha@beer.ux6.net@64.62.253.84) by localhost with SMTP; 9 Oct 2004 10:00:20 -0700 From: "Mikhail P." To: freebsd-hackers@freebsd.org Date: Sat, 9 Oct 2004 17:01:01 +0000 User-Agent: KMail/1.7 References: <200410081937.15068.miha@ghuug.org> <200410091617.26794.miha@ghuug.org> In-Reply-To: Organization: Ghana Unix Users Group MIME-Version: 1.0 Content-Type: Multipart/Mixed; boundary="Boundary-00=_NlBaBLZGX4OeKse" Message-Id: <200410091701.01987.miha@ghuug.org> cc: Dag-Erling =?iso-8859-1?q?Sm=F8rgrav?= Subject: Re: ad0: FAILURE - WRITE_DMA X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: miha@ghuug.org List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Oct 2004 17:00:48 -0000 --Boundary-00=_NlBaBLZGX4OeKse Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On Saturday 09 October 2004 16:23, Dag-Erling Sm=F8rgrav wrote: > "Mikhail P." writes: > > On Saturday 09 October 2004 15:01, Dag-Erling Sm=F8rgrav wrote: > > > A lot of them, or just one or two? Some ATA drives will spin down at > > > regular intervals to recalibrate, and you'll get a harmless timeout if > > > you try to write to the disk while it's doing that. > > > > Unfortunately, all the drives (so far - four 200GB drives). > > I meant "a lot of timeouts", not "a lot of drives". If you only get > one or two timeouts per drive at regular intervals (say, once a > month), they're just recalibrating and there's nothing to worry about. > Well, there is no pattern. Often it just happens by itself - system runs 3-= 10=20 days fine (no warnings, no timeouts), and after that time I start seeing lo= ts=20 of these. To be more exact, for example I have user who's home dir=20 is /home/user; user uses FTP to upload/download files under that directory.= =20 Let's say he has 5k files in total (ranging in size from 1kb to 20mb), so=20 what happens is that when user tries to access certain files (either to=20 continue upload, or continue download of the file), system spews lots of=20 these timeouts and basically "input/ourput error" occurs. For example,=20 yesterday it showed 360 of these messages during 12 hour period, and=20 unfortunately during the time I was sleeping system has locked itself - las= t=20 message in /var/log/messages was regarding ad0 failure. I'm not exactly sure on which files it timed out yesterday, but I do know=20 under which directory it happened - directory has 20k files in it (not in t= he=20 single dir, but including subdirs). Maybe someone knows a quick way I could= =20 open every file in under that directory - this could probably help to=20 identify exactly on which file timeouts happened. Before replacing the drives, I had that server up for 120 days, and it did= =20 spew these messages (more and more with every day, started on about 90th da= y=20 of uptime count). After rebooting system, it asked for fsck, which I did ru= n,=20 but it showed some softupdates inconsistencies, and refused to mount /home = in=20 rw. By the way, I just ran fsck on rw mounted /home (that's where those timeout= s=20 occurred yesterday), and I have attached it's output. I also got another message off-list, where author suggested to play with UD= MA=20 values. I switched from UDMA100 to UDMA66. System's uptime is 12 hours, and= =20 no timeouts so far.. but I'm quite sure they will get back in few days. > BTW, are you using ataidle or anything similar? nope, nothing. > > DES regards, M. --Boundary-00=_NlBaBLZGX4OeKse Content-Type: text/plain; charset="iso-8859-1"; name="fsck.txt" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="fsck.txt" [root]@[beer]:/usr/local/etc/rc.d> fsck /home ** /dev/ad0s1g (NO WRITE) ** Last Mounted on /home ** Phase 1 - Check Blocks and Sizes ** Phase 2 - Check Pathnames ** Phase 3 - Check Connectivity ** Phase 4 - Check Reference Counts LINK COUNT FILE I=8715003 OWNER=noc MODE=0 SIZE=0 MTIME=Oct 9 09:50 2004 COUNT 0 SHOULD BE -1 ADJUST? no LINK COUNT FILE I=8715004 OWNER=noc MODE=0 SIZE=0 MTIME=Oct 9 09:50 2004 COUNT 0 SHOULD BE -1 ADJUST? no LINK COUNT FILE I=8715005 OWNER=noc MODE=0 SIZE=0 MTIME=Oct 9 09:50 2004 COUNT 0 SHOULD BE -1 ADJUST? no LINK COUNT FILE I=8715006 OWNER=noc MODE=0 SIZE=0 MTIME=Oct 9 09:50 2004 COUNT 0 SHOULD BE -1 ADJUST? no LINK COUNT FILE I=8715007 OWNER=noc MODE=0 SIZE=0 MTIME=Oct 9 09:50 2004 COUNT 0 SHOULD BE -1 ADJUST? no LINK COUNT FILE I=8715008 OWNER=noc MODE=0 SIZE=0 MTIME=Oct 9 09:50 2004 COUNT 0 SHOULD BE -1 ADJUST? no LINK COUNT FILE I=8715009 OWNER=noc MODE=0 SIZE=0 MTIME=Oct 9 09:50 2004 COUNT 0 SHOULD BE -1 ADJUST? no LINK COUNT FILE I=8715010 OWNER=noc MODE=0 SIZE=0 MTIME=Oct 9 09:50 2004 COUNT 0 SHOULD BE -1 ADJUST? no LINK COUNT FILE I=8715016 OWNER=noc MODE=0 SIZE=0 MTIME=Oct 9 09:50 2004 COUNT 0 SHOULD BE -1 ADJUST? no LINK COUNT FILE I=8715017 OWNER=noc MODE=0 SIZE=0 MTIME=Oct 9 09:50 2004 COUNT 0 SHOULD BE -1 ADJUST? no LINK COUNT FILE I=8715080 OWNER=noc MODE=0 SIZE=0 MTIME=Oct 9 09:50 2004 COUNT 0 SHOULD BE -1 ADJUST? no LINK COUNT FILE I=8715086 OWNER=noc MODE=0 SIZE=0 MTIME=Oct 9 09:50 2004 COUNT 0 SHOULD BE -1 ADJUST? no LINK COUNT FILE I=8715087 OWNER=noc MODE=0 SIZE=0 MTIME=Oct 9 09:50 2004 COUNT 0 SHOULD BE -1 ADJUST? no LINK COUNT FILE I=8715093 OWNER=noc MODE=0 SIZE=0 MTIME=Oct 9 09:50 2004 COUNT 0 SHOULD BE -1 ADJUST? no LINK COUNT FILE I=8715094 OWNER=noc MODE=0 SIZE=0 MTIME=Oct 9 09:50 2004 COUNT 0 SHOULD BE -1 ADJUST? no LINK COUNT FILE I=8715100 OWNER=noc MODE=0 SIZE=0 MTIME=Oct 9 09:50 2004 COUNT 0 SHOULD BE -1 ADJUST? no LINK COUNT FILE I=8715101 OWNER=noc MODE=0 SIZE=0 MTIME=Oct 9 09:50 2004 COUNT 0 SHOULD BE -1 ADJUST? no LINK COUNT FILE I=8715107 OWNER=noc MODE=0 SIZE=0 MTIME=Oct 9 09:50 2004 COUNT 0 SHOULD BE -1 ADJUST? no LINK COUNT FILE I=8715129 OWNER=noc MODE=0 SIZE=0 MTIME=Oct 9 09:50 2004 COUNT 0 SHOULD BE -1 ADJUST? no LINK COUNT FILE I=8715142 OWNER=noc MODE=0 SIZE=0 MTIME=Oct 9 09:50 2004 COUNT 0 SHOULD BE -1 ADJUST? no LINK COUNT FILE I=8715143 OWNER=noc MODE=0 SIZE=0 MTIME=Oct 9 09:50 2004 COUNT 0 SHOULD BE -1 ADJUST? no LINK COUNT FILE I=8715156 OWNER=noc MODE=0 SIZE=0 MTIME=Oct 9 09:50 2004 COUNT 0 SHOULD BE -1 ADJUST? no LINK COUNT FILE I=8715157 OWNER=noc MODE=0 SIZE=0 MTIME=Oct 9 09:50 2004 COUNT 0 SHOULD BE -1 ADJUST? no LINK COUNT FILE I=8715163 OWNER=noc MODE=0 SIZE=0 MTIME=Oct 9 09:50 2004 COUNT 0 SHOULD BE -1 ADJUST? no ** Phase 5 - Check Cyl groups SUMMARY INFORMATION BAD SALVAGE? no BLK(S) MISSING IN BIT MAPS SALVAGE? no ALLOCATED FRAGS 34852132-34852134 MARKED FREE ALLOCATED FRAGS 34852264-34852268 MARKED FREE ALLOCATED FRAGS 34852344-34852347 MARKED FREE ALLOCATED FRAGS 34852376-34852380 MARKED FREE ALLOCATED FRAGS 34852452-34852453 MARKED FREE ALLOCATED FRAGS 34852512-34852513 MARKED FREE ALLOCATED FRAGS 34852536-34852540 MARKED FREE ALLOCATED FRAGS 34852544-34852545 MARKED FREE ALLOCATED FRAGS 34852548-34852549 MARKED FREE ALLOCATED FRAG 34852567 MARKED FREE ALLOCATED FRAG 34852583 MARKED FREE ALLOCATED FRAGS 34852594-34852599 MARKED FREE ALLOCATED FRAGS 34852616-34852620 MARKED FREE ALLOCATED FRAGS 34852757-34852758 MARKED FREE ALLOCATED FRAGS 34852818-34852820 MARKED FREE ALLOCATED FRAGS 34852824-34852827 MARKED FREE ALLOCATED FRAG 34852906 MARKED FREE ALLOCATED FRAGS 34852925-34852927 MARKED FREE ALLOCATED FRAGS 34853136-34853140 MARKED FREE ALLOCATED FRAGS 34853144-34853148 MARKED FREE ALLOCATED FRAGS 34853152-34853156 MARKED FREE ALLOCATED FRAGS 34853160-34853164 MARKED FREE ALLOCATED FRAGS 34853168-34853172 MARKED FREE ALLOCATED FRAGS 34853245-34853246 MARKED FREE ALLOCATED FRAGS 34853280-34853284 MARKED FREE ALLOCATED FRAGS 34853288-34853292 MARKED FREE ALLOCATED FRAGS 34853304-34853308 MARKED FREE ALLOCATED FRAGS 34853352-34853356 MARKED FREE ALLOCATED FRAGS 34853365-34853366 MARKED FREE ALLOCATED FRAGS 34853368-34853372 MARKED FREE ALLOCATED FRAGS 34853400-34853404 MARKED FREE ALLOCATED FRAGS 34853490-34853494 MARKED FREE ALLOCATED FRAGS 34853496-34853500 MARKED FREE ALLOCATED FRAGS 34853536-34853545 MARKED FREE ALLOCATED FRAGS 34853568-34853572 MARKED FREE ALLOCATED FRAGS 34853868-34853870 MARKED FREE ALLOCATED FRAGS 34853949-34853951 MARKED FREE ALLOCATED FRAGS 34854074-34854075 MARKED FREE ALLOCATED FRAGS 34854934-34854935 MARKED FREE ALLOCATED FRAGS 34855504-34855508 MARKED FREE ALLOCATED FRAGS 34855776-34855777 MARKED FREE ALLOCATED FRAGS 34855920-34855924 MARKED FREE ALLOCATED FRAGS 34856856-34856857 MARKED FREE ALLOCATED FRAGS 34857067-34857068 MARKED FREE ALLOCATED FRAGS 34871843-34871847 MARKED FREE ALLOCATED FRAGS 34879373-34879374 MARKED FREE ALLOCATED FRAGS 37584536-37584551 MARKED FREE ALLOCATED FRAGS 37601008-37601014 MARKED FREE 471717 files, 47373681 used, 38091807 free (33239 frags, 4757321 blocks, 0.0% fragmentation) [root]@[beer]:/usr/local/etc/rc.d> --Boundary-00=_NlBaBLZGX4OeKse-- From owner-freebsd-hackers@FreeBSD.ORG Sat Oct 9 18:26:24 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4D5E116A4CE for ; Sat, 9 Oct 2004 18:26:24 +0000 (GMT) Received: from spider.deepcore.dk (cpe.atm2-0-53484.0x50a6c9a6.abnxx9.customer.tele.dk [80.166.201.166]) by mx1.FreeBSD.org (Postfix) with ESMTP id A5CA843D1D for ; Sat, 9 Oct 2004 18:26:23 +0000 (GMT) (envelope-from sos@DeepCore.dk) Received: from [194.192.25.143] (laptop.deepcore.dk [194.192.25.143]) by spider.deepcore.dk (8.12.11/8.12.10) with ESMTP id i99IQIeJ052873; Sat, 9 Oct 2004 20:26:20 +0200 (CEST) (envelope-from sos@DeepCore.dk) Message-ID: <41682D3F.4060902@DeepCore.dk> Date: Sat, 09 Oct 2004 20:26:07 +0200 From: =?ISO-8859-1?Q?S=F8ren_Schmidt?= User-Agent: Mozilla Thunderbird 0.7.2 (X11/20040802) X-Accept-Language: en-us, en MIME-Version: 1.0 To: miha@ghuug.org References: <200410081937.15068.miha@ghuug.org> In-Reply-To: <200410081937.15068.miha@ghuug.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: quoted-printable X-mail-scanned: by DeepCore Virus & Spam killer v1.4 cc: hackers@freebsd.org Subject: Re: ad0: FAILURE - WRITE_DMA X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Oct 2004 18:26:24 -0000 Mikhail P. wrote: > Hi, >=20 > This question probably has been discussed numerous times, but I'm somew= hat=20 > unsure what really causes ATA failures.. >=20 > I have pretty basic server here which has two IDE drives - each is 200G= B.=20 > System is FreeBSD-5.2.1-p9 > That server has been setup about 9 months ago, and just about 3 months = ago my=20 > logs quickly filled up with: > ad0: FAILURE - WRITE_DMA status=3D51 error=3D10=20 > LBA=3D268435455 Hmm, that means that the drive couldn't find the sector you asked for. Now, what has me wondering is that it is the exact sector where we=20 switch to 48bit adressing mode. Anyhow, I've just checked on the old=20 Maxtor preproduktion 48bit reference drive I have here and it crosses=20 the limit with no problems. What controller are you using ? not all supports 48bit mode correctly.. --=20 -S=F8ren From owner-freebsd-hackers@FreeBSD.ORG Sat Oct 9 18:30:36 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D9DD916A4ED for ; Sat, 9 Oct 2004 18:30:36 +0000 (GMT) Received: from beck.quonix.net (beck.quonix.net [146.145.66.90]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1DFEE43D1F for ; Sat, 9 Oct 2004 18:30:36 +0000 (GMT) (envelope-from john@essenz.com) Received: from [192.168.1.100] (pool-141-158-247-68.phil.east.verizon.net [141.158.247.68]) by beck.quonix.net (8.12.11/8.12.11) with ESMTP id i99IUXxv015417 for ; Sat, 9 Oct 2004 14:30:33 -0400 (EDT) Mime-Version: 1.0 (Apple Message framework v619) In-Reply-To: <20041009044403.P39589-100000@mxb.saturn-tech.com> References: <20041009044403.P39589-100000@mxb.saturn-tech.com> Content-Type: text/plain; charset=US-ASCII; format=flowed Message-Id: <0D27BFB8-1A20-11D9-883D-0003933DDCFA@essenz.com> Content-Transfer-Encoding: 7bit From: John Von Essen Date: Sat, 9 Oct 2004 14:21:34 -0400 To: " " X-Mailer: Apple Mail (2.619) X-SpamAssassin-2.64-Score: 0.5/6 RCVD_IN_NJABL_DUL,RCVD_IN_SORBS_DUL X-MimeDefang-2.44: beck.quonix.net X-Scanned-By: MIMEDefang 2.44 Subject: Re: hacking SCO.... X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Oct 2004 18:30:37 -0000 I was able to use the badtrk utility in SCO to identify bad blocks and put them in the bad block table. The SCSI card is an old Adaptec, AIC-7880 and I believe it does not support automatic bad block detection/redirection. This disk came from a spares kits, so even though it is "new" and never used, it is still 5-6 years old. There were 6 bad blocks, once they were put in the bad block table, everything was fine. Is sformat the freebsd equivalent of the badtrk utility. I have always used Ultra2 LVD SCSI and higher on FreeBSD and have never had this issue of bad blocks. Is that because those newer SCSI disks and controllers have better ECC handling and take care of the bad blocks internally without notifying the user? -john On Oct 9, 2004, at 6:51 AM, Doug Russell wrote: > > On Fri, 8 Oct 2004, Sergey Babkin wrote: > >> Try to use the "Verify" menu from the Adaptec BIOS. It finds and tries >> to re-map the bad sectors (it tries to preserve data during this too, >> unless the sector is completely unreadable). > > The verify commands issued by the BIOS are virtually useless compared > to > the type of tests done my sformat. If you enable automatic read > re-allocation, it is almost the same as simply reading your whole disk > with dd. > >>> I do the full 14 pattern tests before I put a SCSI disk in service. >> >> When a disk starts losing blocks like this, usually they only multiply >> over time. The best thing you can do is replace the disk and >> move the data before you lost more of it. > > NO! Not necessarily! > > If a disk has simply grown a few new defects since it was new, it does > not > necessarily mean it is going to die. I have many disks that had minor > bad > spots on them that weren't even always found by the factory format > routines, or had appeared since (due to transport, debris in the HDA, > poor > holding power for the magnetic fields in some area, etc). If the drive > passes through a few full patern tests without problems and doesn't > continue to grow new defects, it is likely just fine. > > I've got all kinds of old SCSI disks that were 'discarded' due to > errors. > Only a couple are truly dead... the rest have been running for years > with > no problems after making a real grown defect list from the pattern > tests. > > This is something I learned many many years ago when running my old > Miniscribe 3650s on a Perstor high density controller. It formated the > drives to 31 sectors per track instead of 17. Hard on the disks, and > the > media, but a good drive, after being properly tested, would run > flawlessly > for years being hammered 24/7 on BBS machines. Got 78 megs per drive > instead of 42.whatever it was. :) > > Later...... > > > From owner-freebsd-hackers@FreeBSD.ORG Sat Oct 9 18:42:30 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A341116A4CE for ; Sat, 9 Oct 2004 18:42:30 +0000 (GMT) Received: from beer.ux6.net (beer.ux6.net [64.62.253.29]) by mx1.FreeBSD.org (Postfix) with SMTP id 768E543D41 for ; Sat, 9 Oct 2004 18:42:30 +0000 (GMT) (envelope-from miha@ghuug.org) Received: (qmail 16701 invoked by uid 113); 9 Oct 2004 11:42:30 -0700 Received: from 64.62.253.84 by beer.ux6.net (envelope-from , uid 112) with qmail-scanner-1.23 (clamdscan: 0.70. spamassassin: 2.64. Clear:RC:0(64.62.253.84):SA:0(0.0/6.0):. Processed in 5.594298 secs); 09 Oct 2004 18:42:30 -0000 X-Spam-Status: No, hits=0.0 required=6.0 Received: from unknown (HELO miha.netstream-gh.com) (miha@beer.ux6.net@64.62.253.84) by localhost with SMTP; 9 Oct 2004 11:42:24 -0700 From: "Mikhail P." To: freebsd-hackers@freebsd.org Date: Sat, 9 Oct 2004 18:43:06 +0000 User-Agent: KMail/1.7 References: <200410081937.15068.miha@ghuug.org> <41682D3F.4060902@DeepCore.dk> In-Reply-To: <41682D3F.4060902@DeepCore.dk> Organization: Ghana Unix Users Group MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Message-Id: <200410091843.06854.miha@ghuug.org> cc: =?iso-8859-1?q?S=F8ren_Schmidt?= Subject: Re: ad0: FAILURE - WRITE_DMA X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: miha@ghuug.org List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Oct 2004 18:42:30 -0000 On Saturday 09 October 2004 18:26, S=F8ren Schmidt wrote: > Hmm, that means that the drive couldn't find the sector you asked for. > Now, what has me wondering is that it is the exact sector where we > switch to 48bit adressing mode. Anyhow, I've just checked on the old > Maxtor preproduktion 48bit reference drive I have here and it crosses > the limit with no problems. > What controller are you using ? not all supports 48bit mode correctly.. There's VIA's motherboard (not sure about the model name). Here's info regarding ata controller from dmesg: atapci0: port 0xac00-0xac0f at device 17.1 on= =20 pci0 I will be able to test the drives (the ones which I thought of as "failed")= on=20 another board within 10 days or so. regards, M. From owner-freebsd-hackers@FreeBSD.ORG Sat Oct 9 19:47:05 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D991E16A4CF for ; Sat, 9 Oct 2004 19:47:05 +0000 (GMT) Received: from mxb.saturn-tech.com (mxb.saturn-tech.com [207.229.19.99]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5BC2943D45 for ; Sat, 9 Oct 2004 19:47:05 +0000 (GMT) (envelope-from drussell@saturn-tech.com) Received: from mxb.saturn-tech.com (localhost [127.0.0.1]) by mxb.saturn-tech.com (8.12.3/8.12.3) with ESMTP id i99Jo8uR041689; Sat, 9 Oct 2004 13:50:08 -0600 (MDT) (envelope-from drussell@saturn-tech.com) Received: from localhost (drussell@localhost)i99Jo7gM041686; Sat, 9 Oct 2004 13:50:08 -0600 (MDT) (envelope-from drussell@saturn-tech.com) X-Authentication-Warning: mxb.saturn-tech.com: drussell owned process doing -bs Date: Sat, 9 Oct 2004 13:50:07 -0600 (MDT) From: Doug Russell To: John Von Essen In-Reply-To: <0D27BFB8-1A20-11D9-883D-0003933DDCFA@essenz.com> Message-ID: <20041009125651.H41465-100000@mxb.saturn-tech.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: freebsd-hackers@freebsd.org Subject: Re: hacking SCO.... X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Oct 2004 19:47:06 -0000 On Sat, 9 Oct 2004, John Von Essen wrote: > The SCSI card is an old Adaptec, AIC-7880 and I believe it does not > support automatic bad block detection/redirection. If it has a BIOS it should have the verify tool in there... All the verify tool does, though, is issue a verify command to each sector. You can do this yourself, even on a running system, also. > This disk came from a spares kits, so even though it is "new" and never > used, it is still 5-6 years old. There were 6 bad blocks, once they > were put in the bad block table, everything was fine. Exactly. Most of my SCSI disks are old spares, or old surplus disks. They've likely been moved several times, bumped around, and time itself can make a marginal section of the magnetic coating stop holding data perfectly. > Is sformat the freebsd equivalent of the badtrk utility. I have always No, I don't believe so. I think badtrk is probably like the old bad144 system that was abandoned because it is unnecessary on all modern disks. All modern IDE disks have built-in re-allocation tables, similar to the way SCSI disks work, but you can't manipulate them manually as easily as you can on a SCSI disk. sformat is a handy formatting utility written by Joerg Schilling. It has special options for partitioning disks on SUN machines, but the format routines and defect scans will run on virtually any platform. It has full patern testing abilities. First it writes and verifies every byte on the drive as all 00000000's then all 11111111's... then 01010101 and 10101010, etc. etc... stressing the media in every possible combination. (Many, many, errors won't show up if you just write all zeros or ones, for example. It is much harder to store a zero next to a one, so trying every combination pre-tests anything that might be written.) This kind of testing is done at the factory, and limited pattern testing is generally done by the built-in low-level format routine on most drives. > used Ultra2 LVD SCSI and higher on FreeBSD and have never had this > issue of bad blocks. Is that because those newer SCSI disks and > controllers have better ECC handling and take care of the bad blocks > internally without notifying the user? If you play with the SCSI modepages, you can tell the drive to post an error or not under various conditions (a correctible ECC error, an uncorrectible error, a re-allocated block, etc.) You've probably never seen errors before because the drives were set with Automatic (Write / Read) Reallocation Enable (AWRE and ARRE) set in modepage 1. This disk you're working with now obviously has ARRE and probably AWRE disabled, so it isn't trying to re-allocate the blocks when it finds an error. I'd check that and turn it on. Then, the next time you try to read the bad block, the drive should remap it on its own. The exact behavior varies by drive and by settings in the modepages. Some drives may have AWRE and ARRE enabled, but not re-allocate a certain block because they can't get the data off the sector in the retry time allowed. Cranking up the retry timer (when available) might work, or else you have to do it manually by sending the re-allocate block command. I sure love SCSI disks... They let you do virtually ANYTHING to them if you know the technical details of how to send the commands. (The technical manuals for the disks are very handy in this regard.) On FreeBSD, you can see what was in the defect table at the factory by doing a camcontrol defects daX -f phys -P (I like phys, as it shows the actual physical head and cylinder number with a byte offset -- you can actually 'see' the areas that are defective). You can see the GROWN defect list (rather than the primary) with -G. VERY often the grown defects are simply the next sector or two to the sides of an existing defect. If a series of defects span several cylinders on the same head at about the same offset, it's probably a media defect 'scratch' across the disk. If it is on the same cylinder on several heads at about the same place, it is probably from a mini-head-crash due to the disk getting bumped, etc, where it actually damaged spots on several disks at once when the heads touched (or almost touched). etc. etc. Interestingly enough, the way sformat sends the block format commands, some disks add the new defects found to their PRIMARY defect list, instead of the GROWN list, as if they had been re-tested at the factory. There is a command to clear the GROWN list, but not the PRIMARY. (Some cheesy drives re-do their primary table when you send them the single low-level-format command, but most just add to the table. If you ever have LESS primary defects after sending a LLF command, it would be a VERY good idea to use sformat to better pattern test the drive before service) Here are some examples from a couple of disks here: Script started on Sat Oct 9 13:13:01 2004 ROOT mxb:/home/drussell 101 > camcontrol defects da0 -f phys -P /* This is the PRIMARY (factory) defect table) /* Got 277 defects: 3:0:105 4:0:105 5:0:105 6:0:105 7:0:105 8:0:105 9:0:105 10:0:105 /* See, must be a 'scratch across the first 60 tracks */ 11:0:105 /* on head 0. */ 12:0:105 13:0:105 14:0:105 14:1:10 15:0:105 16:0:105 17:0:105 18:0:105 19:0:105 20:0:105 21:0:105 21:19:34 /* One other defect on head 19 (this disk has 11 media */ 22:0:105 /* platters with 21 heads (one unused surface) */ 23:0:105 /* the defect is on 19, the second-last head */ 24:0:105 25:0:105 26:0:105 27:0:105 28:0:105 29:0:105 30:0:105 31:0:105 41:0:105 42:0:105 43:0:105 44:0:105 45:0:105 46:0:105 47:0:105 48:0:105 49:0:105 50:0:105 51:0:105 52:0:105 53:0:105 54:0:105 55:0:105 56:0:105 57:0:105 58:0:105 59:0:105 60:0:105 114:1:91 135:4:89 227:14:63 252:11:97 299:2:74 343:5:56 396:17:119 449:20:115 463:2:110 522:5:45 523:8:45 531:15:103 569:15:15 598:17:42 685:7:103 687:15:57 692:17:35 737:16:9 801:3:79 863:20:29 902:8:112 919:15:18 974:20:29 975:20:29 976:20:29 977:20:29 1054:2:38 1092:13:70 1116:8:78 1134:17:75 1236:5:28 1276:17:40 1343:16:46 1351:13:60 1352:13:60 1353:13:60 1354:13:60 1355:13:60 1356:13:60 1357:13:60 1358:13:60 1359:13:60 1360:13:60 1361:13:60 1362:13:60 1363:13:60 1364:13:60 1404:18:6 1440:20:103 1596:5:96 1598:5:96 1634:12:64 1698:19:54 1699:19:54 1700:19:54 1701:19:54 1702:19:54 1703:19:54 1704:19:54 1705:19:54 1706:19:54 1707:19:54 1708:19:54 1709:19:54 1710:19:54 1711:19:54 1712:19:54 1713:19:54 1714:19:54 1715:19:54 1716:19:54 1717:19:54 1746:20:100 1791:19:13 1829:13:94 1835:14:63 1836:14:63 1852:13:92 1853:13:92 1854:13:92 1855:13:92 1856:13:92 1875:15:80 1935:15:89 2008:14:52 2009:14:52 2010:14:52 2010:14:83 2011:14:52 2012:14:52 2013:14:52 2014:14:52 2015:14:52 2016:14:52 2017:14:52 2018:14:52 2019:14:52 2020:14:52 2021:14:52 2022:14:52 2028:7:46 2028:20:27 2038:18:53 2151:5:66 2153:17:65 2198:6:97 2278:15:10 2279:15:10 2280:15:10 2281:15:10 2447:16:7 2521:1:68 2612:20:6 2625:15:56 2767:8:69 2828:7:81 2865:13:59 2866:13:59 2867:13:59 2868:13:59 2909:13:18 2958:3:10 3001:13:58 3002:13:58 3003:13:58 3004:13:58 3005:13:58 3006:13:58 3007:13:58 3008:13:58 3009:5:49 3009:13:58 3010:13:58 3011:13:58 3012:13:58 3013:13:58 3014:13:58 3015:13:58 3016:13:58 3017:13:58 3018:13:58 3019:13:58 3020:13:58 3021:13:58 3022:13:58 3023:13:58 3024:13:58 3025:13:58 3026:13:58 3027:13:58 3028:13:58 3078:13:58 3079:13:58 3080:13:58 3081:13:58 3082:13:58 3083:13:58 3084:13:58 3085:13:58 3086:13:58 3087:13:57 3088:13:57 3089:13:57 3090:13:57 3091:13:57 3213:2:54 3255:17:42 3256:17:42 3257:17:42 3258:17:42 3259:17:42 3260:17:42 3261:17:42 3262:17:42 3263:17:42 3264:17:42 3265:17:42 3266:17:42 3267:17:42 3268:17:42 3269:17:42 3270:17:42 3271:17:42 3272:17:42 3273:17:42 3290:2:39 3331:20:38 3332:20:38 3333:20:38 3334:20:37 3335:20:37 3336:20:37 3337:20:37 3338:20:37 3339:20:37 3340:20:37 3341:20:37 3342:20:37 3343:20:37 3344:20:37 3650:20:28 3651:20:28 3652:20:28 3653:20:28 3654:20:28 3655:20:28 3656:20:28 3657:20:28 3658:20:28 3658:20:29 3659:20:28 3660:20:28 3661:20:28 3662:20:28 3663:20:28 3664:20:28 3665:20:28 3666:20:28 3676:15:14 3690:14:31 3702:20:41 3703:20:41 3704:20:41 3705:20:41 3710:3:31 3711:3:31 ROOT mxb:/home/drussell 102 > ^P^G camcontrol defects da0 -f phys -G Got 0 defects. /* no new defects detected since last 'factory' format */ ROOT mxb:/home/drussell 103 > ^0^1 camcontrol defects da0 -f phys -G Got 0 defects. /* no grown defects on da1, either */ ROOT mxb:/home/drussell 104 > ^G^P camcontrol defects da0 -f phys -P /* this disk has 4 platters, and all 8 surfaces have r/w heads */ Got 156 defects: 86:7:84 86:7:85 151:5:224 150:5:224 149:5:224 327:5:258 327:5:259 355:3:189 355:3:190 395:3:244 395:3:245 394:3:244 394:3:245 609:4:195 609:4:196 656:7:17 687:3:126 687:3:127 687:3:128 687:3:129 687:3:130 711:6:84 711:6:85 827:7:12 827:7:13 933:3:248 933:3:249 1053:4:186 1053:4:187 1058:7:11 1058:7:12 1058:7:13 1086:4:59 1086:4:60 1267:4:184 1315:5:133 1315:5:134 1513:4:183 1513:4:184 1580:4:198 1583:4:185 1592:2:197 1592:2:198 1593:3:72 1749:6:101 1787:5:72 1790:6:99 1909:6:99 2008:2:140 2043:5:96 2043:5:97 2078:6:99 2184:2:80 2259:5:114 2276:6:96 2276:6:97 2354:6:96 2354:6:97 2356:6:96 2356:6:97 2390:6:96 2390:6:97 2402:6:96 2402:6:97 2425:6:96 2425:6:97 2428:6:96 2428:6:97 2449:3:224 2449:3:225 2528:4:174 2528:4:175 2528:4:176 2528:4:177 2536:6:96 2536:6:97 2565:3:42 2565:3:43 2626:4:213 2640:4:179 2716:6:93 2716:6:94 2813:6:93 2813:6:94 2831:4:159 2909:4:186 2909:4:187 2984:6:93 2984:6:94 3000:2:77 3000:2:78 3003:2:204 3024:6:93 3024:6:94 3058:2:77 3058:6:93 3058:6:94 3164:6:91 3202:4:179 3240:5:173 3348:2:71 3346:7:18 3346:7:19 3413:4:182 3488:4:182 3488:4:183 3494:7:40 3494:7:41 3525:4:22 3525:4:23 3657:7:15 3657:7:16 3788:4:176 4024:5:154 4024:5:155 4108:4:4 4139:6:45 4139:6:46 4158:7:18 4158:7:19 4228:2:69 4228:2:70 4253:4:152 4287:6:117 4287:6:118 4311:2:63 4311:2:64 4337:6:155 4383:2:63 4507:2:62 4546:6:18 4566:5:87 4566:5:88 4593:7:74 4593:7:75 4668:6:167 4807:4:162 4889:2:71 4926:4:17 5038:4:54 5038:4:55 5554:7:57 5554:7:58 5741:4:132 5805:3:86 5802:5:80 5862:7:72 5862:7:73 5899:4:169 5953:7:19 6038:7:187 6029:7:25 6081:4:139 6081:4:140 6689:3:10 6866:4:89 Script done on Sat Oct 9 13:13:46 2004 Script started on Sat Oct 9 13:15:20 2004 ROOT killarney:/home/drussell 101 > camcontrol defects da0 -f phys -P Got 144 defects: 0:13:84 5:20:3 31:13:50 43:9:70 140:10:94 222:10:66 281:17:65 282:17:65 283:17:65 284:17:65 285:17:65 286:17:65 287:17:65 288:17:65 289:17:65 290:17:65 291:17:65 292:17:65 293:17:65 294:17:65 330:12:57 331:12:57 332:12:57 333:12:57 463:11:123 477:16:71 487:19:46 504:19:40 510:19:46 586:17:16 675:0:76 703:12:31 772:9:120 774:10:105 894:10:78 941:0:35 974:3:16 1019:4:11 1029:20:21 1068:16:72 1069:16:72 1070:16:72 1071:16:72 1131:14:78 1132:14:78 1133:14:78 1134:14:78 1135:14:78 /* another good-sized defect that looks like a 'scratch' */ 1136:14:78 1137:14:78 1138:14:78 1139:14:78 1140:14:78 1141:14:78 1142:14:78 1143:14:78 1144:14:78 1145:14:78 1146:14:78 1147:14:78 1148:14:78 1149:14:77 1150:14:77 1151:14:77 1152:14:77 1153:14:77 1154:14:77 1155:14:77 1156:14:77 1157:14:77 1158:14:77 1159:14:77 1160:14:77 1172:14:76 1173:14:76 1174:14:76 1175:14:76 1176:14:76 1177:14:76 1178:14:76 1179:14:76 1180:14:76 1181:14:76 1182:14:76 1183:14:76 1184:14:76 1185:14:76 1186:14:76 1187:14:76 1188:14:76 1189:14:76 1190:14:76 1191:14:76 1192:14:76 1193:14:76 1194:14:76 1720:13:72 1721:13:72 1722:13:72 1723:13:72 1724:13:72 1832:18:44 1833:18:44 1834:18:44 1835:18:44 1836:18:44 1967:16:84 1973:13:97 1997:2:74 2130:14:56 2251:8:8 2443:15:83 2444:15:83 2445:15:83 2446:8:45 2446:15:83 2466:19:85 2766:11:61 2767:11:61 2768:11:61 2769:11:61 2796:17:66 3012:20:24 3038:20:92 3426:17:64 3525:10:73 3527:17:5 3529:3:44 3656:10:15 3664:0:47 3686:19:10 3687:19:10 3688:19:10 3689:19:10 3690:19:10 3691:19:10 3692:19:10 3693:19:10 3694:19:10 3695:19:10 3696:19:10 3697:19:10 3698:19:10 3699:19:10 ROOT killarney:/home/drussell 102 > ^P^G camcontrol defects da0 -f phys -P Got 18 defects: 1702:10:66 1703:10:66 1704:10:66 /* This one's got grown defects that I detected using */ 1705:10:66 /* sformat before putting it into service (old spare) */ 1706:10:66 /* these defects were almost certainly caused by heads */ 1707:10:66 /* hitting platters while spinning. Same area, */ 1708:10:66 /* different platters, with the cylinders right after */ 1709:10:66 /* each other... The drive was seeking the heads when */ 1718:14:66 /* it was jarred hard enough to cause a head crash */ 1719:14:66 /* it would certainly seem.. */ 1720:14:66 1721:14:66 1722:14:66 1723:14:66 1724:14:66 1725:14:66 2990:10:77 3386:10:29 Script done on Sat Oct 9 13:15:42 2004 I keep logs of the contents of the PLIST and the GLIST before and after I sformat it before it goes into service. Checking this disk now (which has AWRE and ARRE enabled) shows that the GLIST is still the same as it was at least 25000 power-on-hours ago. It is probably about time to take this disk out of service for another sformat run (been running non-stop for over 3 years) as a periodic test, but then it can go right back into service. Just because that drive had a couple new defects that were found in testing, doesn't mean it was about to die. (On the contrary; it has performed flawlessly since going into service)... Would it have remapped those on the fly if it were just put into service without tests? Perhaps, eventually, but I'd rather do a dedicated heavy-duty test myself, first. THIS is why sformat is your friend, my fellow -hackers. :) Oh, and thanks should go out to Joerg Schilling for writing such a good utility that I've never had to go back and write my own. (Wrote a MUCH less advanced one back in the day for my MFM drives on the perstor to watch for ECC errors, even correctible ones, and make a real 'map') Long live SCSI disks! :) Later...... From owner-freebsd-hackers@FreeBSD.ORG Sat Oct 9 20:00:01 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id AFC1116A4CE for ; Sat, 9 Oct 2004 20:00:01 +0000 (GMT) Received: from mxb.saturn-tech.com (mxb.saturn-tech.com [207.229.19.99]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4F1DE43D3F for ; Sat, 9 Oct 2004 20:00:01 +0000 (GMT) (envelope-from drussell@saturn-tech.com) Received: from mxb.saturn-tech.com (localhost [127.0.0.1]) by mxb.saturn-tech.com (8.12.3/8.12.3) with ESMTP id i99K34uR041813; Sat, 9 Oct 2004 14:03:05 -0600 (MDT) (envelope-from drussell@saturn-tech.com) Received: from localhost (drussell@localhost)i99K34l5041810; Sat, 9 Oct 2004 14:03:04 -0600 (MDT) (envelope-from drussell@saturn-tech.com) X-Authentication-Warning: mxb.saturn-tech.com: drussell owned process doing -bs Date: Sat, 9 Oct 2004 14:03:04 -0600 (MDT) From: Doug Russell To: John Von Essen In-Reply-To: <20041009125651.H41465-100000@mxb.saturn-tech.com> Message-ID: <20041009135118.X41465-100000@mxb.saturn-tech.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: freebsd-hackers@freebsd.org Subject: Re: hacking SCO.... X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Oct 2004 20:00:01 -0000 Gotta love when you reply to your own posts... :) On Sat, 9 Oct 2004, Doug Russell wrote: > If it has a BIOS it should have the verify tool in there... > > All the verify tool does, though, is issue a verify command to each > sector. You can do this yourself, even on a running system, also. I meant to add a couple more notes about the modepages.... The number (or maximum time -- it's drive dependent) of retries for regular reads and writes are adjustable in modepage 1. There are alternate settings for the VERIFY commands (like sent to the drive in the BIOS verify utility) on the VERIFY page (modepage 7). Reading the docs for the actual drive in question is the only way you can tell EXACTLY what is done by each setting, and it does take a little research to understand exactly what is going on, but there are LOTS of nice knobs to twiddle on most disks. You might have to add some things to /usr/src/share/misc/scsi_modes (on freebsd) to be able to edit all the possible options on some disks using the editor routines. For example, I created the following entry for Seagate disks like all my ST19171WC (about 60) and ST15150W drives (20+) that actually understands things like the cache segmentation size (how many little chunks of cache it should hold, and therefore how big each is, which is a VERY nice tuneable for a heavy-multi-user server versus single user A/V RAID array disk tuning; multi-user, you want lots of little cache segments... streaming use, you want a couple of huge segments): 0x08 "Caching Page" { {IC (Initiator Control enable)} t1 {ABPF (ABort Pre-Fetch on selection)} t1 {CAP (Caching Analysis Permitted)} t1 {DISC (DISContinuity)} t1 {SIZE (cache segmentation by SIZE enable)} t1 {WCE (Write Cache Enable)} t1 {MF (prefetch Multiplication Factor)} t1 {RCD (Read Cache Disable)} t1 {Demand Retention Priority} t4 {Write Retention Priority} t4 {Disable Pre-fetch Transfer Length} i2 {Minimum Pre-fetch} i2 {Maximum Pre-fetch} i2 {Maximum Pre-fetch Ceiling} i2 {FSW (Force Sequential Write)} t1 {LBCSS (Logical Block Cache Segment Size)} t1 {DRA (Disable Read-Ahead)} t1 {Reserved} *t5 {Number of Cache Segments} i1 {Cache Segment Size} i2 {Reserved} *i1 {Non-Cache Segment Size} i3 I turn off all retries, etc, and set the drive to do full error reporting before I run any tests. (You don't want the drive correcting anything itself, you want to report EVERYTHING...) Modepages are fun. :) Later...... From owner-freebsd-hackers@FreeBSD.ORG Sat Oct 9 20:53:34 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C504916A4CE for ; Sat, 9 Oct 2004 20:53:34 +0000 (GMT) Received: from smtp.des.no (flood.des.no [217.116.83.31]) by mx1.FreeBSD.org (Postfix) with ESMTP id EF4E743D1F for ; Sat, 9 Oct 2004 20:53:33 +0000 (GMT) (envelope-from des@des.no) Received: by smtp.des.no (Pony Express, from userid 666) id A70035310; Sat, 9 Oct 2004 22:53:32 +0200 (CEST) Received: from dwp.des.no (des.no [80.203.228.37]) by smtp.des.no (Pony Express) with ESMTP id B7C1A530A; Sat, 9 Oct 2004 22:53:25 +0200 (CEST) Received: by dwp.des.no (Postfix, from userid 2602) id 567A1B861; Sat, 9 Oct 2004 22:53:25 +0200 (CEST) To: miha@ghuug.org References: <200410081937.15068.miha@ghuug.org> <200410091617.26794.miha@ghuug.org> <200410091701.01987.miha@ghuug.org> From: des@des.no (=?iso-8859-1?q?Dag-Erling_Sm=F8rgrav?=) Date: Sat, 09 Oct 2004 22:53:25 +0200 In-Reply-To: <200410091701.01987.miha@ghuug.org> (Mikhail P.'s message of "Sat, 9 Oct 2004 17:01:01 +0000") Message-ID: User-Agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Spam-Checker-Version: SpamAssassin 2.64 (2004-01-11) on flood.des.no X-Spam-Level: X-Spam-Status: No, hits=0.0 required=5.0 tests=AWL autolearn=no version=2.64 cc: freebsd-hackers@freebsd.org Subject: Re: ad0: FAILURE - WRITE_DMA X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Oct 2004 20:53:34 -0000 "Mikhail P." writes: > Well, there is no pattern. [...] Could be bad cables, could be bad drives. Environmental factors are a more likely cause, though. Are all the failing disks in the same machine? If they're in separate machines, are those rack-mount, or are they standing on a table or shelf? If a shelf, what kind? What's the ambient temperature in the machine room? DES --=20 Dag-Erling Sm=F8rgrav - des@des.no