1833062 Members
2760 Online
110049 Solutions
New Discussion

CDE profile

 
SOLVED
Go to solution
Chris Frangandonis
Regular Advisor

CDE profile

Hi All,

Could any one help me try and resolve a problem with login onto a x-terminal which CDE is downloaded from the K580 machine. The user logs on using his user-name and password.
When I open an hp-term window, I am still using another's log on profile. The only way to log on to my own user profile is to exit CDE, but doing this disrupts the background applications which would still be running. Is there a Script that once opening an hp-term window it will check to verify if the user logging on is the same user that is already logged on, and if so continue with his own .profile, should this not be the case, then user must not be allowed to access an hp-term window.


Thanks
Chris
6 REPLIES 6
Tore_1
Regular Advisor

Re: CDE profile

Hi, Im not sure if this is what you are asking for, but to read the .profile file when logging into cde you need to put

DTSOURCEPROFILE=true

in your .dtprofile

Chris Frangandonis
Regular Advisor

Re: CDE profile

Hi Tore,

Thanks, yes but should I also edit all the users .profile and insert $DT in each and how ?

Chris
Bill McNAMARA_1
Honored Contributor

Re: CDE profile

This link discusses global dtprofiles.

http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0x20f73c853cd9d5118ff40090279cd0f9,00.html

A global .profile can be played with in /etc/profile

Bill
It works for me (tm)
Steve Steel
Honored Contributor
Solution

Re: CDE profile

Hi

here is the full info

The best way to affect the shell environment inside the
terminal windows is to use the following method. This tells the
terminal window application (dtterm, hpterm, or xterm) to have
the shell inside the window be a loginshell. A loginshell by
default sources the profile. This will happen as any terminal
window on the system is opened inside a CDE session.

1. On a system-wide basis, enable the "loginShell" resource for
the terminal emulators by creating sys.resources (chmod 644) in
/etc/dt/config/C/ containing: *loginShell: True

2. On a per-user basis, create a $HOME/.Xdefaults containing:
*loginShell: True

Both of these changes will take effect with the next login to CDE.
If the same environment is needed for any terminal window run
on the system (even those started outside a CDE session) then
this same resource line: *loginShell: True
can be added to the app-defaults files for the terminal
window applications. These are located in:
/usr/lib/X11/app-defaults/HPterm (create it if it does not exist)
/usr/lib/X11/app-defaults/xterm
/etc/dt/app-defaults/$LANG/Dtterm (where $LANG=C if US-English
is the default system language, the app-defaults/C directory
may not exist by default on the system. Create them and copy
the Dtterm file from /usr/dt/app-defaults/C if that is the case).

The "*loginShell" resource will configure the terminal
emulators (dtterm, hpterm, xterm) to behave as if the user had
telnet-ed or rlogin-ed to the system. This means that the
default sequence of reading /etc/profile, etc. will occur each
time a terminal window is opened. The environment in the shell
window will NOT be the same as that of the CDE session (dtsession).

If PATHS or environment variables need to be set for the dtsession
as a whole (for applications started as actions from the CDE
front panel or CDE toolboxes), then one of the following three
methods are advised:

a) export the environment variable directly from the dtprofile.

b) create a ksh script and place it in /etc/dt/config/Xsession.d

c) set DTSOURCEPROFILE=true and then alter the env variable in
the profile.

WARNING: Using syntax that needs stdin, stdout, stderr should
be strictly avoided. Again stdin, stderr, stdout or ttys are
not available at this point in the login process. It should be
limited to exporting an environment variables. Again none of the
three methods are needed if the only thing that needs to be modified
is the shell environment inside terminal emulator windows.


Steve Steel

If you want truly to understand something, try to change it. (Kurt Lewin)
Chris Frangandonis
Regular Advisor

Re: CDE profile

Hi Steve,

Nice one, sorry I got lost. On a per-user basis each user is created with a .profile, should I create a .Xdefaults for each with the same contents as .profile !!!. Could you please explain *loginShell in a simpler text.

Thanking You
Chris
Alex Glennie
Honored Contributor

Re: CDE profile

Steve's suggestion is bang on .... see man dtterm wrt *loginShell .... but to cut a long story short when a user log's in via CDE their .profile is read once, dtterm,hpterm or xterms do not by default read or re-read users .profiles ... so if you login as userA and then su or login to userB you continue using the contents of userA's .profile.

All you need to do is create an .Xdefaults file in $HOME and add *loginShell : true ... this will force terms to read users .profiles .... nothing else need go into .Xdefaults.

(exit out of CDE and then back in for the change to take effect)

hope that's clearer ?