Recently, I found that my dmesg log are filled of junk. Or I should say it contains lots of errors and complains that I already fix. However, I don’t want to reboot the machine to get rid of these error messages. How can I do it? The solution is very simple.

For FreeBSD and other BSD members, run the following:

sudo sysctl kern.msgbuf_clear=1

For Fedora / Ubuntu Linux, run the following instead:

sudo dmesg -c



Our sponsors:

Every time I upgrade the PHP and related extensions, I always run into the same problem with some PHP-PECL modules. Recently with the new release of PHP 5.3.7, there is no exception for the trouble. So what kind of trouble I have today? The Tokyo Tyrant (The middleman between my program and Tokyo Cabinet).

#php -v

PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/lib/php/20090626/' - /usr/local/lib/php/20090626/ Undefined symbol "ps_globals" in Unknown on line 0

This problem was caused by a version mis-match. PHP is running at a later version, which the Tokyo Tyrant extension is running at an earlier version. To solve this computer problem, all you need is to re-install the PHP-Tokyo-Tyrant extension, i.e.,

cd /usr/ports/databases/pecl-tokyo_tyrant
suod make deinstall clean
sudo make install

And later, you may or may not get the following error message:

cc -shared  .libs/tokyo_tyrant.o .libs/tokyo_tyrant_funcs.o .libs/connection.o .libs/session_funcs.o .libs/server_pool.o .libs/failover.o .libs/session.o  -Wl,--rpath -Wl,/usr/local/lib -Wl,--rpath -Wl,/usr/local/lib -L/usr/local/lib -ltokyotyrant -llua -ltokyocabinet /usr/local/lib/ -llzma -lbz2 -lz -lrt -lm  -Wl,-soname -Wl, -o ./.libs/
/usr/bin/ld: cannot find -llua
*** Error code 1

Stop in /usr/ports/databases/pecl-tokyo_tyrant/work/tokyo_tyrant-0.6.0.
*** Error code 1

Stop in /usr/ports/databases/pecl-tokyo_tyrant.

The problem is related to Lua. By default, the extension enable the Lua option, which I have a hard time to make it run properly on FreeBSD box. Since my website does not use the Lua with Tokyo Cabinet, I simply disable it:

sudo nano /usr/ports/databases/pecl-tokyo_tyrant/work/tokyo_tyrant-0.6.0/Make

Look for the keyword: lua
And you will find something like the following:

TOKYO_TYRANT_SHARED_LIBADD = -R/usr/local/lib -L/usr/local/lib -R/usr/local/lib -L/usr/local/lib -ltokyotyrant -llua -ltokyocabinet -lbz2 -lz -lrt -lm -ltokyocabinet -llzo2 -llzma -lbz2 -lz -lrt -lm

Delete the option: “-llua”, i.e.,

TOKYO_TYRANT_SHARED_LIBADD = -R/usr/local/lib -L/usr/local/lib -R/usr/local/lib -L/usr/local/lib -ltokyotyrant -ltokyocabinet -lbz2 -lz -lrt -lm -ltokyocabinet -llzo2 -llzma -lbz2 -lz -lrt -lm

and re-start the installation:

cd /usr/ports/databases/pecl-tokyo_tyrant
sudo make install clean

Now re-run the php, and you may see the following error:

#php -v

PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/lib/php/20090626/' - /usr/local/lib/php/20090626/ Undefined symbol "ps_globals" in Unknown on line 0
Segmentation fault: 11

That’s because the Tokyo Tyrant module is placed at a wrong position in the PHP extension file. Edit the file:

sudo nano /usr/local/etc/php/extensions.ini

and move the following code to the END of the file (Yes, order does matter):

And re-check your php:

#php -v

PHP 5.3.7 with Suhosin-Patch (cli) (built: Aug 23 2011 10:33:12)
Copyright (c) 1997-2011 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2011 Zend Technologies

Now everything is all set.

Unfortunately, you pretty much need to do the same thing every time when upgrading your PHP on FreeBSD box.


Our sponsors:

I noticed some beeping sound coming from my server today. After I opened the server case, I found that the problem came from my newly install HighPoint RocketRAID card. During the beep, the server could not operate normally. First, the system dumped some error messages, and followed by core dump, and the computer ended up rebooting by itself. After the system was restarted, during the first few seconds, the system was doing fine. After waiting for couple minutes, the error happened again. So I know that it was not some random error, and it was repeatable.

Here are my step-by-step guide on how to solve this problem:

Beeping doesn’t mean defective

After reading the manual, I found that beeping is part of the monitoring process. If the card detects any failure in the RAID system, it will start beeping. If you have any doubt, try to run the card on a different machine. That’s the best way to verify whether the card is defective or not.

Did you make any change to the system recently

Making a system stable is not easy, because you don’t know whether the hardware are conflicting with each other, or the newly installed module will cause the system unstable or not. For example, I found that the beeping happened after I enabled the Linux Emulation module in FreeBSD. After I turned that off, things are working fine.

Are the cables securely attached?

SATA harddrive pretty much is the standard today. It is fast and doesn’t take up lots of space. However, unlike the old IDE cable, it is very easy to get loosen. After I unplugged all the attached SATA cables from the RAID card, and put them back afterward, the problem seemed gone.

Flash the firmware

Although this is not likely, but the problem can sometimes caused by an out-dated firmware. (I have experience a similar thing on my motherboard before). Try to flash the card with the latest firmware.

If none of these methods work for you, sounds like your card is defective.


Our sponsors: