1833329 Members
3774 Online
110051 Solutions
New Discussion

Reflection X question

 
SOLVED
Go to solution
Gerry Tully
Frequent Advisor

Reflection X question

Has anyone seen a problem where when logging into an XDMC connection, it does not run the .profile file unless I type . $HOME/.profile? The last line in the .dtprofile is uncommented, so I thought it would work. Seems to work for some users and not others. Thanks.
Any Ideas?
7 REPLIES 7
William Wong_2
Trusted Contributor

Re: Reflection X question

I assume you mean the line you mean is uncommented is:

DTSOURCEPROFILE=true.

However .profile is only valid for certain
shells which include korn shell, posix shell and bourne shell. Users that have a default of c shell will not have .profile execute as
.cshrc is what it executes. So for the users that it does not work for are they running csh (c shell) as their default? Check by look at the entry at the end of /etc/passwd and see what shell they are set for.
John Dvorchak
Honored Contributor

Re: Reflection X question

Are you sure some users are not reading their $HOME/.profile or are there statements in those affected user's .profile and specifically requires a tty device. Since the desktop reads .profile with no associated terminal, any read or echo statements will be lost. This is from the .dtprofile file itself:

### The desktop reads the .dtprofile and .profile/.login without an
### associated terminal emulator such as xterm or dtterm. This means
### there is no available command line for interaction with the user.
### This being the case, these scripts must avoid using commands that
### depend on having an associated terminal emulator or that interact
### with the user. Any messages printed in these scripts will not be
### seen when you log in and any prompts such as by the 'read' command
### will return an empty string to the script. Commands that set a
### terminal state, such as "tset" or "stty" should be avoided.
If it has wheels or a skirt, you can't afford it.
Gerry Tully
Frequent Advisor

Re: Reflection X question

Everyone has the same shell. There is a line that runs a script . /oracle/env_functions.sh but it doesn't look like it is setting the environment from the script.
Any Ideas?
A. Clay Stephenson
Acclaimed Contributor

Re: Reflection X question

One thing that immediately occurs to me is that if the home directories are auto-mounted, you may have problems with the automounter maps. This would explain why it seems to work for some and not for other seemimgly identical users.

If it ain't broke, I can fix that.
Bill Hassell
Honored Contributor
Solution

Re: Reflection X question

This is a VERY common problem with Xwindow managers and has nothing to do with Reflection/X. And the problem is more pervasive than setting DTSOURCEPROFILE. What your users are expecting is a 'normal' Unix login which (for POSIX shells) first runs /etc/profile and then .profile (DTSOURCEPROFILE doesn't run /etc/profile). It turns out that the default for all terminal emulators is to startup without executing the usual profiles. To fix this, put this into every HOME directory for every user:

echo "*loginShell: true" >> $HOME/.Xdefaults

Now terminal emulators such as hpterm, xterm or dtterm will login as expected and will have the same profiles as a telnet connection. You can also add additional resource settings for the emulators or other Xwindow applications. For example, the contents might look like this:

*loginShell: true
HPterm*scrollBar: true
HPterm*saveLines: 10s
HPterm*background: navy
HPterm*foreground: white
Xterm*background: darkslateblue
Xterm*foreground: white
Xterm*saveLines: 10s
Xterm*scrollBar: true
Dtterm*saveLines: 10s
Dtterm*scrollBar: true

and after adding these lines to .Xdefaults, all hpterm, xterm and dtterm windows will have a scroll bar plus 10 screens (800 lines) of history. hpterm will have a dark blue with white letter color scheme while xterm will have a more gray-blue background with white letters. dtterm will match the overall CDE color scheme.

.Xdefaults is one of the many ways to set window decorations or resources. Look at the man page for hpterm and you'll see the dozens of options and resources that can be set. They can be set generically for every window or they can be set for a window that has a specific title. man X is a start but a good book on Xwindows will also be worthwhile.


Bill Hassell, sysadmin
Robert-Jan Goossens
Honored Contributor

Re: Reflection X question

Hi,

http://bizforums.itrc.hp.com/cm/QuestionAnswer/0,,0x826150011d20d6118ff40090279cd0f9,00.html

maybe some info in the above answers.

Hope it helps,

Robert-Jan.
Gerry Tully
Frequent Advisor

Re: Reflection X question

I came back to post the fix to the problem, and read some of the responses. Bill, you hit the nail on the head. I had to put that line into the .Xdefaults file and now everyone is happy (especially me). Thanks for everyones help.
Any Ideas?