Archive for March, 2004

What is Unix

Saturday, March 27th, 2004

Unix is a multiuser, multitasking operating system. It is the glue that holds together the various parts of a computer: memory, processor, disks, etc. Unix by itself is not a single operating system but a term that includes dozens of different implementations commonly referred to as Unix flavors.

Unix was designed to provide simple and flexible, yet powerful tools to perform a wide variety of tasks.

Basically a Unix operating system is made up by three pieces:

  • The kernel is the core (the heart) of the system that sits in memory and controls computer resources.
  • The shell that interacts with the user and the kernel. Interprets and executes commands.
  • The applications that run on top of the shell.

Unable to boot a Solaris box

Saturday, March 27th, 2004

A few days ago one of my Solaris box’s filesystem got full of space so I was unable to get the system working properly and I was unable to boot it. This tip will show you how I got rid of this issue.

First of all insert the Solaris installation CD-ROM and boot your machine. Then press STOP-a and type the following in the prompt:

boot cdrom -s

After a few minutes you’ll get a prompt where you could start your job. In my case I did the following to free some space:

mount /dev/c0t0d0s0 /mount_point
find /mount_point -size +1000000 | sort -nr | more

Once you’ve done…

reboot

Note that this tip is also valid in other circumstances where you are unable to boot your system.

Monitoring Apache activity

Wednesday, March 24th, 2004

The Apache mod_status module provides useful information to find out the activity and performance of the HTTP daemon.

To watch the activity of your Apache webserver edit httpd.conf or apache2.conf or whatever is named in your environment and add the following:

(more…)

Gentoo and rc.local

Wednesday, March 17th, 2004

Most GNU/LInux distros have an initialization script called rc.local. This script will be executed after all other init scripts, I mean, it will be run by the system at the end of the boot process . This will allow you to add certain programs so they can be executed at boot time after all system services are started.

Gentoo Linux does not provide such a file. Instead we have an equivalent script called /etc/conf.d/local.start where you can put all your initialization stuff. Even more, Gentoo provides an /etc/conf.d/local.stop where you can place… guess what?

Interrupting the boot sequence

Tuesday, March 16th, 2004

This trick is useful if you have problems booting your SPARC machine.

To interrupt the boot sequence, use the key combination Stop-A or L1-A on a Sun keyboard. If your system uses a serial console (i.e. minicom) send a BREAK. For example in minicom use CTRL-A F.

Disabling automounter for /home directory

Sunday, March 14th, 2004

By default SunOS 5.x comes with the automounter enabled. This implies that some filesystems such as /home will no longer be treated as normal directories. Despite this facilitates the administration of your system, in some situations you’ll want to avoid this behaviour.

To avoid the automounter to serve the /home directory as if it was an NFS resource and thus allowing you to mount the directory according to your needs, proceed as follows:

Edit /etc/auto_master and comment the line starting by /home. Then make sure to restart automount so it will reload its maps:

automount

equery, the package query tool

Wednesday, March 10th, 2004

The portage package suit tools provide a query tool that allows you to grab some information from your installed packages. Let’s see some usages of the equery utility.

For example to see all the files owned by a given package type:

equery files snort

Another example: show me the package that owns the top command.

equery belongs `which top`

Now tell me the USE flags for MySQL.

equery uses mysql

Show me the dependency tree for php.

equery depgraph php

For more information simply type…

equery -h

The nohup command

Saturday, March 6th, 2004

Or how to execute a Unix command that is immune to hangups. Sometimes when you are working on your Unix machine, you’ll want to run commands that can survive to logouts or unexpected session terminations. Most Unix flavors provide the nohup command to handle these situations.

When your unix session unexpectedly terminates or you logout, all the processes will be killed. However, if you start a command with nohup (no hangup), it will ignore a HANGUP signal.

Simply type:

nohup COMMAND &

Now logout and login again and you will see that COMMAND is still running.

ps -ef | grep -i COMMAND

Note that if you do not redirect the standard error or standard output, the system will create a file named nohup.out in the current directory or in the $HOME directory. To avoid this behaviour you could start COMMAND as follows:

nohup COMMAND > /var/log/cron.log 2>&1

NetBSD release 1.6.2 announced

Tuesday, March 2nd, 2004

The NetBSD team has announced the availability of NetBSD 1.6.2.

From NetBSD site

NetBSD 1.6.2 is a maintenance release for users of NetBSD 1.6.1 and earlier releases, and it provides the following updates relative to 1.6.1:

* A number of security issues have been fixed.
* Some performance fixes have been incorporated.
* Improved device support in some existing drivers.
* Some new device drivers have been added.
* Some minor userland fixes have been applied.
* The stability of the sparc64 port has been greatly enhanced.

More information here.

Gentoo Linux 2004.0 Released

Monday, March 1st, 2004

Gentoo Linux is proud to announce the release of Gentoo Linux 2004.0 for the x86, AMD64, PowerPC, Sun SPARC, and SGI MIPS architectures. more details can be found from the official site, slashdot.