Search Text         
Search Tips?
Search By   And   Or   Boolean   Exact Match   TA #
Search In   Whole Doc   Keywords Sort By  
Product   Sub Product  

View Technical Articles (sorted by Product) New/Updated in the last:    7 days      14 days      30 days             
TA # Date Created Date Updated Resolved Issue?   Printer Friendly Version of This TA   Print Article
  E-mail This TA   E-mail Article
125359 10/01/2003 09:19 AM 10/13/2003 02:33 PM
Yes No
The LKP home directory appears to change unexpectedly. What is happening?
Keywords
unixware uware 7.1.2 7.1.3 openunix Linux Kernel Personality LKP uw7 devices relationship mapping pwd home $HOME cd
Release
SCO Open UNIX 8 Release 8.0.0 (7.1.2)
UnixWare 7 Release 7.1.3

Problem
          A user logs into a Unix Shell via telnet, rlogin, etc. 
          They type "linux" (from the user's home directory 
          /home/foo) to enter the Linux (LKP) environment. 
            
          The user types `pwd` and gets /unixware/home/foo  
          The user then types `cd` then `pwd` and then gets /home/foo


Solution
          This is consistent with what is expected with LKP. 
           
          This is what is happening:  
            
          All of the Linux environment is under /linux while in a 
          Unix shell. Likewise, all of the Unix environment is 
          under /unixware while in a Linux shell.  
            
          Now when you change from a Unix shell to a Linux shell, 
          your directory should remain the same, right? In order to do this the 
          kernel plays tricks with the command `pwd`.  
            
          The key thing to understand here is that when you change 
          from Unix to Linux there is a chroot call made. (see man 2 chroot)  

          In our case "chroot /linux /bin/bash."  
            
          So say for example your directory in a Unix shell is 
          /usr/bin. If you type "linux" to change your shell to a Linux shell, 
          your world has changed as well as your root directory.  
            
          So what has happened? /linux is now the root directory /.  
          Your current  directory has changed from /usr/bin to 
          /unixware/usr/bin, because your shell has changed. So the 
          kernel has done the right thing. It has put you in the 
          same directory that you were in, but now it has a 
          different name.  
           
          Now the only way to escape a chroot call, is to use 
          lxuwfs. It is a special file system that can remount the real root 
          directory to /unixware. So you can for example use linux binaries to 
          modify files in the Unix environment. There are other 
          mount points that use lxuwfs and they are listed in the 
          mount table. "grep lxuwfs /etc/vfstab"  
            
          Things work no differently in /home, but /linux/home is 
          mounted to /home using lxuwfs, so that users no matter what their 
          shell (Unix or Linux or OpenServer via OKP) can go to $HOME and their 
          files will be there.

          WORKAROUND: 
          To automatically have your `pwd` reflect a home directory of
          "/home/foo" on login to Linux namespace, do the following;

          echo "cd $HOME" >> ~/.bashrc

SEE ALSO:
          Technical Article 114681 "Open Unix 8, In LKP running Linux binaries on files with
          relatives pathnames yields confusing results"
Related Articles
•  In Linux Kernel Personality (LKP), I get "No such file or directory" when I try to start StarOffice 5.2.
•  Open UNIX 8, In LKP running Linux binaries on files with relative pathnames yields confusing results.
•  Open UNIX 8, Linux Kernel Personality (LKP): Identifying Linux process attributes crash(1M).
•  What versions of Oracle databases are known to work on SCO Operating Systems and how do I install them?
•  I am not able to use the SAMBA "smbmount" command.
Back to Search ResultsBack to Search Results