Operating System - HP-UX
1833082 Members
2813 Online
110050 Solutions
New Discussion

ssh/rlogin versus dtwm login environment variables

 
SOLVED
Go to solution
Brian Willis
Advisor

ssh/rlogin versus dtwm login environment variables

I have a user who is logging into a HP-UX B.11.11 U 9000/785 2004338428 using an xterm to dtwm, and his MAIL variable in the shell is set to /var/mail/USERNAME. This is where it's supposed to point. When he logs in via ssh, it gets set to /var/spool/mail/USERNAME. Is the mailer program from dtwm finding the proper path and setting it? I know I can set the variable by hand in the .profile, but I would rather find where it's coming from so I can change it globaly for the rest of our users.
7 REPLIES 7
Pete Randall
Outstanding Contributor

Re: ssh/rlogin versus dtwm login environment variables

$HOME/.dtprofile?


Pete

Pete
Brian Willis
Advisor

Re: ssh/rlogin versus dtwm login environment variables

The only thing in the .dtprofile is:
DTSOURCEPROFILE=true
C. Beerse_1
Regular Advisor

Re: ssh/rlogin versus dtwm login environment variables

With a character login (telnet, ssh, remsh and serial-line-terminal) the login only runs the startup-scripts for the login-shell: /etc/profile and ~/.profile for bourne-shell variants (most shells) or /etc/login, ~/.login and ~/.cshrc for c-shell variants (csh, tcsh). Check your shell-manual for details.

With a graphical login (cde, X11, xdmcp and such) the files that are processed is a large list (/usr/dt/..., /etc/dt/...). In user-space, the ~/.dtlogin is the place too look. Only where a c-shell is actively used, the ~/.cshrc file is also sourced once the shell is started. If a bourne-shell variant is used, no file is sourced (not even the ~/.profile).

Hence check both areas for setting of this variable and correct the wrong one.
make everything as simple as possible, not simpler (A.Einstein??)
Brian Willis
Advisor

Re: ssh/rlogin versus dtwm login environment variables

Ok, that's part of it. Thanks!

I have found the variable in the /usr/dt/bin/Xsession:
# MAIL set to "/var/mail/$USER"
[ -z "$MAIL" ] && MAIL="/var/mail/$USER"
export PATH EDITOR MAIL TERM SESSION_SVR LANG

Any guesses to where it might get set for ssh? I've added some code to the users .profile and will added it to the /etc/profile if needed, but I would rather find the error and fix it.
Ermin Borovac
Honored Contributor
Solution

Re: ssh/rlogin versus dtwm login environment variables

Mail directory is erroneously set to /var/spool/mail at compile time. Did you compile openssh yourself? If so, run configure and then modify defines.h as follows

# define MAIL_DIRECTORY "/var/spool/mail"

to

# define MAIL_DIRECTORY "/var/mail"

This may be fixed in HP's openssh (not sure about that).

http://www.software.hp.com/portal/swdepot/displayProductInfo.do?productNumber=T1471AA
Brian Willis
Advisor

Re: ssh/rlogin versus dtwm login environment variables

You hit the nail on the head. I had just found that myself by doing a recursive grep on the system. Luckly I still had the source sitting around for ssh and found it in there. Thank you very much for your help everyone. I don't know if I'm going to recompile for a little bug like that, but I might.
Brian Willis
Advisor

Re: ssh/rlogin versus dtwm login environment variables

The previous comments have the solution. Thank you so much for your help.