Cover V08, I01
Article

jan99.tar


Questions and Answers

Bjorn Satdeva

 Q I have already downloaded recommended patch 103179-08.tar.Z for Sun OS 5.5, Now, how do I apply a patch, and what are the precautions needed before applying it?

 A You will need to uncompress and un-tar the patch. You should be able to find a README file in the patch directory that will give you information on how to apply it. The necessary precaution is, as always, to have good backup. There should be information included in the PATCH information on how to back out of it, but sometimes, the only way out is to restore an old backup.

 Q Is it necessary for me to duplicate all incoming and outgoing mail (Sendmail) for the user? How can I do this using the Sendmail program on a platform running FreeBSD and BSDI?

 A You are not describing the purpose of duplicating email. So, I assume that you simply need to have email delivered to a user in two different places. You can do this in two different ways. One way is with the systems alias file, which will allow you to redirect incoming mail to one or more different locations, to a file or even to a program. Be careful with the latter, however. From a security point of view, this can be a big problem that could allow intruders access to your system.

To use this method, simply edit the /etc/aliases file, and then run newaliases to make the changes take effect. The syntax of the alias file is simple. Enter the name of the alias, and then a comma-separated list of destinations.

The second method allows individual users to redirect their incoming mail to a different location, by creating a .forward file. Again, the syntax is a list of recipients. However, the user might want to keep a local copy of the email as well as sending it somewhere else. The classic example is the vacation program (which will send notifications to the sender when the receiver is away from work). In that case, a backslash in front of the user name prohibits any further aliasing of that user name. For example:

\bjorn, "|/usr/bin/vacation bjorn"

will deliver mail both to my mailbox and forward a copy of the mail to the vacation program.

 Q I would like to know what the raw partition is on UNIX.

 A A disk device can be accessed in two different ways. The first way is as a raw mode, which gives you access to the partition. This bypasses the file system and is used by software that does not use the UNIX file system (such as many databases) or by programs that already understand the UNIX file system (such as dump). Most programs, however, use the second way, which is the "cooked" partition, where access goes through the file system in the usual manner.

 Q What can I delete or remove in Sun Solaris when there's an Oracle database running? How can I prevent the root directory from being 100% full?

 A It may be too late to do you much good at this time, but the root partition should always be kept small, and write access should be kept to a minimum. The reason for this is that it is much harder to fix a garbled root partition than any other partition on the machine. Therefore, you do want to ensure that /tmp and /var (or any new directories you are adding to the machines) live on separately mounted file systems.

Logging should never be done to the root file system, so if you possibly can, move the logging to a different directory. If damage already has been done, if at all possible, make the log directory into a separate mount point.

The root directory should be large enough to keep all the usual stuff (like /etc, kernel, bootstrapper, etc.) as well as a few extra copies of the kernel. Nothing else should go there, so a root directory that is 80 or 90% full is OK, if you have gotten the rest right.

 Q I have a problem configuring dial-in PPP connectivity in a Solaris 2.6 machine. When I dial-up from a laptop and connect to the server as PPP user, I am only able to ping the server but not any of the resources or machines in the LAN to which I am connecting. I have configured the Solaris machine as the PPP dial-in server, which dynamically assigns the IP address for the laptop. I am getting connected without any problems but could not become a part of the entire network in true sense.

 A It sounds as if you have forgotten to set the default route on your laptop. The default route must be set on the laptop and must point to the server. As long as the laptop only has that one network connection, and as long as the routing on the server is working correctly, then it should work.

 Q Which is the best backup format for HP-UX server?

 A HP wants you to use fbackup. Unfortunately HP-UX does not support dump and restore, so you are either stuck with fbackup or tar. Personally, I would use GNU tar in this situation, as I do not trust fbackup, and do not like the fact that it is using a proprietary format for the backup image.

 Q I use a tmpfs to share /tmp and swap space. On /etc/vfstab on the swap line I added size=100m for the /tmp file system. After making the changes, I rebooted the system. I did not see any difference in the df -k output after the changes. Can you please tell me what is going on?

 A 100 M seems very large for a memory file system. Remember that you need to allocate that memory to the file system, taking it away from any other usage. My guess is that the system will not allow you to allocate that much, as it otherwise would not have enough for its other memory needs. I am not entirely sure how the memory file system is implemented, but I have occasionally seen a memory file system (using much less than what was allocated in fstab) still being reported as full if the machine was otherwise short on memory. This seems to be meaningful behavior to me. If you need a really large /tmp file system, use a traditional disk file system instead.

 Q We run Sun Solaris here and would like to assign more than 16 groups to a user. There is a system variable called NGROUPS_MAX that shows as 16 currently, which leads me to believe that it can be increased. If so, how?

 A This value is compiled into the kernel and cannot be changed by the end user. Changing this value may have all kinds of side effects. So, even if you have the complete source for everything, do not do this unless you are prepared to spend a substantial amount of time debugging both kernel and utilities.

 Q How can I write and execute a script so that the first line contains rlogin -l (user name) (host name) and the second one contains any executable commands or scripts, such as /opt/bin/OA (OA is a runner script for Office Automation applications) on remote machine. In this case, all permissions are OK. I would like to execute this script from any different host (in a LAN), but I can't automatically set the DISPLAY variable correctly.

 A You cannot rlogin to a remote machine and execute commands from the script that did the rlogin. The reason is that rlogin starts a new process (which will run on the remote machine). You can do a simple test to demonstrate this by building and executing the following little shell scripts:

#! /bin/sh
rlogin remotesys
echo hello world

When you execute this script, it will do a rlogin to the remote host, where you will get an interactive login prompt. After you exit the rlogin, and return to the original machine, the script will execute the echo command, and you will see the message "hello world" on your monitor.

The way to work around this is to get the program called expect. This differs from other kinds of command interpreters because a script consists of a series of send and expect statements. The following is an example of a expect script that logs into a remote system and executes the echo from the above example:

#!/usr/local/bin/expect -f
set force_conservative 0  ;# set to 1 to force
                          ;# conservative mode even if script
                          ;# wasn't run conservatively
                          ;# originally
   if {$force_conservative} {
           set send_slow {1 .1}
           proc send {ignore arg} {
                   sleep .1
                   exp_send -s - $arg
           }
   }

   set timeout -1
   match_max 100000
   send - "rlogin remotesys\r"
   expect - "Password:"
   send - "<passwd>\r"
   expect - "%> "
   send - "echo hallo world\r"
   expect - "%> "
   send - "exit\r"
   expect - "Connection closed.\r"

 Q Is there any tracking tool or utility for debugging delayed mail reception? How do I know at which mail hop the mail got delayed? I have been receiving messages anywhere from 2 hours to 2 days from the time they were sent. It is not consistent though.

 A When you look at the headers of the mail message, you will see a number of lines starting with "Received:". Each system in the path of the email is suposed to add a received line for the purpose of seeing the path the mail has traveled and any possible delays that have occurred.

 Q What's the difference between NFS, DNS, NIS+, and NIS? What distinguishes them from each other?

 A NFS is Sun's Networked File System, and by now, more or less, the de facto method of sharing file systems between computers.

DNS is the Domain Name Service, which is the way information about hostnames and addresses are shared across the Intenet.

NIS stands for Network Information Name Service. It was original called Yellow Pages, which is why many of the commands for NIS start with yp (such as ypbind, ypcat, etc.) NIS was developed by Sun, and is, like NFS, more or less the default way of sharing system information between UNIX machines.

NIS+ is Sun's re-implementation of NIS. It attempts to address some of the problems with NIS, but the implementers of NIS+ have made a series of bad choices in the design of NIS+, so it has seen only limited usage compared to the other types of services you asked about.

About the Author

Bjorn Satdeva is the president of /sys/admin, inc., a consulting firm which specializes in large installation system administration. Bjorn is also co-founder and former president of Bay-LISA, a San Francisco Bay Area user's group for system administrators of large sites. Bjorn can be reached at questions@sysadmin.com.