vBulletin Search Engine Optimization
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| Is there a method for root to display the current environment of some other currently logged-in user? For example: User "X" gets different results when running a particular program than user "Y". I would like to look at and compare the two user's environments to determine if some variable is being set that causes the difference. Thanks, Tom |
| |||
| Something like : su - X ; env >/tmp/X.env CTRL D su - Y ; env>/tmp/Y.env CTRL D diff /tmp/X.env /tmp/Y.env ?? Tom Lowrie wrote: > Is there a method for root to display the current environment of some other > currently logged-in user? > > For example: User "X" gets different results when running a particular > program than user "Y". I would like to look at and compare the two user's > environments to determine if some variable is being set that causes the > difference. > > Thanks, > > Tom |
| |||
| Tom Lowrie <tlowrie@munis.com> wrote: > Is there a method for root to display the current environment of some other > currently logged-in user? You could try the -e option to ps. For example: qaaix11:~$ ps eww PID TTY STAT TIME COMMAND 45520 pts/1 A 0:00 -bash USER=jdweiner LOGNAME=jdweiner HOME=/home/jdweiner PATH=/usr/bin:/etc:/usr/sbin:/usr/ucb:/usr/bin/X11:/sbin:/usr/java130/jre/bin:/usr/java130/bin MAIL=/var/spool/mail/jdweiner SHELL=/usr/bin/bash TZ=EST5EDT SSH_CLIENT=10.21.2.143 51073 22 SSH_TTY=/dev/pts/1 TERM=xterm AUTHSTATE=compat LANG=en_US LOCPATH=/usr/lib/nls/loc LC__FASTMSG=true ODMDIR=/etc/objrepos DEFAULT_BROWSER=netscape DOCUMENT_SERVER_MACHINE_NAME=localhost DOCUMENT_SERVER_PORT=49213 CGI_DIRECTORY=/var/docsearch/ cgi-bin DOCUMENT_DIRECTORY=/usr/docsearch/html SSH_AUTH_SOCK=/tmp/ssh-Tzb38726/agent.38726 NLSPATH=/usr/lib/nls/msg/%L/%N:/usr/lib/nls/msg/%L/%N.cat |
| |||
| toto <toto@toto.com> wrote: t> Something like : t> su - X ; env >/tmp/X.env t> CTRL D t> su - Y ; env>/tmp/Y.env t> CTRL D t> diff /tmp/X.env /tmp/Y.env Grah. Don't top-post. # su - $user -c "env > /tmp/$user.env" t> Tom Lowrie wrote: >> Is there a method for root to display the current environment of some other >> currently logged-in user? >> >> For example: User "X" gets different results when running a particular >> program than user "Y". I would like to look at and compare the two user's >> environments to determine if some variable is being set that causes the >> difference. Regards, Nicholas -- "Why shouldn't I top-post?" http://www.aglami.com/tpfaq.html "Meanings are another story." http://www.ifas.org/wa/glossolalia.html |
| |||
| toto <toto@toto.com> wrote in message news:<3F2533E7.1010409@toto.com>... > Something like : > > su - X ; env >/tmp/X.env > CTRL D > su - Y ; env>/tmp/Y.env > CTRL D > diff /tmp/X.env /tmp/Y.env > > ?? > > Tom Lowrie wrote: > > Is there a method for root to display the current environment of some other > > currently logged-in user? > > > > For example: User "X" gets different results when running a particular > > program than user "Y". I would like to look at and compare the two user's > > environments to determine if some variable is being set that causes the > > difference. > > > > Thanks, > > > > Tom That would be good, except that I might not see the actual current environment of the user, say if the user set something in their current environment, or ran something that altered their environment. I was thinking along the line of something similar to the getenv() function, but getting some other users' environment instead of my own. Tom |
| ||||
| Jeremiah DeWitt Weiner <jdw@panix.com> wrote in message news:<bg3fmp$jn9$2@reader1.panix.com>... > Tom Lowrie <tlowrie@munis.com> wrote: > > Is there a method for root to display the current environment of some other > > currently logged-in user? > > You could try the -e option to ps. For example: > > qaaix11:~$ ps eww > PID TTY STAT TIME COMMAND > 45520 pts/1 A 0:00 -bash USER=jdweiner LOGNAME=jdweiner HOME=/home/jdweiner PATH=/usr/bin:/etc:/usr/sbin:/usr/ucb:/usr/bin/X11:/sbin:/usr/java130/jre/bin:/usr/java130/bin MAIL=/var/spool/mail/jdweiner SHELL=/usr/bin/bash TZ=EST5EDT SSH_CLIENT=10.21.2.143 51073 22 SSH_TTY=/dev/pts/1 TERM=xterm AUTHSTATE=compat LANG=en_US LOCPATH=/usr/lib/nls/loc LC__FASTMSG=true ODMDIR=/etc/objrepos DEFAULT_BROWSER=netscape DOCUMENT_SERVER_MACHINE_NAME=localhost DOCUMENT_SERVER_PORT=49213 CGI_DIRECTORY=/var/docsearch/ > cgi-bin DOCUMENT_DIRECTORY=/usr/docsearch/html SSH_AUTH_SOCK=/tmp/ssh-Tzb38726/agent.38726 NLSPATH=/usr/lib/nls/msg/%L/%N:/usr/lib/nls/msg/%L/%N.cat Jeremiah, Thanks. That does _exactly_ what I'm looking to do. I just add the tty of the user in question - ps ewwt pts/123 - and I have my answer. Tom |