Best of Tech Support

Various

Issue #99, July 2002

Our experts answer your technical questions.

I Have No “core” and I Must Debug

The default action for a dozen UNIX signals like SIGSEGV is to abort and generate a core file as a dump of the memory image of the faulty process. On Red Hat, when getting such signals, the processes abort but do not generate any core file. The only way to know a faulty process was sent such signals is to strace it. If it is possible, where on Red Hat is the core generation configured?

—Pedro Guedes, pmg01@netc.pt

The ulimit command controls the size limit of several things in your Linux system, among them, the size of the core files. Issuing a ulimit -c 0 will tell Linux to disable core files (since they will be of zero size), ulimit -c xxxx will tell Linux to allow core files of up to xxxx blocks in size. ulimit may be set in /etc/profile for all users or in your home directory's .bash_profile. Typing ulimit -h gives help on this command. If you edit the file /etc/security/limits.conf, there you may find a line something like:

*  soft   core  0

or:

*  hard   core  0

That last 0 on each of these examples indicates that the core file size should be no bigger than 0KB; therefore there are no core files generated. Hard and soft refer to the kind of limit imposed, “hard” being more strict. Change that 0 to something else, depending on the biggest core dump file that you may expect. This file (/etc/security/limits.conf) is part of the PAM (Pluggable Authentication Modules) system, which most distributions, including Red Hat, use.

—Felipe E. Barousse Boué, fbarousse@piensa.com

X on an Old SiS Video Card

I have installed Red Hat 7.2 on an old (1994-ish) colussus, but I cannot get X to run as it doesn't see the monitor, which is a CTX 1565CD. However, when I try to run Xconfigurator or any other X config tool, it does not pass the X config test. When started, the PCI probe returns the entry Silicon Integrated Systems (SiS) SG86C20, which does not appear anywhere on the list of supported cards.

—Jim Logan, jim_message@hotmail.com

The Linux Hardware Compatibility Guide (www.ssc.com/mirrors/LDP/HOWTO/Hardware-HOWTO) says you can use XF86_SVGA in a 3.x version of XFree86, or the “sis” driver in a 4.x version. The SVGA driver is a good option to try because it works with almost any card, although it will not be accelerated. Also, if you have a newer version of X, see if your card supports VESA by enabling it in the kernel and using the “vesa” driver for X.

—Chad Robinson, crobinson@rfgonline.com

What's My IP Address Today?

I have Cox.net broadband service with an SMC router yielding a DHCP address for my home network. On the network, a Linux box is the virtual server. What I would like to do is poll the router to find the LAN side address and e-mail it to myself. The purpose of course is to be able to remotely connect using the DHCP IP address. The web page configuration on the router always starts at the login page regardless of the URL used (security). SMC does not seem willing to respond at all to my question.

—Tom Mautner, mautner@cox.net

Have you considered a dynamic DNS service? That may let you do an end run around to collect the address internally. A service such as ZoneEdit will allow you to update your address automatically via a web query, which you can automate with lynx.

—Chad Robinson, crobinson@rfgonline.com

Send yourself an empty e-mail, and you will see that the Received header lines will contain the IP that your router used when it connected to Cox's mail relay. You'll see something like this:

Received: from manyroads.ssc.com (manyroads.ssc.com
        [192.168.3.58]) by mail.ssc.com (Postfix) with ESMTP

and you can get the IP from there. Not high tech, but it works.

—Marc Merlin, marc@merlins.org

If the router is doing NAT, and you want the address of its internal interface, run:

route -n | mail you@example.net

—Don Marti, info@linuxjournal.com

X Takes over Both Video Cards

I have two graphic cards in my box, one is ATI Rage XL (PCI) and one is ATI RADEON VE QY (AGP). I would like to control the AGP card from a kernel module we have written (which displays on a projector), and I would like to let X control the PCI card (which displays on a flat panel monitor). The problem begins when we use startx. The PCI controlled monitor starts X correctly, but our kernel module no longer has control of our AGP card (no image displays on the projector). Does anyone know why X seems to be taking away our control of the AGP card?

—Jing Xu, jing@cs.unm.edu

Try forcing X to use a specific bus ID using the “BusID” parameter. Perhaps X is trying to use both cards as a multihead configuration, but you should be able to prevent it from doing that.

—Chad Robinson, crobinson@rfgonline.com

Fixing ext2 Filesystem Damage

Question: after a power blackout I am having trouble with my drive. I am using the ext2 filesystem. With the help of the tomsrtbt floppy distribution and a couple of documents from the LDP, I have been able to boot in single-user mode. But when I try to execute the network script, the system sticks after echoing the following:

Disabling IPv$ packet forwarding
sysctl: ip forwarding off

What can I try next?

—Roberto Kruse, rkruse@ieee.org

I would advise you to boot from a rescue disk and run an e2fsck on the partitions of your damaged hard disk for an automatic check:

e2fsck -p -v /dev/<partition_to_fix>

Keep in mind that messing around with your disk, even with fsck and e2fsck, may result in loss of data, so be careful that you understand what you are about to do.

—Felipe E. Barousse Boué, fbarousse@piensa.com

You can try booting Linux with linux single or linux init=/bin/bash if all else fails. Type this at the LILO prompt. After that, you can look at the output of rpm -Va, which should tell you which packages have modified or missing files, and you can then re-install the said packages (with rpm -U --force /location/of/package.rpm) All that said, it's probably as good a time as any to upgrade your system to the latest Red Hat version, which should also fix your problem in the process.

—Marc Merlin, marc@merlins.org

How to Mount a USB Device?

I would like to access a Disgo 16MB USB Flash RAM device from Mandrake Linux. Will Linux automatically mount this device? If so, how can I find it?

—Greg, gregory_connor@yahoo.co.uk

I believe that Mandrake uses the usbdevfs pseudo-filesystem, though I don't know where it mounts. Type mount to see. My Red Hat machine mounts it on /proc/bus/usb.

—Ben Ford, ben@kalifornia.com

Linux supports USB storage devices if you have a recent kernel version. According to Mandrake's web site, they shipped 8.1 with kernel version 2.4.8. However, because the device drivers have evolved quite a bit in the last few months, it may be helpful to update to the latest 2.4.x version, which at the time of this writing is 2.4.18. You will need both the USB device filesystem and SCSI generic support. Then, check out the Linux USB Guide (linux-usb.sourceforge.net/USB-guide/book1.html). The “mass storage” section should be helpful.

—Chad Robinson, crobinson@rfgonline.com