From owner-freebsd-arch@FreeBSD.ORG Mon Dec 6 04: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 385BB16A4CE; Mon, 6 Dec 2004 04:16:37 +0000 (GMT) Received: from smtp3.server.rpi.edu (smtp3.server.rpi.edu [128.113.2.3]) by mx1.FreeBSD.org (Postfix) with ESMTP id C31B743D67; Mon, 6 Dec 2004 04:16:34 +0000 (GMT) (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.13.0/8.13.0) with ESMTP id iB64GWL4031604; Sun, 5 Dec 2004 23:16:33 -0500 Mime-Version: 1.0 Message-Id: In-Reply-To: <200411301628.05476.peter@wemm.org> References: <20041130231236.GD56431@darkness.comp.waw.pl> <200411301628.05476.peter@wemm.org> Date: Sun, 5 Dec 2004 23:16:32 -0500 To: Peter Wemm , freebsd-arch@freebsd.org From: Garance A Drosihn Content-Type: text/plain; charset="us-ascii" ; format="flowed" X-CanItPRO-Stream: default X-RPI-SA-Score: undef - spam-scanning disabled X-Scanned-By: CanIt (www . canit . ca) cc: Pawel Jakub Dawidek Subject: Re: ps -e without procfs(5). 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, 06 Dec 2004 04:16:37 -0000 At 4:28 PM -0800 11/30/04, Peter Wemm wrote: >On Tuesday 30 November 2004 03:12 pm, Pawel Jakub Dawidek wrote: >> Hello. >> >> I need some testing for this patch: >> >> http://people.freebsd.org/~pjd/patches/ps-e.patch >> > > It allows to use 'ps -e' without procfs(5) mounted. > >ps -e is "live" and reads the environment from the process. It looks >like your patch adds a once-only snapshot of the exec-time values.. > >I've only ever used "ps -e" to figure out what the current live values >are, I'd be more interested in a ptrace based replacement.. I also always thought that `ps -e' was live, but I went to check on that, and now I'm not so sure it is. On both 4.x and 5.x (with procfs mounted), I tried doing `ps -eww -p $$'. I got a list of environment variables, and I tried adding or modifying a variable and then re-entering the command. As near as I could tell, the output did not change. So, it looks like the procfs implementation is also just a copy of the variables as they were set when the process initially started up. I also tried a quick test of 'ps eww p $$' on a linux box, and it also seems to show only the environment variables (and values) that the process started up with. I think there are a few issues that need to be addressed in Pawel's work here, but it looks like he is correct in implementing it as a once-only snapshot. Maybe we should have something else to show the "live" environment of a process. We probably need to do more comparisons of the procfs-based `ps -e' (on both 4.x and 5.x) with Pawel's work, but once we sort out the security issues I think it is a reasonable thing to add. It will mean there is one less reason that anyone has to mount procfs, and I believe that is a direction that we (as a project) wanted to go. -- Garance Alistair Drosehn = gad@gilead.netel.rpi.edu Senior Systems Programmer or gad@freebsd.org Rensselaer Polytechnic Institute or drosih@rpi.edu