Change network interfaces in linux with tg3 from eth0 to eth1

December 15th, 2009

Thought I would share this, because there are many of us the need to use specific interface to support specific network traffic. One of the difficulties you have probably encountered is the network device drivers. However, just think about what is going on and you will derive a solution.

Now, when the system boots there is a hardware discovery, coldplug and hotplug processes. After that initiation the drivers start to load. The problem is the order the drivers load and not the driver itself. So, the result is that you might want a PCI NIC card to become eth2 and the on-board to become eth0 and eth1.

I was working with Novell’s SLES 9 SP4 on an IBM x336. After the system booted, I would perform an “ifconfig” command and find the devices not in the order I required, with the PCI network interface always being eth0. I added “ifdown – nameif – ifup” commands to the network init script to no avail. It was like the rc script was not being read. The problem turned out to be with the tg3 (Tiggon) driver.

The solution I came up with was very simple and you might laugh after reading this post.

  1. I kept my “ifdown – nameif – ifup” scipts intact within the rcnetwok script. You will need to down the interfaces, rename them and bring them back up again.
  2. Within the /etc/sysconfig/hardware/<device file>, I set the STARTMODE to manual.
  3. At the start of the /etc/init.d/network script, just after the required start section, I added: /sbin/hwup /etc/sysconfig/hardware/<device file>

What this does it tell the system not to bring the device up. When the network init script runs, it brings the device up. This means there will be not “holds” on the device to your “ifdown – nameif – ifup” section of the network start script will run. You can do this for any device you do not want to come up until the network init script runs.

Hope that helps. Please patronize my sponsors who make this possible. Leave a comment to let everyone know how you solved this problem and if this solution worked for you.

Enjoy!

CUPS: Setting printer quotas and file system considerations

December 10th, 2009

The Common Unix Print Server (CUPS) has become the standard in Linux. Line Print (LP), although frequently used in Sun shops, is lightweight and easy to use, but lacks support and development. LP provides great command line options; however, with the advent of a graphical user interface (GUI) World, the command line has been superseded by the “click”. CUPS provides the “click” consideration, but Administrators need to address printer quotas and file system considerations.

File system considerations? Just install cups and you are done. Right? Not necessarily, because you need to consider a couple of very important aspects of a print server spool directory, input/output (IO) and number of files. I/O is a concern due to the spool directory being a pass-through directory. The number of files is a concern, because the spool directory could be expected to manage tens-of-thousands of files if you are printing labels. Here are a few recommendations to think about:

  • What is the fastest disks we have for the spool directory?
  • Are there other applications running on the server?
  • Create “/var/spool” on a separate partition?
  • What file system format will provide the least overhead and handle the number of files we will be sending to the print server spool directory?
  • Did you create an exclusion directive in netbackup for the spool directory? I would not back up the spool directory, because it should be empty (unless there is a problem) and the competition for I/O on the file system may result in printer slowness.
  • Did we create a cronjob to monitor the file system and alert someone when the number of files is building? Monitoring and notification are excellent methods to know when CUPS, network and or a printer is experiencing problems and for “tweaking” configurations.

Configurations are a concern when dealing with the health of CUPS. CUPS has default quotas in the cupsd.conf file. Adjustments are required for enterprise deployment. I would recommend the following adjustments:

  1. PreserveJobHistory Yes TO PreserveJobHistory No . This might seem like a great option to keep on or use the default “Yes”, but this can cause problems with another setting. If a job has gone to the printer and printed, why save the job? This will not effect the jobs in the queue if a printer goes down or is unreachable.
  2. MaxJobs 500 TO MaxJobs <what ever number you will have at one time in the spool directory>. You need to set this up to the max number of jobs from all printers at one time and give yourself a buffer. If the CUPS spool directory hits this number, CUPS will stop working on print jobs. You will need to stop cups, delete the old files in the spool directory and restart cups. If you keep the default PreserveJobHistory setting, CUPS will include old jobs in the MaxJobs count.
    Why not set it to 0 (unlimited)? If you do not perform routine maintenance on the spool directory, it will fill if there is a printer issue. If you did not place “/var/spool” on a separate directory as recommended, you will need to use a recover CD to mount “/” and clean up the spool directory in order for your system to restart.
  3. MaxJobsPerPrinter 0 TO MaxJobsPerPrinter <your value>. This is a tricky setting if you are printing labels. If the label printer goes down and jobs are still being sent to the label printer you could fill the spool directory if the setting left at unlimited. Not to mention you will hit your MaxJobs setting and have to clean-up CUPS.

After reading this article, you should have a good understanding of what is required to ensure a healthy CUPS environment in regard to file system and printer quota consideratios. Please leave comments about how you resolved problems with your CUPS environment. As always, please patronize the sponsors of this page. They make this possible.