Date: Sun, 5 Dec 2004 23:16:32 -0500 From: Garance A Drosihn <drosih@rpi.edu> To: Peter Wemm <peter@wemm.org>, freebsd-arch@freebsd.org Cc: Pawel Jakub Dawidek <pjd@freebsd.org> Subject: Re: ps -e without procfs(5). Message-ID: <p06200746bdd989a25878@[128.113.24.47]> In-Reply-To: <200411301628.05476.peter@wemm.org> References: <20041130231236.GD56431@darkness.comp.waw.pl> <200411301628.05476.peter@wemm.org>
next in thread | previous in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?p06200746bdd989a25878>