Cover V13, i06

Article

jun2004.tar

Questions and Answers

Amy Rich

Q I'm trying to compile Apache 1.3.29 with mod_ssl 2.8.16 and mod_perl 1.29 on a Solaris 8 machine with gcc 3.3.2. I've downloaded the source, unpacked it, and configured it as follows:

cd mod_ssl-2.8.16-1.3.29
./configure --with-apache=../apache_1.3.29 --with-ssl=/usr/local

cd ../mod_perl-1.29
/usr/bin/perl Makefile.PL \
 DO_HTTPD=1 \
 EVERYTHING=1 \
 APACHE_SRC=../apache_1.3.29/src \
 USE_APACI=1 \
 SSL_BASE=/usr/local \
 APACHE_PREFIX=/usr/local/apache \
 APACI_ARGS='--enable-module=ssl,--enable-module=rewrite' \
 INSTALLSITEARCH=/usr/local/lib/perl5/site_perl/5.8.0/sun4-solaris \
 INSTALLSITEMAN3DIR=/usr/local/man/man3
make
Not too far into the compilation, I get the following errors:
gcc -c -I.. -I/usr/local/lib/perl5/5.8.0/sun4-solaris/CORE -I../os/unix
  -I../include -DSOLARIS2=280 -DMOD_SSL=208116 -DMOD_PERL
  -DUSE_PERL_SSI -fno-strict-aliasing -I/usr/local/include
  -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DEAPI -DNO_DL_NEEDED
  -fno-strict-aliasing -I/usr/local/include -D_LARGEFILE_SOURCE
  -D_FILE_OFFSET_BITS=64 '../apaci' util.c
util.c: In function 'ap_find_token':
util.c:1410: error: 'test_char_table' undeclared (first use in this function)
util.c:1410: error: (Each undeclared identifier is reported only once
util.c:1410: error: for each function it appears in.)
util.c:1410: error: 'T_HTTP_TOKEN_STOP' undeclared (first use in this function)
util.c: In function 'ap_escape_logitem':
util.c:1487: error: 'test_char_table' undeclared (first use in this function)
util.c:1487: error: 'T_ESCAPE_LOGITEM' undeclared (first use in this function)
util.c: In function 'ap_escape_shell_cmd':
util.c:1547: error: 'test_char_table' undeclared (first use in this function)
util.c:1547: error: 'T_ESCAPE_SHELL_CMD' undeclared (first use in this function)
util.c: In function 'ap_escape_path_segment':
util.c:1651: error: 'test_char_table' undeclared (first use in this function)
util.c:1651: error: 'T_ESCAPE_PATH_SEGMENT' undeclared (first use in this \
  function)
util.c: In function 'ap_os_escape_path':
util.c:1680: error: 'test_char_table' undeclared (first use in this function)
util.c:1680: error: 'T_OS_ESCAPE_PATH' undeclared (first use in this function)
*** Error code 1
make: Fatal error: Command failed for target 'util.o'
Current working directory
/home/arr/build/apache/src/apache_1.3.29/src/main
*** Error code 1
make: Fatal error: Command failed for target 'subdirs'
Current working directory /home/arr/build/apache/src/apache_1.3.29/src
*** Error code 1
make: Fatal error: Command failed for target 'build-std'
Current working directory /home/arr/build/apache/src/apache_1.3.29
*** Error code 1
make: Fatal error: Command failed for target 'build'
Current working directory /home/arr/build/apache/src/apache_1.3.29
*** Error code 1
make: Fatal error: Command failed for target 'apaci_httpd'
I'm not sure what the issue is, since everything seems to look fine. Where should all of these functions be declared, and why isn't gcc finding them?

A Your problem is not the compiler but your make program. This is a common error if you're using /usr/ccs/bin/make instead of GNU make. If you have GNU make installed, put its path in your PATH before /usr/ccs/bin. If you don't have GNU make installed, obtain and build the source from:

http://ftp.gnu.org/pub/gnu/make/
Or use one of the precompiled packages from:

http://www.sunfreeware.com/
or

http://www.blastwave.org/
Q We have several Solaris 8 machines at our facility. One of our users has a very wide terminal he uses to connect to these machines. When he does an ls, it's limited to 80 columns, even though he has the COLUMNS environment variable set. According to the ls man page:

There are three major listing formats. The default format for output directed to a terminal is multi-column with entries sorted down the columns. The -1 option allows single column output and -m enables stream output format. In order to determine output formats for the -C, -x, and -m options, ls uses an environment variable, COLUMNS, to determine the number of character positions available on one output line. If this variable is not set, the terminfo(4) database is used to determine the number of columns, based on the environment variable TERM. If this information cannot be obtained, 80 columns are assumed.

So why can he only get 80-column output?

A There are a couple reasons why you would be getting 80-column output even when using the COLUMNS setting. Make sure you're using /usr/bin/ls or /usr/xpg4/bin/ls and not /usr/ucb/ls. The UCB ls (man section 1b instead of 1) does not honor the COLUMNS variable. If you are using /usr/bin/ls or /usr/xpg4/bin/ls and COLUMNS is set to a number above 160, this is assumed to be an error and defaults back to 80 columns. If you have a sunsolve.sun.com account, you can see this referenced under bugids 1233465 and 4133872. As far as I know there is no work-around for Solaris 8, but this has been updated in Solaris 9 so that the maximum column size is 1000. The minimum in both versions of Solaris is 20 columns.

Q I have a cable modem connected to an OpenBSD 3.4 machine acting as a router. I'm using dyndns.org to update my DNS information for my personal domain. Is there some nifty script available to handle the dyndns interaction for me so that I don't need to modify things manually when my IP changes?

A There's a Perl script called ddclient available in the OpenBSD ports tree under net/ddclient. The ddclient script also supports the following dynamic DNS sites:

DynDNS.org -- See http://www.dyndns.org
dnsPark -- See http://www.dnspark.com
EasyDNS -- See http://www.easydns.com
Hammernode -- See http://www.hn.org
OrgDNS -- See http://www.orgdns.org
Zoneedit -- See http://www.zoneedit.com

It also includes support for DSL Reports host monitoring service. See the following for details:

http://dslreports.com
Q I just did a recovery of a Solaris 9 machine from a flash archive, but it didn't restore important files like /etc/hosts, /etc/defaultrouter, /etc/vfstab, and /etc/hostname.<interface>. I know these files existed on the master machine where I created the flash archive, but the items restored to this new machine look like blank system default files. How can I get flash to create an exact duplicate?

A The flarcreate program does the equivalent of sys-unconfig before the archive is packaged. To keep the machine-specific configuration files, I suggest creating a tar ball or a separate directory with the necessary files. You can then use a script to move these files back into place. If you don't back up these files and use a script to place them back where they belong, sysidconfig should handle the reconfiguration of the machine (whether that be as part of a jumpstart installation or an interactive install depends on the flash installation method). See the man pages for sys-unconfig(1M) and sysidconfig(1M) for more information.

Q I'm running FreeBSD 5.2-RELEASE and I'm trying to get the GNU GRUB boot loader installed and working from the ports collection. It compiles and installs fine, but when I run grub-install, I get the following errors:

grub-install '(hd0)'
/dev/ad0s1a does not have any corresponding BIOS drive.
grub-install /dev/ad0
/dev/ad0 does not have any corresponding BIOS drive.
The simplest form of my grub.conf contains the following:

default 0
timeout 5

title  FreeBSD 5.2
root   (hd1,0,a)
kernel /boot/loader
Why won't GRUB recognize my boot disk at all?

A My guess is that you're using an old version of the GRUB port. Until early February 2004, the GRUB port did not support UFS2, the default filesystem type for FreeBSD 5.2, without chainloading. You can use chainloading as follows:

title  FreeBSD 5.2
rootnoverify (hd1,0)
chainloader +1
If you'd rather not use chainloading, try updating your ports collection and installing the new GRUB with the UFS2 patch. Another option is to use a different boot loader altogether, such as the Graphical Boot Manager, GAG. GAG can be obtained from:

http://gag.sourceforge.net/
Q I'm running Solaris 7 on an Ultra 10. At one point, we experienced a period of high load and killed off a number of processes by hand to try to bring the machine back to normal. For one particular process (an in-house application called stalld) I tried terminating the process using kill <pid>. When that failed, I tried kill -9. That also seemed to fail, because the process was still there after the first kill -9 attempt. I ran the kill -9 several times, and the process finally died. I thought that kill -9 immediately terminated the process, no matter what? Why were the first few kill -9 calls ineffective?

A A kill -9 will terminate a process as long as the process is not already a zombie. Since your process finally terminated, it's likely that the process was blocked and it took a while for it to receive the kill signal. This often happens when the process is in iowait or is swapped out. Because you mentioned that the load was high, perhaps the program had crashed and was writing a large core file out to disk, or there was no free memory for the process to run.

Q I've just acquired an old SPARC 20 to use as a router/firewall, and I've successfully installed Solaris 8 on it. A monitor came with the SPARC 20 so that it could be used as an X-capable machine, too. Unfortunately, I don't seem to be able to use X at all. Even the installation wasn't a GUI like I'm used to; it was the character-based install on the graphical monitor. I saw X working on this machine before I got it, so I know it's not something weird with the brand of monitor or the connectors. I've tried everything I can think of to get X configured but I haven't had any luck. Do you have any suggestions?

A The fact that the install program started in character mode indicates that it did not recognize the graphics card. It's likely that your SPARC 20 has an old ZX or TZX (leo) frame buffer. You can verify this by identifying the graphics card in the boot message. Solaris stopped supporting the ZX/TZX after 2.6, so it's possible that you saw the machine running with version 2.6 or older of the OS before you acquired it.

Of course, running X on this card is going to be very slow, and you generally don't want to run X on a machine that's acting as a router and/or firewall anyway, but it should be possible if you choose to do so. Obtain the leo packages from a 2.6 installation and use those to run the graphics card. The leo package directories you'll want off the 2.6 install media are:

SUNWleo.m (since you have a sun4m machine)
SUNWleoo
SUNWleor
SUNWleow

Q I'm running FreeBSD 4.9-STABLE. I do a cvsup on a nightly basis to keep my ports tree up to date. I often get timeouts from the primary site in my configuration file and I'm wondering whether there's some way to avoid that.

A A good solution to your problem may be to use the fastest_cvsup program to select your cvsup server each time. The fastest_cvsup program, as its name implies, locates the "closest" cvsup server based on the time needed to establish a connection. The fastest_cvsup program can search all cvsup servers worldwide or be restricted to one or more countries based on the argument supplied to the -c flag. Install the port from /usr/ports/sysutils/fastest_cvsup and modify your cvsup cron entry to look something like the following if you want to test servers in the United States:

/usr/local/bin/cvsup -g -h '/usr/local/bin/fastest_cvsup -Q -c us' \
    /path/to/your/cvsupfile
See the fastest_cvsup(7) man page for more details.

Q I'm trying to compile and install OpenSSL 0.9.7d on a Solaris 8 machine with gcc 2.95.3. I obtain the portable tar bundle from their Web site, unpack it, and run config and build it as follows:

./config --prefix=/usr/local --openssldir=/usr/local/etc/openssl shared
make
make install
Everything builds and installs without errors, but when I run /usr/local/bin/openssl, I get the following error:

ld.so.1: /usr/local/bin/openssl: fatal: libssl.so.0.9.7: \
  open failed: No such file or directory
I check the the /usr/local/bin/openssl binary using ldd:

ldd /usr/local/bin/openssl
     libssl.so.0.9.7 =>       (file not found)
     libcrypto.so.0.9.7 =>    (file not found)
     libsocket.so.1 =>        /usr/lib/libsocket.so.1
     libnsl.so.1 =>   /usr/lib/libnsl.so.1
     libdl.so.1 =>    /usr/lib/libdl.so.1
     libc.so.1 =>     /usr/lib/libc.so.1
     libmp.so.2 =>    /usr/lib/libmp.so.2
     /usr/platform/SUNW,UltraAX-i2/lib/libc_psr.so.1
The library is definitely in /usr/local/lib, and I specified the prefix on the configure line, so why can't it find the library?

A Unfortunately, the OpenSSL make files are not smart enough to compile the openssl binary with the runtime environment of the library directory specified on the command line. This is especially odd for OpenSSL; it obviously knows where the libraries will end up because it installs them. You can work around this behavior by explicitly setting the variable LD_RUN_PATH before you compile the software. You can also use crle to add /usr/local/lib to the system-wide library search path. I suggest the former, but many people prefer the latter to work around all software packages that don't compile binaries with the correct run time path. For more information on modifying the system-wide runtime environment, read the crle(1) man page.

Q We have an old Sun E450 that we're essentially turning into an NFS server for various non-intensive jobs at our site. There's some debate going on as to whether or not we need a second power supply to handle the load. We're not really concerned about redundancy, because this machine isn't going to have critical data on it. Do you know definitively whether or not the second power supply is actually required in an E450, or is it just there for redundancy's sake?

A The answer to your question is "it depends". If your E450 doesn't have much in the way of disk, PCI slots, or number of CPUs, then you're definitely not going to need the second power supply. If you're packing it full of CPUs, memory, disk, and PCI cards, then you will want the extra power supply for the load. To help determine your specific needs, take a look at:

http://docs.sun.com/db/doc/805-0429-10/6j0fk0g0h?a=view
and fill out the worksheets contained on that page. Note that the third power supply can only be used for redundancy. In the rare case that your power requirements exceed what two power supplies can provide, you're going to have to remove components until you're under the maximum rated value.

Amy Rich, president of the Boston-based Oceanwave Consulting, Inc. (http://www.oceanwave.com), has been a UNIX systems administrator for more than 10 years. She received a BSCS at Worcester Polytechnic Institute, and can be reached at: qna@oceanwave.com.