LJ Archive

Best of Technical Support


Issue #103, November 2002

Our experts answer your technical questions.

Building Custom Packets

Can I create my own IP header, with a new static field of 32 bits, and send it to a destination host?

—Muguntha Kumar, mugunth_kay@rediffmail.com

Sure. Look at sendip for a programming example: www.earth.li/projectpurple/progs/sendip.html.

—Marc Merlin, marc_bts@merlins.org

Die, Process, Die, Die!

What does process state D mean in the output of ps? Why doesn't the system allow root to kill processes with state D? What should one do if these processes are consuming a lot of system resources, which need to be released for use by other processes?

—Ankit Doshi, doshiaj@yahoo.com

State D means the process is in uninterruptible sleep—sleeping, waiting for something to happen, but it cannot be interrupted, even by kill -9. Sometimes the D process is trying to access remote filesystems that are unmounted or no longer available. If that is the case, use the soft option to mount.

—Felipe Barousse Boué, fbarousse@piensa.com

Ignore This Message?

At bootup I get:

Cannot locate memory.

I am not able to see any fault. Is this significant?

—George Robertson, grobertson29@earthlink.net

This is the driver module for Broadcom Cryptonet BCM5820. If you do not have this device, you can ignore this error.

—Usman Ansari, usmansansari@yahoo.com

RPM, Please Format Results My Way

I was trying to query all of the installed RPMs on my computer, so I used rpm -qaR. However, this gave me a lot of information that isn't user-friendly. I read a section in Maximum RPM about the --queryformat option. Now, I'm using this:

rpm -qaR "%{NAME}[%-8{REQUIRENAME}\n]"

The results, though, are exactly the same as those from the previous query. Anybody have any ideas how to make the output readable/usable?

—Joe, joeslapnuts@yahoo.com

You need to include --qf or --queryformat immediately before your query format string. Use rpm --querytags to list all the possible tags in the version of RPM you have.

—Don Marti, info@linuxjournal.com

I Have No Screens and I Must X

I have Red Hat 7.2 on a Gateway PC with an ATI RADEON 8500. I installed XFree86 on a number of systems, but I'm stumped with this one. Initially, I set up /etc/X11/XF86Config-4 to use the RADEON driver and according to the log, it loads that driver as well as the ATI driver and a bunch more. All appears to be fine until the end; then it says:

(II) Primary Device is: PCI 01:00:0
(EE) No devices detected.
Fatal server error: no screens found

Any ideas?

—Chris Carlson, cwcarlson@cox.net

To rule out configuration errors, try using an /etc/X11/XF86Config-4 generated by Xconfigurator.

—Christopher Wingert, cwingert@qualcomm.com

You may need to upgrade your XFree86 to 4.2 (stock Red Hat 7.2 comes with XFree86 4.1), which includes support for your ATI RADEON. See www.xfree86.org/4.2.0/Status6.html#6.

—Felipe Barousse Boué, fbarousse@piensa.com

Bad Luck or Bad Disk?

I encountered a corrupted / filesystem last June. I tried to repair the filesystem (running fsck) but was unable to recover it, so I re-installed Red Hat 7.2. After a month, the same thing happened. Now we are trying to find out if this problem is hardware- or software-related. How can I find out?

—Bing, bingcruz@yahoo.com

If you have a stock Red Hat box (i.e., no custom software), it is unlikely to be the RH distribution. I would suspect your hard drive is about to fail.

—Christopher Wingert, cwingert@qualcomm.com

Are you shutting down correctly? If you hit the power switch while a lot is happening, that could corrupt two installs in two months.

—Don Marti, info@linuxjournal.com

Check your logs, especially /var/log/messages, for any indication of disk or disk controller failures or mishaps. If you're re-installing Linux, run the “check for disk bad blocks” option, which makes a more in-depth check of your disk.

—Felipe Barousse Boué, fbarousse@piensa.com

It's almost certainly the hardware. Other possibilities include an overclocked CPU or motherboard, turning the power off without shutting down, overheating and so on.

—Ben Ford, ben@kalifornia.com

1) Next time you install, make two root partitions, one called / and one called /safe. Copy the content of / to /safe every so often, and make sure LILO or GRUB is able to boot from there. That way you won't be dead in the water if this happens again. 2) It's hard to say if it's hardware or software without more information. Consider switching to a journaling filesystem, such as ext3, so your system can recover more easily if you have problems.

—Marc Merlin, marc_bts@merlins.org

Printer Won't

I am running Red Hat 7.2 and trying to install my HP DeskJet 932C. I have done everything by the book, even tried all the drivers listed, and the printer still does not work. Can anyone tell me what the deal is here? Yes, it is a USB printer.

—Tim Fey, TFey@cfl.rr.com

Try modprobe printer, and check out /var/log/messages to see if your printer is detected. You can then use printtool to configure it for use with your distribution.

—Christopher Wingert, cwingert@qualcomm.com

Try another USB device to make sure the port you are using with the printer is working. If you are getting any error messages please send them.

—Don Marti, info@linuxjournal.com

You do not say if you're having a problem configuring the USB to talk to the printer or a problem with the actual data format sent to the printer with a working USB connection. If it's the latter, I'd suggest you go to CUPS for the latest drivers for your printer, www.cups.org. You can even generate the proper configuration files for your printer on-line.

—Felipe Barousse Boué, fbarousse@piensa.com

Don't Run This Program Twice

In libc is there a function to call to see if my application is already running?

—Pieter Coetzee, pieter@cosmosc.co.za

The way most programs do this is they store their PID in a file such as /var/run/gdm.pid.

—Marc Merlin, marc_bts@merlins.org

/var/run is writable only by root. If you want to have only one copy of an X application running per user, gnome-moz-remote probably does something close to what you want. It looks for an already running copy of Mozilla, and if one is running, it opens the given URL with that copy. Otherwise, it starts a new Mozilla process. Look at cvs.gnome.org/lxr/source//libgnome-2/libgnome/gnome-moz-remote.c.

—Don Marti, info@linuxjournal.com

LJ Archive