Loading ...
Sorry, an error occurred while loading the content.

dhcp disrupts X

Expand Messages
  • Anish Muttreja
    Hi This is my first post on the group and I would like to say hello to everybody. My laptop (rh 8.0 ) uses a wireless connection. The wireless works just fine.
    Message 1 of 6 , Apr 1, 2003
    • 0 Attachment
      Hi
      This is my first post on the group and I would like to say hello to
      everybody. My laptop (rh 8.0 ) uses a wireless connection. The wireless
      works just fine. I login and then plug in the pcmcia wireless card and
      the computer activates the wireless and gets its ip using dhcp.
      Problem is this causes X to start denying permission to connect to 0:0
      and I can't open another window.
      All I can do then is restart X.
      So I guess dhcp must be done before X starts. But I would like to know
      if there is a way to teach X the new ip information without restarting ?

      anish

      --
      Anish Muttreja <muttreja@...>
      Princeton University
    • Mark Feit
      ... wireless ... and ... 0:0 ... know ... restarting ? Unfortunately, there s no way to tell the X server to listen at a new address without restarting it
      Message 2 of 6 , Apr 2, 2003
      • 0 Attachment
        --- In linux-dell-laptops@yahoogroups.com, Anish Muttreja
        <muttreja@p...> wrote:
        > Hi
        > This is my first post on the group and I would like to say hello to
        > everybody. My laptop (rh 8.0 ) uses a wireless connection. The
        wireless
        > works just fine. I login and then plug in the pcmcia wireless card
        and
        > the computer activates the wireless and gets its ip using dhcp.
        > Problem is this causes X to start denying permission to connect to
        0:0
        > and I can't open another window.
        > All I can do then is restart X.
        > So I guess dhcp must be done before X starts. But I would like to
        know
        > if there is a way to teach X the new ip information without
        restarting ?

        Unfortunately, there's no way to tell the X server to listen at a new
        address without restarting it other than using `xhost +address' where
        address is the hostname or IP of your new interface. But you
        shouldn't have to do that.

        Clients running on the local host should have a DISPLAY environment
        variable without the host name in it (i.e., ":0" or ":0.0"). This
        will force the use of the more-efficient Unix-domain socket in
        /tmp/.X11-unix. The addition of new interfaces won't have any effect
        on these, because Unix sockets don't have any concept of hosts.

        If dhcpcd is making your host name resolve to the IP of the new
        interface and your DISPLAY variable has a hostname in it (i.e.,
        "blah:0" or "blah:0.0"), you're going to run into trouble. (I'd
        check, but my laptop is 25 miles away at the moment.) The TCP stack
        will make a connection to the IP of the new interface ("blah"), and
        because that same interface is the shortest route there, the
        connection will appear to come from there. X, not having seen the new
        interface when it started, will reject the connection attempt as being
        another unauthorized host. (If you being up your wireless card before
        starting X, everything should work just fine.)

        I don't have a machine with 8.0 handy, but unless Red Hat went in and
        changed something (possible, but I doubt it), the default has been
        ":0" since I started using X in 1988.

        Hope that helps.

        -- Mark
      • anishmuttreja@netscape.net
        Thanks , that was very thoughtfully written. $DIPLAY is still :0. I don t think dhcp changes $DISPLAY. However , after dhcp xhost + doesn t work , because I am
        Message 3 of 6 , Apr 3, 2003
        • 0 Attachment
          Thanks , that was very thoughtfully written.
          $DIPLAY is still :0. I don't think dhcp changes $DISPLAY.
          However , after dhcp xhost + doesn't work , because I am issuing that command from a different machine, so it gets the same error as any application window that triesto open a connection :). Infact, I get this error

          connection to ":0.0" refused by server
          Xlib: Invalid MIT-MAGIC-COOKIE-1 key
          xhost: unable to open display ":0

          So I still haven't solved it yet. Thgh ofcourse you are right , running dhcplient (they changed dhcpcd to dhcpclient in rh 8.0) before X starts is no problem.

          Thanks,
          Anish



          "Mark Feit" <mfeit+linux-dell-laptops@...> wrote:

          >--- In linux-dell-laptops@yahoogroups.com, Anish Muttreja
          ><muttreja@p...> wrote:
          >> Hi
          >> This is my first post on the group and I would like to say hello to
          >> everybody. My laptop (rh 8.0 ) uses a wireless connection. The
          >wireless
          >> works just fine. I login and then plug in the pcmcia wireless card
          >and
          >> the computer activates the wireless and gets its ip using dhcp.
          >> Problem is this causes X to start denying permission to connect to
          >0:0
          >> and I can't open another window.
          >> All I can do then is restart X.
          >> So I guess dhcp must be done before X starts. But I would like to
          >know
          >> if there is a way to teach X the new ip information without
          >restarting ?
          >
          >Unfortunately, there's no way to tell the X server to listen at a new
          >address without restarting it other than using `xhost +address' where
          >address is the hostname or IP of your new interface. But you
          >shouldn't have to do that.
          >
          >Clients running on the local host should have a DISPLAY environment
          >variable without the host name in it (i.e., ":0" or ":0.0"). This
          >will force the use of the more-efficient Unix-domain socket in
          >/tmp/.X11-unix. The addition of new interfaces won't have any effect
          >on these, because Unix sockets don't have any concept of hosts.
          >
          >If dhcpcd is making your host name resolve to the IP of the new
          >interface and your DISPLAY variable has a hostname in it (i.e.,
          >"blah:0" or "blah:0.0"), you're going to run into trouble. (I'd
          >check, but my laptop is 25 miles away at the moment.) The TCP stack
          >will make a connection to the IP of the new interface ("blah"), and
          >because that same interface is the shortest route there, the
          >connection will appear to come from there. X, not having seen the new
          >interface when it started, will reject the connection attempt as being
          >another unauthorized host. (If you being up your wireless card before
          >starting X, everything should work just fine.)
          >
          >I don't have a machine with 8.0 handy, but unless Red Hat went in and
          >changed something (possible, but I doubt it), the default has been
          >":0" since I started using X in 1988.
          >
          >Hope that helps.
          >
          >-- Mark
          >
          >

          __________________________________________________________________
          Try AOL and get 1045 hours FREE for 45 days!
          http://free.aol.com/tryaolfree/index.adp?375380

          Get AOL Instant Messenger 5.1 for FREE! Download Now!
          http://aim.aol.com/aimnew/Aim/register.adp?promo=380455
        • Mark Feit
          ... That s correct. There s no way for one process to influence the environment of another other than through forking. ... that command from a different
          Message 4 of 6 , Apr 3, 2003
          • 0 Attachment
            --- In linux-dell-laptops@yahoogroups.com, anishmuttreja@n... wrote:
            > Thanks , that was very thoughtfully written.
            > $DIPLAY is still :0. I don't think dhcp changes $DISPLAY.

            That's correct. There's no way for one process to influence the
            environment of another other than through forking.

            > However , after dhcp xhost + doesn't work , because I am issuing
            that command from a different machine, so it gets the same error as
            any application window that triesto open a connection :). Infact, I
            get this error
            >
            > connection to ":0.0" refused by server
            > Xlib: Invalid MIT-MAGIC-COOKIE-1 key
            > xhost: unable to open display ":0

            Aaaah, that's an xauth problem, which is a different story. You'll
            want to check to see that `hostname' returns the same thing before and
            after you bring up the new interface. RH 7.3's ifup scripts force
            dhcpcd to change the hostname to whatever came from the DHCP server if
            the existing one was "(none)", "localhost" or "localhost.localdomain".
            8.0 may do the same.

            The cookie that xauth uses to authenticate local clients is generated
            baed on the hostname when X starts, so a change would cause new
            clients to submit a cookie that doesn't match. Giving your machine a
            hostname (set in /etc/sysconfig/network) should help it. (Note that
            you can call it whatever you want; the machine's hostname isn't
            related to the DNS hostname.)

            --Mark
          • Hugh Taylor
            ... Please excuse my ignorance, but after reading this thread a number of times, I still can t figure out what you are trying to do. I understand you have a
            Message 5 of 6 , Apr 3, 2003
            • 0 Attachment
              On Wed, 2003-04-02 at 18:19, Mark Feit wrote:
              --- In linux-dell-laptops@yahoogroups.com, Anish Muttreja
              <muttreja@p...> wrote:
              > Hi
              > This is my first post on the group and I would like to say hello to
              > everybody. My laptop (rh 8.0 ) uses a wireless connection. The
              wireless
              > works just fine. I login and then plug in the pcmcia wireless card
              and
              > the computer activates the wireless and gets its ip using dhcp.
              > Problem is this causes X to start denying permission to connect to
              0:0
              > and I can't open another window.
              > All I can do then is restart X.
              > So I guess dhcp must be done before X starts. But I would like to
              know
              > if there is a way to teach X the new ip information without
              restarting ?

              Unfortunately, there's no way to tell the X server to listen at a new
              address without restarting it other than using `xhost +address' where
              address is the hostname or IP of your new interface.  But you
              shouldn't have to do that.

              Clients running on the local host should have a DISPLAY environment
              variable without the host name in it (i.e., ":0" or ":0.0").  This
              will force the use of the more-efficient Unix-domain socket in
              /tmp/.X11-unix.  The addition of new interfaces won't have any effect
              on these, because Unix sockets don't have any concept of hosts.

              If dhcpcd is making your host name resolve to the IP of the new
              interface and your DISPLAY variable has a hostname in it (i.e.,
              "blah:0" or "blah:0.0"), you're going to run into trouble.  (I'd
              check, but my laptop is 25 miles away at the moment.)  The TCP stack
              will make a connection to the IP of the new interface ("blah"), and
              because that same interface is the shortest route there, the
              connection will appear to come from there.  X, not having seen the new
              interface when it started, will reject the connection attempt as being
              another unauthorized host.  (If you being up your wireless card before
              starting X, everything should work just fine.)

              I don't have a machine with 8.0 handy, but unless Red Hat went in and
              changed something (possible, but I doubt it), the default has been
              ":0" since I started using X in 1988.

              Hope that helps.

              -- Mark



              Please excuse my ignorance, but after reading this thread a number of times, I still can't figure out what you are trying to do. I understand you have a laptop, you're putting a wireless card into the pcmcia slot and it is connecting to the network. Are you then having problems starting an xsession? Are you trying to run more than one xsession? Are you trying to start a remote xsession? I must be missing something. I have a laptop using RH7.2 and am constantly switching between a pcmcia ethernet card and a pcmcia wireless card while in X. All I need to do to reconnect to a network is change a couple of configuration files (which I have automated using a program called netenv) and then run /etc/init.d/network restart. I do all of this while in X. If I'm totally off base, I apologize and just ignore this (although I would like to understand what you are trying to do).

              Hugh Taylor <hrtay@...>
            • anishmuttreja@netscape.net
              Hi You might want to read Mark s most recent email, to see exactly what my problem was. I guess my description of it was pretty vague. My wireless conncetion
              Message 6 of 6 , Apr 3, 2003
              • 0 Attachment
                Hi
                You might want to read Mark's most recent email, to see exactly what my problem was. I guess my description of it was pretty vague.
                My wireless conncetion is totally automated. All I do is insert the card.
                However that runs dhcpclient and my machine that booted up with no hostname, gets a hostname from dns. This creates what Mark calls an xauth problem, X is running on localhost and won't allow any coonections from the new hostname.
                Notably, this problem only happens the first time the connetion is made.
                If I do an ifup and ifdown, after having restarted X, there is no problem because my dns server just gives me the same hostname again.
                Hope this clears up.

                anish

                Hugh Taylor <hrtay@...> wrote:

                >On Wed, 2003-04-02 at 18:19, Mark Feit wrote:
                >
                >> --- In linux-dell-laptops@yahoogroups.com, Anish Muttreja
                >> <muttreja@p...> wrote:
                >> > Hi
                >> > This is my first post on the group and I would like to say hello to
                >> > everybody. My laptop (rh 8.0 ) uses a wireless connection. The
                >> wireless
                >> > works just fine. I login and then plug in the pcmcia wireless card
                >> and
                >> > the computer activates the wireless and gets its ip using dhcp.
                >> > Problem is this causes X to start denying permission to connect to
                >> 0:0
                >> > and I can't open another window.
                >> > All I can do then is restart X.
                >> > So I guess dhcp must be done before X starts. But I would like to
                >> know
                >> > if there is a way to teach X the new ip information without
                >> restarting ?
                >>
                >> Unfortunately, there's no way to tell the X server to listen at a new
                >> address without restarting it other than using `xhost +address' where
                >> address is the hostname or IP of your new interface. But you
                >> shouldn't have to do that.
                >>
                >> Clients running on the local host should have a DISPLAY environment
                >> variable without the host name in it (i.e., ":0" or ":0.0"). This
                >> will force the use of the more-efficient Unix-domain socket in
                >> /tmp/.X11-unix. The addition of new interfaces won't have any effect
                >> on these, because Unix sockets don't have any concept of hosts.
                >>
                >> If dhcpcd is making your host name resolve to the IP of the new
                >> interface and your DISPLAY variable has a hostname in it (i.e.,
                >> "blah:0" or "blah:0.0"), you're going to run into trouble. (I'd
                >> check, but my laptop is 25 miles away at the moment.) The TCP stack
                >> will make a connection to the IP of the new interface ("blah"), and
                >> because that same interface is the shortest route there, the
                >> connection will appear to come from there. X, not having seen the new
                >> interface when it started, will reject the connection attempt as being
                >> another unauthorized host. (If you being up your wireless card before
                >> starting X, everything should work just fine.)
                >>
                >> I don't have a machine with 8.0 handy, but unless Red Hat went in and
                >> changed something (possible, but I doubt it), the default has been
                >> ":0" since I started using X in 1988.
                >>
                >> Hope that helps.
                >>
                >> -- Mark
                >>
                >>
                >
                >Please excuse my ignorance, but after reading this thread a number of
                >times, I still can't figure out what you are trying to do. I understand
                >you have a laptop, you're putting a wireless card into the pcmcia slot
                >and it is connecting to the network. Are you then having problems
                >starting an xsession? Are you trying to run more than one xsession? Are
                >you trying to start a remote xsession? I must be missing something. I
                >have a laptop using RH7.2 and am constantly switching between a pcmcia
                >ethernet card and a pcmcia wireless card while in X. All I need to do to
                >reconnect to a network is change a couple of configuration files (which
                >I have automated using a program called netenv) and then run
                >/etc/init.d/network restart. I do all of this while in X. If I'm totally
                >off base, I apologize and just ignore this (although I would like to
                >understand what you are trying to do).
                >
                >Hugh Taylor <hrtay@...>
                >

                __________________________________________________________________
                Try AOL and get 1045 hours FREE for 45 days!
                http://free.aol.com/tryaolfree/index.adp?375380

                Get AOL Instant Messenger 5.1 for FREE! Download Now!
                http://aim.aol.com/aimnew/Aim/register.adp?promo=380455
              Your message has been successfully submitted and would be delivered to recipients shortly.