* XDM not creating login shells
@ 1994-03-25 14:10 Larry Cannell
1994-03-28 14:55 ` Peter Derr
0 siblings, 1 reply; 2+ messages in thread
From: Larry Cannell @ 1994-03-25 14:10 UTC (permalink / raw)
I've come across this situation with XDM in both Ultrix and OSF/1. It has
to do with the way the session manager is started.
SHORT DESCRIPTION:
XDM starts up DEC's session manager (dxsession) in its Xsession script. The
default XDM setup in OSF/1 does not start dxsession as a login shell and,
therefore, login scripts such at .login, .profile, and /etc/profile are not
executed.
ORIGINAL PROBLEM:
When I first started configuring XDM on our Ultrix DECstations I noticed that
something was just not quite right with the session manager. One problem that
really bugged me was Bookreader was no longer finding its library discs.
Bookreader was supposed to use the environment variable DECW_BOOK which was set
properly in the /etc/profile file upon login but my XDM logins were not getting
that environment variable set.
ANALYSIS AND SOLUTION:
As it turns out the Xsession process (and subsequent dxsession process) was not
being executed in a login shell. Once I wrote a small program to exec
dxsession under a login shell then my problems disappeared.
This problem also exists on OSF/1 which, by the way, uses XDM as it's standard
X window login method.
To fix this I've modified my Xsession script on both Ultrix and OSF/1. The
line which originally started up dxsession was replaced with:
#
# Exec dxsession as a login shell
#
exec /usr/lib/X11/xdm/exec_shell $USER
The code for exec_shell is as follows:
#include <pwd.h>
#if __ultrix
#define DXSESSION "/usr/bin/dxsession"
#elif __osf__
#define DXSESSION "/usr/bin/X11/dxsession"
#endif
struct passwd *pwd;
main(argc, argv)
int argc;
char **argv;
{
pwd = getpwnam(argv[1]);
execl(pwd->pw_shell, "-", "-c", DXSESSION, 0);
exit(0);
}
This program simply finds the shell of the user (which is passed in arg1)
and then exec it with arg0 as '-' to indicate a login shell. It also passes
the argument -c and then the path for dxsession. This tells the login shell
to immediately run dxsession. Because the shell recognizes this as a login
the appropriate login scripts are run.
Hope this helps someone.
--
Larry Cannell (cannell@ed8200.ped.pto.ford.com)
Powertrain Electronics
Ford Motor Company
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: XDM not creating login shells
1994-03-25 14:10 XDM not creating login shells Larry Cannell
@ 1994-03-28 14:55 ` Peter Derr
0 siblings, 0 replies; 2+ messages in thread
From: Peter Derr @ 1994-03-28 14:55 UTC (permalink / raw)
The .xsession script is the X analog of the .login file. I quote from the
X Window System Administrator's Guide (published by O'Reilly and Assoc. and
included in the DEC OSF/1 doc set) -- "you might want to start thinking of the
.login file as the startup file for ASCII-based user serssions only." (Read
more about this in section 2.3.3.3 page 33.)
I suggest that you not modify the /usr/lib/X11/xdm/Xsession script in this
way but rather suggest that each user create a ~/.xsession script to configure
his X environment. A typical .xsession script might define various environment
variables and then run dxsession. One trick I use is to define a script of
environment variable definitions which is sourced from both my .login and my
.xsession.
--
+----------------------------------------------------------+
|Peter Derr Unix Software Group |
|Mailstop: ZKO3-3/Y15 (dtn) 381-2977 |
|Digital Equipment Corp. (603)881-2977 |
|110 Spitbook Road inet: pderr@zk3.dec.com |
|Nashua, NH 03062-2698 decnet: quarry::pderr |
+----------------------------------------------------------+
--
+----------------------------------------------------------+
|Peter Derr Unix Software Group |
|Mailstop: ZKO3-3/Y15 (dtn) 381-2977 |
|Digital Equipment Corp. (603)881-2977 |
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~1994-03-28 14:55 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1994-03-25 14:10 XDM not creating login shells Larry Cannell
1994-03-28 14:55 ` Peter Derr
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox