From owner-freebsd-arch@FreeBSD.ORG Sat Mar 20 13:17:07 2004 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9094916A501; Sat, 20 Mar 2004 13:17:07 -0800 (PST) Received: from smtp2.server.rpi.edu (smtp2.server.rpi.edu [128.113.2.2]) by mx1.FreeBSD.org (Postfix) with ESMTP id D11EF43DD2; Sat, 20 Mar 2004 12:51:45 -0800 (PST) (envelope-from drosih@rpi.edu) Received: from [128.113.24.47] (gilead.netel.rpi.edu [128.113.24.47]) by smtp2.server.rpi.edu (8.12.8/8.12.8) with ESMTP id i2KKpWEw020752; Sat, 20 Mar 2004 15:51:32 -0500 Mime-Version: 1.0 X-Sender: drosih@mail.rpi.edu Message-Id: Date: Sat, 20 Mar 2004 15:51:31 -0500 To: freebsd-standards@FreeBSD.org From: Garance A Drosihn Content-Type: text/plain; charset="us-ascii" ; format="flowed" X-Scanned-By: CanIt (www . canit . ca) X-Mailman-Approved-At: Sun, 21 Mar 2004 05:06:58 -0800 cc: Alexey Dokuchaev Subject: PATCH for a more-POSIX `ps', and related adventures X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Mar 2004 21:17:08 -0000 [this is BCC'ed to -arch so more people have a chance to see it, but I expect most of the discussion to happen in freebsd-standards]. It started out that I just wanted to get rid of one message that `ps' writes to stderr in -current but not in -stable. "As long as I was there", I thought I'd add support for a comma-separated list of processes for `ps -p' (as described in SUSv3). Alexey Dokuchaev asked if this change got us much closer to POSIX/SUS. Now it did get us a *little* closer, but in re-reading SUSv3 I realized that I didn't get it (that one option) quite as close as I would like. So, "as long as I was there", I figured I should try to come a little closer. Now, after about 30 consecutive "as long as I was there" small projects, I have an update which: Changes -p so it accepts a list of process IDs, and -t so it accepts a list of terminal names (instead of only allowing a single value). Adds the -A option of SUSv3 (exactly the same as `-ax') Adds the `-G gidlist' and '-g pgidlist' options of SYSv3. (note that this replaced a null `-g' option...) Adds a `-R ruserlist' option, which is the same as what SYSv3 describes for `-u' (we already have a `-u'). Amazingly, none of solaris, linux, or irix seem to have any kind of `-R' option. Adds a `-s sidlist' option, which is not in SUSv3, but it is in solaris, linux, and irix -- and it's an option I have personally wished for on occasion... Allows the user to specify any of these "selector options" multiple times, and have it keep adding to that list instead of replacing values for that list. Better parsing of options. Better error messages for invalid values (IMO). Fixes interactions between all these "selector options", & our `-x' option (which is not mentioned in SUSv3). For the selector options, I tried to meet the description of: "If any are specified, the default list shall be ignored and ps shall select the processes represented by the inclusive OR of all the selection-criteria options." Applies all these selection criteria *before* sorting the list of processes we get from kvm_getprocs(), and before using the list to compute the sizes of the output fields. That does not get us matching POSIX/SUSv3, but it does get us a lot closer. There are a few questions/issues that came up for me while writing this, but I'll list those in separate messages. I'll also do a minimal update to the man page before commiting this. I wanted to do this without bloating up the size of `ps' by too much, and on i386 the executable has grown by --- 164 bytes! (0.6% increase)! [at this point I will do a touchdown-style victory dance, and spike my keyboard into the floor...] The update weighs in at almost 900 lines, and is available at: http://people.freebsd.org/~gad/ps-susv3.diff I certainly didn't intend to end up with that large of an update, but at this point I'm not going to go back and try to break it down into 30 separate updates of 50 lines each... Please look it over, try it out, and let me know if these options seem to work the way you'd expect them to, or if I have messed anything up. And please please PLEASE -- don't give me any more ideas of something *else* I could do "as long as I'm there"! -- Garance Alistair Drosehn = gad@gilead.netel.rpi.edu Senior Systems Programmer or gad@freebsd.org Rensselaer Polytechnic Institute or drosih@rpi.edu From owner-freebsd-arch@FreeBSD.ORG Sun Mar 21 19:11:05 2004 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D891F16A4CE for ; Sun, 21 Mar 2004 19:11:05 -0800 (PST) Received: from smtp.omnis.com (smtp.omnis.com [216.239.128.26]) by mx1.FreeBSD.org (Postfix) with ESMTP id BBD5743D2F for ; Sun, 21 Mar 2004 19:11:05 -0800 (PST) (envelope-from wes@softweyr.com) Received: from 204.68.178.189 (66-91-236-204.san.rr.com [66.91.236.204]) by smtp-relay.omnis.com (Postfix) with ESMTP id AA355881CF9; Sun, 21 Mar 2004 19:11:03 -0800 (PST) From: Wes Peters To: "M. Warner Losh" , ticso@cicely.de, ticso@cicely12.cicely.de Date: Sun, 21 Mar 2004 19:13:49 -0800 User-Agent: KMail/1.5.4 References: <20040320052007.GC33602@cicely12.cicely.de> <20040320.184336.88475380.imp@bsdimp.com> In-Reply-To: <20040320.184336.88475380.imp@bsdimp.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200403211913.49901.wes@softweyr.com> cc: arch@freebsd.org Subject: Re: Opinions about using USB serial numbers X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Mar 2004 03:11:06 -0000 On Saturday 20 March 2004 17:43, M. Warner Losh wrote: > In message: <20040320052007.GC33602@cicely12.cicely.de> > > Bernd Walter writes: > : I have a lot to do with systems using many USB devices of the same > : kind. > : Currently device are named acording to their probing order. > : That result in the problematic that device names can change after > : reboot or replugging in different order. > : > : I would like to add functionality for creating alias devnodes > : including the serial numbers (if the device has one setup). > : E.g. for a ucom(4) device you will get /dev/ucom0 and > : ucom.serialnumber. If the device has no serial numer there will be > : just /dev/ucom0 as befor. > : > : Another solution could be to create the nodes in a tree form: > : /dev/usbchannel0/hubport1/pubport2/ucom > : That would work for devices without serial numbers too, but I > : personally dislike this way. > > I'd rather that we have a generic binding of a device instance number > to a pnp location. > > However, having said that, you can use devd to extract the information > from the node and then create a symbolic link... Using the serial number would give the ability to reliably connect to a specific device, or to know that it is not currently present in the system. For certain embedded applications, that could be very nice. -- "Where am I, and what am I doing in this handbasket?" Wes Peters Softweyr LLC wes@softweyr.com http://softweyr.com/ From owner-freebsd-arch@FreeBSD.ORG Sun Mar 21 22:57:32 2004 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 25F5316A4CE for ; Sun, 21 Mar 2004 22:57:32 -0800 (PST) Received: from t-axegw.t.axe-inc.co.jp (t-axegw.t.axe-inc.co.jp [218.230.241.250]) by mx1.FreeBSD.org (Postfix) with ESMTP id 209EF43D48 for ; Sun, 21 Mar 2004 22:57:31 -0800 (PST) (envelope-from tanimura@axe-inc.co.jp) Received: from shojaku.t.axe-inc.co.jp ([192.168.6.178]) id i2M6vDYI080595 ; Mon, 22 Mar 2004 15:57:14 +0900 (JST) Received: from shojaku.t.axe-inc.co.jp (localhost [127.0.0.1]) id i2M6vCrS097750 ; Mon, 22 Mar 2004 15:57:12 +0900 (JST) Message-Id: <200403220657.i2M6vCrS097750@shojaku.t.axe-inc.co.jp> Date: Mon, 22 Mar 2004 15:57:12 +0900 From: Seigo Tanimura To: John Baldwin In-Reply-To: <200403161009.48938.john@baldwin.cx> References: <200403160519.i2G5J0V6023193@urban> <200403161009.48938.john@baldwin.cx> User-Agent: Wanderlust/2.10.0 (Venus) SEMI/1.14.5 (Awara-Onsen) FLIM/1.14.5 (Demachiyanagi) APEL/10.5 MULE XEmacs/21.4 (patch 14) (Reasonable Discussion) (i386--freebsd) MIME-Version: 1.0 (generated by SEMI 1.14.5 - "Awara-Onsen") Content-Type: text/plain; charset=US-ASCII cc: arch@FreeBSD.org cc: Seigo Tanimura Subject: Re: Is MTX_CONTESTED evil? X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Mar 2004 06:57:32 -0000 On Tue, 16 Mar 2004 10:09:48 -0500, John Baldwin said: john> On Tuesday 16 March 2004 12:19 am, Seigo Tanimura wrote: >> _mtx_unlock_sleep() currently wakes up only one thread being blocked, >> and leaves MTX_CONTESTED on a mutex. According to Solaris Internals, >> that strategy adds an overhead to check for MTX_CONTESTED on a mutex, >> even though it is not held by any thread. The thread waken up cannot >> grab the mutex immediately by _obtain_lock() and have to go through >> _mtx_lock_sleep(). The penalty tends to be large for a mutex with a >> high contention, and we have at least one of such a mutex - Giant. >> >> What would it be like if we axed MTX_CONTEST and let >> _mtx_unlock_sleep() wake up all of the blocked threads? john> We wouldn't be able to axe MTX_CONTEST. We also use it to determine on unlock john> if we can unlock easily or if we have waiters that we need to awake. The john> only way we might be able to axe MTX_CONTEST would be to penalize every john> unlock operation requiring a turnstile lookup (spin lock acquire/release + john> hash table lookup) even unlocks of an uncontested mutex. However, what I john> think you want to do is get rid of the mtx_lock == MTX_CONTESTED case and use john> turnstile_wakeup() rather than turnstile_signal()? Is that what you are Yes. What I an wondering is whether the reduction of the cost due to a mutex with waiters and no holders can beat the cost of waking up all the waiters on the turnstile. john> asking? That is something we can try at some point in the future, but we john> would need to benchmark both ways. What we might can do is add a kernel john> option MUTEX_WAKE_ALL or some such that uses the Solaris behavior. Having it john> be an option like ADAPTIVE_MUTEXES makes it easier to benchmark both cases. On the detection of the waiters by MTX_CONTEST, maybe we can test MTX_CONTEST on mtx_lock before performing _release_lock(). If the test succeeds, _mtx_unlock_sleep() must be called and we do not need to perform an atomic test-and-set. A race can occur if the mutex is locked after the MTX_CONTEST test, but _release_lock() should then cover the case. Pseudocode: mtx_unlock(m) { if (m->mtx_lock & MTX_CONTEST || !_release_lock(m)) _mtx_unlock_sleep(m); } -- Seigo Tanimura From owner-freebsd-arch@FreeBSD.ORG Mon Mar 22 04:09:19 2004 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6F80C16A4CE; Mon, 22 Mar 2004 04:09:19 -0800 (PST) Received: from phuket.psconsult.nl (ps226.psconsult.nl [213.222.19.226]) by mx1.FreeBSD.org (Postfix) with ESMTP id BD14F43D31; Mon, 22 Mar 2004 04:09:18 -0800 (PST) (envelope-from fb-standards@psconsult.nl) Received: from phuket.psconsult.nl (localhost [127.0.0.1]) by phuket.psconsult.nl (8.12.8p2/8.12.8) with ESMTP id i2MC9HYe009565; Mon, 22 Mar 2004 13:09:17 +0100 (CET) (envelope-from fb-standards@psconsult.nl) Received: (from paul@localhost) by phuket.psconsult.nl (8.12.8p2/8.12.8/Submit) id i2MC9GXM009564; Mon, 22 Mar 2004 13:09:16 +0100 (CET) Date: Mon, 22 Mar 2004 13:09:16 +0100 From: Paul Schenkeveld To: Garance A Drosihn Message-ID: <20040322120916.GA9002@psconsult.nl> Mail-Followup-To: Garance A Drosihn , freebsd-standards@freebsd.org, freebsd-arch@freebsd.org References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.6i cc: freebsd-standards@freebsd.org cc: freebsd-arch@freebsd.org Subject: Re: PATCH for a more-POSIX `ps', and related adventures X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Mar 2004 12:09:19 -0000 Hi, On Sat, Mar 20, 2004 at 03:51:31PM -0500, Garance A Drosihn wrote: > [this is BCC'ed to -arch so more people have a chance to see it, but > I expect most of the discussion to happen in freebsd-standards]. > > ... Any chance this can be adapted for RELENG_4 or do you think the ps source has changed too much between RELENG_4 and HEAD? Of course I tried a quick patch using 4.9-STABLE sources but most chunks failed. A patch and make using HEAD sources showes too many #include differences. I can spend some time to adapt for RELENG_4 if I know that there's a chance of success but I'm not to familiar with the changes between 4 and 5. > -- > Garance Alistair Drosehn = gad@gilead.netel.rpi.edu > Senior Systems Programmer or gad@freebsd.org > Rensselaer Polytechnic Institute or drosih@rpi.edu Regards, Paul Schenkeveld, Consultant PSconsult ICT Services BV From owner-freebsd-arch@FreeBSD.ORG Mon Mar 22 04:33:52 2004 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1F0AF16A4CE for ; Mon, 22 Mar 2004 04:33:52 -0800 (PST) Received: from srv1.cosmo-project.de (srv1.cosmo-project.de [213.83.6.106]) by mx1.FreeBSD.org (Postfix) with ESMTP id 450FE43D45 for ; Mon, 22 Mar 2004 04:33:51 -0800 (PST) (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) i2MCVQUS051821 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=OK); Mon, 22 Mar 2004 13:31:29 +0100 (CET) (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 i2MCUohn043984 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 22 Mar 2004 13:30:51 +0100 (CET) (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 i2MCUopY071128; Mon, 22 Mar 2004 13:30:50 +0100 (CET) (envelope-from ticso@cicely12.cicely.de) Received: (from ticso@localhost) by cicely12.cicely.de (8.12.11/8.12.11/Submit) id i2MCUnAI071127; Mon, 22 Mar 2004 13:30:49 +0100 (CET) (envelope-from ticso) Date: Mon, 22 Mar 2004 13:30:49 +0100 From: Bernd Walter To: "M. Warner Losh" Message-ID: <20040322123048.GP63452@cicely12.cicely.de> References: <20040320052007.GC33602@cicely12.cicely.de> <20040320.184336.88475380.imp@bsdimp.com> <20040321071100.GH33602@cicely12.cicely.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20040321071100.GH33602@cicely12.cicely.de> 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.63 X-Spam-Report: * -4.9 BAYES_00 BODY: Bayesian spam probability is 0 to 1% * [score: 0.0000] X-Spam-Checker-Version: SpamAssassin 2.63 (2004-01-11) on cicely12.cicely.de cc: ticso@cicely12.cicely.de cc: arch@freebsd.org cc: ticso@cicely.de Subject: Re: Opinions about using USB serial numbers X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: ticso@cicely.de List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Mar 2004 12:33:52 -0000 On Sun, Mar 21, 2004 at 08:11:01AM +0100, Bernd Walter wrote: > On Sat, Mar 20, 2004 at 06:43:36PM -0700, M. Warner Losh wrote: > > However, having said that, you can use devd to extract the information > > from the node and then create a symbolic link... > > OK - lets try it with devd. > Usefull devd support is required anyway. > > That's what I get on plugging in a device: > Processing event '? at on uhub2' > Pushing table > Processing nomatch event > Popping table > Processing event '+ubser0 at on uhub2' > Pushing table > device-name=ubser0 > Processing attach event OK - I'm a bit further now: Processing event '?Vendor=0x03da Product=0x0001 DeviceClass=0x00 DeviceSubClass=0x00 DeviceProtocol=0x00 SerialNumber=" foo" at port=2 on uhub2' Pushing table vendor=0x03da Product=0x0001 DeviceClass=0x00 DeviceSubClass=0x00 DeviceProtocol=0x00 SerialNumber= foo port=2 bus=uhub2 Processing nomatch event Popping table Processing event '+ubser0 at port=2 on uhub2' Pushing table device-name=ubser0 port=2 bus=uhub2 Processing attach event [...] Processing event '-ubser0 at port=2 on uhub2' Pushing table device-name=ubser0 port=2 bus=uhub2 Processing detach event The serial numer is still a fake one, but proves that " surounded whitespace works. Getting the interface number and interface specific parameters is tricky so it's not done yet. What still puzzles me is why only the nomatch event includes pnpinfo. devinfo is just fine: [58]cicely13# devinfo -v | grep ubser0 ubser0 pnpinfo Vendor=0x03da Product=0x0001 DeviceClass=0x00 DeviceSubClass=0x00 DeviceProtocol=0x00 SerialNumber=" foo" at port=2 -- B.Walter BWCT http://www.bwct.de ticso@bwct.de info@bwct.de From owner-freebsd-arch@FreeBSD.ORG Mon Mar 22 04:47:05 2004 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7866316A4CE; Mon, 22 Mar 2004 04:47:05 -0800 (PST) Received: from mx.nsu.ru (mx.nsu.ru [212.192.164.5]) by mx1.FreeBSD.org (Postfix) with ESMTP id 044A443D1D; Mon, 22 Mar 2004 04:47:05 -0800 (PST) (envelope-from danfe@regency.nsu.ru) Received: from regency.nsu.ru ([193.124.210.26]) by mx.nsu.ru with esmtp (Exim 4.30) id 1B5OqM-00089s-Pp; Mon, 22 Mar 2004 18:47:50 +0600 Received: from regency.nsu.ru (localhost [127.0.0.1]) by regency.nsu.ru (8.12.10/8.12.10) with ESMTP id i2MCmG2a078329; Mon, 22 Mar 2004 18:48:16 +0600 (NOVT) (envelope-from danfe@regency.nsu.ru) Received: (from danfe@localhost) by regency.nsu.ru (8.12.10/8.12.10/Submit) id i2MCmGWp078327; Mon, 22 Mar 2004 18:48:16 +0600 (NOVT) (envelope-from danfe) Date: Mon, 22 Mar 2004 18:48:15 +0600 From: Alexey Dokuchaev To: Garance A Drosihn , freebsd-standards@freebsd.org, freebsd-arch@freebsd.org Message-ID: <20040322124815.GA76254@regency.nsu.ru> References: <20040322120916.GA9002@psconsult.nl> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20040322120916.GA9002@psconsult.nl> User-Agent: Mutt/1.4.1i Subject: Re: PATCH for a more-POSIX `ps', and related adventures X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Mar 2004 12:47:05 -0000 On Mon, Mar 22, 2004 at 01:09:16PM +0100, Paul Schenkeveld wrote: > Hi, > > On Sat, Mar 20, 2004 at 03:51:31PM -0500, Garance A Drosihn wrote: > > [this is BCC'ed to -arch so more people have a chance to see it, but > > I expect most of the discussion to happen in freebsd-standards]. > > > > ... > > Any chance this can be adapted for RELENG_4 or do you think the > ps source has changed too much between RELENG_4 and HEAD? I personally do not see that much need in putting anything more than a trivial effort in bringing this stuff to RELENG_4. 4.x is living its life out, and this change is not something that 4.x definitely must have. General practice here is most probably is: unless there's a stong reason (like security one) or it's a trivial change, don't MFC. Deed is not worth the trouble. ./danfe From owner-freebsd-arch@FreeBSD.ORG Mon Mar 22 07:20:42 2004 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E869E16A4CE for ; Mon, 22 Mar 2004 07:20:42 -0800 (PST) Received: from srv1.cosmo-project.de (srv1.cosmo-project.de [213.83.6.106]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3546A43D4C for ; Mon, 22 Mar 2004 07:20:42 -0800 (PST) (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) i2MFHTUS058506 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=OK); Mon, 22 Mar 2004 16:17:32 +0100 (CET) (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 i2MFGnhn045502 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 22 Mar 2004 16:16:50 +0100 (CET) (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 i2MFGnes071967; Mon, 22 Mar 2004 16:16:49 +0100 (CET) (envelope-from ticso@cicely12.cicely.de) Received: (from ticso@localhost) by cicely12.cicely.de (8.12.11/8.12.11/Submit) id i2MFGmXJ071966; Mon, 22 Mar 2004 16:16:48 +0100 (CET) (envelope-from ticso) Date: Mon, 22 Mar 2004 16:16:48 +0100 From: Bernd Walter To: "M. Warner Losh" Message-ID: <20040322151647.GU63452@cicely12.cicely.de> References: <20040320052007.GC33602@cicely12.cicely.de> <20040320.184336.88475380.imp@bsdimp.com> <20040321071100.GH33602@cicely12.cicely.de> <20040322123048.GP63452@cicely12.cicely.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20040322123048.GP63452@cicely12.cicely.de> 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.63 X-Spam-Report: * -4.9 BAYES_00 BODY: Bayesian spam probability is 0 to 1% * [score: 0.0000] X-Spam-Checker-Version: SpamAssassin 2.63 (2004-01-11) on cicely12.cicely.de cc: ticso@cicely12.cicely.de cc: arch@FreeBSD.org cc: ticso@cicely.de Subject: Re: Opinions about using USB serial numbers X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: ticso@cicely.de List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Mar 2004 15:20:43 -0000 On Mon, Mar 22, 2004 at 01:30:49PM +0100, Bernd Walter wrote: > What still puzzles me is why only the nomatch event includes pnpinfo. I've found the code in subr_bus and it looks very intentionally to me. Should I move the serial number into the location string? Or can we add the pnpinfo to attach/detach messages as well? -- B.Walter BWCT http://www.bwct.de ticso@bwct.de info@bwct.de From owner-freebsd-arch@FreeBSD.ORG Mon Mar 22 10:18:25 2004 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2ED4416A4CF; Mon, 22 Mar 2004 10:18:25 -0800 (PST) Received: from smtp1.server.rpi.edu (smtp1.server.rpi.edu [128.113.2.1]) by mx1.FreeBSD.org (Postfix) with ESMTP id BC1D243D45; Mon, 22 Mar 2004 10:18:24 -0800 (PST) (envelope-from drosih@rpi.edu) Received: from [128.113.24.47] (gilead.netel.rpi.edu [128.113.24.47]) by smtp1.server.rpi.edu (8.12.8/8.12.8) with ESMTP id i2MIINHB016764; Mon, 22 Mar 2004 13:18:24 -0500 Mime-Version: 1.0 X-Sender: drosih@mail.rpi.edu Message-Id: In-Reply-To: <20040322155901.GA17891@stack.nl> References: <20040322155901.GA17891@stack.nl> Date: Mon, 22 Mar 2004 13:18:22 -0500 To: Jilles Tjoelker From: Garance A Drosihn Content-Type: text/plain; charset="us-ascii" ; format="flowed" X-Scanned-By: CanIt (www . canit . ca) cc: arch@freebsd.org cc: freebsd-standards@freebsd.org Subject: Re: PATCH for a more-POSIX `ps', and related adventures X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Mar 2004 18:18:25 -0000 At 4:59 PM +0100 3/22/04, Jilles Tjoelker wrote: >On Sat, Mar 20, 2004, Garance A Drosihn wrote: > >> Adds a `-R ruserlist' option, which is the same as what >> SYSv3 describes for `-u' (we already have a `-u'). >> Amazingly, none of solaris, linux, or irix seem to >> have any kind of `-R' option. > >SUSv3 says -u selects by effective uid and -U selects by real uid. >FreeBSD -U selects by effective uid and -u is something else totally. >This is only of the (few) obstacles to SUSv3 (not XSI) compatibility >(another being the default selection). XSI level compatibility would >require a lot of POLA violation. Ugh. I kept thinking I was reading that one backwards, but somehow I managed to keep convincing myself that I had it right. Well, I am not comfortable suggesting that we change -U's definition this far into the life of 5.x. That could be pretty confusing (even though it is a subtle change). Great. So what should I do here? Add a `-E' option for "effective userid"? In fact, add both `-E' and `-R', and then we would have two options that we could MFC into 4.x as well as 5.x (without any conflict). At some later date (in 6.x?), we would have the option of changing '-U' to match the standard definition. Amazingly, both `-E' and `-R' seem to be unused on the other OS's I have here. I am not thrilled with that idea, but at the moment I can't think of a better one. I *would* like to support matches of both real and effective users. I guess we could add some other option which would say "use the POSIX definitions of -u and -U", but that doesn't exactly thrill me either. Anyone have any other suggestions? Should I just leave it alone for now? -- Garance Alistair Drosehn = gad@gilead.netel.rpi.edu Senior Systems Programmer or gad@freebsd.org Rensselaer Polytechnic Institute or drosih@rpi.edu From owner-freebsd-arch@FreeBSD.ORG Mon Mar 22 14:40:56 2004 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7BE9616A4CE for ; Mon, 22 Mar 2004 14:40:56 -0800 (PST) Received: from mail3.speakeasy.net (mail3.speakeasy.net [216.254.0.203]) by mx1.FreeBSD.org (Postfix) with ESMTP id 593AE43D2D for ; Mon, 22 Mar 2004 14:40:56 -0800 (PST) (envelope-from jhb@FreeBSD.org) Received: (qmail 25723 invoked from network); 22 Mar 2004 22:40:55 -0000 Received: from dsl027-160-063.atl1.dsl.speakeasy.net (HELO server.baldwin.cx) ([216.27.160.63]) (envelope-sender ) encrypted SMTP for ; 22 Mar 2004 22:40:55 -0000 Received: from 10.50.40.205 (gw1.twc.weather.com [216.133.140.1]) by server.baldwin.cx (8.12.10/8.12.10) with ESMTP id i2MMen28000256; Mon, 22 Mar 2004 17:40:50 -0500 (EST) (envelope-from jhb@FreeBSD.org) From: John Baldwin To: Seigo Tanimura Date: Mon, 22 Mar 2004 14:20:39 -0500 User-Agent: KMail/1.6 References: <200403160519.i2G5J0V6023193@urban> <200403161009.48938.john@baldwin.cx> <200403220657.i2M6vCrS097750@shojaku.t.axe-inc.co.jp> In-Reply-To: <200403220657.i2M6vCrS097750@shojaku.t.axe-inc.co.jp> MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <200403221420.39732.jhb@FreeBSD.org> X-Spam-Checker-Version: SpamAssassin 2.63 (2004-01-11) on server.baldwin.cx cc: arch@FreeBSD.org Subject: Re: Is MTX_CONTESTED evil? X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Mar 2004 22:40:56 -0000 On Monday 22 March 2004 01:57 am, Seigo Tanimura wrote: > On Tue, 16 Mar 2004 10:09:48 -0500, > John Baldwin said: > > john> On Tuesday 16 March 2004 12:19 am, Seigo Tanimura wrote: > >> _mtx_unlock_sleep() currently wakes up only one thread being blocked, > >> and leaves MTX_CONTESTED on a mutex. According to Solaris Internals, > >> that strategy adds an overhead to check for MTX_CONTESTED on a mutex, > >> even though it is not held by any thread. The thread waken up cannot > >> grab the mutex immediately by _obtain_lock() and have to go through > >> _mtx_lock_sleep(). The penalty tends to be large for a mutex with a > >> high contention, and we have at least one of such a mutex - Giant. > >> > >> What would it be like if we axed MTX_CONTEST and let > >> _mtx_unlock_sleep() wake up all of the blocked threads? > > john> We wouldn't be able to axe MTX_CONTEST. We also use it to determine > on unlock john> if we can unlock easily or if we have waiters that we need > to awake. The john> only way we might be able to axe MTX_CONTEST would be > to penalize every john> unlock operation requiring a turnstile lookup (spin > lock acquire/release + john> hash table lookup) even unlocks of an > uncontested mutex. However, what I john> think you want to do is get rid > of the mtx_lock == MTX_CONTESTED case and use john> turnstile_wakeup() > rather than turnstile_signal()? Is that what you are > > Yes. What I an wondering is whether the reduction of the cost due to > a mutex with waiters and no holders can beat the cost of waking up all > the waiters on the turnstile. > > > john> asking? That is something we can try at some point in the future, > but we john> would need to benchmark both ways. What we might can do is > add a kernel john> option MUTEX_WAKE_ALL or some such that uses the Solaris > behavior. Having it john> be an option like ADAPTIVE_MUTEXES makes it > easier to benchmark both cases. > > > On the detection of the waiters by MTX_CONTEST, maybe we can test > MTX_CONTEST on mtx_lock before performing _release_lock(). If the > test succeeds, _mtx_unlock_sleep() must be called and we do not need > to perform an atomic test-and-set. A race can occur if the mutex is > locked after the MTX_CONTEST test, but _release_lock() should then > cover the case. > > Pseudocode: > > mtx_unlock(m) > { > if (m->mtx_lock & MTX_CONTEST || !_release_lock(m)) > _mtx_unlock_sleep(m); > } I would just always do the atomic op to avoid penalizing the common fast case (not contested, not recursed). BTW, last week I did implement the MUTEX_WAKE_ALL kernel option in the jhb_lock p4 branch. I've been very busy with work stuff though for several days now, but when I get some free time again I'll post the patch so people can play with it. -- John Baldwin <>< http://www.FreeBSD.org/~jhb/ "Power Users Use the Power to Serve" = http://www.FreeBSD.org From owner-freebsd-arch@FreeBSD.ORG Mon Mar 22 15:46:16 2004 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7DC8C16A4CE for ; Mon, 22 Mar 2004 15:46:16 -0800 (PST) Received: from VARK.homeunix.com (adsl-68-121-162-101.dsl.pltn13.pacbell.net [68.121.162.101]) by mx1.FreeBSD.org (Postfix) with ESMTP id 324D043D58 for ; Mon, 22 Mar 2004 15:46:16 -0800 (PST) (envelope-from das@FreeBSD.ORG) Received: from VARK.homeunix.com (localhost [127.0.0.1]) by VARK.homeunix.com (8.12.11/8.12.10) with ESMTP id i2MNjv5O007877; Mon, 22 Mar 2004 15:45:57 -0800 (PST) (envelope-from das@FreeBSD.ORG) Received: (from das@localhost) by VARK.homeunix.com (8.12.11/8.12.10/Submit) id i2MNjvVu007876; Mon, 22 Mar 2004 15:45:57 -0800 (PST) (envelope-from das@FreeBSD.ORG) Date: Mon, 22 Mar 2004 15:45:57 -0800 From: David Schultz To: Seigo Tanimura Message-ID: <20040322234557.GA7661@VARK.homeunix.com> Mail-Followup-To: Seigo Tanimura , John Baldwin , arch@FreeBSD.ORG References: <200403160519.i2G5J0V6023193@urban> <200403161009.48938.john@baldwin.cx> <200403220657.i2M6vCrS097750@shojaku.t.axe-inc.co.jp> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200403220657.i2M6vCrS097750@shojaku.t.axe-inc.co.jp> cc: John Baldwin cc: arch@FreeBSD.ORG Subject: Re: Is MTX_CONTESTED evil? X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Mar 2004 23:46:16 -0000 On Mon, Mar 22, 2004, Seigo Tanimura wrote: > On Tue, 16 Mar 2004 10:09:48 -0500, > John Baldwin said: > > john> On Tuesday 16 March 2004 12:19 am, Seigo Tanimura wrote: > >> _mtx_unlock_sleep() currently wakes up only one thread being blocked, > >> and leaves MTX_CONTESTED on a mutex. According to Solaris Internals, > >> that strategy adds an overhead to check for MTX_CONTESTED on a mutex, > >> even though it is not held by any thread. The thread waken up cannot > >> grab the mutex immediately by _obtain_lock() and have to go through > >> _mtx_lock_sleep(). The penalty tends to be large for a mutex with a > >> high contention, and we have at least one of such a mutex - Giant. > >> > >> What would it be like if we axed MTX_CONTEST and let > >> _mtx_unlock_sleep() wake up all of the blocked threads? > > john> We wouldn't be able to axe MTX_CONTEST. We also use it to determine on unlock > john> if we can unlock easily or if we have waiters that we need to awake. The > john> only way we might be able to axe MTX_CONTEST would be to penalize every > john> unlock operation requiring a turnstile lookup (spin lock acquire/release + > john> hash table lookup) even unlocks of an uncontested mutex. However, what I > john> think you want to do is get rid of the mtx_lock == MTX_CONTESTED case and use > john> turnstile_wakeup() rather than turnstile_signal()? Is that what you are > > Yes. What I an wondering is whether the reduction of the cost due to > a mutex with waiters and no holders can beat the cost of waking up all > the waiters on the turnstile. By the way, one thing to keep in mind is that Solaris has working adaptive mutexes. For adaptive mutexes, the waiting case is almost never supposed to happen, so it's more reasonable for them to wake all waiters. However, AFAIK, FreeBSD's adaptive mutex support is incomplete or broken at this point, so you may run into a thundering herd problem if you wake all waiters. From owner-freebsd-arch@FreeBSD.ORG Mon Mar 22 16:05:07 2004 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D862B16A4CF for ; Mon, 22 Mar 2004 16:05:07 -0800 (PST) Received: from mail1.speakeasy.net (mail1.speakeasy.net [216.254.0.201]) by mx1.FreeBSD.org (Postfix) with ESMTP id CFC4B43D41 for ; Mon, 22 Mar 2004 16:05:06 -0800 (PST) (envelope-from john@baldwin.cx) Received: (qmail 11365 invoked from network); 23 Mar 2004 00:05:06 -0000 Received: from dsl027-160-063.atl1.dsl.speakeasy.net (HELO server.baldwin.cx) ([216.27.160.63]) (envelope-sender ) encrypted SMTP for ; 23 Mar 2004 00:05:06 -0000 Received: from 10.50.40.205 (gw1.twc.weather.com [216.133.140.1]) by server.baldwin.cx (8.12.10/8.12.10) with ESMTP id i2N05228000598; Mon, 22 Mar 2004 19:05:03 -0500 (EST) (envelope-from john@baldwin.cx) From: John Baldwin To: David Schultz Date: Mon, 22 Mar 2004 19:06:47 -0500 User-Agent: KMail/1.6 References: <200403160519.i2G5J0V6023193@urban> <200403220657.i2M6vCrS097750@shojaku.t.axe-inc.co.jp> <20040322234557.GA7661@VARK.homeunix.com> In-Reply-To: <20040322234557.GA7661@VARK.homeunix.com> MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <200403221906.47238.john@baldwin.cx> X-Spam-Checker-Version: SpamAssassin 2.63 (2004-01-11) on server.baldwin.cx cc: arch@FreeBSD.ORG cc: Seigo Tanimura Subject: Re: Is MTX_CONTESTED evil? X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Mar 2004 00:05:08 -0000 On Monday 22 March 2004 06:45 pm, David Schultz wrote: > On Mon, Mar 22, 2004, Seigo Tanimura wrote: > > On Tue, 16 Mar 2004 10:09:48 -0500, > > John Baldwin said: > > > > john> On Tuesday 16 March 2004 12:19 am, Seigo Tanimura wrote: > > >> _mtx_unlock_sleep() currently wakes up only one thread being blocked, > > >> and leaves MTX_CONTESTED on a mutex. According to Solaris Internals, > > >> that strategy adds an overhead to check for MTX_CONTESTED on a mutex, > > >> even though it is not held by any thread. The thread waken up cannot > > >> grab the mutex immediately by _obtain_lock() and have to go through > > >> _mtx_lock_sleep(). The penalty tends to be large for a mutex with a > > >> high contention, and we have at least one of such a mutex - Giant. > > >> > > >> What would it be like if we axed MTX_CONTEST and let > > >> _mtx_unlock_sleep() wake up all of the blocked threads? > > > > john> We wouldn't be able to axe MTX_CONTEST. We also use it to > > determine on unlock john> if we can unlock easily or if we have waiters > > that we need to awake. The john> only way we might be able to axe > > MTX_CONTEST would be to penalize every john> unlock operation requiring a > > turnstile lookup (spin lock acquire/release + john> hash table lookup) > > even unlocks of an uncontested mutex. However, what I john> think you > > want to do is get rid of the mtx_lock == MTX_CONTESTED case and use john> > > turnstile_wakeup() rather than turnstile_signal()? Is that what you are > > > > Yes. What I an wondering is whether the reduction of the cost due to > > a mutex with waiters and no holders can beat the cost of waking up all > > the waiters on the turnstile. > > By the way, one thing to keep in mind is that Solaris has working > adaptive mutexes. For adaptive mutexes, the waiting case is > almost never supposed to happen, so it's more reasonable for them > to wake all waiters. However, AFAIK, FreeBSD's adaptive mutex > support is incomplete or broken at this point, so you may run into > a thundering herd problem if you wake all waiters. Adaptive mutexes work just fine, but they aren't on by default. In FreeBSD, adaptive mutexes spin so long as the owner is still executing on another CPU. -- John Baldwin <>< http://www.baldwin.cx/~john/ "Power Users Use the Power to Serve" = http://www.FreeBSD.org From owner-freebsd-arch@FreeBSD.ORG Mon Mar 22 20:41:11 2004 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6EC3A16A4CE; Mon, 22 Mar 2004 20:41:11 -0800 (PST) Received: from relay.macomnet.ru (relay.macomnet.ru [195.128.64.10]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8EADF43D45; Mon, 22 Mar 2004 20:41:10 -0800 (PST) (envelope-from maxim@macomnet.ru) Received: from mp3 (uvwb7r80@mp3files.int.ru [195.128.64.20]) by relay.macomnet.ru (8.12.10/8.12.10) with ESMTP id i2N4ewOB9359456; Tue, 23 Mar 2004 07:40:58 +0300 (MSK) Date: Tue, 23 Mar 2004 07:40:58 +0300 (MSK) From: Maxim Konovalov To: John Baldwin In-Reply-To: <200403221906.47238.john@baldwin.cx> Message-ID: <20040323073742.C62061@mp3files.int.ru> References: <200403160519.i2G5J0V6023193@urban> <200403220657.i2M6vCrS097750@shojaku.t.axe-inc.co.jp> <200403221906.47238.john@baldwin.cx> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: arch@freebsd.org cc: David Schultz cc: Seigo Tanimura Subject: Re: Is MTX_CONTESTED evil? X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Mar 2004 04:41:11 -0000 On Mon, 22 Mar 2004, 19:06-0500, John Baldwin wrote: [...] > > By the way, one thing to keep in mind is that Solaris has working > > adaptive mutexes. For adaptive mutexes, the waiting case is > > almost never supposed to happen, so it's more reasonable for them > > to wake all waiters. However, AFAIK, FreeBSD's adaptive mutex > > support is incomplete or broken at this point, so you may run into > > a thundering herd problem if you wake all waiters. > > Adaptive mutexes work just fine, but they aren't on by default. In FreeBSD, > adaptive mutexes spin so long as the owner is still executing on another CPU. With 'options ADATIVE_MUTEXES' our SMP testbox crashes very reliable. If you are interested in a traceback and/or crashdump let me know. -- Maxim Konovalov From owner-freebsd-arch@FreeBSD.ORG Tue Mar 23 01:59:47 2004 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 125CC16A4CE for ; Tue, 23 Mar 2004 01:59:47 -0800 (PST) Received: from ausmtp01.au.ibm.com (ausmtp01.au.ibm.com [202.81.18.186]) by mx1.FreeBSD.org (Postfix) with ESMTP id 795A143D39 for ; Tue, 23 Mar 2004 01:59:46 -0800 (PST) (envelope-from jamesw@tw.ibm.com) Received: from sd0112e0.au.ibm.com (d23rh903.au.ibm.com [202.81.18.201]) by ausmtp01.au.ibm.com (8.12.10/8.12.9) with ESMTP id i2N9xbur073944 for ; Tue, 23 Mar 2004 20:59:39 +1100 Received: from d23ml050.tw.ibm.com (d23av02.au.ibm.com [9.190.250.243]) i2NA08Lc079350 for ; Tue, 23 Mar 2004 21:00:09 +1100 To: freebsd-arch@FreeBSD.org X-Mailer: Lotus Notes Release 5.0.3 (Intl) 21 March 2000 Message-ID: From: JAMES WANG Date: Tue, 23 Mar 2004 17:57:38 +0800 X-MIMETrack: Serialize by Router on d23ml050/23/M/IBM(Release 6.0.2CF2|July 23, 2003) at 23/03/2004 18:04:35 MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Content-Filtered-By: Mailman/MimeDel 2.1.1 Subject: FreeBSD support Platform X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Mar 2004 09:59:47 -0000 Dear I am james wang working at IBM Taiwan. Need you support one question : Dose FreeBSD support on IBM xSeries ( Intel Xeon Based Dual processor ) ? what version ? WITH BEST REGARDS James Wang Manager,Taichung Office Tel : 04-305 5678 Ext 1548 or Direct : 04-324 1548 Fax : 04-301 4411 Mobil : 0932390262 Mail : jamesw@tw.ibm.com From owner-freebsd-arch@FreeBSD.ORG Tue Mar 23 09:24:40 2004 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A0EA216A4CE for ; Tue, 23 Mar 2004 09:24:40 -0800 (PST) Received: from srv1.cosmo-project.de (srv1.cosmo-project.de [213.83.6.106]) by mx1.FreeBSD.org (Postfix) with ESMTP id CDE3843D58 for ; Tue, 23 Mar 2004 09:24:39 -0800 (PST) (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) i2NHMhUS020301 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=OK); Tue, 23 Mar 2004 18:22:48 +0100 (CET) (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 i2NHLjhn057553 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 23 Mar 2004 18:21:45 +0100 (CET) (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 i2NHLid0079128; Tue, 23 Mar 2004 18:21:44 +0100 (CET) (envelope-from ticso@cicely12.cicely.de) Received: (from ticso@localhost) by cicely12.cicely.de (8.12.11/8.12.11/Submit) id i2NHLiZk079127; Tue, 23 Mar 2004 18:21:44 +0100 (CET) (envelope-from ticso) Date: Tue, 23 Mar 2004 18:21:44 +0100 From: Bernd Walter To: "M. Warner Losh" Message-ID: <20040323172142.GF63452@cicely12.cicely.de> References: <20040320052007.GC33602@cicely12.cicely.de> <20040320.184336.88475380.imp@bsdimp.com> <20040321071100.GH33602@cicely12.cicely.de> <20040322123048.GP63452@cicely12.cicely.de> <20040322151647.GU63452@cicely12.cicely.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20040322151647.GU63452@cicely12.cicely.de> 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: ticso@cicely12.cicely.de cc: arch@FreeBSD.org cc: ticso@cicely.de Subject: Opinions about using USB serial numbers - Patch X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: ticso@cicely.de List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Mar 2004 17:24:40 -0000 On Mon, Mar 22, 2004 at 04:16:48PM +0100, Bernd Walter wrote: > On Mon, Mar 22, 2004 at 01:30:49PM +0100, Bernd Walter wrote: > > What still puzzles me is why only the nomatch event includes pnpinfo. > > I've found the code in subr_bus and it looks very intentionally to me. > Should I move the serial number into the location string? > Or can we add the pnpinfo to attach/detach messages as well? I just added pnpinfo to attach/detach messages as well and I managed to get devd to create the required symlinks: Processing event '+ubser0 vendor=0x03da product=0x0001 devclass=0x00 devsubclass=0x00 sernum="1080054842" intclass=0xff intsubclass=0x00 at port=3 interface=0 on uhub3' Pushing table device-name=ubser0 vendor=0x03da product=0x0001 devclass=0x00 devsubclass=0x00 sernum=1080054842 intclass=0xff intsubclass=0x00 Processing attach event Testing device-name=ubser0 against ^ed50 Testing device-name=ubser0 against ^ubser[0-9]+ Executing '/etc/devd/ubser-start.sh ubser0 1080054842' Popping table Processing event '-ubser0 vendor=0x03da product=0x0001 devclass=0x00 devsubclass=0x00 sernum="" intclass=0xff intsubclass=0x00 at port=3 interface=0 on uhub3' Pushing table device-name=ubser0 vendor=0x03da product=0x0001 devclass=0x00 devsubclass=0x00 sernum= intclass=0xff intsubclass=0x00 Processing detach event Testing device-name=ubser0 against ^ed50 Testing device-name=ubser0 against ^ubser[0-9]+ Executing '/etc/devd/ubser-stop.sh ubser0 ' Popping table [102]cicely13# ls -al /dev/ubser0.* crw-rw---- 1 uucp dialer 233, 0 Mar 23 17:34 /dev/ubser0.0 crw-rw---- 1 uucp dialer 233, 1 Mar 23 17:34 /dev/ubser0.1 lrwxr-xr-x 1 root wheel 8 Mar 23 17:54 /dev/ubser.1080054842.0 -> ubser0.0 lrwxr-xr-x 1 root wheel 8 Mar 23 17:54 /dev/ubser.1080054842.1 -> ubser0.1 lrwxr-xr-x 1 root wheel 8 Mar 23 17:54 /dev/ubser.1080054842.2 -> ubser0.2 lrwxr-xr-x 1 root wheel 8 Mar 23 17:54 /dev/ubser.1080054842.3 -> ubser0.3 lrwxr-xr-x 1 root wheel 8 Mar 23 17:54 /dev/ubser.1080054842.4 -> ubser0.4 lrwxr-xr-x 1 root wheel 8 Mar 23 17:54 /dev/ubser.1080054842.5 -> ubser0.5 crw-rw---- 1 uucp dialer 233, 2 Mar 23 17:34 /dev/ubser0.2 crw-rw---- 1 uucp dialer 233, 3 Mar 23 17:34 /dev/ubser0.3 crw-rw---- 1 uucp dialer 233, 4 Mar 23 17:34 /dev/ubser0.4 crw-rw---- 1 uucp dialer 233, 5 Mar 23 17:34 /dev/ubser0.5 [103]cicely13# ls -al /dev/ubser0.* ls: No match. Exit 1 The detach message doesn't contain the serial since this is not cached as the other values - however the device-name is enough to rm the links at detach because we know they are pointing to ubser0.* nodes. Since this is an interface level driver I should add the interface number to the symlink name as well - but that's up to the one configuring devd. The patch is at http://www.bwct.de/usb-devd.patch -- B.Walter BWCT http://www.bwct.de ticso@bwct.de info@bwct.de From owner-freebsd-arch@FreeBSD.ORG Tue Mar 23 10:40:43 2004 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1323916A4EC for ; Tue, 23 Mar 2004 10:40:43 -0800 (PST) Received: from mail1.speakeasy.net (mail1.speakeasy.net [216.254.0.201]) by mx1.FreeBSD.org (Postfix) with ESMTP id DD03343D3F for ; Tue, 23 Mar 2004 10:40:42 -0800 (PST) (envelope-from jhb@FreeBSD.org) Received: (qmail 13520 invoked from network); 23 Mar 2004 18:40:42 -0000 Received: from dsl027-160-063.atl1.dsl.speakeasy.net (HELO server.baldwin.cx) ([216.27.160.63]) (envelope-sender ) encrypted SMTP for ; 23 Mar 2004 18:40:42 -0000 Received: from 10.50.40.205 (gw1.twc.weather.com [216.133.140.1]) by server.baldwin.cx (8.12.10/8.12.10) with ESMTP id i2NIeO28004934; Tue, 23 Mar 2004 13:40:24 -0500 (EST) (envelope-from jhb@FreeBSD.org) From: John Baldwin To: Maxim Konovalov Date: Tue, 23 Mar 2004 10:26:23 -0500 User-Agent: KMail/1.6 References: <200403160519.i2G5J0V6023193@urban> <200403221906.47238.john@baldwin.cx> <20040323073742.C62061@mp3files.int.ru> In-Reply-To: <20040323073742.C62061@mp3files.int.ru> MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <200403231026.24155.jhb@FreeBSD.org> X-Spam-Checker-Version: SpamAssassin 2.63 (2004-01-11) on server.baldwin.cx cc: arch@freebsd.org cc: David Schultz cc: Seigo Tanimura Subject: Re: Is MTX_CONTESTED evil? X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Mar 2004 18:40:43 -0000 On Monday 22 March 2004 11:40 pm, Maxim Konovalov wrote: > On Mon, 22 Mar 2004, 19:06-0500, John Baldwin wrote: > > [...] > > > > By the way, one thing to keep in mind is that Solaris has working > > > adaptive mutexes. For adaptive mutexes, the waiting case is > > > almost never supposed to happen, so it's more reasonable for them > > > to wake all waiters. However, AFAIK, FreeBSD's adaptive mutex > > > support is incomplete or broken at this point, so you may run into > > > a thundering herd problem if you wake all waiters. > > > > Adaptive mutexes work just fine, but they aren't on by default. In > > FreeBSD, adaptive mutexes spin so long as the owner is still executing on > > another CPU. > > With 'options ADATIVE_MUTEXES' our SMP testbox crashes very reliable. > If you are interested in a traceback and/or crashdump let me know. I can look at it. The bug is likely in some other code that is not really MP safe but is out from under Giant anyways as adaptive mutexes allow more concurrent execution and thus expose a lot more races. -- John Baldwin <>< http://www.FreeBSD.org/~jhb/ "Power Users Use the Power to Serve" = http://www.FreeBSD.org From owner-freebsd-arch@FreeBSD.ORG Tue Mar 23 10:43:53 2004 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 43E8016A4CE for ; Tue, 23 Mar 2004 10:43:53 -0800 (PST) Received: from spiff.melthusia.org (spiff.melthusia.org [207.67.244.17]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2B21C43D2F for ; Tue, 23 Mar 2004 10:43:53 -0800 (PST) (envelope-from gtetlow@spiff.melthusia.org) Received: from spiff.melthusia.org (gtetlow@localhost [127.0.0.1]) by spiff.melthusia.org (8.12.10/8.12.10) with ESMTP id i2NIg3Gc011586; Tue, 23 Mar 2004 10:42:03 -0800 (PST) (envelope-from gtetlow@spiff.melthusia.org) Received: (from gtetlow@localhost) by spiff.melthusia.org (8.12.10/8.12.10/Submit) id i2NIg1bJ011585; Tue, 23 Mar 2004 10:42:01 -0800 (PST) (envelope-from gtetlow) Date: Tue, 23 Mar 2004 10:42:01 -0800 From: Gordon Tetlow To: JAMES WANG Message-ID: <20040323184201.GB3110@spiff.melthusia.org> References: Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="KFztAG8eRSV9hGtP" Content-Disposition: inline In-Reply-To: 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 . User-Agent: Mutt/1.5.5.1i cc: freebsd-arch@freebsd.org Subject: Re: FreeBSD support Platform X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Mar 2004 18:43:53 -0000 --KFztAG8eRSV9hGtP Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Mar 23, 2004 at 05:57:38PM +0800, JAMES WANG wrote: > Dear >=20 > I am james wang working at IBM Taiwan. Need you support one question : >=20 > Dose FreeBSD support on IBM xSeries ( Intel Xeon Based Dual processor ) ? > what version ? This is best sent to -questions. -arch is for architecture questions. Although I haven't personally tested it, I suspect the IBM xSeries servers will work fine. The question comes down to driver support for things like the network card. That said, the best way to find out is to attempt an install on one and report your results (I'm assuming you have access to hardware if you=20 work for IBM). -gordon --KFztAG8eRSV9hGtP Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.3 (FreeBSD) iD8DBQFAYIT4Ru2t9DV9ZfsRAo1qAJwMo9J3WYv/DY4nR94WuHLN028dSQCeLB6F hkEjhfEkhk8LEj6iFZYUtUM= =uWau -----END PGP SIGNATURE----- --KFztAG8eRSV9hGtP-- From owner-freebsd-arch@FreeBSD.ORG Tue Mar 23 10:46:37 2004 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2E8ED16A4CE; Tue, 23 Mar 2004 10:46:37 -0800 (PST) Received: from relay.macomnet.ru (relay.macomnet.ru [195.128.64.10]) by mx1.FreeBSD.org (Postfix) with ESMTP id 49A7143D1D; Tue, 23 Mar 2004 10:46:36 -0800 (PST) (envelope-from maxim@macomnet.ru) Received: from mp3 (349ojauq@mp3files.int.ru [195.128.64.20]) by relay.macomnet.ru (8.12.10/8.12.10) with ESMTP id i2NIkQOB9398485; Tue, 23 Mar 2004 21:46:26 +0300 (MSK) Date: Tue, 23 Mar 2004 21:46:26 +0300 (MSK) From: Maxim Konovalov To: John Baldwin In-Reply-To: <200403231026.24155.jhb@FreeBSD.org> Message-ID: <20040323214327.A46706@mp3files.int.ru> References: <200403160519.i2G5J0V6023193@urban> <200403221906.47238.john@baldwin.cx> <200403231026.24155.jhb@FreeBSD.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: dima@rt.ru cc: arch@FreeBSD.org cc: David Schultz cc: Seigo Tanimura Subject: ADAPTIVE_MITEXES (Was: Is MTX_CONTESTED evil?) X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Mar 2004 18:46:37 -0000 [ CC'ed the box owner ] On Tue, 23 Mar 2004, 10:26-0500, John Baldwin wrote: > On Monday 22 March 2004 11:40 pm, Maxim Konovalov wrote: > > On Mon, 22 Mar 2004, 19:06-0500, John Baldwin wrote: > > > > [...] > > > > > > By the way, one thing to keep in mind is that Solaris has working > > > > adaptive mutexes. For adaptive mutexes, the waiting case is > > > > almost never supposed to happen, so it's more reasonable for them > > > > to wake all waiters. However, AFAIK, FreeBSD's adaptive mutex > > > > support is incomplete or broken at this point, so you may run into > > > > a thundering herd problem if you wake all waiters. > > > > > > Adaptive mutexes work just fine, but they aren't on by default. In > > > FreeBSD, adaptive mutexes spin so long as the owner is still executing on > > > another CPU. > > > > With 'options ADATIVE_MUTEXES' our SMP testbox crashes very reliable. > > If you are interested in a traceback and/or crashdump let me know. > > I can look at it. The bug is likely in some other code that is not really MP > safe but is out from under Giant anyways as adaptive mutexes allow more > concurrent execution and thus expose a lot more races. OK, we rebuilt the kernel with 'options ADAPTIVE_MUTEXES' and now running our usual stress testes. Hope will get a crashdump soon. -- Maxim Konovalov From owner-freebsd-arch@FreeBSD.ORG Tue Mar 23 12:05:21 2004 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id ADA1D16A4CE; Tue, 23 Mar 2004 12:05:21 -0800 (PST) Received: from smtp.des.no (flood.des.no [217.116.83.31]) by mx1.FreeBSD.org (Postfix) with ESMTP id 729FF43D31; Tue, 23 Mar 2004 12:05:21 -0800 (PST) (envelope-from des@des.no) Received: by smtp.des.no (Pony Express, from userid 666) id 85C365309; Tue, 23 Mar 2004 21:05:20 +0100 (CET) Received: from dwp.des.no (des.no [80.203.228.37]) by smtp.des.no (Pony Express) with ESMTP id 389C65308; Tue, 23 Mar 2004 21:05:11 +0100 (CET) Received: by dwp.des.no (Postfix, from userid 2602) id 1D38033C6C; Tue, 23 Mar 2004 21:05:11 +0100 (CET) To: John Baldwin References: <200403160519.i2G5J0V6023193@urban> <200403220657.i2M6vCrS097750@shojaku.t.axe-inc.co.jp> <20040322234557.GA7661@VARK.homeunix.com> <200403221906.47238.john@baldwin.cx> From: des@des.no (Dag-Erling =?iso-8859-1?q?Sm=F8rgrav?=) Date: Tue, 23 Mar 2004 21:05:11 +0100 In-Reply-To: <200403221906.47238.john@baldwin.cx> (John Baldwin's message of "Mon, 22 Mar 2004 19:06:47 -0500") Message-ID: User-Agent: Gnus/5.090024 (Oort Gnus v0.24) Emacs/21.3 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Checker-Version: SpamAssassin 2.63 (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.63 cc: arch@FreeBSD.ORG cc: David Schultz cc: Seigo Tanimura Subject: Re: Is MTX_CONTESTED evil? X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Mar 2004 20:05:21 -0000 John Baldwin writes: > Adaptive mutexes work just fine, but they aren't on by default. No, they don't "work just fine", unless of course they are *supposed* to cause frequent panics. DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-freebsd-arch@FreeBSD.ORG Tue Mar 23 12:07:05 2004 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0D9C516A4CE; Tue, 23 Mar 2004 12:07:05 -0800 (PST) Received: from smtp.des.no (flood.des.no [217.116.83.31]) by mx1.FreeBSD.org (Postfix) with ESMTP id 580DA43D54; Tue, 23 Mar 2004 12:07:03 -0800 (PST) (envelope-from des@des.no) Received: by smtp.des.no (Pony Express, from userid 666) id 63D355309; Tue, 23 Mar 2004 21:07:02 +0100 (CET) Received: from dwp.des.no (des.no [80.203.228.37]) by smtp.des.no (Pony Express) with ESMTP id 9A68D5308; Tue, 23 Mar 2004 21:06:52 +0100 (CET) Received: by dwp.des.no (Postfix, from userid 2602) id 5E52433C6C; Tue, 23 Mar 2004 21:06:52 +0100 (CET) To: John Baldwin References: <200403160519.i2G5J0V6023193@urban> <200403220657.i2M6vCrS097750@shojaku.t.axe-inc.co.jp> <20040322234557.GA7661@VARK.homeunix.com> <200403221906.47238.john@baldwin.cx> From: des@des.no (Dag-Erling =?iso-8859-1?q?Sm=F8rgrav?=) Date: Tue, 23 Mar 2004 21:06:52 +0100 In-Reply-To: (Dag-Erling =?iso-8859-1?q?Sm=F8rgrav's?= message of "Tue, 23 Mar 2004 21:05:11 +0100") Message-ID: User-Agent: Gnus/5.090024 (Oort Gnus v0.24) Emacs/21.3 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Checker-Version: SpamAssassin 2.63 (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.63 cc: arch@FreeBSD.ORG cc: David Schultz cc: Seigo Tanimura Subject: Re: Is MTX_CONTESTED evil? X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Mar 2004 20:07:05 -0000 des@des.no (Dag-Erling Sm=C3=B8rgrav) writes: > John Baldwin writes: > > Adaptive mutexes work just fine, but they aren't on by default. > No, they don't "work just fine", unless of course they are *supposed* > to cause frequent panics. s/panic/freeze/ DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-freebsd-arch@FreeBSD.ORG Wed Mar 24 07:41:05 2004 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0A6DC16A4CF for ; Wed, 24 Mar 2004 07:41:05 -0800 (PST) Received: from mail2.speakeasy.net (mail2.speakeasy.net [216.254.0.202]) by mx1.FreeBSD.org (Postfix) with ESMTP id DC3BE43D41 for ; Wed, 24 Mar 2004 07:41:04 -0800 (PST) (envelope-from jhb@FreeBSD.org) Received: (qmail 9904 invoked from network); 24 Mar 2004 15:41:04 -0000 Received: from dsl027-160-063.atl1.dsl.speakeasy.net (HELO server.baldwin.cx) ([216.27.160.63]) (envelope-sender ) encrypted SMTP for ; 24 Mar 2004 15:41:04 -0000 Received: from 10.50.40.205 (gw1.twc.weather.com [216.133.140.1]) by server.baldwin.cx (8.12.10/8.12.10) with ESMTP id i2OFe6DJ004603; Wed, 24 Mar 2004 10:40:52 -0500 (EST) (envelope-from jhb@FreeBSD.org) From: John Baldwin To: des@des.no (Dag-Erling =?utf-8?q?Sm=C3=B8rgrav?=) Date: Tue, 23 Mar 2004 17:24:45 -0500 User-Agent: KMail/1.6 References: <200403160519.i2G5J0V6023193@urban> In-Reply-To: MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <200403231724.45923.jhb@FreeBSD.org> X-Spam-Checker-Version: SpamAssassin 2.63 (2004-01-11) on server.baldwin.cx cc: arch@FreeBSD.ORG cc: David Schultz cc: Seigo Tanimura Subject: Re: Is MTX_CONTESTED evil? X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Mar 2004 15:41:05 -0000 On Tuesday 23 March 2004 03:06 pm, Dag-Erling Sm=C3=B8rgrav wrote: > des@des.no (Dag-Erling Sm=C3=B8rgrav) writes: > > John Baldwin writes: > > > Adaptive mutexes work just fine, but they aren't on by default. > > > > No, they don't "work just fine", unless of course they are *supposed* > > to cause frequent panics. > > s/panic/freeze/ They worked just fine on sparc64, alpha, and i386 when they were developed = and=20 nothing has changed since then. However, since they increase the chances o= f=20 "near concurrency" on multiple CPUs (i.e. one CPU grabbing a lock right aft= er=20 another released it) they expose races and thus bugs in code that uses=20 mutexes improperly. The fault is not in adaptive mutexes, but in the other= =20 broken code, just as compile failures aren't the result of the tinderbox=20 itself being broken. :-) =2D-=20 John Baldwin <>< http://www.FreeBSD.org/~jhb/ "Power Users Use the Power to Serve" =3D http://www.FreeBSD.org From owner-freebsd-arch@FreeBSD.ORG Wed Mar 24 12:21:31 2004 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id DF84716A4CE for ; Wed, 24 Mar 2004 12:21:31 -0800 (PST) Received: from smtp4.server.rpi.edu (smtp4.server.rpi.edu [128.113.2.4]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7181343D31 for ; Wed, 24 Mar 2004 12:21:31 -0800 (PST) (envelope-from drosih@rpi.edu) Received: from [128.113.24.47] (gilead.netel.rpi.edu [128.113.24.47]) by smtp4.server.rpi.edu (8.12.8/8.12.8) with ESMTP id i2OKLUoP019928 for ; Wed, 24 Mar 2004 15:21:30 -0500 Mime-Version: 1.0 X-Sender: drosih@mail.rpi.edu Message-Id: Date: Wed, 24 Mar 2004 15:21:29 -0500 To: arch@FreeBSD.ORG From: Garance A Drosihn Content-Type: text/plain; charset="us-ascii" ; format="flowed" X-Scanned-By: CanIt (www . canit . ca) Subject: Adding `pgrep' and `pkill' to /usr/bin X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Mar 2004 20:21:32 -0000 I noticed the upcoming version of OpenBSD will add the commands `pkill' and `pgrep', which they picked up from NetBSD. These commands also exist in Solaris and Linux. Anyone mind if I add them to FreeBSD? I'd just pick up the versions from NetBSD, and make whatever changes are needed for them to work on FreeBSD. (I actually had an idea of adding another option or two to `ps' which would have given it abilities similar to `pgrep', but once I noticed these I figured it would make more sense to add them) -- Garance Alistair Drosehn = gad@gilead.netel.rpi.edu Senior Systems Programmer or gad@freebsd.org Rensselaer Polytechnic Institute or drosih@rpi.edu From owner-freebsd-arch@FreeBSD.ORG Wed Mar 24 13:05:55 2004 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 35AF916A4CE for ; Wed, 24 Mar 2004 13:05:55 -0800 (PST) Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2649243D31 for ; Wed, 24 Mar 2004 13:05:55 -0800 (PST) (envelope-from mux@freebsd.org) Received: by elvis.mu.org (Postfix, from userid 1920) id EE50C5C7D7; Wed, 24 Mar 2004 13:05:54 -0800 (PST) Date: Wed, 24 Mar 2004 22:05:54 +0100 From: Maxime Henrion To: Garance A Drosihn Message-ID: <20040324210554.GQ35475@elvis.mu.org> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.1i cc: arch@FreeBSD.ORG Subject: Re: Adding `pgrep' and `pkill' to /usr/bin X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Mar 2004 21:05:55 -0000 Garance A Drosihn wrote: > I noticed the upcoming version of OpenBSD will add the commands > `pkill' and `pgrep', which they picked up from NetBSD. These > commands also exist in Solaris and Linux. Anyone mind if I add > them to FreeBSD? I'd just pick up the versions from NetBSD, and > make whatever changes are needed for them to work on FreeBSD. By all means go for it, please! :-) > (I actually had an idea of adding another option or two to `ps' > which would have given it abilities similar to `pgrep', but once > I noticed these I figured it would make more sense to add them) Yeah, especially if you consider the huge number of command line options `ps' already has. By the way, your work on `ps' to make it more in line with SUSv3 is greatly appreciated. Cheers, Maxime From owner-freebsd-arch@FreeBSD.ORG Wed Mar 24 13:09:33 2004 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2668316A4DF for ; Wed, 24 Mar 2004 13:09:33 -0800 (PST) Received: from mail5.speakeasy.net (mail5.speakeasy.net [216.254.0.205]) by mx1.FreeBSD.org (Postfix) with ESMTP id EAC1243D2F for ; Wed, 24 Mar 2004 13:09:32 -0800 (PST) (envelope-from john@baldwin.cx) Received: (qmail 23397 invoked from network); 24 Mar 2004 21:09:32 -0000 Received: from dsl027-160-063.atl1.dsl.speakeasy.net (HELO server.baldwin.cx) ([216.27.160.63]) (envelope-sender ) encrypted SMTP for ; 24 Mar 2004 21:09:32 -0000 Received: from 10.50.40.205 (gw1.twc.weather.com [216.133.140.1]) by server.baldwin.cx (8.12.10/8.12.10) with ESMTP id i2OL9HDF006757; Wed, 24 Mar 2004 16:09:18 -0500 (EST) (envelope-from john@baldwin.cx) From: John Baldwin To: arch@FreeBSD.org Date: Wed, 24 Mar 2004 16:11:03 -0500 User-Agent: KMail/1.6 References: In-Reply-To: MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <200403241611.03808.john@baldwin.cx> X-Spam-Checker-Version: SpamAssassin 2.63 (2004-01-11) on server.baldwin.cx cc: Garance A Drosihn Subject: Re: Adding `pgrep' and `pkill' to /usr/bin X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Mar 2004 21:09:33 -0000 On Wednesday 24 March 2004 03:21 pm, Garance A Drosihn wrote: > I noticed the upcoming version of OpenBSD will add the commands > `pkill' and `pgrep', which they picked up from NetBSD. These > commands also exist in Solaris and Linux. Anyone mind if I add > them to FreeBSD? I'd just pick up the versions from NetBSD, and > make whatever changes are needed for them to work on FreeBSD. > > (I actually had an idea of adding another option or two to `ps' > which would have given it abilities similar to `pgrep', but once > I noticed these I figured it would make more sense to add them) What do they do? -- John Baldwin <>< http://www.baldwin.cx/~john/ "Power Users Use the Power to Serve" = http://www.FreeBSD.org From owner-freebsd-arch@FreeBSD.ORG Wed Mar 24 13:11:45 2004 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9B9AD16A4CE for ; Wed, 24 Mar 2004 13:11:45 -0800 (PST) Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8C15D43D2F for ; Wed, 24 Mar 2004 13:11:45 -0800 (PST) (envelope-from mux@freebsd.org) Received: by elvis.mu.org (Postfix, from userid 1920) id 83D995C7D1; Wed, 24 Mar 2004 13:11:45 -0800 (PST) Date: Wed, 24 Mar 2004 22:11:45 +0100 From: Maxime Henrion To: arch@FreeBSD.org Message-ID: <20040324211145.GR35475@elvis.mu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.1i Subject: Re: Adding `pgrep' and `pkill' to /usr/bin X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Mar 2004 21:11:45 -0000 Garance A Drosihn wrote: > I noticed the upcoming version of OpenBSD will add the commands > `pkill' and `pgrep', which they picked up from NetBSD. These > commands also exist in Solaris and Linux. Anyone mind if I add > them to FreeBSD? I'd just pick up the versions from NetBSD, and > make whatever changes are needed for them to work on FreeBSD. By all means go for it, please! :-) > (I actually had an idea of adding another option or two to `ps' > which would have given it abilities similar to `pgrep', but once > I noticed these I figured it would make more sense to add them) Yeah, especially if you consider the huge number of command line options `ps' already has. By the way, your work on `ps' to make it more in line with SUSv3 is greatly appreciated. Cheers, Maxime From owner-freebsd-arch@FreeBSD.ORG Wed Mar 24 13:48:05 2004 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id DD13516A4DA; Wed, 24 Mar 2004 13:48:05 -0800 (PST) Received: from rwcrmhc11.comcast.net (rwcrmhc11.comcast.net [204.127.198.35]) by mx1.FreeBSD.org (Postfix) with ESMTP id B66BF43D31; Wed, 24 Mar 2004 13:48:05 -0800 (PST) (envelope-from albert@users.sf.net) Received: from c-65-34-189-253.se.client2.attbi.com ([65.34.189.253]) by comcast.net (rwcrmhc11) with SMTP id <2004032421480401300132fce>; Wed, 24 Mar 2004 21:48:05 +0000 From: Albert Cahalan To: freebsd-arch@freebsd.org, freebsd-standards@freebsd.org Content-Type: text/plain Organization: Message-Id: <1080165171.2232.910.camel@cube> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.4 Date: 24 Mar 2004 16:52:52 -0500 Content-Transfer-Encoding: 7bit cc: jilles+fbsd-standards@stack.nl cc: drosih@rpi.edu cc: fb-standards@psconsult.nl cc: des@des.no Subject: Re: PATCH for a more-POSIX `ps', and related adventures X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Mar 2004 21:48:06 -0000 Wow, the SUSv3 ps problem is finally being addressed. I hope that you'll be willing to discuss this with the Linux ps author (me) and maybe drag in a few other ps authors or maintainers. This is your chance to put an end to sysadmins everywhere cursing the historical ps differences; don't let NIH stop you. Perhaps there is a better place to discuss this. I'm not even sure my mail will get through to freebsd-arch and freebsd-standards. I'm a Comcast customer. :-/ I think you may be painting yourself into a corner if you commit the proposed changes. Please delay them at the very least. I'd be happy to work with somebody to write a spec for good behavior, kind of like SUSv3 plus BSD minus crufty bits. ------ comments on various proposed changes ------ > Now, after about 30 consecutive "as long as I was there" small > projects, I have an update which: > Changes -p so it accepts a list of process IDs, and -t so > it accepts a list of terminal names (instead of only > allowing a single value). Good. > Adds the -A option of SUSv3 (exactly the same as `-ax') You've added both "A" and "-A", right? That is, you're still not using the presense/absense of a "-" to provide for separate BSD and UNIX switch namespaces. You wouldn't be caving to the Linux world if you did; I swiped the idea from Digital UNIX. (a.k.a. Tru64 or OSF/1) It's also in AIX. > Adds the `-G gidlist' and '-g pgidlist' options of SYSv3. > (note that this replaced a null `-g' option...) Eh... must you? You're trashing compatibility with SunOS 4. Separate option namespaces solve this problem fairly well, especially if you let an environment variable force the parser into a pure traditional-bsd mode. > Adds a `-R ruserlist' option, which is the same as what > SYSv3 describes for `-u' (we already have a `-u'). > Amazingly, none of solaris, linux, or irix seem to > have any kind of `-R' option. Why should they? The -u option works fine. Linux is a bit special here, in that -u may be used simultaneously with the BSD-style u option: ps u -u root,albert > Adds a `-s sidlist' option, which is not in SUSv3, but > it is in solaris, linux, and irix -- and it's an > option I have personally wished for on occasion... What about the traditional BSD signals format? I know NetBSD broke this... you too? It is valuable when debugging. > Allows the user to specify any of these "selector options" > multiple times, and have it keep adding to that > list instead of replacing values for that list. Good. > Better parsing of options. Better error messages for > invalid values (IMO). I notice that you're jumping through hoops for "ps t" support. Getting rid of the getopt-based parser would greatly help you. > Fixes interactions between all these "selector options", > & our `-x' option (which is not mentioned in SUSv3). > For the selector options, I tried to meet the > description of: "If any are specified, the default > list shall be ignored and ps shall select the > processes represented by the inclusive OR of all > the selection-criteria options." Here you have a big ugly problem. Historical BSD selection acts by lifting filters which are enabled by default. UNIX selection acts by adding processes to a set that will be displayed, except that the default is a special case to avoid an empty display. I've worked hard to get reasonable results out of mixed BSD and UNIX selection, but that isn't so important. You could give an error in that case. There are essentially 4 cases that you have to deal with: 1. the default special case 2. BSD selection 'a' and 'x' disable filters 3. UNIX selection add processes to an empty set 4. BSD + UNIX selection error > Applies all these selection criteria *before* sorting > the list of processes we get from kvm_getprocs(), > and before using the list to compute the sizes of > the output fields. Cute, but memory-intensive and not friendly if your process table ever gets corrupted. It's not so nice on SMP either, since a grep or awk script ("ps ... | awk ...") can't start until ps is done. > Please look it over, try it out, and let me know if these options > seem to work the way you'd expect them to, or if I have messed > anything up. And please please PLEASE -- don't give me any more > ideas of something *else* I could do "as long as I'm there"! Oh. Sorry. > Great. So what should I do here? Add a -E' option for "effective > userid"? In fact, add both -E' and -R', and then we would have > two options that we could MFC into 4.x as well as 5.x (without any > conflict). At some later date (in 6.x?), we would have the option > of changing '-U' to match the standard definition. Amazingly, both > -E' and -R' seem to be unused on the other OS's I have here. If you split the namespace like AIX, Tru64, and Linux do, then you don't need these options. > I am not thrilled with that idea, but at the moment I can't think > of a better one. I *would* like to support matches of both real > and effective users. I guess we could add some other option > which would say "use the POSIX definitions of -u and -U", but that > doesn't exactly thrill me either. Why not? Tru64 uses the CMD_ENV environment variable to handle this. Linux does too, with PS_PERSONALITY taking priority. So, on either OS, you can do: ps -u root -U albert ps u CMD_ENV=sysv ps -u root -U albert CMD_ENV=bsd ps -u ps -u # this is an error on Tru64, and a warning on Linux > Old BSD ps used to exclude process group leaders > unless '-g' or '-x' were given. If you want it, I'll help somebody port the Linux ps. :-) I'll even consider a non-LGPL license if that changes things. Then you can enjoy near-perfect SunOS 4 goodness: PS_PERSONALITY=sunos4 ps -aux PS_PERSONALITY=sunos4 ps -auxg > Well, my follow-up message explained my reasoning for this in more > detail, but your logic seems pretty reasonable too. If I do this, > I'll add a -X option which would "turn off -x", so to speak. There > are times where I don't want to see the extra processes. A -X' > option does not seem to conflict with solaris, aix, or irix. Linux > does have a -X, but it's for "old Linux i386 register format", and I > think we can safely assume we would never implement that, and that > it is also not likely to become a "standard" option... The X format is not really i386-specific. The column headers sure look like it, but the ESP and EIP columns are really just the stack and instruction pointers. They work fine on PowerPC. You're not helping the suffering sysadmins if you add yet another incompatible feature. Portable scripts won't be able to use your proposed X option. From owner-freebsd-arch@FreeBSD.ORG Wed Mar 24 15:06:34 2004 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id DF81216A4CE for ; Wed, 24 Mar 2004 15:06:34 -0800 (PST) Received: from TRANG.nuxi.com (trang.nuxi.com [66.93.134.19]) by mx1.FreeBSD.org (Postfix) with ESMTP id BD04343D3F for ; Wed, 24 Mar 2004 15:06:34 -0800 (PST) (envelope-from obrien@NUXI.com) Received: from dragon.nuxi.com (obrien@localhost [127.0.0.1]) by TRANG.nuxi.com (8.12.11/8.12.10) with ESMTP id i2ON6XH3015175; Wed, 24 Mar 2004 15:06:33 -0800 (PST) (envelope-from obrien@dragon.nuxi.com) Received: (from obrien@localhost) by dragon.nuxi.com (8.12.11/8.12.11/Submit) id i2ON6XYN015174; Wed, 24 Mar 2004 15:06:33 -0800 (PST) (envelope-from obrien) Date: Wed, 24 Mar 2004 15:06:33 -0800 From: "David O'Brien" To: Garance A Drosihn Message-ID: <20040324230633.GB14111@dragon.nuxi.com> Mail-Followup-To: David O'Brien , Garance A Drosihn , arch@FreeBSD.ORG References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.1i X-Operating-System: FreeBSD 5.2-CURRENT Organization: The NUXI BSD Group X-Pgp-Rsa-Fingerprint: B7 4D 3E E9 11 39 5F A3 90 76 5D 69 58 D9 98 7A X-Pgp-Rsa-Keyid: 1024/34F9F9D5 cc: arch@FreeBSD.ORG Subject: Re: Adding `pgrep' and `pkill' to /usr/bin X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: arch@FreeBSD.ORG List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Mar 2004 23:06:35 -0000 On Wed, Mar 24, 2004 at 03:21:29PM -0500, Garance A Drosihn wrote: > I noticed the upcoming version of OpenBSD will add the commands > `pkill' and `pgrep', which they picked up from NetBSD. These > commands also exist in Solaris and Linux. Anyone mind if I add > them to FreeBSD? I'd just pick up the versions from NetBSD, and > make whatever changes are needed for them to work on FreeBSD. Yes, please do. -- -- David (obrien@FreeBSD.org) From owner-freebsd-arch@FreeBSD.ORG Wed Mar 24 15:25:12 2004 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8333316A4CE for ; Wed, 24 Mar 2004 15:25:12 -0800 (PST) Received: from smtp3.server.rpi.edu (smtp3.server.rpi.edu [128.113.2.3]) by mx1.FreeBSD.org (Postfix) with ESMTP id 238C143D31 for ; Wed, 24 Mar 2004 15:25:12 -0800 (PST) (envelope-from drosih@rpi.edu) Received: from [128.113.24.47] (gilead.netel.rpi.edu [128.113.24.47]) by smtp3.server.rpi.edu (8.12.8/8.12.8) with ESMTP id i2ONP8LP027994; Wed, 24 Mar 2004 18:25:08 -0500 Mime-Version: 1.0 X-Sender: drosih@mail.rpi.edu Message-Id: In-Reply-To: <200403241611.03808.john@baldwin.cx> References: <200403241611.03808.john@baldwin.cx> Date: Wed, 24 Mar 2004 18:25:07 -0500 To: John Baldwin , arch@FreeBSD.org From: Garance A Drosihn Content-Type: text/plain; charset="us-ascii" ; format="flowed" X-Scanned-By: CanIt (www . canit . ca) Subject: Re: Adding `pgrep' and `pkill' to /usr/bin X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Mar 2004 23:25:12 -0000 At 4:11 PM -0500 3/24/04, John Baldwin wrote: >On Wednesday 24 March 2004, Garance A Drosihn wrote: > > I noticed the upcoming version of OpenBSD will add the commands >> `pkill' and `pgrep', which they picked up from NetBSD. These >> commands also exist in Solaris and Linux. Anyone mind if I add >> them to FreeBSD? I'd just pick up the versions from NetBSD, and > > make whatever changes are needed for them to work on FreeBSD. > >What do they do? Oh. Yeah, it might help if I said something about that... The short answer: The `pgrep' command searches the process table on the running system and prints the process IDs of all processes that match the criteria given on the command line. Criteria includes matching against the process-name, or matching against the full-argument list of the processes. The `pkill' command searches the process table on the running system and signals all processes that match the criteria given on the command line. Note that a running `pgrep' or `pkill' process will never consider itself nor system processes (kernel threads) as a potential match. The more complete answer: http://www.openbsd.org/cgi-bin/man.cgi?query=pkill&sektion=1 -- Garance Alistair Drosehn = gad@gilead.netel.rpi.edu Senior Systems Programmer or gad@freebsd.org Rensselaer Polytechnic Institute or drosih@rpi.edu From owner-freebsd-arch@FreeBSD.ORG Wed Mar 24 15:47:57 2004 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id AB02716A4CE for ; Wed, 24 Mar 2004 15:47:57 -0800 (PST) Received: from rwcrmhc11.comcast.net (rwcrmhc11.comcast.net [204.127.198.35]) by mx1.FreeBSD.org (Postfix) with ESMTP id 86B0D43D31 for ; Wed, 24 Mar 2004 15:47:56 -0800 (PST) (envelope-from julian@elischer.org) Received: from interjet.elischer.org ([24.7.73.28]) by comcast.net (rwcrmhc11) with ESMTP id <200403242347560130013oqie>; Wed, 24 Mar 2004 23:47:56 +0000 Received: from localhost (localhost.elischer.org [127.0.0.1]) by InterJet.elischer.org (8.9.1a/8.9.1) with ESMTP id PAA67383; Wed, 24 Mar 2004 15:51:23 -0800 (PST) Date: Wed, 24 Mar 2004 15:51:22 -0800 (PST) From: Julian Elischer To: Garance A Drosihn In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: John Baldwin cc: arch@FreeBSD.org Subject: Re: Adding `pgrep' and `pkill' to /usr/bin X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Mar 2004 23:47:57 -0000 On Wed, 24 Mar 2004, Garance A Drosihn wrote: > At 4:11 PM -0500 3/24/04, John Baldwin wrote: > >On Wednesday 24 March 2004, Garance A Drosihn wrote: > > > I noticed the upcoming version of OpenBSD will add the commands > >> `pkill' and `pgrep', which they picked up from NetBSD. These > >> commands also exist in Solaris and Linux. Anyone mind if I add > >> them to FreeBSD? I'd just pick up the versions from NetBSD, and > > > make whatever changes are needed for them to work on FreeBSD. > > > >What do they do? > > Oh. Yeah, it might help if I said something about that... > > The short answer: > > The `pgrep' command searches the process table on the running system > and prints the process IDs of all processes that match the criteria > given on the command line. Criteria includes matching against the > process-name, or matching against the full-argument list of the > processes. > > The `pkill' command searches the process table on the running > system and signals all processes that match the criteria given on > the command line. > > Note that a running `pgrep' or `pkill' process will never consider > itself nor system processes (kernel threads) as a potential match. so pkill is like killall but miore flexible? how about you make killall a special case of pkill so we don't have the duplication.. > > The more complete answer: > http://www.openbsd.org/cgi-bin/man.cgi?query=pkill&sektion=1 > > -- > Garance Alistair Drosehn = gad@gilead.netel.rpi.edu > Senior Systems Programmer or gad@freebsd.org > Rensselaer Polytechnic Institute or drosih@rpi.edu > _______________________________________________ > freebsd-arch@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-arch > To unsubscribe, send any mail to "freebsd-arch-unsubscribe@freebsd.org" > From owner-freebsd-arch@FreeBSD.ORG Wed Mar 24 15:51:22 2004 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 880A016A4CE for ; Wed, 24 Mar 2004 15:51:22 -0800 (PST) Received: from darkness.comp.waw.pl (unknown [195.117.238.236]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3484443D3F for ; Wed, 24 Mar 2004 15:51:22 -0800 (PST) (envelope-from pjd@darkness.comp.waw.pl) Received: by darkness.comp.waw.pl (Postfix, from userid 1009) id 782BAACBCB; Thu, 25 Mar 2004 00:51:20 +0100 (CET) Date: Thu, 25 Mar 2004 00:51:20 +0100 From: Pawel Jakub Dawidek To: freebsd-arch@freebsd.org Message-ID: <20040324235120.GU8930@darkness.comp.waw.pl> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="nNLEAEjXOhgjywrq" Content-Disposition: inline User-Agent: Mutt/1.4.2i X-PGP-Key-URL: http://people.freebsd.org/~pjd/pjd.asc X-OS: FreeBSD 5.2.1-RC2 i386 Subject: SUIDDIR -> security.bsd.suiddir_enable. X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Mar 2004 23:51:22 -0000 --nNLEAEjXOhgjywrq Content-Type: text/plain; charset=iso-8859-2 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi. Any objection on such exchange? In p4 pjd_suiddir branch I've a code that replace SUIDDIR kernel option with sysctl security.bsd.suiddir_enable sysctl with is turned off by default. SUIDDIR option is not removed, but it means now: turn on suiddir functionality by default. For those without p4 knowledge: http://people.freebsd.org/~pjd/patches/suiddir_enable.patch This stuff was not yet tested, I don't even know if this compiles, this is only a proof-of-concept. I'm not also sure if security.bsd.* is the right place, maybe vfs.* is better? --=20 Pawel Jakub Dawidek http://www.FreeBSD.org pjd@FreeBSD.org http://garage.freebsd.pl FreeBSD committer Am I Evil? Yes, I Am! --nNLEAEjXOhgjywrq Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (FreeBSD) iD8DBQFAYh74ForvXbEpPzQRAkrBAKDCKetDCWI0J4P4EId3zhHHomsTCACfdnrB hCvGpS5+dtiX98CJlOoTScc= =RjDi -----END PGP SIGNATURE----- --nNLEAEjXOhgjywrq-- From owner-freebsd-arch@FreeBSD.ORG Wed Mar 24 16:32:22 2004 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C155E16A4CE for ; Wed, 24 Mar 2004 16:32:22 -0800 (PST) Received: from smtp2.server.rpi.edu (smtp2.server.rpi.edu [128.113.2.2]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6A2BD43D49 for ; Wed, 24 Mar 2004 16:32:22 -0800 (PST) (envelope-from drosih@rpi.edu) Received: from [128.113.24.47] (gilead.netel.rpi.edu [128.113.24.47]) by smtp2.server.rpi.edu (8.12.8/8.12.8) with ESMTP id i2P0VnEw017897; Wed, 24 Mar 2004 19:31:49 -0500 Mime-Version: 1.0 X-Sender: drosih@mail.rpi.edu Message-Id: In-Reply-To: References: Date: Wed, 24 Mar 2004 19:31:48 -0500 To: Julian Elischer From: Garance A Drosihn Content-Type: text/plain; charset="us-ascii" ; format="flowed" X-Scanned-By: CanIt (www . canit . ca) cc: arch@FreeBSD.org Subject: Re: Adding `pgrep' and `pkill' to /usr/bin X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Mar 2004 00:32:22 -0000 At 3:51 PM -0800 3/24/04, Julian Elischer wrote: >On Wed, 24 Mar 2004, Garance A Drosihn wrote: > > > The `pkill' command searches the process table on the running > > system and signals all processes that match the criteria given > > on the command line. > >so pkill is like killall but more flexible? > >how about you make killall a special case of pkill so we don't >have the duplication.. Well, at first I'll just add it and see what it takes to get it working, but then I'll see about collapsing killall into a special-case of pkill. Sounds like a good idea. -- Garance Alistair Drosehn = gad@gilead.netel.rpi.edu Senior Systems Programmer or gad@freebsd.org Rensselaer Polytechnic Institute or drosih@rpi.edu From owner-freebsd-arch@FreeBSD.ORG Wed Mar 24 17:37:21 2004 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id CC26A16A4CE for ; Wed, 24 Mar 2004 17:37:21 -0800 (PST) Received: from ns1.xcllnt.net (209-128-86-226.BAYAREA.NET [209.128.86.226]) by mx1.FreeBSD.org (Postfix) with ESMTP id 86A3E43D49 for ; Wed, 24 Mar 2004 17:37:21 -0800 (PST) (envelope-from marcel@xcllnt.net) Received: from ns1.xcllnt.net (localhost [127.0.0.1]) by ns1.xcllnt.net (8.12.11/8.12.11) with ESMTP id i2P1bL57001201 for ; Wed, 24 Mar 2004 17:37:21 -0800 (PST) (envelope-from marcel@ns1.xcllnt.net) Received: (from marcel@localhost) by ns1.xcllnt.net (8.12.11/8.12.11/Submit) id i2P1bLQL001200 for arch@FreeBSD.org; Wed, 24 Mar 2004 17:37:21 -0800 (PST) (envelope-from marcel) Date: Wed, 24 Mar 2004 17:37:21 -0800 From: Marcel Moolenaar To: arch@FreeBSD.org Message-ID: <20040325013721.GA1103@ns1.xcllnt.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.5.1i Subject: Having thread->td_frame point to the most recent frame X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Mar 2004 01:37:21 -0000 Gang, I'm revamping kernel debugging support and thread awareness is one of the features that I'm going to add (at least for remote gdb, but likely to ddb as well). It's the thread awareness that causes me to raise the following issue: When we enter the kernel, we set curthread->td_frame to the current frame only when we came from user mode. This obviously to make sure the frame remains valid across nested interrupts/traps. For debugging you really want the latest (most recent) frame so that when you switch to a particular thread to produce a backtrace, you have the right frame (=context). So naturally, you really want to have thread->td_frame point to the frame that corresponds to the current kernel entry, whether from userland or not. One way to deal with this is to link frames so that the frame of the most recent entry is pointed to by thread->td_frame and the frame of the previous kernel entry is pointed to by thread->td_frame->tf_prev (or NULL when there's no previous frame -- or whatever). Obviously, we need to restore the previous frame when we exit the kernel. Thus, on entry into the kernel we do something like: framep->tf_prev = curthread->td_frame; curthread->td_frame = framep; On exit from the kernel we roll back like: framep = curthread->td_frame; curthread->td_frame = framep->tf_prev Q1: Are there any corner cases I'm missing or would such a scheme work? Q2: What's impacted if and when a new field to struct trapframe is added? Q3: Are there better alternatives for solving the issue? -- Marcel Moolenaar USPA: A-39004 marcel@xcllnt.net From owner-freebsd-arch@FreeBSD.ORG Wed Mar 24 22:53:33 2004 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3490F16A4CE for ; Wed, 24 Mar 2004 22:53:33 -0800 (PST) Received: from mx.nsu.ru (mx.nsu.ru [212.192.164.5]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2353943D1D for ; Wed, 24 Mar 2004 22:53:32 -0800 (PST) (envelope-from danfe@regency.nsu.ru) Received: from regency.nsu.ru ([193.124.210.26]) by mx.nsu.ru with esmtp (Exim 4.30) id 1B6Ol5-0004rs-5W; Thu, 25 Mar 2004 12:54:31 +0600 Received: from regency.nsu.ru (localhost [127.0.0.1]) by regency.nsu.ru (8.12.10/8.12.10) with ESMTP id i2P6rFxm079115; Thu, 25 Mar 2004 12:53:15 +0600 (NOVT) (envelope-from danfe@regency.nsu.ru) Received: (from danfe@localhost) by regency.nsu.ru (8.12.10/8.12.10/Submit) id i2P6rEvr079091; Thu, 25 Mar 2004 12:53:14 +0600 (NOVT) (envelope-from danfe) Date: Thu, 25 Mar 2004 12:53:14 +0600 From: Alexey Dokuchaev To: Julian Elischer Message-ID: <20040325065314.GA64827@regency.nsu.ru> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.1i cc: John Baldwin cc: arch@freebsd.org cc: Garance A Drosihn Subject: Re: Adding `pgrep' and `pkill' to /usr/bin X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Mar 2004 06:53:33 -0000 On Wed, Mar 24, 2004 at 03:51:22PM -0800, Julian Elischer wrote: > > > On Wed, 24 Mar 2004, Garance A Drosihn wrote: > > > At 4:11 PM -0500 3/24/04, John Baldwin wrote: > > >On Wednesday 24 March 2004, Garance A Drosihn wrote: > > > > I noticed the upcoming version of OpenBSD will add the commands > > >> `pkill' and `pgrep', which they picked up from NetBSD. These > > >> commands also exist in Solaris and Linux. Anyone mind if I add > > >> them to FreeBSD? I'd just pick up the versions from NetBSD, and > > > > make whatever changes are needed for them to work on FreeBSD. > > > > > >What do they do? > > > > Oh. Yeah, it might help if I said something about that... > > > > The short answer: > > > > The `pgrep' command searches the process table on the running system > > and prints the process IDs of all processes that match the criteria > > given on the command line. Criteria includes matching against the > > process-name, or matching against the full-argument list of the > > processes. I've been using alias "psg = ps auxlww | grep" for pretty much the same purpose. Is there some very strong reasoning behind bringing in some new facility? > > > > The `pkill' command searches the process table on the running > > system and signals all processes that match the criteria given on > > the command line. > > > > Note that a running `pgrep' or `pkill' process will never consider > > itself nor system processes (kernel threads) as a potential match. > > > so pkill is like killall but miore flexible? > > how about you make killall a special case of pkill so we don't have the > duplication.. Seconded here. Frankly, I tend to go against populating base system with utilities of not so strict orthogonality. ./danfe From owner-freebsd-arch@FreeBSD.ORG Wed Mar 24 23:01:32 2004 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C136016A4CE for ; Wed, 24 Mar 2004 23:01:32 -0800 (PST) Received: from VARK.homeunix.com (adsl-69-104-80-69.dsl.pltn13.pacbell.net [69.104.80.69]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9482943D53 for ; Wed, 24 Mar 2004 23:01:32 -0800 (PST) (envelope-from das@FreeBSD.ORG) Received: from VARK.homeunix.com (localhost [127.0.0.1]) by VARK.homeunix.com (8.12.11/8.12.10) with ESMTP id i2P71K4r067625; Wed, 24 Mar 2004 23:01:20 -0800 (PST) (envelope-from das@FreeBSD.ORG) Received: (from das@localhost) by VARK.homeunix.com (8.12.11/8.12.10/Submit) id i2P71KbQ067624; Wed, 24 Mar 2004 23:01:20 -0800 (PST) (envelope-from das@FreeBSD.ORG) Date: Wed, 24 Mar 2004 23:01:20 -0800 From: David Schultz To: Garance A Drosihn Message-ID: <20040325070120.GA67497@VARK.homeunix.com> Mail-Followup-To: Garance A Drosihn , arch@FreeBSD.ORG References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: cc: arch@FreeBSD.ORG Subject: Re: Adding `pgrep' and `pkill' to /usr/bin X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Mar 2004 07:01:32 -0000 On Wed, Mar 24, 2004, Garance A Drosihn wrote: > I noticed the upcoming version of OpenBSD will add the commands > `pkill' and `pgrep', which they picked up from NetBSD. These > commands also exist in Solaris and Linux. Anyone mind if I add > them to FreeBSD? I'd just pick up the versions from NetBSD, and > make whatever changes are needed for them to work on FreeBSD. > > (I actually had an idea of adding another option or two to `ps' > which would have given it abilities similar to `pgrep', but once > I noticed these I figured it would make more sense to add them) I think it would be *great* to import any and all of the Solaris proc tools into FreeBSD. I tend to think of these utilities as ps(1), fstat(1), and friends done the proper Unix way (with lots of simple tools that can be combined for powerful effect.) For those who haven't seen the rest of the tools, take a look at: http://www.freebsd.org/cgi/man.cgi?query=proc&manpath=SunOS+5.9 From owner-freebsd-arch@FreeBSD.ORG Wed Mar 24 23:37:41 2004 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4717716A4CE for ; Wed, 24 Mar 2004 23:37:41 -0800 (PST) Received: from arginine.spc.org (arginine.spc.org [195.206.69.236]) by mx1.FreeBSD.org (Postfix) with ESMTP id E617043D2F for ; Wed, 24 Mar 2004 23:37:40 -0800 (PST) (envelope-from bms@spc.org) Received: from localhost (localhost [127.0.0.1]) by arginine.spc.org (Postfix) with ESMTP id 3A70C65218; Thu, 25 Mar 2004 07:37:40 +0000 (GMT) Received: from arginine.spc.org ([127.0.0.1]) by localhost (arginine.spc.org [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 65909-04-5; Thu, 25 Mar 2004 07:37:39 +0000 (GMT) Received: from empiric.dek.spc.org (82-147-17-88.dsl.uk.rapidplay.com [82.147.17.88]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by arginine.spc.org (Postfix) with ESMTP id 8E8ED65213; Thu, 25 Mar 2004 07:37:37 +0000 (GMT) Received: by empiric.dek.spc.org (Postfix, from userid 1001) id E23EF6108; Thu, 25 Mar 2004 07:37:36 +0000 (GMT) Date: Thu, 25 Mar 2004 07:37:36 +0000 From: Bruce M Simpson To: Garance A Drosihn , arch@FreeBSD.ORG Message-ID: <20040325073736.GB76908@empiric.dek.spc.org> References: <20040325070120.GA67497@VARK.homeunix.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20040325070120.GA67497@VARK.homeunix.com> Subject: Re: Adding `pgrep' and `pkill' to /usr/bin X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Mar 2004 07:37:41 -0000 On Wed, Mar 24, 2004 at 11:01:20PM -0800, David Schultz wrote: > I think it would be *great* to import any and all of the Solaris > proc tools into FreeBSD. I tend to think of these utilities as > ps(1), fstat(1), and friends done the proper Unix way (with lots > of simple tools that can be combined for powerful effect.) I particularly like the tools such as pstack, etc which are well referenced in 'Solaris Internals'. BMS From owner-freebsd-arch@FreeBSD.ORG Thu Mar 25 00:48:53 2004 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id AA7EF16A4CE for ; Thu, 25 Mar 2004 00:48:53 -0800 (PST) Received: from mail009.syd.optusnet.com.au (mail009.syd.optusnet.com.au [211.29.132.64]) by mx1.FreeBSD.org (Postfix) with ESMTP id B885743D48 for ; Thu, 25 Mar 2004 00:48:52 -0800 (PST) (envelope-from peterjeremy@optushome.com.au) Received: from server.vk2pj.dyndns.org (c211-30-75-229.belrs2.nsw.optusnet.com.au [211.30.75.229]) i2P8mc127705; Thu, 25 Mar 2004 19:48:38 +1100 Received: from server.vk2pj.dyndns.org (localhost.vk2pj.dyndns.org [127.0.0.1])i2P8mbNa057448; Thu, 25 Mar 2004 19:48:37 +1100 (EST) (envelope-from peter@server.vk2pj.dyndns.org) Received: (from peter@localhost) by server.vk2pj.dyndns.org (8.12.10/8.12.10/Submit) id i2P8mbUq057447; Thu, 25 Mar 2004 19:48:37 +1100 (EST) (envelope-from peter) Date: Thu, 25 Mar 2004 19:48:37 +1100 From: Peter Jeremy To: Alexey Dokuchaev Message-ID: <20040325084837.GA57169@server.vk2pj.dyndns.org> References: <20040325065314.GA64827@regency.nsu.ru> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20040325065314.GA64827@regency.nsu.ru> User-Agent: Mutt/1.4.2.1i cc: arch@freebsd.org Subject: Re: Adding `pgrep' and `pkill' to /usr/bin X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Mar 2004 08:48:53 -0000 On Thu, Mar 25, 2004 at 12:53:14PM +0600, Alexey Dokuchaev wrote: >On Wed, Mar 24, 2004 at 03:51:22PM -0800, Julian Elischer wrote: >> >> >> On Wed, 24 Mar 2004, Garance A Drosihn wrote: >> > The `pgrep' command searches the process table on the running system >> > and prints the process IDs of all processes that match the criteria >> > given on the command line. Criteria includes matching against the >> > process-name, or matching against the full-argument list of the >> > processes. > >I've been using alias "psg = ps auxlww | grep" for pretty much the same >purpose. Is there some very strong reasoning behind bringing in some >new facility? grep'ing the output from ps generally requires tricks to avoid the grep process matching. pgrep avoids this and allows better control over what is being matched. At another level, Unices tend to differ most when it comes to administration utilities. This requires sysadmins to mentally change gears as they move between xterm (should I type "ps -ef" or "ps -ax" into this terminal?). Adding (useful) sysadmin utilities from one of the more common Unices would seem to be A Good Thing. Peter From owner-freebsd-arch@FreeBSD.ORG Thu Mar 25 02:09:43 2004 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D5FC016A4CE for ; Thu, 25 Mar 2004 02:09:43 -0800 (PST) Received: from arginine.spc.org (arginine.spc.org [195.206.69.236]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9FC7243D48 for ; Thu, 25 Mar 2004 02:09:43 -0800 (PST) (envelope-from bms@spc.org) Received: from localhost (localhost [127.0.0.1]) by arginine.spc.org (Postfix) with ESMTP id B2388653F8; Thu, 25 Mar 2004 10:09:42 +0000 (GMT) Received: from arginine.spc.org ([127.0.0.1]) by localhost (arginine.spc.org [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 67091-06-3; Thu, 25 Mar 2004 10:09:42 +0000 (GMT) Received: from empiric.dek.spc.org (82-147-17-88.dsl.uk.rapidplay.com [82.147.17.88]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by arginine.spc.org (Postfix) with ESMTP id CC4DB653AE; Thu, 25 Mar 2004 10:09:41 +0000 (GMT) Received: by empiric.dek.spc.org (Postfix, from userid 1001) id 215B46108; Thu, 25 Mar 2004 10:09:41 +0000 (GMT) Date: Thu, 25 Mar 2004 10:09:41 +0000 From: Bruce M Simpson To: Peter Jeremy Message-ID: <20040325100941.GI76908@empiric.dek.spc.org> References: <20040325065314.GA64827@regency.nsu.ru> <20040325084837.GA57169@server.vk2pj.dyndns.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20040325084837.GA57169@server.vk2pj.dyndns.org> cc: Alexey Dokuchaev cc: arch@freebsd.org Subject: Re: Adding `pgrep' and `pkill' to /usr/bin X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Mar 2004 10:09:44 -0000 On Thu, Mar 25, 2004 at 07:48:37PM +1100, Peter Jeremy wrote: > grep'ing the output from ps generally requires tricks to avoid the grep > process matching. pgrep avoids this and allows better control over what > is being matched. I like this. Please commit soon. BMS From owner-freebsd-arch@FreeBSD.ORG Thu Mar 25 02:56:15 2004 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4986716A4CE for ; Thu, 25 Mar 2004 02:56:15 -0800 (PST) Received: from mailout1.pacific.net.au (mailout1.pacific.net.au [61.8.0.84]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8EBBC43D45 for ; Thu, 25 Mar 2004 02:56:14 -0800 (PST) (envelope-from bde@zeta.org.au) Received: from mailproxy2.pacific.net.au (mailproxy2.pacific.net.au [61.8.0.87])i2PAuD4u028907; Thu, 25 Mar 2004 21:56:13 +1100 Received: from gamplex.bde.org (katana.zip.com.au [61.8.7.246]) i2PAuBsg014439; Thu, 25 Mar 2004 21:56:12 +1100 Date: Thu, 25 Mar 2004 21:56:10 +1100 (EST) From: Bruce Evans X-X-Sender: bde@gamplex.bde.org To: Garance A Drosihn In-Reply-To: Message-ID: <20040325214705.T36592@gamplex.bde.org> References: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: arch@freebsd.org Subject: Re: Adding `pgrep' and `pkill' to /usr/bin X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Mar 2004 10:56:15 -0000 On Wed, 24 Mar 2004, Garance A Drosihn wrote: > I noticed the upcoming version of OpenBSD will add the commands > `pkill' and `pgrep', which they picked up from NetBSD. These > commands also exist in Solaris and Linux. Anyone mind if I add > them to FreeBSD? I'd just pick up the versions from NetBSD, and > make whatever changes are needed for them to work on FreeBSD. What's wrong with the pkill port? It has already been picked from NetBSD, and whatever changes are needed for it to work on FreeBSD have already been made (and pgrep is part of pkill). If you add this to /usr/bin instead of leaving it in ports, don't forget to do the same for doscmd and some other things that are only in ports. Bruce From owner-freebsd-arch@FreeBSD.ORG Thu Mar 25 04:06:42 2004 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id B019F16A4CE; Thu, 25 Mar 2004 04:06:42 -0800 (PST) Received: from mailout2.pacific.net.au (mailout2.pacific.net.au [61.8.0.85]) by mx1.FreeBSD.org (Postfix) with ESMTP id F37CE43D2D; Thu, 25 Mar 2004 04:06:41 -0800 (PST) (envelope-from bde@zeta.org.au) Received: from mailproxy1.pacific.net.au (mailproxy1.pacific.net.au [61.8.0.86])i2PC6e5v018161; Thu, 25 Mar 2004 23:06:40 +1100 Received: from gamplex.bde.org (katana.zip.com.au [61.8.7.246]) i2PC6cGQ022855; Thu, 25 Mar 2004 23:06:39 +1100 Date: Thu, 25 Mar 2004 23:06:38 +1100 (EST) From: Bruce Evans X-X-Sender: bde@gamplex.bde.org To: Pawel Jakub Dawidek In-Reply-To: <20040324235120.GU8930@darkness.comp.waw.pl> Message-ID: <20040325225342.D36800@gamplex.bde.org> References: <20040324235120.GU8930@darkness.comp.waw.pl> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: freebsd-arch@freebsd.org Subject: Re: SUIDDIR -> security.bsd.suiddir_enable. X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Mar 2004 12:06:42 -0000 On Thu, 25 Mar 2004, Pawel Jakub Dawidek wrote: > Any objection on such exchange? > > In p4 pjd_suiddir branch I've a code that replace SUIDDIR kernel option > with sysctl security.bsd.suiddir_enable sysctl with is turned off by > default. SUIDDIR option is not removed, but it means now: turn on suiddir > functionality by default. Using SUIDDIR is controlled by the MNT_SUIDDIR mount option, so there shouldn't be another knob to control it. If there is a security problem using MNT_SUIDDIR, then MNT_SUIDDIR should be disallowed up front so that that all the places that implement SUIDDIR don't have to test both knobs. > I'm not also sure if security.bsd.* is the right place, maybe vfs.* > is better? /dev/null is better :-). Bruce From owner-freebsd-arch@FreeBSD.ORG Thu Mar 25 04:35:56 2004 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id B73C116A4CE for ; Thu, 25 Mar 2004 04:35:56 -0800 (PST) Received: from darkness.comp.waw.pl (unknown [195.117.238.236]) by mx1.FreeBSD.org (Postfix) with ESMTP id D203E43D2F for ; Thu, 25 Mar 2004 04:35:55 -0800 (PST) (envelope-from pjd@darkness.comp.waw.pl) Received: by darkness.comp.waw.pl (Postfix, from userid 1009) id 837F2ACAEE; Thu, 25 Mar 2004 13:35:54 +0100 (CET) Date: Thu, 25 Mar 2004 13:35:54 +0100 From: Pawel Jakub Dawidek To: Bruce Evans Message-ID: <20040325123554.GZ8930@darkness.comp.waw.pl> References: <20040324235120.GU8930@darkness.comp.waw.pl> <20040325225342.D36800@gamplex.bde.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="6CpFlezhW0MxRmxw" Content-Disposition: inline In-Reply-To: <20040325225342.D36800@gamplex.bde.org> User-Agent: Mutt/1.4.2i X-PGP-Key-URL: http://people.freebsd.org/~pjd/pjd.asc X-OS: FreeBSD 5.2.1-RC2 i386 cc: freebsd-arch@freebsd.org Subject: Re: SUIDDIR -> security.bsd.suiddir_enable. X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Mar 2004 12:35:56 -0000 --6CpFlezhW0MxRmxw Content-Type: text/plain; charset=iso-8859-2 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Mar 25, 2004 at 11:06:38PM +1100, Bruce Evans wrote: +> On Thu, 25 Mar 2004, Pawel Jakub Dawidek wrote: +>=20 +> > Any objection on such exchange? +> > +> > In p4 pjd_suiddir branch I've a code that replace SUIDDIR kernel option +> > with sysctl security.bsd.suiddir_enable sysctl with is turned off by +> > default. SUIDDIR option is not removed, but it means now: turn on suid= dir +> > functionality by default. +>=20 +> Using SUIDDIR is controlled by the MNT_SUIDDIR mount option, so there +> shouldn't be another knob to control it. If there is a security problem +> using MNT_SUIDDIR, then MNT_SUIDDIR should be disallowed up front so +> that that all the places that implement SUIDDIR don't have to test +> both knobs. First of all this adds 0 overhead. And I think there is a need for additional level of security for such functionality, but I see no reason to force people to recompile kernel. --=20 Pawel Jakub Dawidek http://www.FreeBSD.org pjd@FreeBSD.org http://garage.freebsd.pl FreeBSD committer Am I Evil? Yes, I Am! --6CpFlezhW0MxRmxw Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (FreeBSD) iD8DBQFAYtIqForvXbEpPzQRAtMlAKDccfUxz8WfXLXZ5pbOgmyvDe8z2QCg99LU hVK7fpNLCUsiRpS/sRUVh9w= =PToh -----END PGP SIGNATURE----- --6CpFlezhW0MxRmxw-- From owner-freebsd-arch@FreeBSD.ORG Thu Mar 25 05:50:13 2004 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9053416A4D0; Thu, 25 Mar 2004 05:50:13 -0800 (PST) Received: from mailout1.pacific.net.au (mailout1.pacific.net.au [61.8.0.84]) by mx1.FreeBSD.org (Postfix) with ESMTP id C0DD643D3F; Thu, 25 Mar 2004 05:50:12 -0800 (PST) (envelope-from bde@zeta.org.au) Received: from mailproxy1.pacific.net.au (mailproxy1.pacific.net.au [61.8.0.86])i2PDoB4u018756; Fri, 26 Mar 2004 00:50:11 +1100 Received: from gamplex.bde.org (katana.zip.com.au [61.8.7.246]) i2PDo9GQ007760; Fri, 26 Mar 2004 00:50:10 +1100 Date: Fri, 26 Mar 2004 00:50:09 +1100 (EST) From: Bruce Evans X-X-Sender: bde@gamplex.bde.org To: Pawel Jakub Dawidek In-Reply-To: <20040325123554.GZ8930@darkness.comp.waw.pl> Message-ID: <20040326000115.R37325@gamplex.bde.org> References: <20040324235120.GU8930@darkness.comp.waw.pl> <20040325123554.GZ8930@darkness.comp.waw.pl> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: freebsd-arch@FreeBSD.org Subject: Re: SUIDDIR -> security.bsd.suiddir_enable. X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Mar 2004 13:50:13 -0000 On Thu, 25 Mar 2004, Pawel Jakub Dawidek wrote: > On Thu, Mar 25, 2004 at 11:06:38PM +1100, Bruce Evans wrote: > +> On Thu, 25 Mar 2004, Pawel Jakub Dawidek wrote: > +> > +> > Any objection on such exchange? > +> > > +> > In p4 pjd_suiddir branch I've a code that replace SUIDDIR kernel option > +> > with sysctl security.bsd.suiddir_enable sysctl with is turned off by > +> > default. SUIDDIR option is not removed, but it means now: turn on suiddir > +> > functionality by default. > +> > +> Using SUIDDIR is controlled by the MNT_SUIDDIR mount option, so there > +> shouldn't be another knob to control it. If there is a security problem > +> using MNT_SUIDDIR, then MNT_SUIDDIR should be disallowed up front so > +> that that all the places that implement SUIDDIR don't have to test > +> both knobs. > > First of all this adds 0 overhead. Actually, all of it adds a small amount of overhead. First, making the SUIDDIR code non-optional requires a test of a variable to decide if the suiddir case is active. Second, the sysctl variable requires another test to decide if the suiddir case is active (this only in the path where the first test succeeds). The sysctl variable also gives the code a different ugly structure, basically from: % #ifdef SUIDDIR % /* XXX bogus indentation. */ % { % if ((dvp->v_mount->mnt_flag & MNT_SUIDDIR)) { % suiddir_case(); % } else { % nonsuiddircase(); % } % } % #else /* !SUIDDIR */ % nonsuiddircase(); % #endif /* SUIDDIR */ to: % if (suiddir_enable) { % if ((dvp->v_mount->mnt_flag & MNT_SUIDDIR)) { % suiddir_case(); % } else { % nonsuiddircase(); % } % } else { % nonsuiddircase(); % } (actually much uglier due to nested declarations, nested QUOTA ifdefs, and duplication of a large block of code for nonsuiddircase()). It should be written as: % if ((dvp->v_mount->mnt_flag & MNT_SUIDDIR)) { % suiddir_case(); % } else { % nonsuiddircase(); % } > And I think there is a need for additional level of security for such > functionality, but I see no reason to force people to recompile kernel. I now think there is no new security problem other than another way for root to make mistakes, because mounting with MNT_SUIDDIR doesn't do anything that can't be done by root using chown() and chmod(). There is an old security problem: unprivileged users are permitted to do MNT_SUIDDIR mounts if they are permitted to do mounts at all. Bruce From owner-freebsd-arch@FreeBSD.ORG Thu Mar 25 05:52:36 2004 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6ECE816A4CF; Thu, 25 Mar 2004 05:52:36 -0800 (PST) Received: from fledge.watson.org (fledge.watson.org [204.156.12.50]) by mx1.FreeBSD.org (Postfix) with ESMTP id 156EE43D31; Thu, 25 Mar 2004 05:52:36 -0800 (PST) (envelope-from robert@fledge.watson.org) Received: from fledge.watson.org (localhost [127.0.0.1]) by fledge.watson.org (8.12.10/8.12.10) with ESMTP id i2PDoOxC053135; Thu, 25 Mar 2004 08:50:24 -0500 (EST) (envelope-from robert@fledge.watson.org) Received: from localhost (robert@localhost)i2PDoJv0053130; Thu, 25 Mar 2004 08:50:19 -0500 (EST) (envelope-from robert@fledge.watson.org) Date: Thu, 25 Mar 2004 08:50:18 -0500 (EST) From: Robert Watson X-Sender: robert@fledge.watson.org To: Pawel Jakub Dawidek In-Reply-To: <20040325123554.GZ8930@darkness.comp.waw.pl> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: freebsd-arch@FreeBSD.org Subject: Re: SUIDDIR -> security.bsd.suiddir_enable. X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Mar 2004 13:52:36 -0000 On Thu, 25 Mar 2004, Pawel Jakub Dawidek wrote: > On Thu, Mar 25, 2004 at 11:06:38PM +1100, Bruce Evans wrote: > +> On Thu, 25 Mar 2004, Pawel Jakub Dawidek wrote: > +> > +> > Any objection on such exchange? > +> > > +> > In p4 pjd_suiddir branch I've a code that replace SUIDDIR kernel option > +> > with sysctl security.bsd.suiddir_enable sysctl with is turned off by > +> > default. SUIDDIR option is not removed, but it means now: turn on suiddir > +> > functionality by default. > +> > +> Using SUIDDIR is controlled by the MNT_SUIDDIR mount option, so there > +> shouldn't be another knob to control it. If there is a security problem > +> using MNT_SUIDDIR, then MNT_SUIDDIR should be disallowed up front so > +> that that all the places that implement SUIDDIR don't have to test > +> both knobs. > > First of all this adds 0 overhead. And I think there is a need for > additional level of security for such functionality, but I see no reason > to force people to recompile kernel. Actually, I think what Bruce is actually saying is that the MNT_SUIDDIR mount option should be sufficient without a sysctl, if we really think suiddir is safe to use, rather than offering a global disable off by default. So the question really becomes "do we want to use recompilation as a hurdle to discourage use of this feature"... Robert N M Watson FreeBSD Core Team, TrustedBSD Projects robert@fledge.watson.org Senior Research Scientist, McAfee Research From owner-freebsd-arch@FreeBSD.ORG Thu Mar 25 06:45:55 2004 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1BAE116A4CE; Thu, 25 Mar 2004 06:45:55 -0800 (PST) Received: from gw.celabo.org (gw.celabo.org [208.42.49.153]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9D76743D41; Thu, 25 Mar 2004 06:45:54 -0800 (PST) (envelope-from nectar@celabo.org) Received: from madman.celabo.org (madman.celabo.org [10.0.1.111]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "madman.celabo.org", Issuer "celabo.org CA" (verified OK)) by gw.celabo.org (Postfix) with ESMTP id 4C0EB5482B; Thu, 25 Mar 2004 08:45:54 -0600 (CST) Received: by madman.celabo.org (Postfix, from userid 1001) id CCF096D455; Thu, 25 Mar 2004 08:45:53 -0600 (CST) Date: Thu, 25 Mar 2004 08:45:53 -0600 From: "Jacques A. Vidrine" To: Pawel Jakub Dawidek Message-ID: <20040325144553.GA61830@madman.celabo.org> Mail-Followup-To: "Jacques A. Vidrine" , Pawel Jakub Dawidek , freebsd-arch@freebsd.org References: <20040324235120.GU8930@darkness.comp.waw.pl> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20040324235120.GU8930@darkness.comp.waw.pl> X-Url: http://www.celabo.org/ User-Agent: Mutt/1.5.6i cc: freebsd-arch@freebsd.org Subject: Re: SUIDDIR -> security.bsd.suiddir_enable. X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Mar 2004 14:45:55 -0000 On Thu, Mar 25, 2004 at 12:51:20AM +0100, Pawel Jakub Dawidek wrote: > Any objection on such exchange? I prefer it to remain a non-default compile-time option to discourage use. -- Jacques Vidrine / nectar@celabo.org / jvidrine@verio.net / nectar@freebsd.org From owner-freebsd-arch@FreeBSD.ORG Thu Mar 25 06:50:32 2004 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 49D9016A4CE; Thu, 25 Mar 2004 06:50:32 -0800 (PST) Received: from darkness.comp.waw.pl (unknown [195.117.238.236]) by mx1.FreeBSD.org (Postfix) with ESMTP id E1E4F43D1D; Thu, 25 Mar 2004 06:50:31 -0800 (PST) (envelope-from pjd@darkness.comp.waw.pl) Received: by darkness.comp.waw.pl (Postfix, from userid 1009) id E7738AC9B3; Thu, 25 Mar 2004 15:50:30 +0100 (CET) Date: Thu, 25 Mar 2004 15:50:30 +0100 From: Pawel Jakub Dawidek To: "Jacques A. Vidrine" , freebsd-arch@freebsd.org Message-ID: <20040325145030.GB8930@darkness.comp.waw.pl> References: <20040324235120.GU8930@darkness.comp.waw.pl> <20040325144553.GA61830@madman.celabo.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="TiGNc3ldf20CNpkJ" Content-Disposition: inline In-Reply-To: <20040325144553.GA61830@madman.celabo.org> User-Agent: Mutt/1.4.2i X-PGP-Key-URL: http://people.freebsd.org/~pjd/pjd.asc X-OS: FreeBSD 5.2.1-RC2 i386 Subject: Re: SUIDDIR -> security.bsd.suiddir_enable. X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Mar 2004 14:50:32 -0000 --TiGNc3ldf20CNpkJ Content-Type: text/plain; charset=iso-8859-2 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Mar 25, 2004 at 08:45:53AM -0600, Jacques A. Vidrine wrote: +> On Thu, Mar 25, 2004 at 12:51:20AM +0100, Pawel Jakub Dawidek wrote: +> > Any objection on such exchange? +>=20 +> I prefer it to remain a non-default compile-time option to discourage +> use. Ok. BTW. Should we disallow usage of MNT_SUIDDIR flag for usermounts? We don't do it now, I think. --=20 Pawel Jakub Dawidek http://www.FreeBSD.org pjd@FreeBSD.org http://garage.freebsd.pl FreeBSD committer Am I Evil? Yes, I Am! --TiGNc3ldf20CNpkJ Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (FreeBSD) iD8DBQFAYvG2ForvXbEpPzQRAuN5AJ4peEwGaSmPrXUYMCvbRZ53gjVP+wCgurlY cWjlXKGQoSCmpsuuUPq6p1I= =ZtOk -----END PGP SIGNATURE----- --TiGNc3ldf20CNpkJ-- From owner-freebsd-arch@FreeBSD.ORG Thu Mar 25 06:51:25 2004 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id EFA6916A4CE; Thu, 25 Mar 2004 06:51:25 -0800 (PST) Received: from gw.celabo.org (gw.celabo.org [208.42.49.153]) by mx1.FreeBSD.org (Postfix) with ESMTP id BA16943D49; Thu, 25 Mar 2004 06:51:25 -0800 (PST) (envelope-from nectar@celabo.org) Received: from madman.celabo.org (madman.celabo.org [10.0.1.111]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "madman.celabo.org", Issuer "celabo.org CA" (verified OK)) by gw.celabo.org (Postfix) with ESMTP id 632AD5485D; Thu, 25 Mar 2004 08:51:25 -0600 (CST) Received: by madman.celabo.org (Postfix, from userid 1001) id 03E636D455; Thu, 25 Mar 2004 08:51:24 -0600 (CST) Date: Thu, 25 Mar 2004 08:51:24 -0600 From: "Jacques A. Vidrine" To: Garance A Drosihn Message-ID: <20040325145124.GB61830@madman.celabo.org> Mail-Followup-To: "Jacques A. Vidrine" , Garance A Drosihn , Jilles Tjoelker , arch@freebsd.org, freebsd-standards@freebsd.org References: <20040322155901.GA17891@stack.nl> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Url: http://www.celabo.org/ User-Agent: Mutt/1.5.6i cc: arch@freebsd.org cc: Jilles Tjoelker cc: freebsd-standards@freebsd.org Subject: Re: PATCH for a more-POSIX `ps', and related adventures X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Mar 2004 14:51:26 -0000 On Mon, Mar 22, 2004 at 01:18:22PM -0500, Garance A Drosihn wrote: > Great. So what should I do here? I dunno. Add a completely POSIX compliant ps command into /usr/posix ? Or replace /usr/bin/ps with a completely POSIX compliant ps and move our traditional one to /usr/ucb? :-) Seriously, we should give some hard thought into how to provide/migrate to a POSIX compatible utilities environment. It's been discussed on the lists before, but I still believe providing POSIX compatible versions of utilities on a separate path is the only clean way to make this happen. Cheers, -- Jacques Vidrine / nectar@celabo.org / jvidrine@verio.net / nectar@freebsd.org From owner-freebsd-arch@FreeBSD.ORG Thu Mar 25 06:53:10 2004 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 58F8D16A4CE; Thu, 25 Mar 2004 06:53:10 -0800 (PST) Received: from gw.celabo.org (gw.celabo.org [208.42.49.153]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2505643D5A; Thu, 25 Mar 2004 06:53:10 -0800 (PST) (envelope-from nectar@celabo.org) Received: from madman.celabo.org (madman.celabo.org [10.0.1.111]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "madman.celabo.org", Issuer "celabo.org CA" (verified OK)) by gw.celabo.org (Postfix) with ESMTP id D2C275482B; Thu, 25 Mar 2004 08:53:09 -0600 (CST) Received: by madman.celabo.org (Postfix, from userid 1001) id 797C76D455; Thu, 25 Mar 2004 08:53:09 -0600 (CST) Date: Thu, 25 Mar 2004 08:53:09 -0600 From: "Jacques A. Vidrine" To: Pawel Jakub Dawidek Message-ID: <20040325145309.GC61830@madman.celabo.org> Mail-Followup-To: "Jacques A. Vidrine" , Pawel Jakub Dawidek , freebsd-arch@freebsd.org References: <20040324235120.GU8930@darkness.comp.waw.pl> <20040325144553.GA61830@madman.celabo.org> <20040325145030.GB8930@darkness.comp.waw.pl> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20040325145030.GB8930@darkness.comp.waw.pl> X-Url: http://www.celabo.org/ User-Agent: Mutt/1.5.6i cc: freebsd-arch@freebsd.org Subject: Re: SUIDDIR -> security.bsd.suiddir_enable. X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Mar 2004 14:53:10 -0000 On Thu, Mar 25, 2004 at 03:50:30PM +0100, Pawel Jakub Dawidek wrote: > On Thu, Mar 25, 2004 at 08:45:53AM -0600, Jacques A. Vidrine wrote: > +> On Thu, Mar 25, 2004 at 12:51:20AM +0100, Pawel Jakub Dawidek wrote: > +> > Any objection on such exchange? > +> > +> I prefer it to remain a non-default compile-time option to discourage > +> use. > > Ok. BTW. Should we disallow usage of MNT_SUIDDIR flag for usermounts? > We don't do it now, I think. I think we should, but then again I don't use SUIDDIR so I'm not sure if this is desirable behavior or not. Cheers, -- Jacques Vidrine / nectar@celabo.org / jvidrine@verio.net / nectar@freebsd.org From owner-freebsd-arch@FreeBSD.ORG Thu Mar 25 09:17:00 2004 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5BD5D16A4CE; Thu, 25 Mar 2004 09:17:00 -0800 (PST) Received: from rwcrmhc11.comcast.net (rwcrmhc11.comcast.net [204.127.198.35]) by mx1.FreeBSD.org (Postfix) with ESMTP id 450EC43D46; Thu, 25 Mar 2004 09:17:00 -0800 (PST) (envelope-from julian@elischer.org) Received: from interjet.elischer.org ([24.7.73.28]) by comcast.net (rwcrmhc11) with ESMTP id <200403251716590130017amge>; Thu, 25 Mar 2004 17:16:59 +0000 Received: from localhost (localhost.elischer.org [127.0.0.1]) by InterJet.elischer.org (8.9.1a/8.9.1) with ESMTP id JAA76950; Thu, 25 Mar 2004 09:21:16 -0800 (PST) Date: Thu, 25 Mar 2004 09:21:14 -0800 (PST) From: Julian Elischer To: "Jacques A. Vidrine" In-Reply-To: <20040325144553.GA61830@madman.celabo.org> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: Pawel Jakub Dawidek cc: freebsd-arch@freebsd.org Subject: Re: SUIDDIR -> security.bsd.suiddir_enable. X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Mar 2004 17:17:00 -0000 On Thu, 25 Mar 2004, Jacques A. Vidrine wrote: > On Thu, Mar 25, 2004 at 12:51:20AM +0100, Pawel Jakub Dawidek wrote: > > Any objection on such exchange? > > I prefer it to remain a non-default compile-time option to discourage > use. The suiddir option only really makes sense (and is only really secure) for partitions that are exported via SAMBA etc. A shell user can make too much of a nuisance of themselves with it.. We added it for a Samba-based fileserver box product. > -- > Jacques Vidrine / nectar@celabo.org / jvidrine@verio.net / nectar@freebsd.org > _______________________________________________ > freebsd-arch@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-arch > To unsubscribe, send any mail to "freebsd-arch-unsubscribe@freebsd.org" > From owner-freebsd-arch@FreeBSD.ORG Thu Mar 25 10:05:41 2004 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3C7EA16A4CE for ; Thu, 25 Mar 2004 10:05:41 -0800 (PST) Received: from smtp1.server.rpi.edu (smtp1.server.rpi.edu [128.113.2.1]) by mx1.FreeBSD.org (Postfix) with ESMTP id E5C1943D1D for ; Thu, 25 Mar 2004 10:05:40 -0800 (PST) (envelope-from drosih@rpi.edu) Received: from [128.113.24.47] (gilead.netel.rpi.edu [128.113.24.47]) by smtp1.server.rpi.edu (8.12.8/8.12.8) with ESMTP id i2PI5bHB015330; Thu, 25 Mar 2004 13:05:40 -0500 Mime-Version: 1.0 X-Sender: drosih@mail.rpi.edu Message-Id: In-Reply-To: <20040325065314.GA64827@regency.nsu.ru> References: <20040325065314.GA64827@regency.nsu.ru> Date: Thu, 25 Mar 2004 13:05:36 -0500 To: Alexey Dokuchaev From: Garance A Drosihn Content-Type: text/plain; charset="us-ascii" ; format="flowed" X-Scanned-By: CanIt (www . canit . ca) cc: arch@freebsd.org Subject: Re: Adding `pgrep' and `pkill' to /usr/bin X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Mar 2004 18:05:41 -0000 At 12:53 PM +0600 3/25/04, Alexey Dokuchaev wrote: >On Wed, Mar 24, 2004, Julian Elischer wrote: > > > > On Wed, 24 Mar 2004, Garance A Drosihn wrote: > > > > > > The `pgrep' command searches the process table on the running > > > system and prints the process IDs of all processes that match the > > > criteria given on the command line. > >I've been using alias "psg = ps auxlww | grep" for pretty much the >same purpose. Is there some very strong reasoning behind bringing >in some new facility? NetBSD has it in the base system. OpenBSD will soon have it in their base system. Solaris has it in their base system. My installs of Redhat 7.3 have it, although I'm not sure if that is in the base system or some rpm that we (@RPI) add... One nice thing about this is that the different OS's would have the EXACT SAME options for these commands, as opposed to `ps' where it's almost hopeless that we'll ever be able to sort out the different options on different OS's. > > > The `pkill' command searches the process table on the running > > > system and signals all processes that match the criteria given > > > on the command line. > > > > so pkill is like killall but more flexible? > > > > how about you make killall a special case of pkill so we don't > > have the duplication.. > >Seconded here. Frankly, I tend to go against populating base >system with utilities of not so strict orthogonality. I agree that it would be a good idea to implement killall as a special-case of pkill. It might take me awhile to do this, but I'm all for the idea. -- Garance Alistair Drosehn = gad@gilead.netel.rpi.edu Senior Systems Programmer or gad@freebsd.org Rensselaer Polytechnic Institute or drosih@rpi.edu From owner-freebsd-arch@FreeBSD.ORG Thu Mar 25 10:09:20 2004 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id EC2BD16A4CE for ; Thu, 25 Mar 2004 10:09:20 -0800 (PST) Received: from smtp3.server.rpi.edu (smtp3.server.rpi.edu [128.113.2.3]) by mx1.FreeBSD.org (Postfix) with ESMTP id A359743D55 for ; Thu, 25 Mar 2004 10:09:20 -0800 (PST) (envelope-from drosih@rpi.edu) Received: from [128.113.24.47] (gilead.netel.rpi.edu [128.113.24.47]) by smtp3.server.rpi.edu (8.12.8/8.12.8) with ESMTP id i2PI9ILP018501; Thu, 25 Mar 2004 13:09:19 -0500 Mime-Version: 1.0 X-Sender: drosih@mail.rpi.edu Message-Id: In-Reply-To: <20040325214705.T36592@gamplex.bde.org> References: <20040325214705.T36592@gamplex.bde.org> Date: Thu, 25 Mar 2004 13:09:17 -0500 To: Bruce Evans From: Garance A Drosihn Content-Type: text/plain; charset="us-ascii" ; format="flowed" X-Scanned-By: CanIt (www . canit . ca) cc: arch@freebsd.org Subject: Re: Adding `pgrep' and `pkill' to /usr/bin X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Mar 2004 18:09:21 -0000 At 9:56 PM +1100 3/25/04, Bruce Evans wrote: >On Wed, 24 Mar 2004, Garance A Drosihn wrote: > >> I noticed the upcoming version of OpenBSD will add the commands >> `pkill' and `pgrep', which they picked up from NetBSD. These >> commands also exist in Solaris and Linux. Anyone mind if I add >> them to FreeBSD? I'd just pick up the versions from NetBSD, and >> make whatever changes are needed for them to work on FreeBSD. > >What's wrong with the pkill port? It has already been picked from >NetBSD, and whatever changes are needed for it to work on FreeBSD >have already been made (and pgrep is part of pkill). Ooo. Thanks for the pointer. That'll save me some work. >If you add this to /usr/bin instead of leaving it in ports, don't >forget to do the same for doscmd and some other things that are >only in ports. Don't look at me about doscmd! I didn't move it! -- Garance Alistair Drosehn = gad@gilead.netel.rpi.edu Senior Systems Programmer or gad@freebsd.org Rensselaer Polytechnic Institute or drosih@rpi.edu From owner-freebsd-arch@FreeBSD.ORG Thu Mar 25 10:51:47 2004 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C5C0916A4CE for ; Thu, 25 Mar 2004 10:51:47 -0800 (PST) Received: from mgr2.xmission.com (mgr2.xmission.com [198.60.22.202]) by mx1.FreeBSD.org (Postfix) with ESMTP id 889E543D31 for ; Thu, 25 Mar 2004 10:51:47 -0800 (PST) (envelope-from glewis@eyesbeyond.com) Received: from [198.60.22.206] (helo=mgr6.xmission.com) by mgr2.xmission.com with esmtp (Exim 3.35 #1) id 1B6ZxA-00028g-02; Thu, 25 Mar 2004 11:51:44 -0700 Received: from [166.70.56.15] (helo=misty.eyesbeyond.com) by mgr6.xmission.com with esmtp (Exim 4.30) id 1B6ZxA-0003LY-Qi; Thu, 25 Mar 2004 11:51:44 -0700 Received: from misty.eyesbeyond.com (localhost.eyesbeyond.com [127.0.0.1]) i2PIph5G027144; Thu, 25 Mar 2004 11:51:43 -0700 (MST) (envelope-from glewis@eyesbeyond.com) Received: (from glewis@localhost) by misty.eyesbeyond.com (8.12.10/8.12.10/Submit) id i2PIpgCF027143; Thu, 25 Mar 2004 11:51:42 -0700 (MST) (envelope-from glewis@eyesbeyond.com) X-Authentication-Warning: misty.eyesbeyond.com: glewis set sender to glewis@eyesbeyond.com using -f Date: Thu, 25 Mar 2004 11:51:42 -0700 From: Greg Lewis To: Garance A Drosihn Message-ID: <20040325185142.GB26970@misty.eyesbeyond.com> References: <20040325065314.GA64827@regency.nsu.ru> Mime-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.1i Content-Type: text/plain; charset=us-ascii X-Spam-Checker-Version: SpamAssassin 2.63 (2004-01-11) on mgr6.xmission.com X-Spam-Level: X-Spam-Status: No, hits=0.0 required=8.0 tests=none autolearn=no version=2.63 X-SA-Exim-Mail-From: glewis@eyesbeyond.com X-SA-Exim-Version: 3.1 (built Mon Jan 26 13:00:24 MST 2004) X-SA-Exim-Scanned: Yes cc: Alexey Dokuchaev cc: arch@freebsd.org Subject: Re: Adding `pgrep' and `pkill' to /usr/bin X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Mar 2004 18:51:47 -0000 On Thu, Mar 25, 2004 at 01:05:36PM -0500, Garance A Drosihn wrote: > NetBSD has it in the base system. OpenBSD will soon have it in > their base system. Solaris has it in their base system. My > installs of Redhat 7.3 have it, although I'm not sure if that is > in the base system or some rpm that we (@RPI) add... Both pgrep and pkill are part of the procps RPM which is a mandatory package for the base system (at least for Red Hat 9). They are also present on SuSE 9.0. Neither are listed in the latest LSB version (however ps is). FWIW... -- Greg Lewis Email : glewis@eyesbeyond.com Eyes Beyond Web : http://www.eyesbeyond.com Information Technology FreeBSD : glewis@FreeBSD.org From owner-freebsd-arch@FreeBSD.ORG Thu Mar 25 11:17:48 2004 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 19AB316A4CE; Thu, 25 Mar 2004 11:17:48 -0800 (PST) Received: from mailhost.stack.nl (vaak.stack.nl [131.155.140.140]) by mx1.FreeBSD.org (Postfix) with ESMTP id E60EC43D53; Thu, 25 Mar 2004 11:17:46 -0800 (PST) (envelope-from jilles@stack.nl) Received: from turtle.stack.nl (turtle.stack.nl [2001:610:1108:5010:2e0:81ff:fe22:51d8]) by mailhost.stack.nl (Postfix) with ESMTP id 40633059#C68A11F003; Thu, 25 Mar 2004 20:17:45 +0100 (CET) Received: by turtle.stack.nl (Postfix, from userid 1677) id A7D111CC2E; Thu, 25 Mar 2004 20:17:45 +0100 (CET) Date: Thu, 25 Mar 2004 20:17:45 +0100 From: Jilles Tjoelker To: Albert Cahalan Message-ID: <20040325191745.GB71731@stack.nl> References: <1080165171.2232.910.camel@cube> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1080165171.2232.910.camel@cube> X-Operating-System: FreeBSD 5.2.1-RELEASE-p1 i386 User-Agent: Mutt/1.5.6i cc: jilles+fbsd-standards@stack.nl cc: freebsd-standards@freebsd.org cc: freebsd-arch@freebsd.org cc: des@des.no cc: drosih@rpi.edu cc: fb-standards@psconsult.nl Subject: Re: PATCH for a more-POSIX `ps', and related adventures X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Mar 2004 19:17:48 -0000 On Wed, Mar 24, 2004 at 04:52:52PM -0500, Albert Cahalan wrote: > Wow, the SUSv3 ps problem is finally being addressed. I hope that > you'll be willing to discuss this with the Linux ps author (me) > and maybe drag in a few other ps authors or maintainers. This is > your chance to put an end to sysadmins everywhere cursing the > historical ps differences; don't let NIH stop you. > Perhaps there is a better place to discuss this. I'm not even > sure my mail will get through to freebsd-arch and freebsd-standards. > I'm a Comcast customer. :-/ > I think you may be painting yourself into a corner if you commit > the proposed changes. Please delay them at the very least. I'd > be happy to work with somebody to write a spec for good behavior, > kind of like SUSv3 plus BSD minus crufty bits. I think that has been a historical mistake in the POSIX standardization. tar/cpio were not standardized, instead a new utility "pax" was invented. This should have been done with ps too, as the BSD and System V versions are thoroughly incompatible. Instead, they made some half-hearted attempt at making up some compatible subset. This may be the source of the little-used '-A' option (equivalent to '-e' which is used much more often). > ------ comments on various proposed changes ------ > > > Now, after about 30 consecutive "as long as I was there" small > > projects, I have an update which: > > Changes -p so it accepts a list of process IDs, and -t so > > it accepts a list of terminal names (instead of only > > allowing a single value). > > Good. > > > Adds the -A option of SUSv3 (exactly the same as `-ax') > > You've added both "A" and "-A", right? That is, you're still > not using the presense/absense of a "-" to provide for separate > BSD and UNIX switch namespaces. You wouldn't be caving to the > Linux world if you did; I swiped the idea from Digital UNIX. > (a.k.a. Tru64 or OSF/1) It's also in AIX. I think this is ugly. Also, scripts and users on BSD have started to use a hyphen on BSD-style options, e.g. ps -ux. It may be the least bad way out, though. > > Adds a `-s sidlist' option, which is not in SUSv3, but > > it is in solaris, linux, and irix -- and it's an > > option I have personally wished for on occasion... > What about the traditional BSD signals format? I know NetBSD > broke this... you too? It is valuable when debugging. -O sig,sigmask,sigignore,sigcatch does about that, but requires more typing. The hexadecimal numbers are still annoying. > > Allows the user to specify any of these "selector options" > > multiple times, and have it keep adding to that > > list instead of replacing values for that list. > Good. > > Better parsing of options. Better error messages for > > invalid values (IMO). > I notice that you're jumping through hoops for "ps t" support. > Getting rid of the getopt-based parser would greatly help you. Hmm, I rather like a getopt-based parser for the complicated stuff. However, when the first argument doesn't start with a hyphen, FreeBSD ps does weird things and I have at least one PR on file about that ('ps tpt'). > > I am not thrilled with that idea, but at the moment I can't think > > of a better one. I *would* like to support matches of both real > > and effective users. I guess we could add some other option > > which would say "use the POSIX definitions of -u and -U", but that > > doesn't exactly thrill me either. > Why not? Tru64 uses the CMD_ENV environment variable to > handle this. Linux does too, with PS_PERSONALITY taking > priority. So, on either OS, you can do: > ps -u root -U albert > ps u > CMD_ENV=sysv ps -u root -U albert > CMD_ENV=bsd ps -u > ps -u # this is an error on Tru64, and a warning on Linux It has been discussed on freebsd-standards or -arch. Users may set CMD_ENV=sysv if they want to use System V style options, but scripts will not expect that. This requires all scripts using ps to be changed. Separate paths or names for the two seem like a better way. It seems best that it's one binary that changes behaviour depending on argv[0], but that makes it hard to call both of them by the name "ps". > If you want it, I'll help somebody port the Linux ps. :-) > I'll even consider a non-LGPL license if that changes things. > Then you can enjoy near-perfect SunOS 4 goodness: > PS_PERSONALITY=sunos4 ps -aux > PS_PERSONALITY=sunos4 ps -auxg I use almost all options of FreeBSD 4.x ps now and then, with exception of the obscure '-C' option and the sorting options. I'm not especially fond of Linux ps. Some of my annoyances are: * It's over-complicated, supports options from many Unix variants. This may be unavoidable in the end, though. * 'ps axO user' doesn't show full argv ('ps ax' does) * Doesn't have 'I', 'D', 's', '+' status letters * 'sl' keyword doesn't work Of course, some of these annoyances are due to the Linux kernel and not due to procps itself. I don't find Linux ps as annoying as SysV ps that cannot show me all processes running under my uid without me mentioning my uid on the command line, and truncate long argv pretty quickly. Also, in SUSv3 ps (with XSI extensions) there's no -o equivalent for the default output, -f and -l. -- Jilles Tjoelker From owner-freebsd-arch@FreeBSD.ORG Thu Mar 25 12:35:28 2004 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6584116A4CE; Thu, 25 Mar 2004 12:35:28 -0800 (PST) Received: from rwcrmhc13.comcast.net (rwcrmhc13.comcast.net [204.127.198.39]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4F33C43D1D; Thu, 25 Mar 2004 12:35:28 -0800 (PST) (envelope-from albert@users.sf.net) Received: from c-65-34-189-253.se.client2.attbi.com ([65.34.189.253]) by comcast.net (rwcrmhc13) with SMTP id <200403252035210150082h12e>; Thu, 25 Mar 2004 20:35:27 +0000 From: Albert Cahalan To: Jilles Tjoelker In-Reply-To: <20040325191745.GB71731@stack.nl> References: <1080165171.2232.910.camel@cube> <20040325191745.GB71731@stack.nl> Content-Type: text/plain Organization: Message-Id: <1080247208.2232.1095.camel@cube> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.4 Date: 25 Mar 2004 15:40:08 -0500 Content-Transfer-Encoding: 7bit cc: jilles+fbsd-standards@stack.nl cc: freebsd-standards@freebsd.org cc: freebsd-arch@freebsd.org cc: des@des.no cc: drosih@rpi.edu cc: fb-standards@psconsult.nl Subject: Re: PATCH for a more-POSIX `ps', and related adventures X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Mar 2004 20:35:28 -0000 On Thu, 2004-03-25 at 14:17, Jilles Tjoelker wrote: > On Wed, Mar 24, 2004 at 04:52:52PM -0500, Albert Cahalan wrote: > > Wow, the SUSv3 ps problem is finally being addressed. I hope that > > you'll be willing to discuss this with the Linux ps author (me) > > and maybe drag in a few other ps authors or maintainers. This is > > your chance to put an end to sysadmins everywhere cursing the > > historical ps differences; don't let NIH stop you. ... > I think that has been a historical mistake in the POSIX standardization. > tar/cpio were not standardized, instead a new utility "pax" was > invented. This should have been done with ps too, as the BSD and System > V versions are thoroughly incompatible. Instead, they made some > half-hearted attempt at making up some compatible subset. This may be > the source of the little-used '-A' option (equivalent to '-e' which is > used much more often). I would agree, except that nobody uses pax. :-) > > You've added both "A" and "-A", right? That is, you're still > > not using the presense/absense of a "-" to provide for separate > > BSD and UNIX switch namespaces. You wouldn't be caving to the > > Linux world if you did; I swiped the idea from Digital UNIX. > > (a.k.a. Tru64 or OSF/1) It's also in AIX. > > I think this is ugly. Also, scripts and users on BSD have started to > use a hyphen on BSD-style options, e.g. ps -ux. It may be the least bad > way out, though. Ultimately, it is the least bad way out. You might want to add a /usr/ucb/ps though. Then users can set $PATH to that when they want 100% old BSD behavior. Sun does this. Consider making /usr/ucb/ps a trivial script wrapper that sets an environment variable rather than having the main ps executable look at the path. > > > Adds a `-s sidlist' option, which is not in SUSv3, but > > > it is in solaris, linux, and irix -- and it's an > > > option I have personally wished for on occasion... > > > What about the traditional BSD signals format? I know NetBSD > > broke this... you too? It is valuable when debugging. > > -O sig,sigmask,sigignore,sigcatch does about that, but requires more > typing. The hexadecimal numbers are still annoying. How odd that you've lost "ps s" but retained the ability to produce the data! Zero-padded hex is pretty reasonable; it would allow you to count from either side. > Hmm, I rather like a getopt-based parser for the complicated stuff. > However, when the first argument doesn't start with a hyphen, FreeBSD ps > does weird things and I have at least one PR on file about that > ('ps tpt'). The common non-getopt parser crams everything into one big ugly while() loop. You needn't do that; simply break things up a bit as you would for any other code. It's quite readable that way. For example, hack-free handling for "t" is nicely localized: case 't': /* Select by tty. */ /* List of terminals (tty, pty...) _should_ follow t. */ arg=get_opt_arg(); if(!arg){ /* This is old BSD syntax. Put our tty on a tiny list. */ /* ... snip ... */ return NULL; } err=parse_list(arg, parse_tty); /* parse_tty is a function */ if(err) return err; selection_list->typecode = SEL_TTY; return NULL; /* can't have any more options */ > It has been discussed on freebsd-standards or -arch. Users may set > CMD_ENV=sysv if they want to use System V style options, but scripts > will not expect that. This requires all scripts using ps to be changed. Yes and no. You only have to break scripts using options that could be parsed either way. For example, my parser falls back to BSD mode if it sees "ps -axu". It also falls back to BSD mode for "ps -aux" if user "x" doesn't exist. Due to "x" being a commonly-used BSD-only option, it is rare to have a command that can parse either way. To gently break old habits, I give a warning when fall-back parsing is used. > Separate paths or names for the two seem like a better way. It seems > best that it's one binary that changes behaviour depending on argv[0], > but that makes it hard to call both of them by the name "ps". Sun is already using /usr/ucb for this. I suspect many people have this in their $PATH already. > > If you want it, I'll help somebody port the Linux ps. :-) > > I'll even consider a non-LGPL license if that changes things. > > Then you can enjoy near-perfect SunOS 4 goodness: > > > PS_PERSONALITY=sunos4 ps -aux > > PS_PERSONALITY=sunos4 ps -auxg > > I use almost all options of FreeBSD 4.x ps now and then, with > exception of the obscure '-C' option and the sorting options. > > I'm not especially fond of Linux ps. Some of my annoyances are: > > * It's over-complicated, supports options from many Unix variants. > This may be unavoidable in the end, though. Sure. Your HP-UX scripts will work though. > * 'ps axO user' doesn't show full argv ('ps ax' does) Hmmm, that could be considered a bug. I can change this. > * Doesn't have 'I', 'D', 's', '+' status letters "D" is there, along with "S" and "W". "s" and "+" seem kind of redundant, taking up valuable space. "I" can not be supported on Linux. > * 'sl' keyword doesn't work It might be doable, at least approximately, on a 2.6.xx kernel. A port to FreeBSD could of course have this working. (Wow, somebody actually uses the "sl" keyword! Can I assume you maintain the kernel's scheduler?) > Of course, some of these annoyances are due to the Linux kernel and not > due to procps itself. > > I don't find Linux ps as annoying as SysV ps that cannot show me all > processes running under my uid without me mentioning my uid on the > command line, and truncate long argv pretty quickly. Thanks for taking a look. Did I get FreeBSD's "H" option right? I'm not sure what the PID column is supposed to contain. Also, I'd be happy to support a FreeBSD-compatible "Z" if you can properly describe it to me. From owner-freebsd-arch@FreeBSD.ORG Thu Mar 25 13:16:37 2004 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6E13016A4D1 for ; Thu, 25 Mar 2004 13:16:37 -0800 (PST) Received: from dan.emsphone.com (dan.emsphone.com [199.67.51.101]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2456543D3F for ; Thu, 25 Mar 2004 13:16:37 -0800 (PST) (envelope-from dan@dan.emsphone.com) Received: (from dan@localhost) by dan.emsphone.com (8.12.10/8.12.10) id i2PLGaJ5015644; Thu, 25 Mar 2004 15:16:36 -0600 (CST) (envelope-from dan) Date: Thu, 25 Mar 2004 15:16:36 -0600 From: Dan Nelson To: Garance A Drosihn , arch@FreeBSD.ORG Message-ID: <20040325211636.GC3446@dan.emsphone.com> References: <20040325070120.GA67497@VARK.homeunix.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20040325070120.GA67497@VARK.homeunix.com> X-OS: FreeBSD 5.2-CURRENT X-message-flag: Outlook Error User-Agent: Mutt/1.5.6i Subject: Re: Adding `pgrep' and `pkill' to /usr/bin X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Mar 2004 21:16:37 -0000 In the last episode (Mar 24), David Schultz said: > I think it would be *great* to import any and all of the Solaris proc > tools into FreeBSD. I tend to think of these utilities as ps(1), > fstat(1), and friends done the proper Unix way (with lots of simple > tools that can be combined for powerful effect.) For those who > haven't seen the rest of the tools, take a look at: > > http://www.freebsd.org/cgi/man.cgi?query=proc&manpath=SunOS+5.9 Some of these already exist or would be trivial to add: pstack is in ports, and can decode libc_r threads. pwdx could be a wrapper around fstat? pstop and prun are just wrappers around kill -{STOP|CONT} $@ pwait would make wait_for_pids() in rc.subr simpler pstree is in ports and looks similar to ptree -- Dan Nelson dnelson@allantgroup.com From owner-freebsd-arch@FreeBSD.ORG Thu Mar 25 18:06:00 2004 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7211A16A4CE for ; Thu, 25 Mar 2004 18:06:00 -0800 (PST) Received: from smtp4.server.rpi.edu (smtp4.server.rpi.edu [128.113.2.4]) by mx1.FreeBSD.org (Postfix) with ESMTP id 275C843D31 for ; Thu, 25 Mar 2004 18:06:00 -0800 (PST) (envelope-from drosih@rpi.edu) Received: from [128.113.24.47] (gilead.netel.rpi.edu [128.113.24.47]) by smtp4.server.rpi.edu (8.12.8/8.12.8) with ESMTP id i2Q25QoP004748; Thu, 25 Mar 2004 21:05:26 -0500 Mime-Version: 1.0 X-Sender: drosih@mail.rpi.edu Message-Id: In-Reply-To: References: Date: Thu, 25 Mar 2004 21:05:25 -0500 To: arch@freebsd.org From: Garance A Drosihn Content-Type: text/plain; charset="us-ascii" ; format="flowed" X-Scanned-By: CanIt (www . canit . ca) cc: Julian Elischer Subject: Re: Questions on `pgrep' and `pkill' X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Mar 2004 02:06:00 -0000 Well, I have added pkill & pgrep to src/usr.bin, and have it pretty much working (thanks to lioux, who had already done all the real work in the port for sysutils/pkill). I have two minor questions. For the 5.x-branch, I assume that: plist = kvm_getprocs(kd, KERN_PROC_ALL, 0, &nproc); should be asking for KERN_PROC_PROC. Or should I add an `-H' option to govern that? Would it make any sense for these commands to list out threads? (or it would it make sense for `pgrep' but not for `pkill'? I have no experience with threaded processes...) The other question is just something I'm confused about. I have my own little "psgrep" script, so once I had `pgrep' working I compared what my script does to the new command. It happens that I'm running OpenAFS on this machine, and here's basically what I got: (35) psgrep afsd 641 /usr/local/sbin/afsd -stat 1200 -dcache 800 ... 642 /usr/local/sbin/afsd -stat 1200 -dcache 800 ... 643 /usr/local/sbin/afsd -stat 1200 -dcache 800 ... 644 /usr/local/sbin/afsd -stat 1200 -dcache 800 ... 645 /usr/local/sbin/afsd -stat 1200 -dcache 800 ... 646 /usr/local/sbin/afsd -stat 1200 -dcache 800 ... 647 /usr/local/sbin/afsd -stat 1200 -dcache 800 ... 648 /usr/local/sbin/afsd -stat 1200 -dcache 800 ... 649 /usr/local/sbin/afsd -stat 1200 -dcache 800 ... 650 /usr/local/sbin/afsd -stat 1200 -dcache 800 ... (36) pgrep -fl afsd 644 /usr/local/sbin/afsd -stat 1200 -dcache 800 ... I don't understand why pgrep matched only one of these. If you turn on the `-D' option that I added to pgrep, it seems that all the rest of those afsd processes have the P_SYSTEM flag set. Why would all of those processes but one have that flag set? Or why doesn't that one *also* have it set? It isn't even the first or last process that was started up. This wasn't the behavior I would expect. Are there some other flag(s) I should be checking for whatever these commands are using P_SYSTEM for? (I think we'll all be better off if I don't try to become a kernel developer to answer this...) -- Garance Alistair Drosehn = gad@gilead.netel.rpi.edu Senior Systems Programmer or gad@freebsd.org Rensselaer Polytechnic Institute or drosih@rpi.edu From owner-freebsd-arch@FreeBSD.ORG Thu Mar 25 18:30:32 2004 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from green.homeunix.org (freefall.freebsd.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id E71E916A4CE; Thu, 25 Mar 2004 18:30:31 -0800 (PST) Received: from green.homeunix.org (green@localhost [127.0.0.1]) by green.homeunix.org (8.12.11/8.12.11) with ESMTP id i2Q2UUX6097935; Thu, 25 Mar 2004 21:30:30 -0500 (EST) (envelope-from green@green.homeunix.org) Received: from localhost (green@localhost)i2Q2UTNZ097932; Thu, 25 Mar 2004 21:30:29 -0500 (EST) (envelope-from green@green.homeunix.org) Message-Id: <200403260230.i2Q2UTNZ097932@green.homeunix.org> X-Mailer: exmh version 2.6.3 04/04/2003 with nmh-1.0.4 To: John Baldwin In-Reply-To: Message from John Baldwin of "Tue, 23 Mar 2004 17:24:45 EST." <200403231724.45923.jhb@FreeBSD.org> From: "Brian F. Feldman" Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Date: Thu, 25 Mar 2004 21:30:29 -0500 Sender: green@green.homeunix.org cc: Dag-Erling =?utf-8?q?Sm=C3=B8rgrav?= cc: David Schultz cc: Seigo Tanimura cc: arch@FreeBSD.org Subject: Re: Is MTX_CONTESTED evil? X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Mar 2004 02:30:32 -0000 John Baldwin wrote: > On Tuesday 23 March 2004 03:06 pm, Dag-Erling Sm=C3=B8rgrav wrote: > > des@des.no (Dag-Erling Sm=C3=B8rgrav) writes: > > > John Baldwin writes: > > > > Adaptive mutexes work just fine, but they aren't on by default. > > > > > > No, they don't "work just fine", unless of course they are *suppose= d* > > > to cause frequent panics. > > > > s/panic/freeze/ > = > They worked just fine on sparc64, alpha, and i386 when they were develo= ped and = > nothing has changed since then. However, since they increase the chanc= es of = > "near concurrency" on multiple CPUs (i.e. one CPU grabbing a lock right= after = > another released it) they expose races and thus bugs in code that uses = > mutexes improperly. The fault is not in adaptive mutexes, but in the o= ther = > broken code, just as compile failures aren't the result of the tinderbo= x = > itself being broken. :-) Well, that certainly explains the blitz of crashes I had to fix recently!= = Since INVARIANTS and WITNESS are on by default, it would make sense to ma= ke = ADAPTIVE_MUTEX default to catch more bugs. -- = Brian Fundakowski Feldman \'[ FreeBSD ]''''''''= ''\ <> green@FreeBSD.org \ The Power to Serv= e! \ Opinions expressed are my own. \,,,,,,,,,,,,,,,,,,= ,,,,\ From owner-freebsd-arch@FreeBSD.ORG Thu Mar 25 19:17:34 2004 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id AA86C16A4CE for ; Thu, 25 Mar 2004 19:17:34 -0800 (PST) Received: from smtp4.server.rpi.edu (smtp4.server.rpi.edu [128.113.2.4]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6322343D2D for ; Thu, 25 Mar 2004 19:17:34 -0800 (PST) (envelope-from drosih@rpi.edu) Received: from [128.113.24.47] (gilead.netel.rpi.edu [128.113.24.47]) by smtp4.server.rpi.edu (8.12.8/8.12.8) with ESMTP id i2Q3GwoP027396; Thu, 25 Mar 2004 22:16:58 -0500 Mime-Version: 1.0 X-Sender: drosih@mail.rpi.edu Message-Id: In-Reply-To: References: Date: Thu, 25 Mar 2004 22:16:57 -0500 To: arch@freebsd.org From: Garance A Drosihn Content-Type: text/plain; charset="us-ascii" ; format="flowed" X-Scanned-By: CanIt (www . canit . ca) cc: Julian Elischer Subject: Re: Questions on `pgrep' and `pkill' X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Mar 2004 03:17:34 -0000 At 9:05 PM -0500 3/25/04, Garance A Drosihn wrote: > >This wasn't the behavior I would expect. Are there some other >flag(s) I should be checking for whatever these commands are >using P_SYSTEM for? (I think we'll all be better off if I >don't try to become a kernel developer to answer this...) Of course, that won't stop me from guessing... The man page says: Note that a running pgrep or pkill process will never consider itself nor system processes (kernel threads) as a potential match. If I switch the P_SYSTEM check to P_KTHREAD, I get results that seem to be more reasonable to me... -- Garance Alistair Drosehn = gad@gilead.netel.rpi.edu Senior Systems Programmer or gad@freebsd.org Rensselaer Polytechnic Institute or drosih@rpi.edu From owner-freebsd-arch@FreeBSD.ORG Thu Mar 25 21:04:09 2004 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 127FC16A4CE for ; Thu, 25 Mar 2004 21:04:09 -0800 (PST) Received: from praetor.linc-it.com (adsl-068-157-070-217.sip.jan.bellsouth.net [68.157.70.217]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9673443D2D for ; Thu, 25 Mar 2004 21:04:08 -0800 (PST) (envelope-from fullermd@over-yonder.net) Received: from mortis.over-yonder.net (adsl-19-147-6.jan.bellsouth.net [68.19.147.6]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by praetor.linc-it.com (Postfix) with ESMTP id 55E7A155E6; Thu, 25 Mar 2004 23:04:07 -0600 (CST) Received: by mortis.over-yonder.net (Postfix, from userid 100) id 71B2320F2A; Thu, 25 Mar 2004 23:04:05 -0600 (CST) Date: Thu, 25 Mar 2004 23:04:05 -0600 From: "Matthew D. Fuller" To: Peter Jeremy Message-ID: <20040326050404.GA1879@over-yonder.net> References: <20040325065314.GA64827@regency.nsu.ru> <20040325084837.GA57169@server.vk2pj.dyndns.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20040325084837.GA57169@server.vk2pj.dyndns.org> X-Editor: vi X-OS: FreeBSD User-Agent: Mutt/1.5.6i-fullermd.2 cc: Alexey Dokuchaev cc: arch@freebsd.org Subject: Re: Adding `pgrep' and `pkill' to /usr/bin X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Mar 2004 05:04:09 -0000 On Thu, Mar 25, 2004 at 07:48:37PM +1100 I heard the voice of Peter Jeremy, and lo! it spake thus: > > At another level, Unices tend to differ most when it comes to > administration utilities. This requires sysadmins to mentally change > gears as they move between xterm (should I type "ps -ef" or "ps -ax" > into this terminal?). Adding (useful) sysadmin utilities from one of > the more common Unices would seem to be A Good Thing. That's why you have your shell rc file set up aliases. A few snips from mine: ----- case "FREEBSD": case "UNKNOWN": alias p 'ps -agOuser' alias psa 'ps -gaxuww \!* | $PAGER' breaksw case "SOLARIS": alias p '/usr/ucb/ps -agu' alias psa '/usr/ucb/ps -gaxuww \!* | $PAGER' breaksw case "LINUX" alias p 'ps ua' alias psa 'ps axuww \!* | $PAGER' breaksw ----- And so on. True, not perhaps as nice as them actually being the same, but what fun would THAT be? :) -- Matthew Fuller (MF4839) | fullermd@over-yonder.net Systems/Network Administrator | http://www.over-yonder.net/~fullermd/ "The only reason I'm burning my candle at both ends, is because I haven't figured out how to light the middle yet" From owner-freebsd-arch@FreeBSD.ORG Fri Mar 26 00:43:29 2004 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C6C8F16A4DD; Fri, 26 Mar 2004 00:43:29 -0800 (PST) Received: from smtp.des.no (flood.des.no [217.116.83.31]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5192A43D2F; Fri, 26 Mar 2004 00:43:29 -0800 (PST) (envelope-from des@des.no) Received: by smtp.des.no (Pony Express, from userid 666) id E11D75309; Fri, 26 Mar 2004 09:43:27 +0100 (CET) Received: from dwp.des.no (des.no [80.203.228.37]) by smtp.des.no (Pony Express) with ESMTP id 6E56C5308; Fri, 26 Mar 2004 09:43:21 +0100 (CET) Received: by dwp.des.no (Postfix, from userid 2602) id 3FC8633CA7; Fri, 26 Mar 2004 09:43:21 +0100 (CET) To: Albert Cahalan References: <1080165171.2232.910.camel@cube> <20040325191745.GB71731@stack.nl> <1080247208.2232.1095.camel@cube> From: des@des.no (Dag-Erling =?iso-8859-1?q?Sm=F8rgrav?=) Date: Fri, 26 Mar 2004 09:43:21 +0100 In-Reply-To: <1080247208.2232.1095.camel@cube> (Albert Cahalan's message of "25 Mar 2004 15:40:08 -0500") Message-ID: User-Agent: Gnus/5.090024 (Oort Gnus v0.24) Emacs/21.3 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Checker-Version: SpamAssassin 2.63 (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.63 cc: jilles+fbsd-standards@stack.nl cc: Jilles Tjoelker cc: freebsd-standards@freebsd.org cc: freebsd-arch@freebsd.org cc: drosih@rpi.edu cc: fb-standards@psconsult.nl Subject: Re: PATCH for a more-POSIX `ps', and related adventures X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Mar 2004 08:43:30 -0000 Albert Cahalan writes: > On Thu, 2004-03-25 at 14:17, Jilles Tjoelker wrote: > > I think that has been a historical mistake in the POSIX standardization. > > tar/cpio were not standardized, instead a new utility "pax" was > > invented. This should have been done with ps too [...] > I would agree, except that nobody uses pax. :-) NetBSD and OpenBSD use pax exclusively; their tar and cpio are symlinks to /bin/pax. DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-freebsd-arch@FreeBSD.ORG Fri Mar 26 00:47:48 2004 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 323C116A4D5; Fri, 26 Mar 2004 00:47:48 -0800 (PST) Received: from smtp.des.no (flood.des.no [217.116.83.31]) by mx1.FreeBSD.org (Postfix) with ESMTP id F1FEB43D41; Fri, 26 Mar 2004 00:47:47 -0800 (PST) (envelope-from des@des.no) Received: by smtp.des.no (Pony Express, from userid 666) id 2BE315309; Fri, 26 Mar 2004 09:47:47 +0100 (CET) Received: from dwp.des.no (des.no [80.203.228.37]) by smtp.des.no (Pony Express) with ESMTP id 048CC5308; Fri, 26 Mar 2004 09:47:41 +0100 (CET) Received: by dwp.des.no (Postfix, from userid 2602) id E1A0733CA7; Fri, 26 Mar 2004 09:47:40 +0100 (CET) To: "Brian F. Feldman" References: <200403260230.i2Q2UTNZ097932@green.homeunix.org> From: des@des.no (Dag-Erling =?iso-8859-1?q?Sm=F8rgrav?=) Date: Fri, 26 Mar 2004 09:47:40 +0100 In-Reply-To: <200403260230.i2Q2UTNZ097932@green.homeunix.org> (Brian F. Feldman's message of "Thu, 25 Mar 2004 21:30:29 -0500") Message-ID: User-Agent: Gnus/5.090024 (Oort Gnus v0.24) Emacs/21.3 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Checker-Version: SpamAssassin 2.63 (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.63 cc: arch@FreeBSD.org cc: David Schultz cc: Seigo Tanimura cc: John Baldwin Subject: Re: Is MTX_CONTESTED evil? X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Mar 2004 08:47:48 -0000 "Brian F. Feldman" writes: > Well, that certainly explains the blitz of crashes I had to fix > recently! Since INVARIANTS and WITNESS are on by default, it would > make sense to make ADAPTIVE_MUTEX default to catch more bugs. Making ADAPTIVE_MUTEXES default will not catch more bugs, it will just piss off users. DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-freebsd-arch@FreeBSD.ORG Fri Mar 26 06:13:22 2004 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from green.homeunix.org (freefall.freebsd.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id 1672316A4CE; Fri, 26 Mar 2004 06:13:22 -0800 (PST) Received: from green.homeunix.org (green@localhost [127.0.0.1]) by green.homeunix.org (8.12.11/8.12.11) with ESMTP id i2QEDKTu001784; Fri, 26 Mar 2004 09:13:20 -0500 (EST) (envelope-from green@green.homeunix.org) Received: from localhost (green@localhost)i2QEDKHw001781; Fri, 26 Mar 2004 09:13:20 -0500 (EST) (envelope-from green@green.homeunix.org) Message-Id: <200403261413.i2QEDKHw001781@green.homeunix.org> X-Mailer: exmh version 2.6.3 04/04/2003 with nmh-1.0.4 To: des@des.no (Dag-Erling =?iso-8859-1?q?Sm=F8rgrav?=) In-Reply-To: Message from des@des.no (Dag-Erling =?iso-8859-1?q?Sm=F8rgrav?=) of "Fri, 26 Mar 2004 09:47:40 +0100." From: "Brian F. Feldman" Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Date: Fri, 26 Mar 2004 09:13:20 -0500 Sender: green@green.homeunix.org cc: arch@FreeBSD.org cc: David Schultz cc: Seigo Tanimura cc: John Baldwin Subject: Re: Is MTX_CONTESTED evil? X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Mar 2004 14:13:22 -0000 des@des.no (Dag-Erling =3D?iso-8859-1?q?Sm=3DF8rgrav?=3D) wrote: > "Brian F. Feldman" writes: > > Well, that certainly explains the blitz of crashes I had to fix > > recently! Since INVARIANTS and WITNESS are on by default, it would > > make sense to make ADAPTIVE_MUTEX default to catch more bugs. > = > Making ADAPTIVE_MUTEXES default will not catch more bugs, it will just > piss off users. What in the world you are talking about? I didn't know that a large clas= s = of bugs existed on SMP, turned on ADAPTIVE_MUTEXES, and found those bugs.= QED. -- = Brian Fundakowski Feldman \'[ FreeBSD ]''''''''= ''\ <> green@FreeBSD.org \ The Power to Serv= e! \ Opinions expressed are my own. \,,,,,,,,,,,,,,,,,,= ,,,,\ From owner-freebsd-arch@FreeBSD.ORG Fri Mar 26 06:34:09 2004 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0197316A4CE; Fri, 26 Mar 2004 06:34:09 -0800 (PST) Received: from mx.nsu.ru (mx.nsu.ru [212.192.164.5]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8193043D45; Fri, 26 Mar 2004 06:34:08 -0800 (PST) (envelope-from danfe@regency.nsu.ru) Received: from regency.nsu.ru ([193.124.210.26]) by mx.nsu.ru with esmtp (Exim 4.30) id 1B6sPO-00064a-DO; Fri, 26 Mar 2004 20:34:06 +0600 Received: from regency.nsu.ru (localhost [127.0.0.1]) by regency.nsu.ru (8.12.10/8.12.10) with ESMTP id i2QEYDxm002748; Fri, 26 Mar 2004 20:34:13 +0600 (NOVT) (envelope-from danfe@regency.nsu.ru) Received: (from danfe@localhost) by regency.nsu.ru (8.12.10/8.12.10/Submit) id i2QEYBnX002695; Fri, 26 Mar 2004 20:34:12 +0600 (NOVT) (envelope-from danfe) Date: Fri, 26 Mar 2004 20:34:11 +0600 From: Alexey Dokuchaev To: Dag-Erling Sm?rgrav Message-ID: <20040326143411.GA1508@regency.nsu.ru> References: <1080165171.2232.910.camel@cube> <20040325191745.GB71731@stack.nl> <1080247208.2232.1095.camel@cube> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.1i cc: jilles+fbsd-standards@stack.nl cc: Jilles Tjoelker cc: freebsd-standards@freebsd.org cc: Albert Cahalan cc: freebsd-arch@freebsd.org cc: drosih@rpi.edu cc: fb-standards@psconsult.nl Subject: Re: PATCH for a more-POSIX `ps', and related adventures X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Mar 2004 14:34:09 -0000 On Fri, Mar 26, 2004 at 09:43:21AM +0100, Dag-Erling Sm?rgrav wrote: > Albert Cahalan writes: > > On Thu, 2004-03-25 at 14:17, Jilles Tjoelker wrote: > > > I think that has been a historical mistake in the POSIX standardization. > > > tar/cpio were not standardized, instead a new utility "pax" was > > > invented. This should have been done with ps too [...] > > I would agree, except that nobody uses pax. :-) > > NetBSD and OpenBSD use pax exclusively; their tar and cpio are > symlinks to /bin/pax. How do they handle tar/cpio-specific arguments than? By bloating pax(1) with quite some piece of code? This seems odd. ./danfe From owner-freebsd-arch@FreeBSD.ORG Fri Mar 26 06:34:26 2004 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C893816A4CE for ; Fri, 26 Mar 2004 06:34:26 -0800 (PST) Received: from hexagon.stack.nl (hexagon.stack.nl [131.155.140.144]) by mx1.FreeBSD.org (Postfix) with ESMTP id 08E8643D2D for ; Fri, 26 Mar 2004 06:34:26 -0800 (PST) (envelope-from jilles@stack.nl) Received: from turtle.stack.nl (turtle.stack.nl [IPv6:2001:610:1108:5010:2e0:81ff:fe22:51d8]) by hexagon.stack.nl (Postfix) with ESMTP id 40643F70#6EA9F519E; Fri, 26 Mar 2004 15:34:24 +0100 (CET) Received: by turtle.stack.nl (Postfix, from userid 1677) id 3F61B1CC2E; Fri, 26 Mar 2004 15:34:24 +0100 (CET) Date: Fri, 26 Mar 2004 15:34:24 +0100 From: Jilles Tjoelker To: Dan Nelson Message-ID: <20040326143423.GD71731@stack.nl> References: <20040325070120.GA67497@VARK.homeunix.com> <20040325211636.GC3446@dan.emsphone.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20040325211636.GC3446@dan.emsphone.com> X-Operating-System: FreeBSD 5.2.1-RELEASE-p1 i386 User-Agent: Mutt/1.5.6i cc: arch@FreeBSD.ORG cc: Garance A Drosihn Subject: Re: Adding `pgrep' and `pkill' to /usr/bin X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Mar 2004 14:34:26 -0000 On Thu, Mar 25, 2004 at 03:16:36PM -0600, Dan Nelson wrote: > In the last episode (Mar 24), David Schultz said: > > I think it would be *great* to import any and all of the Solaris proc > > tools into FreeBSD. I tend to think of these utilities as ps(1), > > fstat(1), and friends done the proper Unix way (with lots of simple > > tools that can be combined for powerful effect.) For those who > > haven't seen the rest of the tools, take a look at: > > http://www.freebsd.org/cgi/man.cgi?query=proc&manpath=SunOS+5.9 > Some of these already exist or would be trivial to add: > pstack is in ports, and can decode libc_r threads. It works, but the fact that most binaries are stripped doesn't help it. > pwdx could be a wrapper around fstat? How would you obtain the full pathname of the directory? fstat cannot do it, but lsof can. In principle it is possible, since every directory has at most one name. > pstop and prun are just wrappers around kill -{STOP|CONT} $@ No, they're not. kill -STOP notifies the parent process if it's in a wait()-like function with the WUNTRACED option set (e.g. job control shell), and SIGCONT is often caught (to redraw the screen, for example). pstop and prun don't have any of those effects. It's the same kind of "stop" that debuggers use. > pwait would make wait_for_pids() in rc.subr simpler I've made an implementation of pwait using kqueue(2): http://www.stack.nl/~jilles/unix/pwait.tar.gz. It's pretty simple. I doubt whether it's worth putting another program in /bin to make that function simpler, though. > pstree is in ports and looks similar to ptree It would still require some work. -- Jilles Tjoelker From owner-freebsd-arch@FreeBSD.ORG Fri Mar 26 09:42:29 2004 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0D9C416A4CE; Fri, 26 Mar 2004 09:42:29 -0800 (PST) Received: from huva.hittite.isp.9tel.net (huva.hittite.isp.9tel.net [62.62.156.28]) by mx1.FreeBSD.org (Postfix) with ESMTP id 66F0D43D41; Fri, 26 Mar 2004 09:42:28 -0800 (PST) (envelope-from cyrille.lefevre@laposte.net) Received: from pc2k (unknown [81.185.204.209]) by huva.hittite.isp.9tel.net (Postfix) with SMTP id 3B1409BC2C; Fri, 26 Mar 2004 18:43:12 +0100 (CET) Message-ID: <1a9c01c41359$b3da45e0$7890a8c0@dyndns.org> From: "Cyrille Lefevre" To: "David Schultz" , "Garance A Drosihn" References: <20040325070120.GA67497@VARK.homeunix.com> Date: Fri, 26 Mar 2004 18:40:14 +0100 Organization: ACME MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 8bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 cc: arch@freebsd.org Subject: posix ps (was Re: Adding `pgrep' and `pkill' to /usr/bin) X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Mar 2004 17:42:29 -0000 "David Schultz" wrote: > On Wed, Mar 24, 2004, Garance A Drosihn wrote: > > I noticed the upcoming version of OpenBSD will add the commands > > `pkill' and `pgrep', which they picked up from NetBSD. These > > commands also exist in Solaris and Linux. Anyone mind if I add > > them to FreeBSD? I'd just pick up the versions from NetBSD, and > > make whatever changes are needed for them to work on FreeBSD. > > > > (I actually had an idea of adding another option or two to `ps' > > which would have given it abilities similar to `pgrep', but once > > I noticed these I figured it would make more sense to add them) > > I think it would be *great* to import any and all of the Solaris > proc tools into FreeBSD. I tend to think of these utilities as > ps(1), fstat(1), and friends done the proper Unix way (with lots > of simple tools that can be combined for powerful effect.) > For those who haven't seen the rest of the tools, take a look at: Hi, two years ago, I've added posix syntax and so to my locally ps(1). for instance, I'm currently adding the notion of dynamic personalities (the term comes from linux) instead of static #define such as... say : $ ps -X help any bsd bsd43reno bsd44 default extended freebsd hpux irix netbsd none openbsd pedantic posix relaxed solaris sunos susv3 tru64 personalities enable options such as : bsd ps : -g and -n from sunos, -s from tru64 and some other options. posix ps : see susv3 man (see http://www.opengroup.org/onlinepubs/007904975/toc.htm) -j from all except posix -c, -y and -P from solaris -C cmdlist (ala pgrep :) and -x from hpux -M from irix and some others they also enable many keywords such as : RUSAGE and co from tru64, class and psr from solaris, and many others (mostly aliases) when finished, I'll probably submit these changes as a port in the meantime since I suppose -arch will reject these important changes to a native command. the most important and not done part is... the manual page. any volonteers ? here are some sample outputs : $ PERSONALITY=freebsd ps -? usage: ps [-aCcefHhjlmrSTuvWwxZ] [-M core] [-N system] [-O fmtlist] [-o fmtlist] [-p pid] [-t tty] [-U user] [-X perslist] ps -L ps -X help $ PERSONALITY=freebsd,+extended ps -? usage: ps [-aCcefgHhjlmnrSsTuvWwxZ] [-M core] [-N system] [-O fmtlist] [-o fmtlist] [-p pidlist] [-t ttylist] [-U user] [-X perslist] ps -L ps -X help $ PERSONALITY=susv3 ps -? usage: ps [-Aadefl] [-G grouplist] [-g pgrplist] [-n system [-n core]] [-o fmtlist] [-p pidlist] [-t ttylist] [-U ruserlist] [-u userlist] [-X perslist] ps -o help ps -X help $ PERSONALITY=susv3,+extended ps -? usage: ps [-AacdefjlPxy] [-C cmdlist] [-G grouplist] [-g pgrplist] [-n system [-n core]] [-O fmtlist] [-o fmtlist] [-p pidlist] [-s sidlist] [-t ttylist] [-U ruserlist] [-u userlist] [-X perslist] ps -o help ps -X help $ PERSONALITY=hpux ps -? usage: ps [-AacdefHjlPxz] [-C cmdlist] [-G grouplist] [-g pgrplist] [-n system [-n core]] [-o fmtlist] [-p pidlist] [-R prmgrplist] [-s sidlist] [-t ttylist] [-U ruserlist] [-u userlist] [-X perslist] [-Z psetlist] ps -o help ps -X help $ PERSONALITY=hpux,+extended ps -? usage: ps [-AacdefHjlPxyz] [-C cmdlist] [-G grouplist] [-g pgrplist] [-n system [-n core]] [-O fmtlist] [-o fmtlist] [-p pidlist] [-R prmgrplist] [-s sidlist] [-t ttylist] [-U ruserlist] [-u userlist] [-X perslist] [-Z psetlist] ps -o help ps -X help $ PERSONALITY=solaris ps -? usage: ps [-AacdefjLlPy] [-G grouplist] [-g pgrplist] [-n system [-n core]] [-o fmtlist] [-p pidlist] [-s sidlist] [-t ttylist] [-U ruserlist] [-u userlist] [-X perslist] ps -o help ps -X help $ PERSONALITY=solaris,+extended ps -? usage: ps [-AacdefjLlPxy] [-C cmdlist] [-G grouplist] [-g pgrplist] [-n system [-n core]] [-O fmtlist] [-o fmtlist] [-p pidlist] [-s sidlist] [-t ttylist] [-U ruserlist] [-u userlist] [-X perslist] ps -o help ps -X help $ PERSONALITY=tru64 ps -? usage: ps [-Aadefjlmr] [-G grouplist] [-g pgrplist] [-n system [-n core]] [-O fmtlist] [-o fmtlist] [-p pidlist] [-s sidlist] [-t ttylist] [-U ruserlist] [-u userlist] [-X perslist] ps -o help ps -X help $ PERSONALITY=tru64,-posix ps -? usage: ps [-AaeghjlmrSsTuvwx] [-M core] [-N system] [-O fmtlist] [-o fmtlist] [-t tty] [-X perslist] ps -L ps -X help $ PERSONALITY=tru64,bsd ps -? same as above $¨PERSONALITY=susv3,any ps -o help %cpu %mem acflag args class command cpu cursig etime f gid group inblk intpri jobc ktrace label lim lockname login lstart majflt minflt msgrcv msgsnd mwchan nice nivcsw nsigs nswap nvcsw nwchan opri oublk paddr pagein pgid pid ppid pri pset psr re rgid rgroup rss rtprio ruid ruser scnt sid sig sigcatch sigignore sigmask sl start state stime svgid svuid systime sz tdev time tpgid tsid tsiz tt tty ucomm uid upr user usertime vsz xstat DFMT F5FMT FL5FMT JFMT L5FMT LFMT RUSAGE SCHED SFMT THREAD UFMT VFMT acflg addr blocked c caught cls cmd comm cp cputime dev flag flags ignored inblock l logname longtname longtty maxrss ni nsignals oublock pcpu pending pmem policy psxpri rssize rsz runame s scount sess session size slp stat tname traceflag tsess tsession u_procp uname uprocp usrpri util vsize wchan wname $ ps -O RUSAGE PID MINFLT MAJFLT NSWAP INBLK OUBLK MSGSND MSGRCV NSIGS NVCSW NIVCSW S TTY TIME COMMAND 76543 166 0 0 0 0 0 0 0 0 5 OL+ ttyp1 00:00:00 ps $ PERSONALITY=tru64,bsd ps -s UID PID PENDING BLOCKED IGNORED CAUGHT STAT TT TIME COMMAND 0 16231 0 0 18488000 0 OL+ p1 0:00.04 ps -s $ PERSONALITY=susv3 ps -fl F S UID PID PPID C PRI NI ADDR SZ WCHAN STIME TTY TIME CMD 4002 OL+ root 50522 16850 11 97 0 c20dc6e0 284 - 09:22:06 ttyp1 00:00:00 ps -fl $ PERSONALITY=solaris ps -flcy S UID PID PPID CLS PRI RSS SZ WCHAN STIME TTY TIME CMD OL+ root 54243 16850 normal 180 972 284 - 09:23:05 ttyp1 00:00:00 ps -flcy # PERSONALITY=susv3,+extended ps -lcy -C seti S UID PID PPID CLS PRI RSS SZ WCHAN TTY TIME CMD RN+ 1012 28746 13529 normal 223 14504 16284 - consolectl 12-08:27:48 setiathome $ PERSONALITY=tru64,+extended ps -ly S UID PID PPID %CPU PRI NI RSS VSZ WCHAN TTY TIME CMD OL+/ 0 59242 16850 0.0 103 0 992K 1.51M - ttyp1 00:00:00 ps5 PS : note the S (O means on cpu), RSS.VSZ (tru64 format) and TIME (posix format) columns... all internals are dynamically generated, such as format strings : for native freebsd : label:Z user:!nju uid:!d!vnl pid:djl1uv ppid:jl pgid:j jobc:j cpu:l pri:l nice:l %cpu:u %mem:u vsz:lu rss:lu mwchan:!nl tt:d2u state:djl2uv start:u tt:jl time:djl2uv sl:v re:v pagein:v vsz:v rss:v lim:v tsiz:v %cpu:v %mem:v command:djl2uv for native susv3 : f:!ylx s:lx user:fx uid:l pid:dflx ppid:flx c:!cflx pri:!clx intpri:c nice:!clx addr:!ylx vsz:lx wchan:lx tty:dl stime:fx tty:fx time:!Ldflx comm:dl args:fx for extended susv3 : label:M f:!ylx s:lx user:fx uid:l pid:dflxj1 ppid:flxj pgid:j sid:j psr:P c:!cflx class:c pri:!clx intpri:c nice:!clx psr:P addr:!ylx rss:y vsz:lx=SZ wchan:lx tty:dlj s:2 stime:fx tty:fx2 time:!Ldflxj2 comm:dlj2 args:fx PS : 1 and 2 stand for -O, x stands for -fl, !x say not -x Cyrille Lefevre. -- home: mailto:cyrille.lefevre@laposte.net From owner-freebsd-arch@FreeBSD.ORG Fri Mar 26 10:38:08 2004 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3D6DA16A4CF; Fri, 26 Mar 2004 10:38:08 -0800 (PST) Received: from harmony.village.org (rover.bsdimp.com [204.144.255.66]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9DCE443D39; Fri, 26 Mar 2004 10:38:07 -0800 (PST) (envelope-from imp@bsdimp.com) Received: from localhost (warner@rover2.village.org [10.0.0.1]) by harmony.village.org (8.12.10/8.12.9) with ESMTP id i2QIc2kj046680; Fri, 26 Mar 2004 11:38:02 -0700 (MST) (envelope-from imp@bsdimp.com) Date: Fri, 26 Mar 2004 11:37:51 -0700 (MST) Message-Id: <20040326.113751.14204546.imp@bsdimp.com> To: des@des.no From: "M. Warner Losh" In-Reply-To: References: <200403260230.i2Q2UTNZ097932@green.homeunix.org> 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: das@freebsd.org cc: tanimura@tanimura.dyndns.org cc: arch@freebsd.org Subject: Re: Is MTX_CONTESTED evil? X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Mar 2004 18:38:08 -0000 In message: des@des.no (Dag-Erling Sm=F8rgrav) writes: : "Brian F. Feldman" writes: : > Well, that certainly explains the blitz of crashes I had to fix : > recently! Since INVARIANTS and WITNESS are on by default, it would= : > make sense to make ADAPTIVE_MUTEX default to catch more bugs. : = : Making ADAPTIVE_MUTEXES default will not catch more bugs, it will jus= t : piss off users. I think that if we don't fix the class of bugs that AM points out, we'll ruin our reputation as a quality system in the long run. Maybe they are so pervasive that we don't want to turn it on by default just yet, but there will come a time we turn it on, just like we turned on WITNESS and INVARIANTS to get better coverage on our testing. Warner From owner-freebsd-arch@FreeBSD.ORG Fri Mar 26 12:46:24 2004 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 691B516A4CE; Fri, 26 Mar 2004 12:46:24 -0800 (PST) Received: from rwcrmhc11.comcast.net (rwcrmhc11.comcast.net [204.127.198.35]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4695743D55; Fri, 26 Mar 2004 12:46:24 -0800 (PST) (envelope-from albert@users.sf.net) Received: from c-65-34-189-253.se.client2.attbi.com ([65.34.189.253]) by comcast.net (rwcrmhc11) with SMTP id <2004032620462301300fv4a6e>; Fri, 26 Mar 2004 20:46:23 +0000 From: Albert Cahalan To: arch@freebsd.org Content-Type: text/plain Organization: Message-Id: <1080334271.2255.1301.camel@cube> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.4 Date: 26 Mar 2004 15:51:11 -0500 Content-Transfer-Encoding: 7bit cc: das@freebsd.org cc: drosih@rpi.edu cc: cyrille.lefevre@laposte.net Subject: posix ps (was Re: Adding `pgrep' and `pkill' to /usr/bin) X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Mar 2004 20:46:24 -0000 Cyrille Lefevre writes: > two years ago, I've added posix syntax and so to my locally ps(1). > for instance, I'm currently adding the notion of dynamic personalities OK, would YOU be interested in working with me on some sort of common ps specification beyond what SUSv3 has to offer? I'd love to see something that Sun could adopt, and that could be mostly merged into the next revision of the standard. > (the term comes from linux) instead of static #define such as... say : > > $ ps -X help > any bsd bsd43reno bsd44 default extended freebsd hpux irix netbsd none openbsd > pedantic posix relaxed solaris sunos susv3 tru64 So you use "-X" as an escape into long options? Why not "--help"? > personalities enable options such as : > bsd ps : > -g and -n from sunos, -s from tru64 and some other options. > posix ps : see susv3 man (see > http://www.opengroup.org/onlinepubs/007904975/toc.htm) > -j from all except posix > -c, -y and -P from solaris > -C cmdlist (ala pgrep :) and -x from hpux That "-x" will hurt you. Without it, it is easy for a SUSv3 parser to detect the common old "ps -ax" syntax. BTW, I have a regression test suite that you might find useful. > -M from irix Do you have documentation or examples for this? > and some others > they also enable many keywords such as : > RUSAGE and co from tru64, class and psr from solaris, and many others > (mostly aliases) > > when finished, I'll probably submit these changes as a port in the meantime > since I suppose -arch will reject these important changes to a native command. > the most important and not done part is... the manual page. any volonteers ? Step 1: a. ps does old BSD behavior by default b. /posix/bin/ps is a script that sets the SUSv3 personality c. /usr/ucb/ps is a link to /bin/ps Step 2: a. ps does SUSv3 by default b. /posix/bin/ps is a link to /bin/ps c. /usr/ucb/ps is a script that sets the old BSD personality > $ PERSONALITY=susv3,+extended ps -? > usage: ps [-AacdefjlPxy] [-C cmdlist] [-G grouplist] [-g pgrplist] > [-n system [-n core]] [-O fmtlist] [-o fmtlist] [-p pidlist] > [-s sidlist] [-t ttylist] [-U ruserlist] [-u userlist] [-X perslist] > ps -o help > ps -X help What syntax do you use for PERSONALITY settings? Let's do something compatible. The name isn't so good. Tru64 uses CMD_ENV for this, affecting more than just ps. I made PS_PERSONALITY take priority so that you could change ps behavior without changing other behaviors. You forgot the "-F" from DYNIX/ptx. It's really nice. From owner-freebsd-arch@FreeBSD.ORG Fri Mar 26 14:10:37 2004 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 48FB816A4CE for ; Fri, 26 Mar 2004 14:10:37 -0800 (PST) Received: from mail2.speakeasy.net (mail2.speakeasy.net [216.254.0.202]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2684843D48 for ; Fri, 26 Mar 2004 14:10:37 -0800 (PST) (envelope-from jhb@FreeBSD.org) Received: (qmail 11381 invoked from network); 26 Mar 2004 22:10:34 -0000 Received: from dsl027-160-063.atl1.dsl.speakeasy.net (HELO server.baldwin.cx) ([216.27.160.63]) (envelope-sender ) encrypted SMTP for ; 26 Mar 2004 22:10:34 -0000 Received: from 10.50.40.205 (gw1.twc.weather.com [216.133.140.1]) by server.baldwin.cx (8.12.10/8.12.10) with ESMTP id i2QMAFDI018756; Fri, 26 Mar 2004 17:10:26 -0500 (EST) (envelope-from jhb@FreeBSD.org) From: John Baldwin To: "M. Warner Losh" Date: Fri, 26 Mar 2004 14:04:57 -0500 User-Agent: KMail/1.6 References: <200403260230.i2Q2UTNZ097932@green.homeunix.org> <20040326.113751.14204546.imp@bsdimp.com> In-Reply-To: <20040326.113751.14204546.imp@bsdimp.com> MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Message-Id: <200403261404.57741.jhb@FreeBSD.org> X-Spam-Checker-Version: SpamAssassin 2.63 (2004-01-11) on server.baldwin.cx cc: arch@freebsd.org cc: des@des.no cc: das@freebsd.org cc: tanimura@tanimura.dyndns.org Subject: Re: Is MTX_CONTESTED evil? X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Mar 2004 22:10:37 -0000 On Friday 26 March 2004 01:37 pm, M. Warner Losh wrote: > In message: > > des@des.no (Dag-Erling Sm=F8rgrav) writes: > : "Brian F. Feldman" writes: > : > Well, that certainly explains the blitz of crashes I had to fix > : > recently! Since INVARIANTS and WITNESS are on by default, it would > : > make sense to make ADAPTIVE_MUTEX default to catch more bugs. > : > : Making ADAPTIVE_MUTEXES default will not catch more bugs, it will just > : piss off users. > > I think that if we don't fix the class of bugs that AM points out, > we'll ruin our reputation as a quality system in the long run. Maybe > they are so pervasive that we don't want to turn it on by default just > yet, but there will come a time we turn it on, just like we turned on > WITNESS and INVARIANTS to get better coverage on our testing. Right, let's not just gratuitously break everyone right yet. It's actually= an=20 option largely b/c I want us to be able to benchmark it once our locking is= =20 farther along to see if it helps more than it hurts. =2D-=20 John Baldwin <>< http://www.FreeBSD.org/~jhb/ "Power Users Use the Power to Serve" =3D http://www.FreeBSD.org From owner-freebsd-arch@FreeBSD.ORG Fri Mar 26 14:15:02 2004 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D101B16A4CE; Fri, 26 Mar 2004 14:15:02 -0800 (PST) Received: from huva.hittite.isp.9tel.net (huva.hittite.isp.9tel.net [62.62.156.28]) by mx1.FreeBSD.org (Postfix) with ESMTP id D1BEC43D1D; Fri, 26 Mar 2004 14:15:01 -0800 (PST) (envelope-from cyrille.lefevre@laposte.net) Received: from pc2k (unknown [81.185.204.209]) by huva.hittite.isp.9tel.net (Postfix) with SMTP id CC6329BB60; Fri, 26 Mar 2004 23:15:45 +0100 (CET) Message-ID: <1b9301c4137f$c73acb70$7890a8c0@dyndns.org> From: "Cyrille Lefevre" To: , "Garance A Drosihn" References: Date: Fri, 26 Mar 2004 23:14:59 +0100 Organization: ACME MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 cc: Alexey Dokuchaev cc: freebsd-arch@freebsd.org Subject: Re: PATCH for a more-POSIX `ps', and related adventures X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Mar 2004 22:15:03 -0000 "Garance A Drosihn" wrote: > [this is BCC'ed to -arch so more people have a chance to see it, but > I expect most of the discussion to happen in freebsd-standards]. argh! thread not seen before. please, see my post in -arch entiled : posix ps (was Re: Adding `pgrep' and `pkill' to /usr/bin) > It started out that I just wanted to get rid of one message that > `ps' writes to stderr in -current but not in -stable. "As long as > I was there", I thought I'd add support for a comma-separated list > of processes for `ps -p' (as described in SUSv3). Alexey Dokuchaev > asked if this change got us much closer to POSIX/SUS. Now it did > get us a *little* closer, but in re-reading SUSv3 I realized that > I didn't get it (that one option) quite as close as I would like. > So, "as long as I was there", I figured I should try to come a > little closer. > > Now, after about 30 consecutive "as long as I was there" small > projects, I have an update which: > Changes -p so it accepts a list of process IDs, and -t so > it accepts a list of terminal names (instead of only > allowing a single value). done also > Adds the -A option of SUSv3 (exactly the same as `-ax') well, if sunos -g option is added (done in my implementation), -A (posix) is more -agx than -ax, while -d (posix) stands for -ag. > Adds the `-G gidlist' and '-g pgidlist' options of SYSv3. > (note that this replaced a null `-g' option...) also done. > Adds a `-R ruserlist' option, which is the same as what > SYSv3 describes for `-u' (we already have a `-u'). > Amazingly, none of solaris, linux, or irix seem to > have any kind of `-R' option. please, don't. for two reason : - don't try to mix bsd/posix options. this will be more confusing to have yet another non conformant option. - prefer a switch and/or environment variable to switch between bsd and posix syntax. and stay conformant to each syntax depending to which syntax was selected. a kind of what is done on tru64 (w/ or w/o dash), irix (_XPG=1 env), hpux (UNIX95=1 env), linux (PS_PERSONALITY=posix env), etc. > Adds a `-s sidlist' option, which is not in SUSv3, but > it is in solaris, linux, and irix -- and it's an > option I have personally wished for on occasion... also done. > Allows the user to specify any of these "selector options" > multiple times, and have it keep adding to that > list instead of replacing values for that list. also done > Better parsing of options. Better error messages for > invalid values (IMO). also done. > Fixes interactions between all these "selector options", > & our `-x' option (which is not mentioned in SUSv3). > For the selector options, I tried to meet the > description of: "If any are specified, the default > list shall be ignored and ps shall select the > processes represented by the inclusive OR of all > the selection-criteria options." not seen, so, not done for instance but will be. > Applies all these selection criteria *before* sorting > the list of processes we get from kvm_getprocs(), > and before using the list to compute the sizes of > the output fields. not done but cleaner. > That does not get us matching POSIX/SUSv3, but it does get us a > lot closer. There are a few questions/issues that came up for me > while writing this, but I'll list those in separate messages. I'll > also do a minimal update to the man page before commiting this. > > I wanted to do this without bloating up the size of `ps' by too > much, and on i386 the executable has grown by --- 164 bytes! > (0.6% increase)! [at this point I will do a touchdown-style > victory dance, and spike my keyboard into the floor...] > > The update weighs in at almost 900 lines, and is available at: > http://people.freebsd.org/~gad/ps-susv3.diff > > I certainly didn't intend to end up with that large of an update, > but at this point I'm not going to go back and try to break it > down into 30 separate updates of 50 lines each... > > Please look it over, try it out, and let me know if these options > seem to work the way you'd expect them to, or if I have messed > anything up. And please please PLEASE -- don't give me any more > ideas of something *else* I could do "as long as I'm there"! my first implementation statically add all susv3 plus some solaris options, many keywords or aliases. the current implementation I'm working on may dynamically switch between one or another syntax (principally bsd, posix, hpux, irix, sunos, solaris (posix and ucb) and tru64(posix and bsd)) and may also combine some of them. I could provide you the patch for the statically (#ifdef's) posix adds or, if you prefer to wait a week or two, a patch for the dynamically posix adds I'm working on. Cyrille Lefevre. -- home: mailto:cyrille.lefevre@laposte.net From owner-freebsd-arch@FreeBSD.ORG Fri Mar 26 14:36:33 2004 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id B68E316A4CE; Fri, 26 Mar 2004 14:36:33 -0800 (PST) Received: from smtp4.server.rpi.edu (smtp4.server.rpi.edu [128.113.2.4]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5910543D4C; Fri, 26 Mar 2004 14:36:33 -0800 (PST) (envelope-from drosih@rpi.edu) Received: from [128.113.24.47] (gilead.netel.rpi.edu [128.113.24.47]) by smtp4.server.rpi.edu (8.12.8/8.12.8) with ESMTP id i2QMaWXf016866; Fri, 26 Mar 2004 17:36:32 -0500 Mime-Version: 1.0 X-Sender: drosih@mail.rpi.edu Message-Id: In-Reply-To: <1b9301c4137f$c73acb70$7890a8c0@dyndns.org> References: <1b9301c4137f$c73acb70$7890a8c0@dyndns.org> Date: Fri, 26 Mar 2004 17:36:30 -0500 To: "Cyrille Lefevre" , From: Garance A Drosihn Content-Type: text/plain; charset="us-ascii" ; format="flowed" X-Scanned-By: CanIt (www . canit . ca) cc: Alexey Dokuchaev cc: Albert Cahalan cc: freebsd-arch@freebsd.org Subject: Re: PATCH for a more-POSIX `ps', and related adventures X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Mar 2004 22:36:33 -0000 At 11:14 PM +0100 3/26/04, Cyrille Lefevre wrote: >"Garance A Drosihn" wrote: > > > [this is BCC'ed to -arch so more people have a chance to see > > it, but I expect most of the discussion to happen in > > freebsd-standards]. > >argh! thread not seen before. please, see my post in -arch entiled : >posix ps (was Re: Adding `pgrep' and `pkill' to /usr/bin) You need to catch up on the entire thread before replying. If you are only following -arch, then note that most of the discussion has happened in -standards. Let me save you a little concern, and say that "for now" I have backed away from any of the options where there has been some debate over whether the option would create more headaches than it solves. (most of them are still in the code, but #ifdef'ed out until I do some more thinking). If nothing else, make sure you understand my latest patch, which I intend to commit tonight or tomorrow. The ship has pretty much sailed at this point, because I can't just keep increasing the size of the patch and throwing around multi-hundred line emails every two hours for the next two months. I need to commit the part that I have now, and then think of what I want to do next. We are not going to commit one 10,000 line patch to `ps', attempting to solve every problem ever known to man all at once. I am fairly confident that the 1,000 line patch that I have right now is safe, and is a step forward, and does not bloat the size of /bin/ps, and does not get us into much trouble wrt future changes. Those are all good things. I intend to commit what I have written and debugged. I just sort of stumbled into this `ps' issue last week, and I have worked many hours on what I have done. I know it falls far short of the perfect solution, but I am doing something and I am willing to listen to further ideas. However, I cannot devote my life to `ps', so I will juggle this work with all the other work that I'm trying to do. [I'm also several lines in to a reply to your other message to freebsd-arch, but I'll send this shorter reply right now...] -- Garance Alistair Drosehn = gad@gilead.netel.rpi.edu Senior Systems Programmer or gad@freebsd.org Rensselaer Polytechnic Institute or drosih@rpi.edu From owner-freebsd-arch@FreeBSD.ORG Fri Mar 26 14:51:31 2004 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4163F16A4CE; Fri, 26 Mar 2004 14:51:31 -0800 (PST) Received: from ioskeha.hittite.isp.9tel.net (ioskeha.hittite.isp.9tel.net [62.62.156.27]) by mx1.FreeBSD.org (Postfix) with ESMTP id C5D6D43D2D; Fri, 26 Mar 2004 14:51:30 -0800 (PST) (envelope-from root@gits.dyndns.org) Received: from mail.gits.dyndns.org (unknown [81.185.204.209]) by ioskeha.hittite.isp.9tel.net (Postfix) with ESMTP id 3FAF817B4B9; Fri, 26 Mar 2004 23:51:42 +0100 (CET) Received: from pc2k (pc2k [192.168.144.120]) by mail.gits.dyndns.org (8.12.10/8.12.10) with SMTP id i2QMpOSP089150; Fri, 26 Mar 2004 23:51:25 +0100 (CET) (envelope-from root@gits.dyndns.org) Message-ID: <1b9701c41384$ddff8da0$7890a8c0@dyndns.org> From: "Cyrille Lefevre" To: "Albert Cahalan" , References: <1080334271.2255.1301.camel@cube> Date: Fri, 26 Mar 2004 23:51:24 +0100 Organization: ACME MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 X-Spam-Status: No, hits=-100 required=5 tests=USER_IN_WHITELIST X-Scanned-By: MIMEDefang 2.38 cc: freebsd-standards@freebsd.org cc: das@freebsd.org cc: drosih@rpi.edu Subject: Re: posix ps (was Re: Adding `pgrep' and `pkill' to /usr/bin) X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Mar 2004 22:51:31 -0000 "Albert Cahalan" wrote: > Cyrille Lefevre writes: > > > two years ago, I've added posix syntax and so to my locally ps(1). > > for instance, I'm currently adding the notion of dynamic personalities > > OK, would YOU be interested in working with me on some sort of > common ps specification beyond what SUSv3 has to offer? I'd love > to see something that Sun could adopt, and that could be mostly > merged into the next revision of the standard. why not :) > > (the term comes from linux) instead of static #define such as... say : > > > > $ ps -X help > > any bsd bsd43reno bsd44 default extended freebsd hpux irix netbsd none openbsd > > pedantic posix relaxed solaris sunos susv3 tru64 > > So you use "-X" as an escape into long options? Why not "--help"? no, PERSONALITY=solaris is the same as -X solaris. -X is the option I use to switch between personalities. so, -X help is a sort of -L which lists available keywords. -o help in the posix syntax stands for -L in the bsd syntax. I don't use -L as in the bsd syntax to avoid a conflict with -L which permit to list threads in the solaris syntax. > > personalities enable options such as : > > bsd ps : > > -g and -n from sunos, -s from tru64 and some other options. > > posix ps : see susv3 man (see > > http://www.opengroup.org/onlinepubs/007904975/toc.htm) > > -j from all except posix > > -c, -y and -P from solaris > > -C cmdlist (ala pgrep :) and -x from hpux > > That "-x" will hurt you. Without it, it is easy for a SUSv3 parser > to detect the common old "ps -ax" syntax. well, hpux -f only list the first 64 characters of a command line (where solaris list the first 80 ones), the hpux -x option is equivalent to the bsd -ww option. > BTW, I have a regression test suite that you might find useful. yes, of course. for instance, I'm trying to resolve header's naming, say user is USER or UID depending of the personality... etc. > > -M from irix > > Do you have documentation or examples for this? irix -M is freebsd -Z, so, simple to implement :) > > and some others > > they also enable many keywords such as : > > RUSAGE and co from tru64, class and psr from solaris, and many others > > (mostly aliases) > > > > when finished, I'll probably submit these changes as a port in the meantime > > since I suppose -arch will reject these important changes to a native command. > > the most important and not done part is... the manual page. any volonteers ? > > Step 1: > > a. ps does old BSD behavior by default true > b. /posix/bin/ps is a script that sets the SUSv3 personality > c. /usr/ucb/ps is a link to /bin/ps no problem. > Step 2: > > a. ps does SUSv3 by default > b. /posix/bin/ps is a link to /bin/ps > c. /usr/ucb/ps is a script that sets the old BSD personality > > > $ PERSONALITY=susv3,+extended ps -? > > usage: ps [-AacdefjlPxy] [-C cmdlist] [-G grouplist] [-g pgrplist] > > [-n system [-n core]] [-O fmtlist] [-o fmtlist] [-p pidlist] > > [-s sidlist] [-t ttylist] [-U ruserlist] [-u userlist] [-X perslist] > > ps -o help > > ps -X help > > What syntax do you use for PERSONALITY settings? Let's do > something compatible. [=+-]keyword[,[=+-]keyword ...] "=" is optional and say "this personality", "+" say add "this personality" to the previous one, and "-" say delete "this personality" to the previous one. possible personalities by themself are : bsd43reno bsd44 default freebsd hpux irix netbsd openbsd solaris sunos susv3 tru64 any : all above none : none of the above possible switches bsd : bsd syntax extended : allow enhanced options and keywords. pedantic : be strict about the syntax (-p pid instead of -p pidlist) posix : posix syntax (! bsd) relaxed : ! pedantic some examples : tru64,-posix is equivalent to tru64,+bsd since tru64 implies +posix freebsd,-pedantic,+extended allow -p pidlist, -g and -n sunos options and -s tru64 options. susv3,+extended is strictly posix but allow the following options : -C cmdlist hpux : select processes by name -c irix/hpux/solaris : omit c and nice column, add cls column -j irix/hpux/solaris/tru64 : job control informations -O fmtlist bsd/tru64 : pid fmtlist s tty time comm -P hpux/solaris : add psr column -s sidlist irix/hpux/solaris/tru64 : select process by session id -x hpux : equivalent to -ww bsd option -y solaris : omit f and addr columns, add rss column > The name isn't so good. Tru64 uses CMD_ENV for this, affecting > more than just ps. I made PS_PERSONALITY take priority so that > you could change ps behavior without changing other behaviors. PS_PERSONALITY is the name that linux uses. this may conflict in .profiles since the syntax is different. to complete what you say : irix uses _XPG=1 and hpux uses UNIX95=1 of course, all of them could be tested for more and more compatobility :) > You forgot the "-F" from DYNIX/ptx. It's really nice. any pointer ? Cyrille Lefevre. -- home: mailto:cyrille.lefevre@laposte.net From owner-freebsd-arch@FreeBSD.ORG Fri Mar 26 15:17:07 2004 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 028D616A4CE; Fri, 26 Mar 2004 15:17:07 -0800 (PST) Received: from mtaw4.prodigy.net (mtaw4.prodigy.net [64.164.98.52]) by mx1.FreeBSD.org (Postfix) with ESMTP id E609043D45; Fri, 26 Mar 2004 15:17:06 -0800 (PST) (envelope-from kris@obsecurity.org) Received: from obsecurity.dyndns.org (780e70e64c084c0dc03a45a91a1b1b2c@adsl-67-115-73-128.dsl.lsan03.pacbell.net [67.115.73.128]) by mtaw4.prodigy.net (8.12.10/8.12.10) with ESMTP id i2QNGZfG022805; Fri, 26 Mar 2004 15:16:39 -0800 (PST) Received: by obsecurity.dyndns.org (Postfix, from userid 1000) id 5F98F5267B; Fri, 26 Mar 2004 15:16:35 -0800 (PST) Date: Fri, 26 Mar 2004 15:16:35 -0800 From: Kris Kennaway To: John Baldwin Message-ID: <20040326231635.GA91340@xor.obsecurity.org> References: <200403260230.i2Q2UTNZ097932@green.homeunix.org> <20040326.113751.14204546.imp@bsdimp.com> <200403261404.57741.jhb@FreeBSD.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="d6Gm4EdcadzBjdND" Content-Disposition: inline In-Reply-To: <200403261404.57741.jhb@FreeBSD.org> User-Agent: Mutt/1.4.2.1i cc: arch@freebsd.org cc: das@freebsd.org cc: tanimura@tanimura.dyndns.org cc: des@des.no Subject: Re: Is MTX_CONTESTED evil? X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Mar 2004 23:17:07 -0000 --d6Gm4EdcadzBjdND Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Mar 26, 2004 at 02:04:57PM -0500, John Baldwin wrote: > On Friday 26 March 2004 01:37 pm, M. Warner Losh wrote: > > In message: > > > > des@des.no (Dag-Erling Sm?rgrav) writes: > > : "Brian F. Feldman" writes: > > : > Well, that certainly explains the blitz of crashes I had to fix > > : > recently! Since INVARIANTS and WITNESS are on by default, it would > > : > make sense to make ADAPTIVE_MUTEX default to catch more bugs. > > : > > : Making ADAPTIVE_MUTEXES default will not catch more bugs, it will just > > : piss off users. > > > > I think that if we don't fix the class of bugs that AM points out, > > we'll ruin our reputation as a quality system in the long run. Maybe > > they are so pervasive that we don't want to turn it on by default just > > yet, but there will come a time we turn it on, just like we turned on > > WITNESS and INVARIANTS to get better coverage on our testing. >=20 > Right, let's not just gratuitously break everyone right yet. It's actual= ly an=20 > option largely b/c I want us to be able to benchmark it once our locking = is=20 > farther along to see if it helps more than it hurts. FYI, I'm going to run with this on the bento cluster for a bit to dig out some of these bugs. Kris --d6Gm4EdcadzBjdND Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (FreeBSD) iD8DBQFAZLnSWry0BWjoQKURArDUAJ46SbMSJ7n09fOkq4xLI2v+UumqbgCgr6VR z2aA1EdivOoO71pvYyqLF7c= =Vq/L -----END PGP SIGNATURE----- --d6Gm4EdcadzBjdND-- From owner-freebsd-arch@FreeBSD.ORG Fri Mar 26 16:08:25 2004 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9E08E16A4CE; Fri, 26 Mar 2004 16:08:25 -0800 (PST) Received: from sccrmhc12.comcast.net (sccrmhc12.comcast.net [204.127.202.56]) by mx1.FreeBSD.org (Postfix) with ESMTP id 340C043D3F; Fri, 26 Mar 2004 16:08:25 -0800 (PST) (envelope-from albert@users.sf.net) Received: from c-65-34-189-253.se.client2.attbi.com ([65.34.189.253]) by comcast.net (sccrmhc12) with SMTP id <2004032700082301200605dfe>; Sat, 27 Mar 2004 00:08:24 +0000 From: Albert Cahalan To: Cyrille Lefevre In-Reply-To: <1b9701c41384$ddff8da0$7890a8c0@dyndns.org> References: <1080334271.2255.1301.camel@cube> <1b9701c41384$ddff8da0$7890a8c0@dyndns.org> Content-Type: text/plain Organization: Message-Id: <1080346391.2255.1347.camel@cube> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.4 Date: 26 Mar 2004 19:13:11 -0500 Content-Transfer-Encoding: 7bit cc: arch@freebsd.org cc: das@freebsd.org cc: drosih@rpi.edu cc: freebsd-standards@freebsd.org cc: Albert Cahalan Subject: Re: posix ps (was Re: Adding `pgrep' and `pkill' to /usr/bin) X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Mar 2004 00:08:25 -0000 On Fri, 2004-03-26 at 17:51, Cyrille Lefevre wrote: > "Albert Cahalan" wrote: > > > Cyrille Lefevre writes: > > > > > two years ago, I've added posix syntax and so to my locally ps(1). > > > for instance, I'm currently adding the notion of dynamic personalities > > > > OK, would YOU be interested in working with me on some sort of > > common ps specification beyond what SUSv3 has to offer? I'd love > > to see something that Sun could adopt, and that could be mostly > > merged into the next revision of the standard. > > why not :) Great. Unless people object, I'll wipe the Cc: list for this. BTW, I hadn't meant to imply that any other person was being some kind of uncooperative prick. We all have time constraints and plenty of projects. > > So you use "-X" as an escape into long options? Why not "--help"? > > no, PERSONALITY=solaris is the same as -X solaris. -X is the option > I use to switch between personalities. so, -X help is a sort of -L which > lists available keywords. -o help in the posix syntax stands for -L in > the bsd syntax. I don't use -L as in the bsd syntax to avoid a > conflict with -L which permit to list threads in the solaris syntax. Oh, OK. It's kind of weird, since "ps -o pid,help,comm" would seem to be something for 3 columns, but suit yourself. I didn't bother, thinking "ps L" and "man ps" would do. I suppose the -X has to be the first option...? > > > personalities enable options such as : > > > bsd ps : > > > -g and -n from sunos, -s from tru64 and some other options. > > > posix ps : see susv3 man (see > > > http://www.opengroup.org/onlinepubs/007904975/toc.htm) > > > -j from all except posix > > > -c, -y and -P from solaris > > > -C cmdlist (ala pgrep :) and -x from hpux > > > > That "-x" will hurt you. Without it, it is easy for a SUSv3 parser > > to detect the common old "ps -ax" syntax. > > well, hpux -f only list the first 64 characters of a command line > (where solaris list the first 80 ones), the hpux -x option is > equivalent to the bsd -ww option. Eh, "-ww" plus turning on argument display, right? It's the opposite of BSD "c" AFAIK, and implied by "-f". > > BTW, I have a regression test suite that you might find useful. > > yes, of course. for instance, I'm trying to resolve header's naming, > say user is USER or UID depending of the personality... etc. First of all, perfection is the enemy of good. Part of my solution: {"uid_hack", "UID", pr_euser, sr_nop, 8, USR, XXX, ET|USER}, > > > -M from irix > > > > Do you have documentation or examples for this? > > irix -M is freebsd -Z, so, simple to implement :) It's never that simple. > > > $ PERSONALITY=susv3,+extended ps -? > > > usage: ps [-AacdefjlPxy] [-C cmdlist] [-G grouplist] [-g pgrplist] > > > [-n system [-n core]] [-O fmtlist] [-o fmtlist] [-p pidlist] > > > [-s sidlist] [-t ttylist] [-U ruserlist] [-u userlist] [-X > perslist] > > > ps -o help > > > ps -X help > > > > What syntax do you use for PERSONALITY settings? Let's do > > something compatible. > > [=+-]keyword[,[=+-]keyword ...] > > "=" is optional and say "this personality", "+" say add "this personality" > to the previous one, and "-" say delete "this personality" to the previous one. > > possible personalities by themself are : > bsd43reno bsd44 default freebsd hpux irix netbsd openbsd solaris sunos susv3 > tru64 > any : all above > none : none of the above The bsd43reno/bsd44/freebsd distinction is interesting. I hope you'll add "linux" to your list. :-) I was hoping that your syntax covered fall-back choices. Then I could ask for "unixware" as a first choice, and for "posix" if "unixware" is unknown. > possible switches > bsd : bsd syntax > extended : allow enhanced options and keywords. > pedantic : be strict about the syntax (-p pid instead of -p pidlist) It's normal to allow a list. The list is either the remaining part of the current argument ("ps -p42,45,16") or the next one. I ban crud like "ps -p 42,,7" and "ps -p ,42,91,". > > The name isn't so good. Tru64 uses CMD_ENV for this, affecting > > more than just ps. I made PS_PERSONALITY take priority so that > > you could change ps behavior without changing other behaviors. > > PS_PERSONALITY is the name that linux uses. this may conflict in > .profiles since the syntax is different. to complete what you say : > irix uses _XPG=1 and hpux uses UNIX95=1 > of course, all of them could be tested for more and more compatobility :) Heh. I do in fact check _XPG=1 and UNIX95=1. > > You forgot the "-F" from DYNIX/ptx. It's really nice. > > any pointer ? It's a friendly format, kind of along the lines of BSD "u". $ ps -F UID PID PPID C SZ RSS PSR STIME TTY TIME CMD albert 21666 21665 1 770 1672 0 19:11 pts/14 00:00:00 bash albert 21674 21666 0 744 880 0 19:11 pts/14 00:00:00 ps -F From owner-freebsd-arch@FreeBSD.ORG Fri Mar 26 16:13:50 2004 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0DB5516A4CE; Fri, 26 Mar 2004 16:13:50 -0800 (PST) Received: from smtp2.server.rpi.edu (smtp2.server.rpi.edu [128.113.2.2]) by mx1.FreeBSD.org (Postfix) with ESMTP id B8F7043D41; Fri, 26 Mar 2004 16:13:49 -0800 (PST) (envelope-from drosih@rpi.edu) Received: from [128.113.24.47] (gilead.netel.rpi.edu [128.113.24.47]) by smtp2.server.rpi.edu (8.12.8/8.12.8) with ESMTP id i2R0DkLI006688; Fri, 26 Mar 2004 19:13:49 -0500 Mime-Version: 1.0 X-Sender: drosih@mail.rpi.edu Message-Id: In-Reply-To: <1a9c01c41359$b3da45e0$7890a8c0@dyndns.org> References: <20040325070120.GA67497@VARK.homeunix.com> <1a9c01c41359$b3da45e0$7890a8c0@dyndns.org> Date: Fri, 26 Mar 2004 19:13:45 -0500 To: "Cyrille Lefevre" , "David Schultz" From: Garance A Drosihn Content-Type: text/plain; charset="us-ascii" ; format="flowed" X-Scanned-By: CanIt (www . canit . ca) cc: "Jacques A. Vidrine" cc: arch@freebsd.org cc: Albert Cahalan Subject: Re: posix ps (was Re: Adding `pgrep' and `pkill' to /usr/bin) X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Mar 2004 00:13:50 -0000 At 6:40 PM +0100 3/26/04, Cyrille Lefevre wrote: > >two years ago, I've added posix syntax and so to my locally >ps(1). For instance, I'm currently adding the notion of >dynamic personalities (the term comes from linux) instead >of static #define such as... say : > >$ ps -X help > any bsd bsd43reno bsd44 default extended freebsd hpux > irix netbsd none openbsd pedantic posix relaxed solaris > sunos susv3 tru64 ...etc... >When finished, I'll probably submit these changes as a port, >... since I suppose -arch will reject these important changes >to a native command. I (personally) think that is overkill for a base-system command. I do think that it is important for us to improve on what we have for `ps, but that does not mean we immediately have to rush out and re-implement every version of `ps' on the planet. You are suggesting that we go from being the least feature-full and most-oddball `ps', to trying to match every `ps' along with every subtle formatting-nuance of every system. With the changes that I just did, I went through a fair amount of trouble to make sure that I was not increasing the size of `ps'. There are some FreeBSD users who need to squeeze the OS onto very small file systems, and I think that is a reasonable thing for our users to want. I (personally) think that the size and complexity of some all-encompassing `ps' is not worth the effort, and not worth the PR's we will get over every feature does not *EXACTLY* match how it behaves on the "original OS". I can see your `ps' being a very good option to have as a port, and I might even install it in some situations, but I do not think we want something that elaborate for a base-system command. >here are some sample outputs : > >$ PERSONALITY=freebsd ps -? Secondly, I personally am not fond of commands which COMPLETELY change their behavior based on environment variables. Different options, different formats, different rules. If nothing else, writing the man page for that would be a real nightmare, and I am no good at writing man pages... :-) - - - - - - - - - - - - - - - - - - - - - - - - - HOWEVER, Note that in a different message, written on March 25/2004, Jacques A. Vidrine wrote: >On Mon, Mar 22, 2004, Garance A Drosihn wrote: > > Great. So what should I do here? > >I dunno. Add a completely POSIX compliant ps command into >/usr/posix ? Or replace /usr/bin/ps with a completely POSIX >compliant ps and move our traditional one to /usr/ucb? :-) > >Seriously, we should give some hard thought into how to >provide/migrate to a POSIX compatible utilities environment. >It's been discussed on the lists before, but I still believe >providing POSIX compatible versions of utilities on a separate >path is the only clean way to make this happen. I do have some ideas of what I want to do to provide FreeBSD users with at least an option for posix behavior out of `ps'. I was going to write those up in reply to this message, but I have a steady-stream of "emergency interruptions" (here at work) today, and I'm supposed to be somewhere else right now, so I guess my thoughts will wait until a later date. The one thing I would say is that I expect to do a few gradual updates which will get us "somewhat better". I do not expect to write one cure-all update that attempts to solve everything at once. That is just not the way I like to work. -- Garance Alistair Drosehn = gad@gilead.netel.rpi.edu Senior Systems Programmer or gad@freebsd.org Rensselaer Polytechnic Institute or drosih@rpi.edu From owner-freebsd-arch@FreeBSD.ORG Fri Mar 26 16:59:52 2004 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 14C3716A4CE; Fri, 26 Mar 2004 16:59:52 -0800 (PST) Received: from sccrmhc11.comcast.net (sccrmhc11.comcast.net [204.127.202.55]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2F9F143D2D; Fri, 26 Mar 2004 16:59:51 -0800 (PST) (envelope-from julian@elischer.org) Received: from interjet.elischer.org ([24.7.73.28]) by comcast.net (sccrmhc11) with ESMTP id <2004032700594801100mqei9e>; Sat, 27 Mar 2004 00:59:50 +0000 Received: from localhost (localhost.elischer.org [127.0.0.1]) by InterJet.elischer.org (8.9.1a/8.9.1) with ESMTP id RAA94972; Fri, 26 Mar 2004 17:05:31 -0800 (PST) Date: Fri, 26 Mar 2004 17:05:29 -0800 (PST) From: Julian Elischer To: Albert Cahalan In-Reply-To: <1080346391.2255.1347.camel@cube> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: freebsd-standards@freebsd.org cc: Cyrille Lefevre cc: Albert Cahalan cc: arch@freebsd.org cc: das@freebsd.org cc: drosih@rpi.edu Subject: Re: posix ps (was Re: Adding `pgrep' and `pkill' to /usr/bin) X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Mar 2004 00:59:52 -0000 On 26 Mar 2004, Albert Cahalan wrote: > On Fri, 2004-03-26 at 17:51, Cyrille Lefevre wrote: > > "Albert Cahalan" wrote: > > > > > Cyrille Lefevre writes: > > > > > > > two years ago, I've added posix syntax and so to my locally ps(1). > > > > for instance, I'm currently adding the notion of dynamic personalities > > > > > > OK, would YOU be interested in working with me on some sort of > > > common ps specification beyond what SUSv3 has to offer? I'd love > > > to see something that Sun could adopt, and that could be mostly > > > merged into the next revision of the standard. > > > > why not :) > > Great. Unless people object, I'll wipe the Cc: list for this. Not objecting, but just making sure who is in this before it goes away.. 1/ Linux ps maintainer.? 2/ Someone fro FreeBSD with interest in ps? 3/ anyone else? From owner-freebsd-arch@FreeBSD.ORG Fri Mar 26 17:22:31 2004 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E752516A4CE; Fri, 26 Mar 2004 17:22:31 -0800 (PST) Received: from rwcrmhc13.comcast.net (rwcrmhc13.comcast.net [204.127.198.39]) by mx1.FreeBSD.org (Postfix) with ESMTP id D5F1543D46; Fri, 26 Mar 2004 17:22:31 -0800 (PST) (envelope-from albert@users.sf.net) Received: from c-65-34-189-253.se.client2.attbi.com ([65.34.189.253]) by comcast.net (rwcrmhc13) with SMTP id <2004032701222901500du28ie>; Sat, 27 Mar 2004 01:22:31 +0000 From: Albert Cahalan To: Julian Elischer In-Reply-To: References: Content-Type: text/plain Organization: Message-Id: <1080350838.2232.1413.camel@cube> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.4 Date: 26 Mar 2004 20:27:18 -0500 Content-Transfer-Encoding: 7bit cc: freebsd-standards@freebsd.org cc: Cyrille Lefevre cc: Albert Cahalan cc: arch@freebsd.org cc: das@freebsd.org cc: drosih@rpi.edu Subject: Re: posix ps (was Re: Adding `pgrep' and `pkill' to /usr/bin) X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Mar 2004 01:22:32 -0000 On Fri, 2004-03-26 at 20:05, Julian Elischer wrote: > On 26 Mar 2004, Albert Cahalan wrote: > > > On Fri, 2004-03-26 at 17:51, Cyrille Lefevre wrote: > > > "Albert Cahalan" wrote: > > > > > > > Cyrille Lefevre writes: > > > > > > > > > two years ago, I've added posix syntax and so to my locally ps(1). > > > > > for instance, I'm currently adding the notion of dynamic personalities > > > > > > > > OK, would YOU be interested in working with me on some sort of > > > > common ps specification beyond what SUSv3 has to offer? I'd love > > > > to see something that Sun could adopt, and that could be mostly > > > > merged into the next revision of the standard. > > > > > > why not :) > > > > Great. Unless people object, I'll wipe the Cc: list for this. > > Not objecting, but just making sure who is in this before it goes away.. > 1/ Linux ps maintainer.? yes (me) > 2/ Someone fro FreeBSD with interest in ps? yes (Cyrille Lefevre) > 3/ anyone else? None yet. Do you happen to know the right people at any of the UNIX(R) shops? Rough idea of direction: 1. get some wiki-like thing for editing a document 2. define a fair "extended ps" compromise 3. based on that, patch the SUSv3 ps specification 4. get Linux, one BSD, one SysV, and one OSF/1 to conform 5. get some of the changes into SUSv4 (deadline?) From owner-freebsd-arch@FreeBSD.ORG Sat Mar 27 00:55:47 2004 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 954D516A4CF for ; Sat, 27 Mar 2004 00:55:47 -0800 (PST) Received: from crf-consulting.co.uk (82-44-220-218.cable.ubr10.haye.blueyonder.co.uk [82.44.220.218]) by mx1.FreeBSD.org (Postfix) with ESMTP id 83B1C43D39 for ; Sat, 27 Mar 2004 00:55:45 -0800 (PST) (envelope-from nik@crf-consulting.co.uk) Received: from clan.nothing-going-on.org (clan.nothing-going-on.org [192.168.1.20])i2R8td5U055886 for ; Sat, 27 Mar 2004 08:55:39 GMT (envelope-from nik@catkin) Received: from clan.nothing-going-on.org (localhost [127.0.0.1]) i2R8tcIq026205 for ; Sat, 27 Mar 2004 08:55:38 GMT (envelope-from nik@clan.nothing-going-on.org) Received: (from nik@localhost)i2R8tb5Z026204 for arch@freebsd.org; Sat, 27 Mar 2004 08:55:37 GMT (envelope-from nik) Date: Sat, 27 Mar 2004 08:55:37 +0000 From: Nik Clayton To: arch@freebsd.org Message-ID: <20040327085537.GC33016@clan.nothing-going-on.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="p2kqVDKq5asng8Dg" Content-Disposition: inline User-Agent: Mutt/1.4.2.1i Organization: FreeBSD Project Subject: Where should devctl notifications be sent from? X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Mar 2004 08:55:47 -0000 --p2kqVDKq5asng8Dg Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Apologies in advance if this is too trivial for -arch. I'm trying to work out where it's appropriate to add devctl notifications. The specific problem I'm trying to solve involves an iPod connected through firewire. I'd like to be able to have devd be notified when the iPod arrives, so that various processes can kick off automatically. In an ideal world, I'll drop the iPod in the dock, and some backup processes start, thereby allowing me to justify the purchase of a model several sizes larger than I actually need :-) It looks like there are several places where the devctl_queue_data() and related calls could be placed: firewire(4) -- when the device is plugged in fwohci(4) -- when the interface arrives sbp(4) -- when it's recognised as a mass storage device geom(4) -- when geom creates the device (/dev/da2 (and da2s2) in my case). Robert Watson has a patch that implements this. devfs -- specifically, in make_dev(9) and destroy_dev(9) The limited research that I've done suggests that the most generic place to put this code is inside make_dev(9) and destroy_dev(9). But this seems so trivial that I can't believe no one else hasn't done the work, so I figure there's probably something important that I'm missing. N --=20 FreeBSD: The Power to Serve http://www.freebsd.org/ (__) FreeBSD Documentation Project http://www.freebsd.org/docproj/ \\\'',) \/ \= ^ --- 15B8 3FFC DDB4 34B0 AA5F 94B7 93A8 0764 2C37 E375 --- .\._/= _) --p2kqVDKq5asng8Dg Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (FreeBSD) iD8DBQFAZUGIk6gHZCw343URAjfSAJwIlysRuXL+loo40w5we/W4eB1nzACcCikR G9vlmYB7V9Wcl8XbuUjdaKI= =7Qmf -----END PGP SIGNATURE----- --p2kqVDKq5asng8Dg-- From owner-freebsd-arch@FreeBSD.ORG Sat Mar 27 01:02:53 2004 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 20CAA16A4CE; Sat, 27 Mar 2004 01:02:53 -0800 (PST) Received: from ioskeha.hittite.isp.9tel.net (ioskeha.hittite.isp.9tel.net [62.62.156.27]) by mx1.FreeBSD.org (Postfix) with ESMTP id BDAEA43D2D; Sat, 27 Mar 2004 01:02:52 -0800 (PST) (envelope-from root@gits.dyndns.org) Received: from mail.gits.dyndns.org (unknown [81.185.204.209]) by ioskeha.hittite.isp.9tel.net (Postfix) with ESMTP id B7A1517B488; Sat, 27 Mar 2004 10:03:04 +0100 (CET) Received: from pc2k (pc2k [192.168.144.120]) by mail.gits.dyndns.org (8.12.10/8.12.10) with SMTP id i2R91VSP092472; Sat, 27 Mar 2004 10:01:32 +0100 (CET) (envelope-from root@gits.dyndns.org) Message-ID: <1c0001c413da$19e89e10$7890a8c0@dyndns.org> From: "Cyrille Lefevre" To: "Albert Cahalan" References: <1080334271.2255.1301.camel@cube> <1b9701c41384$ddff8da0$7890a8c0@dyndns.org> <1080346391.2255.1347.camel@cube> Date: Sat, 27 Mar 2004 09:56:49 +0100 Organization: ACME MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 X-Spam-Status: No, hits=-100 required=5 tests=USER_IN_WHITELIST X-Scanned-By: MIMEDefang 2.38 cc: arch@freebsd.org cc: das@freebsd.org cc: drosih@rpi.edu cc: freebsd-standards@freebsd.org Subject: Re: posix ps (was Re: Adding `pgrep' and `pkill' to /usr/bin) X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Mar 2004 09:02:53 -0000 "Albert Cahalan" wrote: > On Fri, 2004-03-26 at 17:51, Cyrille Lefevre wrote: > > "Albert Cahalan" wrote: > > > Cyrille Lefevre writes: [snip] > Oh, OK. It's kind of weird, since "ps -o pid,help,comm" > would seem to be something for 3 columns, but suit yourself. > I didn't bother, thinking "ps L" and "man ps" would do. > > I suppose the -X has to be the first option...? not necesserally, but usually :) I prefer the env var use. [snip] > Eh, "-ww" plus turning on argument display, right? > It's the opposite of BSD "c" AFAIK, and implied by "-f". not exactly, -f is a sort of -w, and -fx is a true -ww. another solution would be to double -f, say -ff, but nobody seems to implement that AFAIK. > > > BTW, I have a regression test suite that you might find useful. > > > > yes, of course. for instance, I'm trying to resolve header's naming, > > say user is USER or UID depending of the personality... etc. > > First of all, perfection is the enemy of good. I know, but I'm like that... perfectionist. > Part of my solution: > {"uid_hack", "UID", pr_euser, sr_nop, 8, USR, XXX, ET|USER}, well, for instacance, I keyword aliases w/ personalities : ALIAS("user", "UID", "user", _SUSV3|_HPUX|_SOLARIS), SIZE("user", "USER", LJUST, uname, s_uname, USER, _BSD44|_FREE|_NET|_OPEN|_SUNOS|_IRIX|_TRU64), but that part is not completed and has not been validated, yet. ALIAS and SIZE (aka CALL w/ DSIZ) are macros which greatly improve the readability of the keywords array. > > > > -M from irix > > > > > > Do you have documentation or examples for this? > > > > irix -M is freebsd -Z, so, simple to implement :) > > It's never that simple. reading the manual page, yes. but I have no testing machine for that. [snip] > The bsd43reno/bsd44/freebsd distinction is interesting. > I hope you'll add "linux" to your list. :-) at last, since the linux manual page is really poor and the code ir really unreadable. > I was hoping that your syntax covered fall-back choices. please, explain your mind by fall-back choices ? for instance, -X unknown gives up w/ an error message and the list of choices. > Then I could ask for "unixware" as a first choice, and > for "posix" if "unixware" is unknown. unixware could be an alias on plain susv3. in my mind, posix just say posix syntax. > > possible switches > > bsd : bsd syntax > > extended : allow enhanced options and keywords. > > pedantic : be strict about the syntax (-p pid instead of -p pidlist) > > It's normal to allow a list. The list is either the remaining > part of the current argument ("ps -p42,45,16") or the next one. > I ban crud like "ps -p 42,,7" and "ps -p ,42,91,". no problem for that, empty values are ignored. > > > The name isn't so good. Tru64 uses CMD_ENV for this, affecting > > > more than just ps. I made PS_PERSONALITY take priority so that > > > you could change ps behavior without changing other behaviors. > > > > PS_PERSONALITY is the name that linux uses. this may conflict in > > .profiles since the syntax is different. to complete what you say : > > irix uses _XPG=1 and hpux uses UNIX95=1 > > of course, all of them could be tested for more and more compatobility :) > > Heh. I do in fact check _XPG=1 and UNIX95=1. > > > > You forgot the "-F" from DYNIX/ptx. It's really nice. > > > > any pointer ? > > It's a friendly format, kind of along the lines of BSD "u". > > $ ps -F > UID PID PPID C SZ RSS PSR STIME TTY TIME CMD > albert 21666 21665 1 770 1672 0 19:11 pts/14 00:00:00 bash > albert 21674 21666 0 744 880 0 19:11 pts/14 00:00:00 ps -F well, a kind of solaris ps -clPy but shorter :) S UID PID PPID CLS PSR PRI RSS SZ WCHAN TTY TIME CMD Cyrille Lefevre. -- home: mailto:cyrille.lefevre@laposte.net From owner-freebsd-arch@FreeBSD.ORG Sat Mar 27 01:11:29 2004 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 52D0616A4CE; Sat, 27 Mar 2004 01:11:29 -0800 (PST) Received: from critter.freebsd.dk (critter.freebsd.dk [212.242.86.163]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8F4CD43D2D; Sat, 27 Mar 2004 01:11:28 -0800 (PST) (envelope-from phk@phk.freebsd.dk) Received: from critter.freebsd.dk (localhost [127.0.0.1]) by critter.freebsd.dk (8.12.11/8.12.11) with ESMTP id i2R9BQsk021269; Sat, 27 Mar 2004 10:11:26 +0100 (CET) (envelope-from phk@phk.freebsd.dk) To: Nik Clayton From: "Poul-Henning Kamp" In-Reply-To: Your message of "Sat, 27 Mar 2004 08:55:37 GMT." <20040327085537.GC33016@clan.nothing-going-on.org> Date: Sat, 27 Mar 2004 10:11:26 +0100 Message-ID: <21268.1080378686@critter.freebsd.dk> cc: arch@freebsd.org Subject: Re: Where should devctl notifications be sent from? X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Mar 2004 09:11:29 -0000 In message <20040327085537.GC33016@clan.nothing-going-on.org>, Nik Clayton writ es: >It looks like there are several places where the devctl_queue_data() and >related calls could be placed: > > firewire(4) -- when the device is plugged in > fwohci(4) -- when the interface arrives > sbp(4) -- when it's recognised as a mass storage device > geom(4) -- when geom creates the device (/dev/da2 (and da2s2) in my > case). Robert Watson has a patch that implements this. > devfs -- specifically, in make_dev(9) and destroy_dev(9) > >The limited research that I've done suggests that the most generic place >to put this code is inside make_dev(9) and destroy_dev(9). But this >seems so trivial that I can't believe no one else hasn't done the work, >so I figure there's probably something important that I'm missing. Hehe, this is far from a trivial question :-) The one question I would like you to answer is: How do you know it is the right iPod before you stuff it with you backup ? The problem is, more or less, that the higher up (ie: lower on your list) in the kernel you get, the more information you have lost. Devctl today is working on the newbus view of hardware, and there we have already lost most of the info that could help you make that decision. For disk devices GEOM has mechanisms for querying for out of band data like serial numbers, but nothing really uses this mechanism yet. I think that removable disks, as a class, is a sufficiently important that we probably should give them VIP treatment. I think this can be done equally well at GEOM and DEVFS levels, and DEVFS might catch other currently uncaught devices for us as well. So, it's not an answer to your question, but at least it narrows down the doubt a bit. -- Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk@FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe Never attribute to malice what can adequately be explained by incompetence. From owner-freebsd-arch@FreeBSD.ORG Sat Mar 27 01:58:23 2004 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E0F4F16A4CE; Sat, 27 Mar 2004 01:58:23 -0800 (PST) Received: from amsfep16-int.chello.nl (amsfep16-int.chello.nl [213.46.243.26]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8919C43D31; Sat, 27 Mar 2004 01:58:22 -0800 (PST) (envelope-from dodell@sitetronics.com) Received: from sitetronics.com ([213.46.139.145]) by amsfep16-int.chello.nl ESMTP <20040327095821.QLPE26437.amsfep16-int.chello.nl@sitetronics.com>; Sat, 27 Mar 2004 10:58:21 +0100 Message-ID: <40654F5D.5010004@sitetronics.com> Date: Sat, 27 Mar 2004 10:54:37 +0100 From: "Devon H. O'Dell" User-Agent: Mozilla Thunderbird 0.5 (Windows/20040207) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Albert Cahalan References: <1080350838.2232.1413.camel@cube> In-Reply-To: <1080350838.2232.1413.camel@cube> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit cc: Cyrille Lefevre cc: Albert Cahalan cc: arch@freebsd.org cc: Julian Elischer cc: das@freebsd.org cc: drosih@rpi.edu cc: freebsd-standards@freebsd.org Subject: Re: posix ps (was Re: Adding `pgrep' and `pkill' to /usr/bin) X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Mar 2004 09:58:24 -0000 Albert Cahalan wrote: > [snip] > None yet. Do you happen to know the right people > at any of the UNIX(R) shops? > > Rough idea of direction: > > 1. get some wiki-like thing for editing a document I'd be happy and willing to set this up. Any preference on the system used? I can do this immediately. > 2. define a fair "extended ps" compromise > 3. based on that, patch the SUSv3 ps specification > 4. get Linux, one BSD, one SysV, and one OSF/1 to conform > 5. get some of the changes into SUSv4 (deadline?) Is there any way I can help with the above? I'm definitely interested in helping make FreeBSD more standards compliant and helping with suggestions for standards as well. Kind regards, Devon H. O'Dell From owner-freebsd-arch@FreeBSD.ORG Sat Mar 27 02:41:12 2004 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8A09416A4CE; Sat, 27 Mar 2004 02:41:12 -0800 (PST) Received: from huva.hittite.isp.9tel.net (huva.hittite.isp.9tel.net [62.62.156.28]) by mx1.FreeBSD.org (Postfix) with ESMTP id D855843D31; Sat, 27 Mar 2004 02:41:11 -0800 (PST) (envelope-from cyrille.lefevre@laposte.net) Received: from pc2k (unknown [81.185.204.209]) by huva.hittite.isp.9tel.net (Postfix) with SMTP id 79DCF9BC67; Sat, 27 Mar 2004 11:41:56 +0100 (CET) Message-ID: <1c0901c413e8$04a466c0$7890a8c0@dyndns.org> From: "Cyrille Lefevre" To: "Garance A Drosihn" References: <20040325070120.GA67497@VARK.homeunix.com> <1a9c01c41359$b3da45e0$7890a8c0@dyndns.org> Date: Sat, 27 Mar 2004 11:41:09 +0100 Organization: ACME MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 cc: "Jacques A. Vidrine" cc: arch@freebsd.org cc: David Schultz cc: Albert Cahalan Subject: Re: posix ps (was Re: Adding `pgrep' and `pkill' to /usr/bin) X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Mar 2004 10:41:12 -0000 "Garance A Drosihn" wrote: > At 6:40 PM +0100 3/26/04, Cyrille Lefevre wrote: > > > >two years ago, I've added posix syntax and so to my locally > >ps(1). For instance, I'm currently adding the notion of > >dynamic personalities (the term comes from linux) instead > >of static #define such as... say : > > > >$ ps -X help > > any bsd bsd43reno bsd44 default extended freebsd hpux > > irix netbsd none openbsd pedantic posix relaxed solaris > > sunos susv3 tru64 > ...etc... > > >When finished, I'll probably submit these changes as a port, > >... since I suppose -arch will reject these important changes > >to a native command. > > I (personally) think that is overkill for a base-system command. > I do think that it is important for us to improve on what we > have for `ps, but that does not mean we immediately have to > rush out and re-implement every version of `ps' on the planet. not every version, but at least, the one w/ interesting options. my patch will follow w/o the enhanced personality part. could you take an eye on it before to commit your changes ? as I read your proposed changes, we could merge them w/o any problem. well, in fact, I already merge some of them (the or part instead of and). original ps : 26668 (no posix compliant) yours : 31072 (partly posix compliant) mine : 35684 (fully posix compliant) > You are suggesting that we go from being the least feature-full > and most-oddball `ps', to trying to match every `ps' along with > every subtle formatting-nuance of every system. With the changes at the beginning, it was not, but ... > that I just did, I went through a fair amount of trouble to make > sure that I was not increasing the size of `ps'. There are some > FreeBSD users who need to squeeze the OS onto very small file > systems, and I think that is a reasonable thing for our users > to want. I (personally) think that the size and complexity of > some all-encompassing `ps' is not worth the effort, and not worth > the PR's we will get over every feature does not *EXACTLY* match > how it behaves on the "original OS". > > I can see your `ps' being a very good option to have as a port, > and I might even install it in some situations, but I do not > think we want something that elaborate for a base-system command. > > >here are some sample outputs : > > > >$ PERSONALITY=freebsd ps -? > > Secondly, I personally am not fond of commands which COMPLETELY > change their behavior based on environment variables. Different > options, different formats, different rules. that's what other system does to avoid conflicts and for clarity. > If nothing else, writing the man page for that would be a real > nightmare, and I am no good at writing man pages... :-) not necesseraly, take a look on the tru64 manual pages. [snip] > I was going to write those up in reply to this message, but I > have a steady-stream of "emergency interruptions" (here at work) > today, and I'm supposed to be somewhere else right now, so I > guess my thoughts will wait until a later date. see you Cyrille Lefevre. -- home: mailto:cyrille.lefevre@laposte.net From owner-freebsd-arch@FreeBSD.ORG Sat Mar 27 04:05:58 2004 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 55C5B16A4CE; Sat, 27 Mar 2004 04:05:58 -0800 (PST) Received: from mx.nsu.ru (mx.nsu.ru [212.192.164.5]) by mx1.FreeBSD.org (Postfix) with ESMTP id F399043D39; Sat, 27 Mar 2004 04:05:57 -0800 (PST) (envelope-from danfe@regency.nsu.ru) Received: from regency.nsu.ru ([193.124.210.26]) by mx.nsu.ru with esmtp (Exim 4.30) id 1B7CZg-0000d6-Cg; Sat, 27 Mar 2004 18:06:04 +0600 Received: from regency.nsu.ru (localhost [127.0.0.1]) by regency.nsu.ru (8.12.10/8.12.10) with ESMTP id i2R8kxxm054901; Sat, 27 Mar 2004 14:46:59 +0600 (NOVT) (envelope-from danfe@regency.nsu.ru) Received: (from danfe@localhost) by regency.nsu.ru (8.12.10/8.12.10/Submit) id i2R8kw9T054801; Sat, 27 Mar 2004 14:46:58 +0600 (NOVT) (envelope-from danfe) Date: Sat, 27 Mar 2004 14:46:58 +0600 From: Alexey Dokuchaev To: Albert Cahalan Message-ID: <20040327084657.GA49799@regency.nsu.ru> References: <1080334271.2255.1301.camel@cube> <1b9701c41384$ddff8da0$7890a8c0@dyndns.org> <1080346391.2255.1347.camel@cube> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1080346391.2255.1347.camel@cube> User-Agent: Mutt/1.4.1i cc: Cyrille Lefevre cc: das@freebsd.org cc: drosih@rpi.edu cc: freebsd-standards@freebsd.org cc: arch@freebsd.org Subject: Re: posix ps (was Re: Adding `pgrep' and `pkill' to /usr/bin) X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Mar 2004 12:05:58 -0000 On Fri, Mar 26, 2004 at 07:13:11PM -0500, Albert Cahalan wrote: > On Fri, 2004-03-26 at 17:51, Cyrille Lefevre wrote: > > "Albert Cahalan" wrote: > > > > > Cyrille Lefevre writes: > > > > > > > two years ago, I've added posix syntax and so to my locally ps(1). > > > > for instance, I'm currently adding the notion of dynamic personalities > > > > > > OK, would YOU be interested in working with me on some sort of > > > common ps specification beyond what SUSv3 has to offer? I'd love > > > to see something that Sun could adopt, and that could be mostly > > > merged into the next revision of the standard. > > > > why not :) > > Great. Unless people object, I'll wipe the Cc: list for this. Hmm. You could probably consider keeping freebsd-standards@ in, though. ./danfe From owner-freebsd-arch@FreeBSD.ORG Sat Mar 27 05:37:59 2004 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D0F2616A4CE; Sat, 27 Mar 2004 05:37:59 -0800 (PST) Received: from huva.hittite.isp.9tel.net (huva.hittite.isp.9tel.net [62.62.156.28]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1A94E43D2F; Sat, 27 Mar 2004 05:37:59 -0800 (PST) (envelope-from cyrille.lefevre@laposte.net) Received: from pc2k (unknown [81.185.204.209]) by huva.hittite.isp.9tel.net (Postfix) with SMTP id 773329BC7F; Sat, 27 Mar 2004 14:38:43 +0100 (CET) Message-ID: <1cd201c41400$b6e960c0$7890a8c0@dyndns.org> From: "Cyrille Lefevre" To: "Alexey Dokuchaev" , "Dag-Erling Sm?rgrav" References: <1080165171.2232.910.camel@cube> <20040325191745.GB71731@stack.nl><1080247208.2232.1095.camel@cube> <20040326143411.GA1508@regency.nsu.ru> Date: Sat, 27 Mar 2004 14:31:18 +0100 Organization: ACME MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 cc: drosih@rpi.edu cc: freebsd-arch@freebsd.org cc: freebsd-standards@freebsd.org cc: Jilles Tjoelker cc: Albert Cahalan Subject: Re: PATCH for a more-POSIX `ps', and related adventures X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Mar 2004 13:38:00 -0000 "Alexey Dokuchaev" wrote: > On Fri, Mar 26, 2004 at 09:43:21AM +0100, Dag-Erling Sm?rgrav wrote: > > Albert Cahalan writes: > > > On Thu, 2004-03-25 at 14:17, Jilles Tjoelker wrote: > > > > I think that has been a historical mistake in the POSIX standardization. > > > > tar/cpio were not standardized, instead a new utility "pax" was > > > > invented. This should have been done with ps too [...] > > > I would agree, except that nobody uses pax. :-) > > > > NetBSD and OpenBSD use pax exclusively; their tar and cpio are > > symlinks to /bin/pax. > > How do they handle tar/cpio-specific arguments than? By bloating pax(1) > with quite some piece of code? This seems odd. the code is already there. let's try : $ ln -s /tmp/tar /bin/pax $ ln -s /tmp/cpio /bin/pax $ /tmp/tar -? usage: pax [-]{crtux}[-befhjmopqsvwyzHLOPXZ014578] [blocksize] [archive] [replstr] [-C directory] [-I file] [file ...] $ /tmp/tar -? usage: pax -o [-aABcLvVzZ] [-C bytes] [-H format] [-O archive] [-F archive] < name-list [> archive] usage: pax -i [-bBcdfmnrsStuvVzZ6] [-C bytes] [-E file] [-H format] [-I archive] [-F archive] [pattern...] [< archive] usage: pax -p [-adlLmuvV] destination-directory < name-list see also PR#38256 (http://www.freebsd.org/cgi/query-pr.cgi?pr=bin/38256) Cyrille Lefevre. -- home: mailto:cyrille.lefevre@laposte.net From owner-freebsd-arch@FreeBSD.ORG Sat Mar 27 06:55:08 2004 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 41A3116A4CE; Sat, 27 Mar 2004 06:55:08 -0800 (PST) Received: from mailhub.fokus.fraunhofer.de (mailhub.fokus.fraunhofer.de [193.174.154.14]) by mx1.FreeBSD.org (Postfix) with ESMTP id 129E043D1D; Sat, 27 Mar 2004 06:55:07 -0800 (PST) (envelope-from brandt@fokus.fraunhofer.de) Received: from beagle (beagle [193.175.132.100])i2REkiJ22245; Sat, 27 Mar 2004 15:46:44 +0100 (MET) Date: Sat, 27 Mar 2004 15:46:43 +0100 (CET) From: Harti Brandt To: Albert Cahalan In-Reply-To: <1080334271.2255.1301.camel@cube> Message-ID: <20040327154442.L6201@beagle.fokus.fraunhofer.de> References: <1080334271.2255.1301.camel@cube> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: arch@freebsd.org cc: das@freebsd.org cc: drosih@rpi.edu cc: cyrille.lefevre@laposte.net Subject: Re: posix ps (was Re: Adding `pgrep' and `pkill' to /usr/bin) X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Mar 2004 14:55:08 -0000 On Fri, 26 Mar 2004, Albert Cahalan wrote: AC>Cyrille Lefevre writes: AC> AC>Step 1: AC> AC>a. ps does old BSD behavior by default AC>b. /posix/bin/ps is a script that sets the SUSv3 personality AC>c. /usr/ucb/ps is a link to /bin/ps AC> AC>Step 2: AC> AC>a. ps does SUSv3 by default AC>b. /posix/bin/ps is a link to /bin/ps AC>c. /usr/ucb/ps is a script that sets the old BSD personality It don't think that 2a is a good step. Too many people are used to BSD behaviour especially if the are on a BSD system. Also it seems to me that having /usr/ucb on a BSD system is a silly thing. If you need /usr/posix (not /posix please) so it be. harti From owner-freebsd-arch@FreeBSD.ORG Sat Mar 27 07:10:12 2004 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4CB2A16A4CE; Sat, 27 Mar 2004 07:10:12 -0800 (PST) Received: from sccrmhc11.comcast.net (sccrmhc11.comcast.net [204.127.202.55]) by mx1.FreeBSD.org (Postfix) with ESMTP id CE2F843D2D; Sat, 27 Mar 2004 07:10:11 -0800 (PST) (envelope-from albert@users.sf.net) Received: from c-65-34-189-253.se.client2.attbi.com ([65.34.189.253]) by comcast.net (sccrmhc11) with SMTP id <20040327151010011001qol9e>; Sat, 27 Mar 2004 15:10:11 +0000 From: Albert Cahalan To: "Devon H. O'Dell" In-Reply-To: <40654F5D.5010004@sitetronics.com> References: <1080350838.2232.1413.camel@cube> <40654F5D.5010004@sitetronics.com> Content-Type: text/plain Organization: Message-Id: <1080400499.2232.1521.camel@cube> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.4 Date: 27 Mar 2004 10:14:59 -0500 Content-Transfer-Encoding: 7bit cc: Cyrille Lefevre cc: Albert Cahalan cc: arch@freebsd.org cc: Julian Elischer cc: das@freebsd.org cc: drosih@rpi.edu cc: freebsd-standards@freebsd.org Subject: Re: posix ps (was Re: Adding `pgrep' and `pkill' to /usr/bin) X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Mar 2004 15:10:12 -0000 On Sat, 2004-03-27 at 04:54, Devon H. O'Dell wrote: > Albert Cahalan wrote: > > [snip] > > None yet. Do you happen to know the right people > > at any of the UNIX(R) shops? > > > > Rough idea of direction: > > > > 1. get some wiki-like thing for editing a document > > I'd be happy and willing to set this up. Any preference on the system > used? I can do this immediately. Just a generic idea: * must have enough control to keep out trolls and spammers * colored text or boxes, for commentary or optional parts * can undo changes * recent changes highlighted or diffs available > > 2. define a fair "extended ps" compromise > > 3. based on that, patch the SUSv3 ps specification > > 4. get Linux, one BSD, one SysV, and one OSF/1 to conform > > 5. get some of the changes into SUSv4 (deadline?) > > Is there any way I can help with the above? I'm definitely interested in > helping make FreeBSD more standards compliant and helping with > suggestions for standards as well. Sure, if you either have experience hacking ps code or you know about ps behavior on a wide variety of systems. From owner-freebsd-arch@FreeBSD.ORG Sat Mar 27 07:34:31 2004 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 40CEB16A4CE for ; Sat, 27 Mar 2004 07:34:31 -0800 (PST) Received: from smtp4.server.rpi.edu (smtp4.server.rpi.edu [128.113.2.4]) by mx1.FreeBSD.org (Postfix) with ESMTP id D2D2E43D41 for ; Sat, 27 Mar 2004 07:34:30 -0800 (PST) (envelope-from drosih@rpi.edu) Received: from [128.113.24.47] (gilead.netel.rpi.edu [128.113.24.47]) by smtp4.server.rpi.edu (8.12.8/8.12.8) with ESMTP id i2RFYTXf002216; Sat, 27 Mar 2004 10:34:30 -0500 Mime-Version: 1.0 X-Sender: drosih@mail.rpi.edu Message-Id: In-Reply-To: <1c0901c413e8$04a466c0$7890a8c0@dyndns.org> References: <20040325070120.GA67497@VARK.homeunix.com> <1a9c01c41359$b3da45e0$7890a8c0@dyndns.org> <1c0901c413e8$04a466c0$7890a8c0@dyndns.org> Date: Sat, 27 Mar 2004 10:34:28 -0500 To: "Cyrille Lefevre" From: Garance A Drosihn Content-Type: text/plain; charset="us-ascii" ; format="flowed" X-Scanned-By: CanIt (www . canit . ca) cc: arch@freebsd.org Subject: Re: posix ps (was Re: Adding `pgrep' and `pkill' to /usr/bin) X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Mar 2004 15:34:31 -0000 At 11:41 AM +0100 3/27/04, Cyrille Lefevre wrote: >as I read your proposed changes, we could merge them w/o >any problem. well, in fact, I already merge some of them >(the or part instead of and). > >original ps : 26668 (no posix compliant) >yours : 31072 (partly posix compliant) >mine : 35684 (fully posix compliant) Actually, the difference between the `ps' that I started with and the `ps' that I ended up with is much less than 5000 bytes (on i386, at least). However I just upgraded my system last night, so I no longer have the earlier files. [well, I suppose I could get them easily enough, but really I have other things on my schedule for today...] > > Secondly, I personally am not fond of commands which COMPLETELY >> change their behavior based on environment variables. Different >> options, different formats, different rules. > >that's what other system does to avoid conflicts and for clarity. That does not make me any fonder of it. I've worked with those options on other systems, and speaking for just me personally, I have not liked how they worked out. I just don't. -- Garance Alistair Drosehn = gad@gilead.netel.rpi.edu Senior Systems Programmer or gad@freebsd.org Rensselaer Polytechnic Institute or drosih@rpi.edu From owner-freebsd-arch@FreeBSD.ORG Sat Mar 27 08:54:17 2004 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id DCDCD16A4CE; Sat, 27 Mar 2004 08:54:17 -0800 (PST) Received: from sccrmhc11.comcast.net (sccrmhc11.comcast.net [204.127.202.55]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8D9A443D3F; Sat, 27 Mar 2004 08:54:17 -0800 (PST) (envelope-from albert@users.sf.net) Received: from c-65-34-189-253.se.client2.attbi.com ([65.34.189.253]) by comcast.net (sccrmhc11) with SMTP id <20040327165411011001scc1e>; Sat, 27 Mar 2004 16:54:17 +0000 From: Albert Cahalan To: Harti Brandt In-Reply-To: <20040327154442.L6201@beagle.fokus.fraunhofer.de> References: <1080334271.2255.1301.camel@cube> <20040327154442.L6201@beagle.fokus.fraunhofer.de> Content-Type: text/plain Organization: Message-Id: <1080406740.2232.1614.camel@cube> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.4 Date: 27 Mar 2004 11:59:00 -0500 Content-Transfer-Encoding: 7bit cc: arch@freebsd.org cc: das@freebsd.org cc: drosih@rpi.edu cc: cyrille.lefevre@laposte.net cc: Albert Cahalan Subject: Re: posix ps (was Re: Adding `pgrep' and `pkill' to /usr/bin) X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Mar 2004 16:54:18 -0000 On Sat, 2004-03-27 at 09:46, Harti Brandt wrote: > On Fri, 26 Mar 2004, Albert Cahalan wrote: > > AC>Cyrille Lefevre writes: > AC> > AC>Step 1: > AC> > AC>a. ps does old BSD behavior by default > AC>b. /posix/bin/ps is a script that sets the SUSv3 personality > AC>c. /usr/ucb/ps is a link to /bin/ps > AC> > AC>Step 2: > AC> > AC>a. ps does SUSv3 by default > AC>b. /posix/bin/ps is a link to /bin/ps > AC>c. /usr/ucb/ps is a script that sets the old BSD personality > > It don't think that 2a is a good step. Too many people are used to BSD > behaviour especially if the are on a BSD system. Also it seems to me that > having /usr/ucb on a BSD system is a silly thing. If you need /usr/posix > (not /posix please) so it be. I suppose you can be outcasts forever, causing cross-platform sysadmins headaches until the world ends. (in 2038, naturally) I forgot to mention an intermediate step that was used when the Linux world made this very same transition. The ps command had only BSD-like behavior, but warned if a "-" was used. People griped about it for a bit while adjusting their habits and scripts. Then, when the cut-over happened, very few things broke. Another trick that helped with the transition was to have ps restart the command parser in BSD mode if the options didn't make sense in UNIX mode. So "ps -axu" would trigger this, issue the warning, and then go on to produce the expected output. (you could re-exec to handle this if you don't want to reset all the parser state) So, I've been there. Things worked out great. From owner-freebsd-arch@FreeBSD.ORG Sat Mar 27 10:57:03 2004 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 25E4F16A4CE for ; Sat, 27 Mar 2004 10:57:03 -0800 (PST) Received: from smtp2.server.rpi.edu (smtp2.server.rpi.edu [128.113.2.2]) by mx1.FreeBSD.org (Postfix) with ESMTP id C2F8843D1D for ; Sat, 27 Mar 2004 10:57:02 -0800 (PST) (envelope-from drosih@rpi.edu) Received: from [128.113.24.47] (gilead.netel.rpi.edu [128.113.24.47]) by smtp2.server.rpi.edu (8.12.8/8.12.8) with ESMTP id i2RIv1LI008921; Sat, 27 Mar 2004 13:57:02 -0500 Mime-Version: 1.0 X-Sender: drosih@mail.rpi.edu Message-Id: In-Reply-To: <1c0901c413e8$04a466c0$7890a8c0@dyndns.org> References: <20040325070120.GA67497@VARK.homeunix.com> <1a9c01c41359$b3da45e0$7890a8c0@dyndns.org> <1c0901c413e8$04a466c0$7890a8c0@dyndns.org> Date: Sat, 27 Mar 2004 13:57:00 -0500 To: "Cyrille Lefevre" From: Garance A Drosihn Content-Type: text/plain; charset="us-ascii" ; format="flowed" X-Scanned-By: CanIt (www . canit . ca) cc: arch@freebsd.org Subject: Re: posix ps (was Re: Adding `pgrep' and `pkill' to /usr/bin) X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Mar 2004 18:57:03 -0000 At 11:41 AM +0100 3/27/04, Cyrille Lefevre wrote: >"Garance A Drosihn" wrote: >as I read your proposed changes, we could merge them w/o >any problem. well, in fact, I already merge some of them >(the or part instead of and). > >original ps : 26668 (no posix compliant) >yours (gad) : 31072 (partly posix compliant) >mine (cyrille) : 35684 (fully posix compliant) Arg. It looks like I must have added another few instructions somewhere, and triggered the same size-increase that I talked about in the "Adventures with gcc: code vs object-code size" thread on the freebsd-hackers. In that case, adding 40 bytes of new instructions to one routine in ps.o caused /bin/ps to jump by 3940 bytes. As long as I had avoided whatever that threshold was, I was able to keep the size down around 27000 bytes. And that was for a version which *included* the -R, -s, and new -g options. Man that's annoying, I had been doing so good with it... -- Garance Alistair Drosehn = gad@gilead.netel.rpi.edu Senior Systems Programmer or gad@freebsd.org Rensselaer Polytechnic Institute or drosih@rpi.edu From owner-freebsd-arch@FreeBSD.ORG Sat Mar 27 12:36:22 2004 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5991816A4CE for ; Sat, 27 Mar 2004 12:36:22 -0800 (PST) Received: from darkness.comp.waw.pl (unknown [195.117.238.236]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9275D43D2F for ; Sat, 27 Mar 2004 12:36:21 -0800 (PST) (envelope-from pjd@darkness.comp.waw.pl) Received: by darkness.comp.waw.pl (Postfix, from userid 1009) id 34261ACAF8; Sat, 27 Mar 2004 21:36:20 +0100 (CET) Date: Sat, 27 Mar 2004 21:36:20 +0100 From: Pawel Jakub Dawidek To: freebsd-arch@freebsd.org Message-ID: <20040327203620.GR8930@darkness.comp.waw.pl> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="u5h+kxyd0mPeN+64" Content-Disposition: inline User-Agent: Mutt/1.4.2i X-PGP-Key-URL: http://people.freebsd.org/~pjd/pjd.asc X-OS: FreeBSD 5.2.1-RC2 i386 Subject: fchroot(2) and others. X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Mar 2004 20:36:22 -0000 --u5h+kxyd0mPeN+64 Content-Type: text/plain; charset=iso-8859-2 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi. Are we interested in fchroot(2) syscall? It exists in NetBSD. If so, its implementation is in pjd_secure_syscalls branch or at: http://people.freebsd.org/~pjd/patches/secure_syscalls.patch I've also impelemnted safe versions of other syscalls: int flink(int fd, const char *link); int funlink(int fd, const char *path); int frename(int fd, const char *from, const char *to); Maybe funlink(2) and frename(2) looks wired, but it should work. The idea is, that one cannot pass descriptor number only to those functions, because they're operating on file systems object names and there is no clean way to get path name from descriptor. So I decide to do it in this way: 1. Take vnode from file descriptor. 2. Lock vnode. 3. Take vnode from path. 4. Lock vnode. 5. Compare both vnodes. 6. If equal do the action (rename, unlink). So we need to open given file and pass descriptor number and its file name to a syscall. Code in branch is not tested yet, it is only a proof-of-concept. --=20 Pawel Jakub Dawidek http://www.FreeBSD.org pjd@FreeBSD.org http://garage.freebsd.pl FreeBSD committer Am I Evil? Yes, I Am! --u5h+kxyd0mPeN+64 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (FreeBSD) iD8DBQFAZeXEForvXbEpPzQRAuyRAKCKq68+JUXWh1BFgBxKIUeIRwx43ACfRKtK BLvMlFKeYp+l+4PTbdimUFg= =01Tt -----END PGP SIGNATURE----- --u5h+kxyd0mPeN+64-- From owner-freebsd-arch@FreeBSD.ORG Sat Mar 27 16:04:16 2004 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id F3AD916A4CF; Sat, 27 Mar 2004 16:04:15 -0800 (PST) Received: from hexagon.stack.nl (hexagon.stack.nl [131.155.140.144]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4160343D31; Sat, 27 Mar 2004 16:04:15 -0800 (PST) (envelope-from jilles@stack.nl) Received: from turtle.stack.nl (turtle.stack.nl [IPv6:2001:610:1108:5010:2e0:81ff:fe22:51d8]) by hexagon.stack.nl (Postfix) with ESMTP id 4066167E#4DE275171; Sun, 28 Mar 2004 01:04:14 +0100 (CET) Received: by turtle.stack.nl (Postfix, from userid 1677) id 1A5D81CC2E; Sun, 28 Mar 2004 01:04:14 +0100 (CET) Date: Sun, 28 Mar 2004 01:04:13 +0100 From: Jilles Tjoelker To: Pawel Jakub Dawidek Message-ID: <20040328000413.GA6185@stack.nl> References: <20040327203620.GR8930@darkness.comp.waw.pl> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20040327203620.GR8930@darkness.comp.waw.pl> X-Operating-System: FreeBSD 5.2.1-RELEASE-p1 i386 User-Agent: Mutt/1.5.6i cc: freebsd-arch@freebsd.org Subject: Re: fchroot(2) and others. X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Mar 2004 00:04:16 -0000 On Sat, Mar 27, 2004 at 09:36:20PM +0100, Pawel Jakub Dawidek wrote: > Are we interested in fchroot(2) syscall? It exists in NetBSD. How's that better than chdir(CHROOTDIR); chroot("."); ? NetBSD seems to have implemented it for SunOS/Solaris compatibility. > If so, its implementation is in pjd_secure_syscalls branch or > at: > http://people.freebsd.org/~pjd/patches/secure_syscalls.patch > I've also impelemnted safe versions of other syscalls: > int flink(int fd, const char *link); This means that you can access a file forever when you get a descriptor on it once, which may not be desired. In any case, this gives more rights than normal. You could mitigate this by requiring the caller to own the file, or by following the same approach (fd+name) as in funlink() and frename(). > int funlink(int fd, const char *path); > int frename(int fd, const char *from, const char *to); Looks good, but I don't really know whether it's worth the extra syscalls. It's not much use if find -unlink doesn't use them. > Maybe funlink(2) and frename(2) looks wired, but it should work. > The idea is, that one cannot pass descriptor number only to those > functions, because they're operating on file systems object names > and there is no clean way to get path name from descriptor. It's actually impossible to get the path name, there may be zero names, or more than one. -- Jilles Tjoelker From owner-freebsd-arch@FreeBSD.ORG Sat Mar 27 16:41:24 2004 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5C48A16A4D0 for ; Sat, 27 Mar 2004 16:41:24 -0800 (PST) Received: from darkness.comp.waw.pl (unknown [195.117.238.236]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0B57D43D2F for ; Sat, 27 Mar 2004 16:41:24 -0800 (PST) (envelope-from pjd@darkness.comp.waw.pl) Received: by darkness.comp.waw.pl (Postfix, from userid 1009) id 10633AC995; Sun, 28 Mar 2004 01:41:23 +0100 (CET) Date: Sun, 28 Mar 2004 01:41:23 +0100 From: Pawel Jakub Dawidek To: Jilles Tjoelker Message-ID: <20040328004123.GV8930@darkness.comp.waw.pl> References: <20040327203620.GR8930@darkness.comp.waw.pl> <20040328000413.GA6185@stack.nl> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="sk1WQj/bN1s+tUrY" Content-Disposition: inline In-Reply-To: <20040328000413.GA6185@stack.nl> User-Agent: Mutt/1.4.2i X-PGP-Key-URL: http://people.freebsd.org/~pjd/pjd.asc X-OS: FreeBSD 5.2.1-RC2 i386 cc: freebsd-arch@freebsd.org Subject: Re: fchroot(2) and others. X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Mar 2004 00:41:24 -0000 --sk1WQj/bN1s+tUrY Content-Type: text/plain; charset=iso-8859-2 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Mar 28, 2004 at 01:04:13AM +0100, Jilles Tjoelker wrote: +> > http://people.freebsd.org/~pjd/patches/secure_syscalls.patch +>=20 +> > I've also impelemnted safe versions of other syscalls: +>=20 +> > int flink(int fd, const char *link); +>=20 +> This means that you can access a file forever when you get a descriptor +> on it once, which may not be desired. In any case, this gives more +> rights than normal. You could mitigate this by requiring the caller to +> own the file, or by following the same approach (fd+name) as in +> funlink() and frename(). Actually if you are worring about this, so should use sysctl: security.bsd.hardlink_check_[ug]id +> > Maybe funlink(2) and frename(2) looks wired, but it should work. +> > The idea is, that one cannot pass descriptor number only to those +> > functions, because they're operating on file systems object names +> > and there is no clean way to get path name from descriptor. +>=20 +> It's actually impossible to get the path name, there may be zero names, +> or more than one. You can try to get path name from the VFS name cache (vn_fullpath(9)), but that's why I called it non-clean-way. --=20 Pawel Jakub Dawidek http://www.FreeBSD.org pjd@FreeBSD.org http://garage.freebsd.pl FreeBSD committer Am I Evil? Yes, I Am! --sk1WQj/bN1s+tUrY Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (FreeBSD) iD8DBQFAZh8zForvXbEpPzQRAhJZAJsFsSIwqKXa+F2TVzxmf3nshScj3ACguaMb ge98EfGKzrlJH8rKjMm6zAI= =fnCA -----END PGP SIGNATURE----- --sk1WQj/bN1s+tUrY-- From owner-freebsd-arch@FreeBSD.ORG Sat Mar 27 23:16:56 2004 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id AD42916A4CE for ; Sat, 27 Mar 2004 23:16:56 -0800 (PST) Received: from web61110.mail.yahoo.com (web61110.mail.yahoo.com [216.155.196.112]) by mx1.FreeBSD.org (Postfix) with SMTP id 40BF643D2D for ; Sat, 27 Mar 2004 23:16:56 -0800 (PST) (envelope-from soria1801@yahoo.com) Message-ID: <20040328071655.29290.qmail@web61110.mail.yahoo.com> Received: from [68.4.176.245] by web61110.mail.yahoo.com via HTTP; Sat, 27 Mar 2004 23:16:55 PST Date: Sat, 27 Mar 2004 23:16:55 -0800 (PST) From: Steven Soria To: freebsd-arch@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Content-Filtered-By: Mailman/MimeDel 2.1.1 Subject: Platform for FreeBSD X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Mar 2004 07:16:56 -0000 Hi, I want to get FreeBSD but im not sure what platform I have. My computer is a little old but I still can do everything I would do on a Pentium4 or other processor. How can I find out what Platform I have? I have an HP Vectra 6/400 series 8 with everything upgraded to the max(Ram, etc.). PLease let me know what kind of platform I have or let me know where i can find out. Thanks, Steven Soria --------------------------------- Do you Yahoo!? Yahoo! Finance Tax Center - File online. File on time.