<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Xmanager Xterm session not disconnecting in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/xmanager-xterm-session-not-disconnecting/m-p/3803073#M266863</link>
    <description>&lt;BR /&gt;Thanks for the response spex but not really what I'm after. &lt;BR /&gt;&lt;BR /&gt;1st I want the process to hang up. Session is logged out so I want all processes associated with the session terminal to hang up. Obviously with two terminals this does not happen.&lt;BR /&gt;&lt;BR /&gt;2nd Surely the process is a child, so hanging up the parent should hang up the child? Why does the child process get a new terminal?&lt;BR /&gt; &lt;BR /&gt;Cheers&lt;BR /&gt;&lt;BR /&gt;James</description>
    <pubDate>Fri, 09 Jun 2006 08:35:24 GMT</pubDate>
    <dc:creator>jpmigue</dc:creator>
    <dc:date>2006-06-09T08:35:24Z</dc:date>
    <item>
      <title>Xmanager Xterm session not disconnecting</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/xmanager-xterm-session-not-disconnecting/m-p/3803071#M266861</link>
      <description>&lt;BR /&gt;I am using Xmanager2 and running Xstart with the following command&lt;BR /&gt;&lt;BR /&gt;/usr/bin/X11/xterm -ls -display $DISPLAY&lt;BR /&gt;&lt;BR /&gt;Now when I do a ps for the newly started session, I get&lt;BR /&gt;&lt;BR /&gt;# ps&lt;BR /&gt;   PID TTY       TIME COMMAND&lt;BR /&gt;  6846 ttyp1     0:00 ps&lt;BR /&gt;  6833 ttyp1     0:00 -sh&lt;BR /&gt;&lt;BR /&gt;Yet when I do a w from another session I get&lt;BR /&gt;&lt;BR /&gt;# w&lt;BR /&gt; 11:15am  up 20 days, 17:37,  3 users,  load average: 0.05, 0.05, 0.04&lt;BR /&gt;User     tty           login@  idle   JCPU   PCPU  what&lt;BR /&gt;root     pts/tb       11:06am                      w&lt;BR /&gt;root     pts/tc       11:06am     9                /usr/bin/X11/xterm -ls -display 192.168.54.41:0&lt;BR /&gt;&lt;BR /&gt;So I've got two terminals asscoiated with the login and when I exit, the ttyp1 session hangs up but the pts/tb doesn't&lt;BR /&gt;&lt;BR /&gt;Any ideas?&lt;BR /&gt;&lt;BR /&gt;Cheers&lt;BR /&gt;&lt;BR /&gt;James</description>
      <pubDate>Fri, 09 Jun 2006 05:53:46 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/xmanager-xterm-session-not-disconnecting/m-p/3803071#M266861</guid>
      <dc:creator>jpmigue</dc:creator>
      <dc:date>2006-06-09T05:53:46Z</dc:date>
    </item>
    <item>
      <title>Re: Xmanager Xterm session not disconnecting</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/xmanager-xterm-session-not-disconnecting/m-p/3803072#M266862</link>
      <description>James,&lt;BR /&gt;&lt;BR /&gt;'xterm' is a child process of the shell running on pts/tc (i.e. the shell has been fork()'ed).  As such, a 'ps' from within the xterm window will not display the xterm process itself, since it has its own address space, distinct from its parent.&lt;BR /&gt;&lt;BR /&gt;'w', or 'uptime -w', will give the same output from any terminal.  In other words, the output from 'w' will be the same whether it is run from your xterm, or from pts/tb.  It's a different command from 'ps', and shows who is logged in, and what they are doing.  So you're comparing apples and oranges by running 'ps' in one place and 'w' in another.&lt;BR /&gt;&lt;BR /&gt;It sounds like you want to run your xterm with the 'nohup' command:&lt;BR /&gt;&lt;BR /&gt;# nohup /usr/bin/X11/xterm -ls -display $DISPLAY &amp;amp;&lt;BR /&gt;&lt;BR /&gt;That way, when you exit your shell, the xterm (which is its child process) won't be killed.&lt;BR /&gt;&lt;BR /&gt;You may also want to look into running 'xterm' from /etc/inittab.&lt;BR /&gt;&lt;BR /&gt;PCS</description>
      <pubDate>Fri, 09 Jun 2006 07:23:07 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/xmanager-xterm-session-not-disconnecting/m-p/3803072#M266862</guid>
      <dc:creator>spex</dc:creator>
      <dc:date>2006-06-09T07:23:07Z</dc:date>
    </item>
    <item>
      <title>Re: Xmanager Xterm session not disconnecting</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/xmanager-xterm-session-not-disconnecting/m-p/3803073#M266863</link>
      <description>&lt;BR /&gt;Thanks for the response spex but not really what I'm after. &lt;BR /&gt;&lt;BR /&gt;1st I want the process to hang up. Session is logged out so I want all processes associated with the session terminal to hang up. Obviously with two terminals this does not happen.&lt;BR /&gt;&lt;BR /&gt;2nd Surely the process is a child, so hanging up the parent should hang up the child? Why does the child process get a new terminal?&lt;BR /&gt; &lt;BR /&gt;Cheers&lt;BR /&gt;&lt;BR /&gt;James</description>
      <pubDate>Fri, 09 Jun 2006 08:35:24 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/xmanager-xterm-session-not-disconnecting/m-p/3803073#M266863</guid>
      <dc:creator>jpmigue</dc:creator>
      <dc:date>2006-06-09T08:35:24Z</dc:date>
    </item>
    <item>
      <title>Re: Xmanager Xterm session not disconnecting</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/xmanager-xterm-session-not-disconnecting/m-p/3803074#M266864</link>
      <description>James,&lt;BR /&gt;&lt;BR /&gt;'xterm' is a special type of program, because unlike other programs, it creates its own terminal when executed.&lt;BR /&gt;&lt;BR /&gt;Watch what happens:&lt;BR /&gt;&lt;BR /&gt;(from pts/1)&lt;BR /&gt;# who&lt;BR /&gt;root       pts/1        Jun  9 09:51&lt;BR /&gt;# ps&lt;BR /&gt;   PID TTY       TIME COMMAND&lt;BR /&gt; 22218 pts/1     0:00 ps&lt;BR /&gt; 22195 pts/1     0:00 sh&lt;BR /&gt;# xterm &amp;amp;&lt;BR /&gt;[1]     22219&lt;BR /&gt;# who&lt;BR /&gt;root       ttyp1        Jun  9 09:53&lt;BR /&gt;root       pts/1        Jun  9 09:51&lt;BR /&gt;# ps -f&lt;BR /&gt;     UID   PID  PPID  C    STIME TTY       TIME COMMAND&lt;BR /&gt;    root 22219 22195  0 09:53:11 pts/1     0:00 xterm&lt;BR /&gt;    root 22223 22195  3 09:53:46 pts/1     0:00 ps -f&lt;BR /&gt;    root 22195 22191  0 09:51:16 pts/1     0:00 -sh&lt;BR /&gt;&lt;BR /&gt;So my shell, /usr/bin/sh, has PID 22195, and its child, xterm, has PID 22219.  Also notice that xterm's PPID (parent PID) is 22195.&lt;BR /&gt;&lt;BR /&gt;# exit&lt;BR /&gt;There are running jobs.&lt;BR /&gt;# exit&lt;BR /&gt;logout root&lt;BR /&gt;&lt;BR /&gt;So my shell and PID 22195 are gone.  Now look at xterm's PPID:&lt;BR /&gt;&lt;BR /&gt;(from xterm@tty1)&lt;BR /&gt;# who&lt;BR /&gt;root       ttyp1        Jun  9 09:53&lt;BR /&gt;# ps -ef |grep xterm |grep -v grep&lt;BR /&gt;    root 22219     1  4 09:53:11 ?         0:00 xterm&lt;BR /&gt;&lt;BR /&gt;So xterm's PPID got reassigned to init, PID 1.&lt;BR /&gt;&lt;BR /&gt;If I understand correctly, you want to kill the xterm when you exit the shell.  There are many ways you could do this.  One way is run 'jobs' from your shell and look for the JOB NUMBER of xterm.  Note that job number is different from PID.  Most likely xterm will be job %1.  Then do 'kill %1' before exiting the shell (the '%' is very important).  &lt;BR /&gt;&lt;BR /&gt;You could add this to the logout trap in your .profile so that it runs automatically upon logout.  Or, in cases where more than one job could be running from this shell, you could get the job id with:&lt;BR /&gt;&lt;BR /&gt;jobs |awk '/xterm/{gsub(/\[|\]/,"")}; {print $1}'&lt;BR /&gt;&lt;BR /&gt;Use this in a script and reference the script in the logout trap in .profile.&lt;BR /&gt;&lt;BR /&gt;PCS</description>
      <pubDate>Fri, 09 Jun 2006 09:54:38 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/xmanager-xterm-session-not-disconnecting/m-p/3803074#M266864</guid>
      <dc:creator>spex</dc:creator>
      <dc:date>2006-06-09T09:54:38Z</dc:date>
    </item>
    <item>
      <title>Re: Xmanager Xterm session not disconnecting</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/xmanager-xterm-session-not-disconnecting/m-p/3803075#M266865</link>
      <description>&lt;BR /&gt;Ok cheers&lt;BR /&gt;&lt;BR /&gt;Resolved by selecting connection using REXEC instead of TELNET, therefore xterm is not forked from /bin/sh and the HUP is sent directly to the xterm process&lt;BR /&gt;&lt;BR /&gt;CHeers for your help&lt;BR /&gt;&lt;BR /&gt;James</description>
      <pubDate>Fri, 09 Jun 2006 11:23:07 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/xmanager-xterm-session-not-disconnecting/m-p/3803075#M266865</guid>
      <dc:creator>jpmigue</dc:creator>
      <dc:date>2006-06-09T11:23:07Z</dc:date>
    </item>
    <item>
      <title>Re: Xmanager Xterm session not disconnecting</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/xmanager-xterm-session-not-disconnecting/m-p/3803076#M266866</link>
      <description>&lt;BR /&gt;Ok cheers&lt;BR /&gt;&lt;BR /&gt;Resolved by selecting connection using REXEC instead of TELNET, therefore xterm is not forked from /bin/sh and the HUP is sent directly to the xterm process&lt;BR /&gt;&lt;BR /&gt;Cheers for your help&lt;BR /&gt;&lt;BR /&gt;James</description>
      <pubDate>Fri, 09 Jun 2006 11:37:39 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/xmanager-xterm-session-not-disconnecting/m-p/3803076#M266866</guid>
      <dc:creator>jpmigue</dc:creator>
      <dc:date>2006-06-09T11:37:39Z</dc:date>
    </item>
  </channel>
</rss>

