return to first page linux journal archive
keywordscontents

Best of Technical Support

X Marks the Spot

My system worked fine for a few months, but now I'm facing some problems with it. When using X, the system suddenly freezes. Neither the keyboard nor the mouse responds. I can't telnet to my computer--nothing works. Log files tell nothing--just as if nothing happened--but I have to boot my computer and hope fsck can fix everything. This happens about once a week and I don't have the slightest idea why. The system is Red Hat 6 out-of-the-box with no updates. Tried another video adapter, but that didn't change anything. Hardware: AMD-233, 64MB, ATI 3d Rage Pro, 3c509, Seagate 32.
--
Tony Söderudd, tsoderud@cc.hut.fi

It's hard to tell what the problem is. One possible reason is a bug in X; try upgrading to the latest stable XFree86 (3.3.5 at the time I write this). Another possibility is some kind of hardware/resource conflict, although since you say the problem happens only once a week on average, it's not too likely. The last option is simply bad hardware, like an overheating CPU (bad fan?) or flaky memory. I believe that is the most likely alternative and the freeze is actually completely unrelated to X. See http://www.bitwizard.nl/sig11/.
--
Marc Merlin, merlin@varesearch.com

A Communications Problem

For the last couple of years, my computer has been a small server on the Internet. Its connection is via modem. I had no problems the first year or so. On April 16, 1999, my /var/adm/messages file filled up with garbage. After a couple of weeks, I determined the phone company came to the wrong residence and ``played'' with my phone lines while my modem was connected. Ever since that time, my modem will randomly hang up without dropping carrier. Linux still thinks it is connected to the Internet, i.e., the route, ifconfig... still show a connection even though there isn't one. This doesn't happen every time the modem disconnects. Sometimes this will happen a couple of times a day; sometimes only once a month. Once it does happen, there is no way to fix it, other than physically turning the modem off and back on. I've tried replacing all hardware: modem, modem cable, serial port(s), phone wiring, phone jack. I've also tried compiling a new kernel and pppd. Nothing has helped. What in the world is happening and how do I fix it?
--
Eric Trimmer, eric@et.trimmer.org

There is a relatively simple solution, but you may need to upgrade your kernel and PPP package to support it, depending on the age of your actual installation. Use the lcp-echo-interval and lcp-echo-failure options to tell pppd to terminate when it doesn't receive a certain number of ping request responses. pppd will then terminate and cycle the connection when your physical layer goes down, whether or not your modem is correctly telling Linux it has lost its link.
--
Chad Robinson, Chad.Robinson@brt.com

Those Pesky .tgz Files

The instructions Software Forge Inc. provided for installing LinuxCAD are not really applicable to OpenLinux 2.2. What is the best way to install software in a .tar or .tar.gz file on an operating system that uses RPM?
--
Wayde C. Gutman, wcgutman@mwpower.net

You can actually install a tar file just fine on an RPM-based system. It is, however, better to have an RPM, since it keeps track of the files installed. I believe you should be able to use alien to convert your tar file into an RPM: http://kitenet.net/programs/alien/.
--
Marc Merlin, merlin@varesearch.com

The tar.gz format is somewhat similar to .ZIP under other operating systems. Usually, you'll just unpack the tar file, following instructions found in the included README or equivalent file.

Use tar tvzf filename to list the contents of a tar.gz file, and tar xvzf filename to extract it. tar is one of the most important UNIX commands; check the introductory UNIX guides or check info tar and man tar to get detailed information.
--
Alessandro Rubini, rubini@prosa.it

To Load or Not to Load

I have tried to use function request_module in my code to load dynamic kernel modules. The request_module function itself is not a problem, but the function kerneld_send, which is called by request_module. Every time I try to insert (insmod) my module, which is supposed to request the other module, I get the following error: ``helloworld.o: unresolved symbol kerneld_send''. Why can't request_module find the kerneld_send function? I use Red Hat 5.0, kernel 2.0.36RTL1.1.
--
Kristiina Valtanen, Kristiina.Valtanen@vtt.fi

At insmod time, the module is linked to the running kernel, using the public symbol table exported by the kernel (shown in /proc/ksyms). The function request_module (defined in linux/module.h) is actually an in-line function, and it gets expanded in-line at compile time. However, kerneld_send is not in-line and must be located at link time. Since kerneld_send is not exported, your module can't be loaded. The function is not exported, because no module normally asks for kenreld functionality. Unneeded internals are not exported. You can export the function by hacking the file kernel/ksyms.c and rebooting a new kernel.
--
Alessandro Rubini, rubini@prosa.it

Support Your Local CD-ROM

I am trying to install Linux 6.0 on my 486. I have run into serious problems. Red Hat Linux 6.0 does not seem to recognize my Sony CD-ROM. Several e-mails and phone calls to Technical Support at Red Hat have not solved my problem. The error message I keep getting is ``I could not mount your CD on device hdk''. I was asked to download the new boot image and try installing it again, but was not successful. I was asked to give some parameters at the boot prompt, again in vain. The last suggestion I got from tech support is to buy a new CD-ROM. The CD I have is Sony Atapi CD76E. It is an IDE controller. Is there anyone who could let me know how I can work around this problem so that I don't have to buy another CD-ROM?
--
Srilakshmi, RSSri@aol.com

You say the installation is trying to mount the CD drive as /dev/hdk--that's the 11th drive on your system! I suspect this is not correct, and the kernel merely needs to be nudged toward the correct device. Consider first the naming conventions for IDE drives (including CD drives):

You should see the pattern. What you probably need to do is determine which /dev device points correctly to your drive, and tell the Linux kernel what it is at the boot: prompt. For example, if you have two IDE controllers on your system (very common), the first controller has one IDE hard drive and the second controller has your CD drive. Thus, you should point your kernel to /dev/hdc. At the boot: prompt, type:

hdc=cdrom
There will be something before this on the boot: line that needs to be typed in; probably linux or install. Red Hat support should be able to tell you what needs to precede the line above.
--
Erik Ratcliffe, erik@calderasystems.com

Control Issues

I'm using Linux and I'm wondering how I can control a TELNET session from a shell script. In DOS, I would use a keyboard buffer, but it seems this is not available in Linux. I would like to send characters, wait for a special response, then send something again. How can I do that?
--
Thomas Lienhard, tl@tlienhard.com

You can open a pipe to telnet and send data to its STDIN and read responses from STDOUT. Using the keyboard buffer makes no sense in UNIX, as no process accesses the keyboard; they just read from standard input. If using the telnet command doesn't work, you can try netcat (available within Debian). Also, note that most languages support TCP connections; expect, for example, is a Tcl extension designed to perform exactly the task you need to accomplish: sending input and expecting responses.
--
Alessandro Rubini, rubini@prosa.it

What you are looking for is expect. This is exactly what it was designed for. man expect on any Linux box with it installed will give you the information you need, or you can download it from http://expect.nist.gov/ if you don't already have it. Also, O'Reilly & Associates publishes a very good book by Don Libes called
--
Mark Bishop, mark@bish.net

Executions 'R' Us

I'm using the KDE window manager, KDM and tcsh. My distribution is Mandrake 6.0. In my home directory, I'm keeping .cshrc and .login for my own initializations, but the problem is that after logging to an X session and invoking any terminal (xterm or kvt), the .login is not executed at all (.cshrc executes fine). Both files (.cshrc and .login) have execute permission and properly execute in a normal (batch) session. Where and how do I need to tell X (and/or KDM) to execute my .login after start-up?
--
Valentine Kouznetsov, vkuznet@fnal.gov

When you log in to the computer using a display manager, no login shell is started, so no .login or .bashlogin is sourced. The display manager handles the authentication and runs your display configuration without passing through a shell. You need to perform all of your initialization from within .cshrc. That's one of the reasons I don't run a display manager at all.
--
Alessandro Rubini, rubini@prosa.it

Need Fire Protection

Is it possible to run a Linux firewall using IP mask connecting a small network to the Net using a cable modem?
--
Tom, tlross@home.com

Yes, it is the easiest firewall configuration. Just run

ipfwadm -a accept -m
or an equivalent ipchains command.
--
Alessandro Rubini, rubini@prosa.it

Resources