Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!thunder.mcrcim.mcgill.edu!snorkelwacker.mit.edu!bloom-beacon!dont-send-mail-to-path-lines From: gdmr@lfcs.edinburgh.ac.UK (George Ross) Newsgroups: comp.windows.x Subject: Re: xdm problem w/.profile&.login Message-ID: <9151.9101101020@subnode.lfcs.ed.ac.uk> Date: 10 Jan 91 10:20:29 GMT Sender: daemon@athena.mit.edu (Mr Background) Organization: The Internet Lines: 31 In article <127530@linus.mitre.org> Douglas S. Rand writes: > How can one get xdm to read the appropriate .login or .profile file for a > user it is starting up? Kind of a pain since you really don't want to > set PATH over and over again in the .cshrc file. > Sourcing the user's login file is fine if everyone uses the same shell. It doesn't work very well when there are several different shells in use (we have tcsh and bash, to name but two). The solution I adopted was to exec the user's favourite shell as a login shell before running the Xsession script. That way everything gets set up as though the user had logged on via login rather than xdm. The sequence goes like this: 1) xdm execs a shell-chooser program as its "session script" 2) The shell-chooser execs the user's favourite shell as a login shell, passing it a script which asks it to exec the "real" Xsession. 3) The "real" Xsession does all the usual things: loading resources, starting clients and the user's favourite window manager. In fact, the "real" Xsession script is nothing more than a wrapper which sets up one or two variables, then execs a common session script (which is also run by people starting X interactively, so we always see the same environment however we get into X). A touch convoluted, but it seems to have the right effect. If anyone wants to see the nitty gritty, drop me a line and I'll shar up a copy. Incidentally, stage 2 relies on the sh- and csh-syntax for the exec command being the same. It wouldn't work for any really wierd shell. -- George D M Ross, Department of Computer Science, University of Edinburgh 031-650 5147 or 031-667 1081 gdmr@uk.ac.ed.cs (or cs.ed.ac.uk if you prefer)