7 Replies Latest reply: Mar 27, 2013 4:04 PM by alan.pae RSS

    Open dtpad from console window

    998812
      I deal with several servers running Solaris 9 & 10. I work with these both locally and using Go Global. When I connect using Go Global with user name nmc, I can open text files from the console window for editing. However, if i login locally or do su - nmc during the Go Global session, i get the error dtpad not found. The environment variables are quite different between the nmc user during a Go Global session and the same user during a local login. To complicate matters further, most of the text files I need to edit are owned by the root user. I cannot use dtpad in any case with the root user.

      Idealy, I would like to approach this within the console window and not permanently change any profiles. I thought it was due to the PATH variable not referencing /usr/dt/bin but when I used export PATH=$PATH:/usr/dt/bin and tried to open dtpad, i got the error indicating that the display could not open.
        • 1. Re: Open dtpad from console window
          bigdelboy
          995809 wrote:
          I deal with several servers running Solaris 9 & 10. I work with these both locally and using Go Global. When I connect using Go Global with user name nmc, I can open text files from the console window for editing. However, if i login locally or do su - nmc during the Go Global session, i get the error dtpad not found. The environment variables are quite different between the nmc user during a Go Global session and the same user during a local login. To complicate matters further, most of the text files I need to edit are owned by the root user. I cannot use dtpad in any case with the root user.

          Idealy, I would like to approach this within the console window and not permanently change any profiles. I thought it was due to the PATH variable not referencing /usr/dt/bin but when I used export PATH=$PATH:/usr/dt/bin and tried to open dtpad,
          WRT:
          i got the error indicating that the display could not open.
          This is because either the DISPLAY variable was not set or the display was not open for your su'd to user to access it.


          ~~~~~~~~~~~~~~~~

          Try:

          ssh -X nmc@localhost

          Then

          export PATH=$PATH:/usr/dt/bin



          This is guarenteed to work; because the .profile setup on nmc might be a problem, as could certain ssh settings ... but worth a quick try.

          (Please note this is slightly simpliflied and sometimes i misunderstand things and give stupid adice, but I suggest above is worth a quick try).

          Also

          echo "My display is: [ $DISPLAY ]"

          can be useful diagnostic.


          ...

          Good Luck,
          • 2. Re: Open dtpad from console window
            998812
            Thanks.

            The ssh -x nmc@localhost did not allow opening dtpad from the console window.

            Here's the $DISPLAY values for the various users:
            Sun Microsystems Inc. SunOS 5.10 Generic January 2005
            r1s0u1rvm% echo "nmc user Go Global display: $DISPLAY"
            nmc user Go Global display: :2.0
            r1s0u1rvm% su - nmc
            Password:
            Sun Microsystems Inc. SunOS 5.10 Generic January 2005
            r1s0u1rvm% echo "nmc user after su - nmc display: $DISPLAY"
            DISPLAY: Undefined variable
            r1s0u1rvm% su - root
            Password:
            Sun Microsystems Inc. SunOS 5.10 Generic January 2005
            You have new mail.
            # echo "root user display: $DISPLAY"
            root user display:
            #
            • 3. Re: Open dtpad from console window
              998812
              I've been researching the environment variables and comparing logins that work to those that don't. What makes the most difference is

              DISPLAY=:0.0
              export DISPLAY
              /usr/dt/bin/dtpad

              I no longer see the "can't open display" error message but the editor still does not open. I also added the following to my PATH variable but it made no difference:

              PATH=$PATH:/usr/dt/bin:/usr/openwin/bin:/usr/ucb
              • 4. Re: Open dtpad from console window
                alan.pae
                So the next issue might be xhost.

                man xhost for security details. You might want to look at /var/adm/messages and see if anything is in there.

                alanr
                • 5. Re: Open dtpad from console window
                  998812
                  Here's the console session experimenting with xhost:

                  r1s0u1rvm% xhost
                  access control enabled, only authorized clients can connect
                  INET:localhost
                  INET:r1s0u1rvm
                  LOCAL:
                  r1s0u1rvm% su - root
                  Password:
                  Sun Microsystems Inc. SunOS 5.10 Generic January 2005
                  You have new mail.
                  # xhost
                  xhost: not found
                  # /usr/openwin/bin/xhost
                  /usr/openwin/bin/xhost: unable to open display ""
                  # DISPLAY=:0
                  # export DISPLAY
                  # /usr/openwin/bin/xhost
                  ^C#
                  #

                  This produced the same results where it appears to be doing something but nothing displays. I have to use ctl+C to return to the prompt. The messages file has some entries relating to ttsession but the time stamps don't match the time that I'm playing around with the DISPLAY variable and xhost.

                  One observation is that the environment variables are very different after su - <username>. I read that the DISPLAY variable is one that determines the behavior of dtpad. How many others affect the operation of dtpad?
                  • 6. Re: Open dtpad from console window
                    Cindys-Oracle
                    I just tested this and it seems like displaying dtpad remotely only works with dtpad -standAlone. I got an error without this option.
                    I'm on a SunRay connecting to an S10 lab system so I had to check current DISPLAY values in the current SunRay term window.

                    I also tested the DISPLAY value with firefox first and firefox came up (slowly) so I knew that the DISPLAY was okay.

                    My steps are below.

                    Thanks, Cindy

                    sunray-13term$ xhost +labsystem-name
                    sunray-13term$ echo $DISPLAY
                    ::33:0

                    labsystem# DISPLAY=sunray-13:33.0
                    labsystem# export DISPLAY
                    labsystem# /usr/dt/bin/dtpad -standAlone
                    • 7. Re: Open dtpad from console window
                      alan.pae
                      So one of the things you can do assuming that the machine is behind a firewall, etc,etc, etc is just to use xhost -.

                      The minus sign will simply disable all security.

                      The other way is to move the Magic Cookies File around:

                      http://www.x.org/releases/current/doc/man/man7/Xsecurity.7.xhtml

                      And if dtpad has issues you might want to try xclock just for testing purposes. Or some other X Windows app.

                      alan