From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 1020c6,2483a3e9bb4e7aa0,start X-Google-Attributes: gid1020c6,public X-Google-Thread: 1164f8,2483a3e9bb4e7aa0,start X-Google-Attributes: gid1164f8,public X-Google-Thread: fee84,2483a3e9bb4e7aa0,start X-Google-Attributes: gidfee84,public X-Google-Thread: 10b612,2483a3e9bb4e7aa0,start X-Google-Attributes: gid10b612,public X-Google-ArrivalTime: 1994-03-25 06:10:30 PST Xref: gmd.de comp.unix.ultrix:13462 comp.sys.dec:14643 comp.unix.admin:15532 comp.unix.osf.osf1:2674 Newsgroups: comp.unix.ultrix,comp.sys.dec,comp.unix.admin,comp.unix.osf.osf1 Path: gmd.de!xlink.net!rz.uni-karlsruhe.de!news.uni-stuttgart.de!news.belwue.de!news.dfn.de!scsing.switch.ch!swidir.switch.ch!univ-lyon1.fr!news.imag.fr!ciril.fr!univ-lille1.fr!zaphod.crihan.fr!warwick!pipex!howland.reston.ans.net!sol.ctr.columbia.edu!newsxfer.itd.umich.edu!jobone!ed8200!pt9233.ped.pto.ford.com!cannell From: cannell@pt9233.ped.pto.ford.com (Larry Cannell) Subject: XDM not creating login shells Message-ID: <1994Mar25.141030.8598@ed8200.ped.pto.ford.com> Sender: news@ed8200.ped.pto.ford.com (USENET News System) Nntp-Posting-Host: pt9233.ped.pto.ford.com Organization: Ford Motor Co., Powertrain Electronics X-Newsreader: TIN [version 1.1 PL7] Date: Fri, 25 Mar 1994 14:10:30 GMT 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 #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