Tech Tip: How to read the environment of a running process on Linux

Document created by kk_sup Employee on Sep 9, 2015Last modified by SamCreek on Dec 17, 2016
Version 2Show Document
  • View in full screen mode

To verify the processes environmental variables in place when the process started run:


strings /proc/<$pid of process>/environ


Example:

 

# ps -ef | grep nhiPoller
root     5049  4955  0 Sep08 ?        00:04:16 /opt/eHealth/bin/sys/nhiPoller

 

# strings /proc/5049/environ | less

NH_SERVER_ID=1
SELINUX_INIT=YES
CONSOLE=/dev/console
XKEYSYMDB=/opt/eHealth/sys/C/XKeysymDB
NH_POLL_BS=linear
~~~~~~~SNIP~~~~~~~~~~~~~~~~~

Attachments

    Outcomes