Saturday, October 31, 2009

How to Kill Defunct Process in Unix

Tech Blog - A "defunct" process or a zombie process is a process that is actually finished which depends on a parent process, which for some reason usually due to error did not terminate.

You can usually see defunct process using the ps -ef command, this process mostly are harmless and can be left alone, however they are annoying in my opinion so I often want them removed, the catch is you can't kill an already dead process, good thing Unix has a utility that will help us removed it.

preap forces the parent of the process specified by pid to waitidfor pid, if pid represents a defunct process.

preap attempts to prevent the administrator from unwisely reaping a child process which might soon be reaped by the parent, if:

The process is a child of init.
The parent process is stopped and might wait on the child when it is again allowed to run.
The process has been defunct for less than one minute.

Using preap

$ preap pid


Below are some howto on troubleshooting

Olympus WS-300M MP3 Player

Tech Blog - Olympus is one of the famous companies manufacturing imaging and audio products, medical, scientific and industrial solutions. Olympus WS-300M MP3 Player is the latest model introduced into the world of music.

Olympus WS-300M MP3 Player is a flash based player with WMA audio formats. The interfaces that come in this model MP3 player are USB direct and 2.0 full speed. The output sound mode is in stereo format. The headphones that come with this model MP3 Player is binaural. It comes with LCD display. The accessory that comes with this model MP3 player is neck strap. The connectivity is wired and it comes with voice recorder feature. The response bandwidth is 100 to 15000Hz. It is designed with built-in microphone that has stereo sound output. It has voice recording feature with recording time up to 68 hours. It features built-in clock, head phone jack and long play back mode. The head phone output power per channel is 5mW. The enclosure is silver in colour. Olympus WS-300M Portable MP3 Player is introduced into the market with 1 year warranty.

Technical features:

The memory capacity of this model player is 256MB. You can store huge data containing music, images and dictation. Rock, Jazz, Pop and Flat are the equalizers in this model MP3 Player. It is designed to have AAA or Ni-MH battery. The battery life of alkaline battery is 13 hours and that of Ni-MH battery is 12 hours. Olympus WS-300M Flash MP3 Player comes with one built-in speaker of 100mW power.

You can compare MP3 Player prices and read reviews on Sony MP3 Players, Creative, Philips, Goodmans, Hitachi and Archos MP3 Players at MP3 Player Reviews site.

Thursday, October 15, 2009

E-mail Attachment | Ubuntu Command Line | Howto

Tech Blog - Here is a very usefull command on sending files as attachement on Linux/Unix command line, this is specifically very usefull when using it in script to send daily report, or just for mailing client certificate directly from the server, there are two ways I know that you can use to send a file as attchemnt using command line, one is using uuencode utility with the "mail" command and the other one using "mutt", I find using mutt command to be much more reliable compared to using uuencodeutility with mail command.

uuencode utility writes an encoded version of the named input file, or standard input if no file is specified, to standard output. The output is encoded using the algorithm described in the STDOUT section and includes the file access permission bits of the input file and the decode_pathname, for re-creation of the file on another system that conforms to this specification.

If you don't have uuencode command on your system, and your running Cent OS or Redhat distribution you can find the uuencode and uudecode on the “sharutils" package.

To send a file attachment using "mail" command
$ uuencode filename.jpg filename.jpg | mail -s 'subject' recipient@email.com

To send a file attachemnt using "mutt" command
$ echo | mutt -a filename.jpg -s 'subject' recipient@email.com

Mutt is a small but very powerful text based program forreading electronic mail under unix operating systems,including support color terminals, MIME, and a threadedsorting mode.


Thats it!

Check out other pages:

Wednesday, October 07, 2009

How to Monitor RAID Devices on Linux

Tech Blog - Here is a simple howto on using mdadm to alert you of failing array Linux Software RAID. this is important becasue failed or failing devices needs to be replaces as diffrent RAID level have different capabilities when it comes to dealing with disk failure.

Lets us try to send a test e-mail to make sure that mail is working on your server
$ mdadm --monitor --scan --mail= YourEmailAddress /dev/md0 -t -1

If your mail is working you will receive a test message from your server

Now we set up the monitoring, to check the RAID array every 15 minutes using cron do "crontab -e" to edit cron
*/15 * * * * /sbin/mdadm --monitor --scan --mail= YourEmailAddressHere /dev/md0 -1

Note: /dev/md0 is the RAID array you want to monitor

Check out commands and howto on creating Linux Software RAID

Saturday, October 03, 2009

VSC Manually Editing Configuration File | Howto

Tech Blog - Here is a quick guide in manually editing Varitas Cluster configuration file main.cf, Veritas Cluster is a High-availability cluster software, it provides application cluster capabilities to systems running databases and applications.


Veritas HA config file can be found in /etc/VRTSvcs/conf/config

Steps in editing the main.cf

First we stop all the cluster with the hastop command
$ hastop -all

Then we create a backup copy of the current configuration file
$ cp main.cf main.cf.backup

We use a text editor to edit the configuration file in this cae we use vi
$ vi main.cf

We verify the configuration file using hacf to make sure that there are no syntax error, hacf - manages VCS configuration files
$ hacf -verify /etc/VRTSvcs/conf/config/

Then we use hacf -generate to generate dependency tree in main.cf
$ hacf -generate /etc/VRTSvcs/conf/config/

Start up the cluster then were done, configuration changes has been applied.
$ hastart

Hope this helps.


Check out other pages:
For suggestion and concerns E-mail