Copyright (C) 2000-2012 |
GNU Info (am-utils.info)Introduction to HlfsdIntroduction to Hlfsd ===================== Electronic mail has become one of the major applications for many computer networks, and use of this service is expected to increase over time, as networks proliferate and become faster. Providing a convenient environment for users to read, compose, and send electronic mail has become a requirement for systems administrators (SAs). Widely used methods for handling mail usually require users to be logged into a designated "home" machine, where their mailbox files reside. Only on that one machine can they read newly arrived mail. Since users have to be logged into that system to read their mail, they often find it convenient to run all of their other processes on that system as well, including memory and CPU-intensive jobs. For example, in our department, we have allocated and configured several multi-processor servers to handle such demanding CPU/memory applications, but these were underutilized, in large part due to the inconvenience of not being able to read mail on those machines. (No home directories were located on these designated CPU-servers, since we did not want NFS service for users' home directories to have to compete with CPU-intensive jobs. At the same time, we discouraged users from running demanding applications on their home machines.) Many different solutions have been proposed to allow users to read their mail on any host. However, all of these solutions fail in one or more of several ways: * they introduce new single points of failure * they require using different mail transfer agents (MTAs) or user agents (UAs) * they do not solve the problem for all cases, i.e. the solution is only partially successful for a particular environment. We have designed a simple filesystem, called the "Home-Link File System", to provide the ability to deliver mail to users' home directories, without modification to mail-related applications. We have endeavored to make it as stable as possible. Of great importance to us was to make sure the HLFS daemon, `hlfsd' , would not hang under any circumstances, and would take the next-best action when faced with problems. Compared to alternative methods, Hlfsd is a stable, more general solution, and easier to install/use. In fact, in some ways, we have even managed to improve the reliability and security of mail service. Our server implements a small filesystem containing a symbolic link to a subdirectory of the invoking user's home directory, and named symbolic links to users' mailbox files. The Hlfsd server finds out the UID of the process that is accessing its mount point, and resolves the pathname component `home' as a symbolic link to a subdirectory within the home directory given by the UID's entry in the password file. If the GID of the process that attempts to access a mailbox file is a special one (called HLFS_GID), then the server maps the name of the _next_ pathname component directly to the user's mailbox. This is necessary so that access to a mailbox file by users other than the owner can succeed. The server has safety features in case of failures such as hung filesystems or home directory filesystems that are inaccessible or full. On most of our machines, mail gets delivered to the directory `/var/spool/mail'. Many programs, including UAs, depend on that path. Hlfsd creates a directory `/mail', and mounts itself on top of that directory. Hlfsd implements the path name component called `home', pointing to a subdirectory of the user's home directory. We have made `/var/spool/mail' a symbolic link to `/mail/home', so that accessing `/var/spool/mail' actually causes access to a subdirectory within a user's home directory. The following table shows an example of how resolving the pathname `/var/mail/NAME' to `/users/ezk/.mailspool/NAME' proceeds. Resolving Component Pathname left to resolve Value if symbolic link / var/mail/NAME var/ mail/NAME mail@ /mail/home/NAME mail@ -> /mail/home / mail/home/NAME mail/ home/NAME home@ NAME home@ -> /users/ezk/.mailspool / users/ezk/.mailspool/NAME users/ ezk/.mailspool/NAME ezk/ .mailspool/NAME .mailspool/ NAME NAME automatically generated by info2www version 1.2.2.9 |