Syed Jahanzaib Personal Blog to Share Knowledge !

January 21, 2012

UBUNTU rc.local not executing problem and its workaround

Filed under: Linux Related — Tags: , , , — Syed Jahanzaib / Pinochio~:) @ 9:03 PM

Sometimes in ubuntu, rc.local does not execute , specially in fresh installation.
So if you encounter this issue , you can solve it by using two methods.
I have used these methods several time with success. Also make sure you command entries are above ‘exit 0‘ line
Also adding 10 seconds delay helps in few cases.

 

Method # 1 , By Using WEBMIN

Method # 2 , By Removing -e from /etc/rc.loacl file [and add 10 seconds delay]

 

Method # 1 , By Using WEBMIN

Install webmin from http://www.webmin.com/deb.html

After installati0n is done, open webmin and goto
SYSTEM > BOOTUP & SHUTDOWN
Scroll down and and Click on rc.local
Select YES on Start at boot time?

As shown in the image below.

Method # 2 , By Removing -e from /etc/rc.loacl file

Edit rc.local file by

nano /etc/rc.local

at first line remove -e  for example

Change from

#!/bin/sh -e

to

#!/bin/sh

Save & Exit, then Reboot and see, hopefully rc.local will execute on the boot.

Also adding following sleep 10 directive before any script in rc.local will help. e.g:

Example of rc.local

 

root@ahmad-desktop:~# cat /etc/rc.local
#!/bin/sh -e
# rc.local
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will “exit 0” on success or any other
# value on error.
# In order to enable or disable this script just change the execution
# bits.
# By default this script does nothing.

# Add 10 seconds delay …

sleep 10

#Followign command will run my script for internet sharing etc / zaib

/etc/fw.sh
exit 0

 

 

Regard’s
Syed Jahanzaib

Ubuntu Memory Limitation Solution


If you install Ubuntu 32bit , and you have more then 4 GB of  RAM, you won’t be able to use it, The easiest solution is to grab latest 64 bit version and install it (Only if your hardware supports 64bit architecture) otherwise you have to use PAE enabled kernel.

For example if you have 8GB of ram, and you issue the command,

free -m

you will see only 3-4 GB of  total ram. You need to install Physical Address Extension (PAE) aware kernel under 32 bit Ubuntu Linux. It is a feature of x86 and x86-64 processors that allows more than 4 Gigabytes of physical memory to be used in 32-bit systems.

HOWTO Install PAE enabled kernel in UBUNTU

Open terminal and type the following command

If you are using Ubuntu v9.10 (Karmic Koala) and above, enter:

apt-get install linux-generic-pae linux-headers-generic-pae

Once kernel images installed, just reboot your workstation, type:

reboot

After reboot, login into your system and type the following command to verify memory usage:

free -m

if you are using Ubuntu version Ubuntu v9.04 and earlier:

apt-get update
sudo apt-get install linux-headers-server linux-image-server linux-server

Now reboot and check memory by free -m

%d bloggers like this: