|
Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com |
Re: Neat debugging trick with "screen" when xgdb is not an option
From: Victor Duchovni (Victor.Duchovni
MorganStanley.com)
Date: Wed Mar 02 2005 - 09:38:25 CST
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On Wed, Mar 02, 2005 at 10:35:17AM -0500, Wietse Venema wrote:
> Victor Duchovni:
> >
> > I rarely use X11, my world runs inside a "screen" session that I can
> > detach and re-attach at will, and that can be reached via SSH gateways
> > that prohibit port forwarding.
> >
> > This means that debugging Postfix servers processes can be tricky. Here
> > is a simple "screen" based recipe:
> >
> > main.cf:
> > debugger_command =
> > PATH=/bin:/usr/bin:/sbin:/usr/sbin; export PATH;
> > HOME=/root; export HOME;
> > screen -e^tt -dmS $process_name gdb $daemon_directory/$process_name $process_id &
> > sleep 1
>
> Does this require that one logs in as root prior to starting screen?
> If not, how does screen know what terminal it should be using?
>
The server-side of screen always sets "TERM=screen". The client side of
screen (when one re-attaches with "-r") translates the logical "screen"
to the physical terminal of the user.
This is also needed for detach/re-attach since the physical terminal
type can and does change between home and office, ...
--
Viktor.
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]