Search This Blog

Wednesday, June 20, 2012

Error inserting module : unknown symbol _udivdi3 undefined

This error occurs on 32 bit operating system. This won't come if you are using 64 bit operating system. If you wan't to avoid this error in 32 bit operating system then you will have to do following thing.

In your code wherever you are doing division by using "/" operator replace it by following
uint32_t do_div(uint64_t dividend, uint32_t divisor)


So a/b would be do_div(a/b).

RHEL Network card not detecting ( Troubleshooting network )

There might be many reasons for network not working as per our requirement. I am going to point out few things which I always do when there is some problem with network. And after working over all theses things for long time, I guess I will be covering most of the reasons for network not working as per our requirement.

Before you start, you can disable firewall using
#service iptables stop

1)You can use following command to configure your network adaptor
#system-config-network
After that you can give it IP address, netmask, broadcast address or allow it to take ip from dhcp server. Then you can save and quit and give following command.
#service network restart

2) #ifconfig
This is the command which you should use first to check if the network interfaces are as per your requirement. So this will confirm that network adaptor is enabled.

3)After this you can try connecting i.e. pinging some ip address in your network which is active. If ping does not work then mostly cable is not properly attached. You can use ethtool to figure that out.

#ethtool ethX
If cable is fine then it will show at the bottom "Link detected : yes"
Otherwise it will show "no" instead of "yes". In that case you can try fixing the cable properly.

4) If there is still problem you can check further information about network card and just cross check it with following command.
#ethtool -i ethX
This will show information about network card

5)You can also check whether network card driver has loaded properly by using following command.
#lsmod | grep


Friday, June 15, 2012

Installing Memcached with libevent and benchmarking it with memslap

Memcached is "Free & open source, high-performance, distributed memory object caching system, generic in nature, but intended for use in speeding up dynamic web applications by alleviating database load." Memcached is used by most of the companies today including Facebook, Craiglist, Flickr and Twitter. This is one of the thing which I worked on during my summer intern. I am just going to mention the steps for installing memcached and the problems which I faced doing it.

Installation:
1) Download libevent from  http://libevent.org/ . This is one of the dependency for installing memcached.

2) Extract it

3) Go inside extracted directory and type following things
#./configure --prefix=/usr/local
(If you don't put --prefix then chances are that later on while installing memcached it might give problems.)


# make && make install

4) Download source code of memcached from http://www.memcached.org/

5) Extract it

6) Go inside the extracted directory.
#./configure --libevent-with=/usr/local
# make && make install

7) You can check whether memcached is working by giving following command
# memcached -u nobody &
After that you can do 
# ps -el | grep memcached
to see if memcached is started.

8)Now its time to install memslap which is client for memcached. Its used for benchmarking purpose.

9) Download couchbase from http://www.couchbase.com/

10) Extract it and go inside libmemcached directory present in it.

11) Then build libmemcached.

# ./configure
# make

12) Now go inside clients directory present inside libmemcached and give following command
# ./memslap -s server_ip
to start benchmarking process. After some time (600s) you will get some output. You can vary parameters as per documentation of memslap.

Thursday, June 14, 2012

Installing g++ on rhel and the error " libtool: link: unsupported hardcode properties"

First let me just tell you how generally g++ is installed on RHEL and then the problem which I faced after installing that.

For RHEL,
# yum install gcc-c++

After I installed g++ on RHEL , then when I tried installing some tool/utility from its source code, I got following error "libtool: link: unsupported hardcode properties" while building the source code. This is what I did to solve this problem.

#make distclean
# ./configure
# make
# make install

And this solved my problem

No route to host error

This is one of the very common problem and at times it can be really irritating since it can be difficult to figure out the problem if you are not experienced user of linux and especially RHEL. Even after using RHEL for more than 2 years I got stuck over this problem for 4-5 hours trying to do everything possible and later realizing that problem was with firewall. Here are few steps which you can do.

1) First of all give ifconfig and check all interfaces and whether they are according to your requirement.
2) Give command #system-config-network and check network configuration
3) Check firewall rules. Disable it using
# service iptables stop

I guess in most of the cases problem must be with firewall. Remember newly installed RHEL does have firewall enabled by default. So that can cause problem if you are not experienced RHEL user.

Force user to logoff from remote or any terminal

So at times it may happen the a user logs in from remote terminal and forgets to log off. So in order to kill such a session of a remote user, following things can be done.
# who -u
This will give you the pid of the process user is using to log in.
Then you can kill that process using
#kill -9 pid

Tuesday, June 12, 2012

Registering RHEL 6

Initially when you install a new RHEL 6 on your pc and try using even basic utilities like gcc, it will show errors like no package named gcc installed. Even when you do yum install gcc it won't work and will throw errors like:

# sudo yum install gcc 
Updating Red Hat repositories.
Setting up Install Process
Error: Nothing to do
No package gcc available.

If you try
#sudo yum grouplist
Loaded plugins: product-id, subscription-manager Updating Red Hat repositories. No group data available Error: for configured repositories
If you try
#sudo yum repolist
Loaded plugins: product-id, subscription-manager
Updating Red Hat repositories.
repolist: 0

All these problems are mostly because your newly installed RHEL is not registered. You can confirm this by giving following command.
# yum repolist all

If the system is not registered it will give ouptut status as disabled. Now you can register your system with following command and then enter the required details.
# sudo rhn_register

After it has successfully registered, give following command.
#yum update