verbalshadow
May 27th, 2005, 03:48 PM
HOWTO: Install InitNG for Ubuntu Hoary
Updated 26 Jun 05
WHAT IS INITNG:
From the readme
"Initng is a full replacement of the old and in many ways deprecated sysvinit
tool. It is designed with speed in mind, doing as much as possible
asynchronously. In other words: It will boot your unix-system much faster, and
give you more control and statistics over your system.
The basic premise is that startup commands can be launched as soon as their
dependencies are met. This limits the effect of bottlenecks like I/O operations;
while one program is performing I/O, another can be utilizing the processor.
Initng tracks the individual service dependencies in its configuration files.
It is designed to use a minimum of system resources and to boot your system
quickly and safely."
What does that mean? Its the difference of giving birth to babies for humans and dogs.
Humans normal can have one baby at a time. Dog are capable of having many pups at one time.
So, getting a big family is easier for the dogs. Same is true for the Init process as well. Sysvinit does things one at a time. InitNG does as many as possible (and in the correct order) at once . This means a faster boot time for you and me.
INTRO:
There is a debian package out for InitNG you can get it http://triggerit.tr.funpic.de/debian/initng/. It is well done and installs with minimal problems but, I don't recommend it for use with Hoary for two reasons. When you use dpkg to install it you have to use --force-depends as it requires libc6 >= 2.3.2.ds1-21 , Hoary has 2.3.2.ds1.20ubuntu13. I have seen No Problems with running or compiling it against Ubuntu's version. The second reason is that SVN version has many fixes that make running it on Ubuntu better. If you do end up using the deb skip down to the Grub section.
PRE-INSTALL:
So we are going to build it from the Subversion Repository. Before for we do that make sure you apt-get or use Synaptic to install build-essianltals, svn and auto-make. Also if you have already install from a deb now is the time to remove it completely. You may want to print this out cause we will be rebooting during this HOWTO.
COMPILING AND INSTALL:
First we will get the source code from svn.
$ svn checkout http://jw.dyndns.org/initng/svn/initng
Once that is complete, we are going to compile it.
$ make
If there right any errors stop here. IF NOT SKIP THE NEXT COMMAND. Wait about 10-15mins then in the initng directory update the svn with the command below to update the src code. Remember svn is a moving target and the devs are actively updating the code and scripts.
$ svn up
Repeat the make command
$ make
If all went well with make than we can install now.
$ sudo make install
We are not done yet. We still have to setup Grub so we can boot to it.
SETTING UP GRUB:
We are going to edit the /boot/grub/menu.lst
$ sudo gedit /boot/grub/menu.lst
Scroll down to the bottom of the page. You should see something similiar to this.
Don't Panic if they it not totally the same. You maybe using a different kernel archieture then me.
title Ubuntu, kernel 2.6.10-5-k7
root (hd0,0)
kernel /boot/vmlinuz-2.6.10-5-k7 root=/dev/hda1 ro quiet splash
initrd /boot/initrd.img-2.6.10-5-k7
savedefault
boot
title Ubuntu, kernel 2.6.10-5-k7 (recovery mode)
root (hd0,0)
kernel /boot/vmlinuz-2.6.10-5-k7 root=/dev/hda1 ro single
initrd /boot/initrd.img-2.6.10-5-k7
savedefault
boot
title Ubuntu, kernel memtest86+
root (hd0,0)
kernel /boot/memtest86+.bin
savedefault
boot
We are going to copy and paste the top one right under itself. Now we are going to make InitNG are init of choice by adding this init=/sbin/initng to the end of the kernel line. Secondly we are going to change the title so we know what we are booting too Ubuntu InitNG is good. Your new entry should look similiar to below.
title Ubuntu InitNG
root (hd0,0)
kernel /boot/vmlinuz-2.6.10-5-k7 root=/dev/hda1 ro quiet splash init=/sbin/initng
initrd /boot/initrd.img-2.6.10-5-k7
savedefault
boot
Double check it. Looks good. Save it.
Be aware that installing new/updated kernels in Ubuntu will overwrite this file.
REBOOT. Right after you reboot grub will prompt you to enter the the grub menu if you are on a single OS system hit ESC before the countdown finishs. If you have dual-booting system then the menu will normal pop up by default unless you have changed this behavior.
Select are newly made entry. "Ubuntu InitNG"
Your system should boot( quickly i might add) and give you a the gdm login.If you don't get a login prompt it means that something failed to load and other boot process are waiting on it. Switch to tty2 by using ctrl-alt-f2.
Login.
Next we are going to check and make sure everything loaded alright.
Switch to tty2 or open a terminal
$ sudo ngc -s
This shows us the list of services/daemons with there current status. I'm on a laptop and the screen with out framebuffering is small so i output the the list to a text file.
$ sudo ngc -s > ngc.lst
This is also good for troubleshooting what services are not running.
MAKING IT UBUNTU:
Add things that make Ubuntu what you expect.
$ sudo ng-update add hald acpid cupsd default
$ sudo ngc -x
This add HAL, cups and Acpi to InitNG default runlevel. That should get you logged in the gnome with no errors displayed. There maybe some functionality missing that I havn't tried yet. If so let me know here or the InitNG forums.
ADD AND REMOVING SCRIPTS:
Add services to boot
$ sudo ng-update add *
Delete services from boot
$ sudo ng-update del *
where * is the name of the script or daemon
ok replace net/eth0 daemon/agetty with what ever you want to remove
SMALL THINGS THAT MAY NEED FIXING:
If you use a static IP address, the net/eth0 script doesn't set up eth0 correctly. I have been told a partial solution.
You need to edit /etc/initng/net/net.i
$ sudo gedit /etc/initng/net/net.i
make the changes seen below in the start and stop portions.
service net/* {
# */
depend = system/mountfs system/modules system/hostname
use = system/static-modules system/coldplug
start {
ifup ${NAME}
}
stop {
ifdown ${NAME}
}
}
ok this didn't not allow allow the eth0 to be config on boot but after boot(and log into gdm) i was able to now configure it using the networking dialog is the system->admin menu
I have seen the dev/mapper/control error with the recent svn version i'm not sure the cause of it yet.
If you have a Nvidia graphics card you may have to use the drivers from nvidia to get to GDM login. see the initng.txt in the src code folder.
HATE UGLY TEXT BOOT:
i do have a partially work splashy init script to hide the uglies it does not update the progress bar but it does show the bootscreen.
save this to /etc/initng/daemon/splashy.i
service daemon/splashy {
need = system/initial
daemon = /sbin/splashy
pid_file = /var/run/splashy.pid
start {
start-stop-daemon --start --quiet --pidfile /var/run/splashy.pid \
--exec /sbin/splashy -- boot 2> /dev/null
}
stop {
start-stop-daemon --start --quiet --exec /sbin/splashy -- shutdown 2> /dev/null
}
then add splashy to the service by
$ sudo ng-update add splashy default
WHERE TO GET HELP IF THINGS GO WRONG WITH INITNG:
The best place is the InitNG forums in the support section at http://forum.initng.thinktux.net/
Updated 26 Jun 05
WHAT IS INITNG:
From the readme
"Initng is a full replacement of the old and in many ways deprecated sysvinit
tool. It is designed with speed in mind, doing as much as possible
asynchronously. In other words: It will boot your unix-system much faster, and
give you more control and statistics over your system.
The basic premise is that startup commands can be launched as soon as their
dependencies are met. This limits the effect of bottlenecks like I/O operations;
while one program is performing I/O, another can be utilizing the processor.
Initng tracks the individual service dependencies in its configuration files.
It is designed to use a minimum of system resources and to boot your system
quickly and safely."
What does that mean? Its the difference of giving birth to babies for humans and dogs.
Humans normal can have one baby at a time. Dog are capable of having many pups at one time.
So, getting a big family is easier for the dogs. Same is true for the Init process as well. Sysvinit does things one at a time. InitNG does as many as possible (and in the correct order) at once . This means a faster boot time for you and me.
INTRO:
There is a debian package out for InitNG you can get it http://triggerit.tr.funpic.de/debian/initng/. It is well done and installs with minimal problems but, I don't recommend it for use with Hoary for two reasons. When you use dpkg to install it you have to use --force-depends as it requires libc6 >= 2.3.2.ds1-21 , Hoary has 2.3.2.ds1.20ubuntu13. I have seen No Problems with running or compiling it against Ubuntu's version. The second reason is that SVN version has many fixes that make running it on Ubuntu better. If you do end up using the deb skip down to the Grub section.
PRE-INSTALL:
So we are going to build it from the Subversion Repository. Before for we do that make sure you apt-get or use Synaptic to install build-essianltals, svn and auto-make. Also if you have already install from a deb now is the time to remove it completely. You may want to print this out cause we will be rebooting during this HOWTO.
COMPILING AND INSTALL:
First we will get the source code from svn.
$ svn checkout http://jw.dyndns.org/initng/svn/initng
Once that is complete, we are going to compile it.
$ make
If there right any errors stop here. IF NOT SKIP THE NEXT COMMAND. Wait about 10-15mins then in the initng directory update the svn with the command below to update the src code. Remember svn is a moving target and the devs are actively updating the code and scripts.
$ svn up
Repeat the make command
$ make
If all went well with make than we can install now.
$ sudo make install
We are not done yet. We still have to setup Grub so we can boot to it.
SETTING UP GRUB:
We are going to edit the /boot/grub/menu.lst
$ sudo gedit /boot/grub/menu.lst
Scroll down to the bottom of the page. You should see something similiar to this.
Don't Panic if they it not totally the same. You maybe using a different kernel archieture then me.
title Ubuntu, kernel 2.6.10-5-k7
root (hd0,0)
kernel /boot/vmlinuz-2.6.10-5-k7 root=/dev/hda1 ro quiet splash
initrd /boot/initrd.img-2.6.10-5-k7
savedefault
boot
title Ubuntu, kernel 2.6.10-5-k7 (recovery mode)
root (hd0,0)
kernel /boot/vmlinuz-2.6.10-5-k7 root=/dev/hda1 ro single
initrd /boot/initrd.img-2.6.10-5-k7
savedefault
boot
title Ubuntu, kernel memtest86+
root (hd0,0)
kernel /boot/memtest86+.bin
savedefault
boot
We are going to copy and paste the top one right under itself. Now we are going to make InitNG are init of choice by adding this init=/sbin/initng to the end of the kernel line. Secondly we are going to change the title so we know what we are booting too Ubuntu InitNG is good. Your new entry should look similiar to below.
title Ubuntu InitNG
root (hd0,0)
kernel /boot/vmlinuz-2.6.10-5-k7 root=/dev/hda1 ro quiet splash init=/sbin/initng
initrd /boot/initrd.img-2.6.10-5-k7
savedefault
boot
Double check it. Looks good. Save it.
Be aware that installing new/updated kernels in Ubuntu will overwrite this file.
REBOOT. Right after you reboot grub will prompt you to enter the the grub menu if you are on a single OS system hit ESC before the countdown finishs. If you have dual-booting system then the menu will normal pop up by default unless you have changed this behavior.
Select are newly made entry. "Ubuntu InitNG"
Your system should boot( quickly i might add) and give you a the gdm login.If you don't get a login prompt it means that something failed to load and other boot process are waiting on it. Switch to tty2 by using ctrl-alt-f2.
Login.
Next we are going to check and make sure everything loaded alright.
Switch to tty2 or open a terminal
$ sudo ngc -s
This shows us the list of services/daemons with there current status. I'm on a laptop and the screen with out framebuffering is small so i output the the list to a text file.
$ sudo ngc -s > ngc.lst
This is also good for troubleshooting what services are not running.
MAKING IT UBUNTU:
Add things that make Ubuntu what you expect.
$ sudo ng-update add hald acpid cupsd default
$ sudo ngc -x
This add HAL, cups and Acpi to InitNG default runlevel. That should get you logged in the gnome with no errors displayed. There maybe some functionality missing that I havn't tried yet. If so let me know here or the InitNG forums.
ADD AND REMOVING SCRIPTS:
Add services to boot
$ sudo ng-update add *
Delete services from boot
$ sudo ng-update del *
where * is the name of the script or daemon
ok replace net/eth0 daemon/agetty with what ever you want to remove
SMALL THINGS THAT MAY NEED FIXING:
If you use a static IP address, the net/eth0 script doesn't set up eth0 correctly. I have been told a partial solution.
You need to edit /etc/initng/net/net.i
$ sudo gedit /etc/initng/net/net.i
make the changes seen below in the start and stop portions.
service net/* {
# */
depend = system/mountfs system/modules system/hostname
use = system/static-modules system/coldplug
start {
ifup ${NAME}
}
stop {
ifdown ${NAME}
}
}
ok this didn't not allow allow the eth0 to be config on boot but after boot(and log into gdm) i was able to now configure it using the networking dialog is the system->admin menu
I have seen the dev/mapper/control error with the recent svn version i'm not sure the cause of it yet.
If you have a Nvidia graphics card you may have to use the drivers from nvidia to get to GDM login. see the initng.txt in the src code folder.
HATE UGLY TEXT BOOT:
i do have a partially work splashy init script to hide the uglies it does not update the progress bar but it does show the bootscreen.
save this to /etc/initng/daemon/splashy.i
service daemon/splashy {
need = system/initial
daemon = /sbin/splashy
pid_file = /var/run/splashy.pid
start {
start-stop-daemon --start --quiet --pidfile /var/run/splashy.pid \
--exec /sbin/splashy -- boot 2> /dev/null
}
stop {
start-stop-daemon --start --quiet --exec /sbin/splashy -- shutdown 2> /dev/null
}
then add splashy to the service by
$ sudo ng-update add splashy default
WHERE TO GET HELP IF THINGS GO WRONG WITH INITNG:
The best place is the InitNG forums in the support section at http://forum.initng.thinktux.net/