LJ Archive

Best of Technical Support

Our experts answer your technical questions.

Adding a New Service

I have written an SMS system in Java. I want to execute that system as a background service in Linux. My system is in a *.jar file. How can I do it as a service in Red Hat?


Kasun Perera


kasun@teamwork.lk

You need to create a script file that you would put in the /etc/rc.d/init.d/ directory. It must have a very specific format, as clearly indicated on this page: www.sensi.org/~alec/unix/redhat/sysvinit.html. I suggest that you look at other scripts in that directory to grasp the general format of the file, especially the first 15 lines or so.


Felipe Barousse Boué


fbarousse@piensa.com

When starting a new service, I like to copy the init script for SSH, because it's usually the simplest. Put in whatever commands you need to run to start your program from the command line. For example, you might need to set some environment variables to run a Java program. Run your init script from the command line to make sure it starts and stops your new service correctly, then use your distribution's tool for managing runlevels to make it run at startup. Use chkconfig on Red Hat.


Don Marti


info@linuxjournal.com

Speeding Up Webmin

I use Webmin and ZoneMinder on my P4 2.2GHz, 1GB RAM system, and the response is less than what I would expect. Is there a way to speed up the loopback device?


Howard Watts


howardwatts@sbcglobal.net

I just upgraded some Webmin systems to the latest Webmin, 1.140 at the time of this writing, and I noticed a substantial speed improvement in operation. I upgraded all modules as well. All this was done directly from within Webmin.


Felipe Barousse Boué


fbarousse@piensa.com

The only lag on the loopback device is traversing the TCP stack; this should be very fast. If you see performance issues, you may want to look at a program called top (see man top) to see if there are any out-of-control processes.


Christopher Wingert


cwingert@qualcomm.com

It is highly unlikely that the loopback device is the culprit. It's more probable that there's something else causing the performance lag, network function or otherwise. Perhaps it's having timeout issues due to failed DNS lookups or something similar?


Timothy Hamlin


thamlin@zeus.nmt.edu

Winmodem: Hack or Replace?

I can't get my modem to work. I have a Creative Labs Blaster v92 PCI internal modem. Linux recognized a Conexant chipset and attempted to install the driver, but I received an error message. Should I try installing SuSE Pro 9.0 instead?


Manny


manuel61@joimail.com

Probably the easiest and most advisable solution is to purchase a very inexpensive modem that is not a Winmodem. You probably would get a better setup with less complex stuff, and you will get a modem that will last for many future Linux generations. Besides, you will show manufacturers that we all want standard modems, not proprietary ones.


Felipe Barousse Boué


fbarousse@piensa.com

It's almost never necessary to upgrade your entire operating system simply to support a device. Without knowing the exact chipset you are using, I can suggest only that you first determine if yours is a full hardware modem or a so-called Winmodem. I suspect it is the latter, because if it were a full hardware modem you probably wouldn't be having any issues. Rather than updating your Linux distribution, figure out which driver it was attempting to load and then go to the Web to find an updated driver. Winmodem support under Linux is ever-increasing (see www.linmodems.org for a good place to start). If you are lucky, you will be able to find a newer, working, version of the driver you are looking for—and save yourself a lot of trouble to boot.


Timothy Hamlin


thamlin@zeus.nmt.edu

Are you looking for a tweaky project to help you understand Winmodems, or do you simply want a Net connection? Have a goal in mind before you decide between the above two answers, and remember that if you upgrade, you may need to redo your modem setup.


Don Marti


info@linuxjournal.com

Getting Started

I would like to learn Red Hat 9. Can I install Red Hat 9 software and Windows 2003 server (Beta) software on the same PC? My PC is a Dell PIII with 700MZ, 6GB hard drive and 128MB of RAM. I know I will need to partition the hard drive. I saw the software for sale on Amazon.com for about $70 US. I am new to this and am trying to learn, so any assistance is appreciated.


Bill


whitesock95829@yahoo.com

Yes, you can install Linux and Windows on the same machine to create what is called a dual-boot system. There are some details to watch, though. Red Hat 9 has been discontinued so, to play with Linux and and learn, I would get Fedora Core 1 (Red Hat-sponsored) instead. You can download it from fedora.redhat.com.


Felipe Barousse Boué


fbarousse@piensa.com

The easiest way to try Linux is download Knoppix from knoppix.org. This allows you to try Linux and not impact your hard drive. Most distributions can be downloaded for free, including Red Hat 9. You may want to search for a more up-to-date distribution such as Fedora Core 2.


Christopher Wingert


cwingert@qualcomm.com

I haven't personally tried setting up a boot manager with Windows 2003 server and don't intend to, but I have heard of several people doing so successfully. The procedure seems the same as with earlier versions of Windows. Here are the main things you need to be aware of:

1) Knoppix includes QtParted, a free software partition editor. The interface is not as polished, but QtParted does just as good a job of partition editing as PowerQuest's PartitionMagic and other proprietary programs, and you might as well get in the spirit by doing the job with free software. Knoppix, incidentally, makes a great rescue disk.

2) You'll want at least one partition for Linux and another of 125MB for a swap partition. Opinions vary about how to partition, with some people favoring putting the /home, /var and other directories on separate partitions. However, because you're just starting out, perhaps you want to use only one.

3) You might also want a FAT32 partition so that you can share files between your operating systems.

4) If Windows isn't already installed, install it first, right after you partition the drive. Windows does not tolerate another operating system during installation. You can work around the problems, but it's easier just to avoid them altogether.

5) When you're installing, make sure you install the GRUB boot manager. The installation automatically detects the presence of Windows, and the boot manager loads when the machine starts and offers you a menu for choosing which operating system you want to start.


Bruce Byfield


bbyfield@axionet.com

You don't need to resize your existing partitions with a partition editor if you're installing from scratch. All Linux distributions include a basic partitioning tool. If you do use a partition editor, keep in mind that if it fails you may lose important data. Make sure to back up your existing system first, and check that the backup is good before resizing any partition. Alternatively, as Rick Moen suggests, once you have a backup, you might as well just restore it to new partitions and save yourself the partition resizing step entirely.

But, your 6GB drive is too small to run two current operating systems comfortably. You might want to add a new, larger drive for Linux.

More advice for new users, including why dual boot is usually a bad idea, is in “Welcome to Linux, 2004” on the Linux Journal Web site (www.linuxjournal.com/article/7516).


Don Marti


info@linuxjournal.com

LJ Archive