Bug 41865

Summary: [PATCH] XFree86 section should document -nolisten tcp option in startx
Product: Documentation Reporter: Eric Anderson <anderson>
Component: Books & ArticlesAssignee: Tom Rhodes <trhodes>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: Latest   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
file.diff
none
book.sgml-faq-patch none

Description Josh Paetzel 2002-08-21 19:25:07 UTC
T 2002     root@host.domain.com:/usr/obj/usr/src/sys/NEW  i386
> >Description:
>       When installing (or upgrading) FreeBSD 4.6 or greater (versions with XFree86 4.x), the startx program has a line "-nolisten tcp" which causes things like opening X apps remotely and displaying them on your local X server to not work.
> I couldn't find any docs on this, so please point it out if I just missed it.
> >How-To-Repeat:
>       Install/upgrade to 4.6(.2) with XFree86 installed.  Run startx to start your X server.  Log in to a remote machine, and try to run xcalc (or any X program) and have it display on your local machine.  
> 
> >Fix:
>       Either comment out the 'listen_tcp="-nolisten tcp"' line in /usr/X11R6/bin/startx, or remove the -nolisten tcp.  
> 
> Here's a quick paragraph for the handbook to cover this.  I'm not sure if this is the exact page to put it on, but it might be ok. 
> 
> --- chapter.sgml        Wed Aug 21 17:13:25 2002
> +++ chapter.sgml-patch  Wed Aug 21 17:24:43 2002
> @@ -491,6 +491,17 @@
>         <application>XFree86 4.X</application> can also be started with
>         &man.xdm.1;.</para>
>  
> +      <para>In order for you to use remotely executed X-Windows programs
> +        such as an <application>xterm</application>, you will most likely
> +        need to change the <filename>/usr/X11R6/bin/startx</filename> X11
> +        startup script and change the line:</para>
> +
> +      <programlisting>listen_tcp="-nolisten tcp"</programlisting>
> +
> +      <para>to:</para>
> +
> +      <programlisting>listen_tcp=""</programlisting>
> +
>      </sect2>
>  
>      <sect2>
> 
> >Release-Note:
> >Audit-Trail:
> >Unformatted:

#man startx

NAME
       startx - initialize an X session

SYNOPSIS
       startx  [ [ client ] options ... ] [ -- [ server ] options
       ... ]

DESCRIPTION
       The startx script is a front end to xinit that provides  a
       somewhat nicer user interface for running a single session
       of the X Window System.  It is often  run  with  no  argu-
       ments.

       Except for the '-listen_tcp' option, arguments immediately
       following the startx command are used to start a client in
       the  same manner as xinit(1).  The '-listen_tcp' option of
       startx enables the TCP/IP transport type which  is  needed
       for  remote  X  displays.  This is disabled by default for
       security reasons.


Josh
Comment 1 Eric Anderson 2002-08-21 23:40:06 UTC
      When installing (or upgrading) FreeBSD 4.6 or greater (versions with XFree86 4.x), the startx program has a line "-nolisten tcp" which causes things like opening X apps remotely and displaying them on your local X server to not work.
I couldn't find any docs on this, so please point it out if I just missed it.

Fix: Either comment out the 'listen_tcp="-nolisten tcp"' line in /usr/X11R6/bin/startx, or remove the -nolisten tcp.  

Here's a quick paragraph for the handbook to cover this.  I'm not sure if this is the exact page to put it on, but it might be ok. 
How-To-Repeat:       Install/upgrade to 4.6(.2) with XFree86 installed.  Run startx to start your X server.  Log in to a remote machine, and try to run xcalc (or any X program) and have it display on your local machine.
Comment 2 Marc Fonvieille freebsd_committer freebsd_triage 2002-08-22 11:15:23 UTC
> --- chapter.sgml        Wed Aug 21 17:13:25 2002
> +++ chapter.sgml-patch  Wed Aug 21 17:24:43 2002
> @@ -491,6 +491,17 @@
>         <application>XFree86 4.X</application> can also be started with
>         &man.xdm.1;.</para>
>  
> +      <para>In order for you to use remotely executed X-Windows programs
> +        such as an <application>xterm</application>, you will most likely
> +        need to change the <filename>/usr/X11R6/bin/startx</filename> X11
> +        startup script and change the line:</para>
> +
> +      <programlisting>listen_tcp="-nolisten tcp"</programlisting>
> +
> +      <para>to:</para>
> +
> +      <programlisting>listen_tcp=""</programlisting>
> +

It's not a good thing to tell people to change files installed by
ports/packages, it will lead to problems during "desinstallation" and/or
upgrade.

That option can be given to startx on the command line as documented in
startx(1).

I don't think, it should be in the Handbook, but maybe in the FAQ, and
also something about using "ssh -X" too would be great :)

Marc
Comment 3 Eric Anderson 2002-08-22 13:38:54 UTC
The FAQ seems like an appropriate place, and I agree with the "don't edit files 
installed by ports/packages" for the most part.  It definitely needs to be 
documented somewhere, since there are posts on various groups asking the 
question, and rarely an answer.

I'll try to whip up a FAQ piece for it.

Eric

Marc Fonvieille wrote:

>>--- chapter.sgml        Wed Aug 21 17:13:25 2002
>>+++ chapter.sgml-patch  Wed Aug 21 17:24:43 2002
>>@@ -491,6 +491,17 @@
>>        <application>XFree86 4.X</application> can also be started with
>>        &man.xdm.1;.</para>
>> 
>>+      <para>In order for you to use remotely executed X-Windows programs
>>+        such as an <application>xterm</application>, you will most likely
>>+        need to change the <filename>/usr/X11R6/bin/startx</filename> X11
>>+        startup script and change the line:</para>
>>+
>>+      <programlisting>listen_tcp="-nolisten tcp"</programlisting>
>>+
>>+      <para>to:</para>
>>+
>>+      <programlisting>listen_tcp=""</programlisting>
>>+
>>
> 
> It's not a good thing to tell people to change files installed by
> ports/packages, it will lead to problems during "desinstallation" and/or
> upgrade.
> 
> That option can be given to startx on the command line as documented in
> startx(1).
> 
> I don't think, it should be in the Handbook, but maybe in the FAQ, and
> also something about using "ssh -X" too would be great :)
> 
> Marc
> 


-- 
------------------------------------------------------------------
Eric Anderson	   Systems Administrator      Centaur Technology
The moon may be smaller than Earth, but it's further away.
------------------------------------------------------------------
Comment 4 Tom Rhodes freebsd_committer freebsd_triage 2003-01-23 16:21:10 UTC
State Changed
From-To: open->feedback

Eric, have you `whipped up' a patch for our FAQ? 


Comment 5 Tom Rhodes freebsd_committer freebsd_triage 2003-01-23 16:21:10 UTC
Responsible Changed
From-To: freebsd-doc->trhodes

Eric, have you `whipped up' a patch for our FAQ?
Comment 6 Eric Anderson 2003-05-13 17:11:15 UTC
Here's my patch for this for the FAQ.

Attached..
Comment 7 Tom Rhodes freebsd_committer freebsd_triage 2003-05-13 20:09:22 UTC
On Tue, 13 May 2003 09:20:07 -0700 (PDT)
Eric Anderson <anderson@centtech.com> wrote:

Hi Eric,

I've made the following changes to your patch and applied it:

>  
>  --- book.sgml	Thu May  8 14:58:37 2003
>  +++ book.sgml-new	Tue May 13 11:08:03 2003
>  @@ -7740,6 +7740,21 @@
>         </qandaentry>
>   
>         <qandaentry>
>  +        <question id="no-remote-x11">
>  +          <para>Why can't I use remote X displays?</para>
>  +        </question>

s/Why can't I use/How do I enable/

>  +
>  +        <answer>
>  +          <para>For security reasons, the default setting is to not allow a 
>  +            machine to remotely open a window.</para>
>  +
>  +          <para>To enable this, when starting X Windows, simply start it

s/To enable this, when starting X Windows, simply start it/To enable this feature,
simply start <application>X</application>

>  +            with the optional <option>-listen_tcp</optional> argument:</para>

<option>-listen_tcp</optional> does not build, I changed optional to option.

>  +            <screen>&prompt.user; <userinput>startx -listen_tcp</userinput></screen>
>  +        </answer>
>  +      </qandaentry>
>  +
>  +      <qandaentry>
>           <question id="window-menu-weird">
>             <para>Why do X Window menus and dialog boxes not work right?</para>
>           </question>

Otherwise, this was applied fine.  Thanks for your submission.

--
Tom Rhodes
Comment 8 Tom Rhodes freebsd_committer freebsd_triage 2003-05-13 20:19:46 UTC
State Changed
From-To: feedback->closed

Slightly different version of Eric's patch applied.  Thanks for the submission.