This howto describes how to set up and run the init replacement Upstart on Fedora.
The current init system has quite some disadvantages, therefore several distributions search for a way to extend or replace the current system. One well known replacement is initng which I already tested on Fedora. Another way to improve the system is Upstart which was introduced by Ubuntu. Since it is Open Source it can be used on Fedora as well.
You can find the newest version of this howto directly at the Upstart wiki. This post is more or less just a snapshot of the current state of the wiki howto.
Also: I used a stripped down version of Fedora 6: no X, no NFS services, no avahi, no SELinux, etc. I deactivated all that stuff to make the boot process faster – and believe me, I had to reboot quite some time till I had everything running.
And of course I used a Fedora installation inside of a virtual machine (Virtual Box in this case) because otherwise I would have gone insane.
And, last but not least: this howto can seriously damage your system! Don’t try this if you not exactly know what you’re doing.
Enough said, lets get down to business.
As you can imagine there are no rpms provided at the moment, so you have to compile everything by hand. Get the upstart archive and the example-jobs from the download section of the upstart wiki.
The configuration of the sources can be done in two ways: fully replacing all init files, or installing upstart to
/opt/ (see also these information). Of course we will take the second way since that is sufficient for testing. The configure line is:
./configure --prefix=/opt/upstart --sysconfdir=/etc --enable-compat=sysv
The installation afterwards is the usual
make && make install.
First of all the set of example jobs have to be extracted to
/etc/event.d/. These examples make sure that upstart can boot your Fedora exactly like the old init does – this is called compat mode.
However, the example jobs need some work since they are all written for Ubuntu. Everything which is a comment starts with a #.
The PATH variable have to be modified so that the new init system calls the right executables:
perl -pi -e 'undef $/; s/script\n/script\n export PATH=\/opt\/upstart\/sbin:\$PATH\n/' /etc/event.d/rc*
rc sysinit script
Fedora has a very important boot rc script which should be executed only once, directly after the start. Therefore, add it to the
export PATH=/opt/upstart/sbin:$PATH # This was added in the last step
exec /etc/rc.d/rc.sysinit # ADD THIS LINE
runlevel --set S >/dev/null || true
The tty* files contain the command
/sbin/getty. Fedora uses
/sbin/mingetty, change that for all tty* files:
perl -pi -e 's/getty 38400/mingetty/' tty*
The rc* files call the executable
/etc/init.d/rc– Fedora, however, has this at
/etc/rc.d/rc. Change that for all rc* files.
perl -pi -e 's/\/etc\/init.d\/rc/\/etc\/rc.d\/rc/' rc*
There is no runlevel rcS in Fedora – therefore, change
exec /etc/init.d/rcS must be changed to exec /etc/init.d/rc S
Also, the script
/etc/event.d/control-alt-deletehas to be modified like this:
export PATH=/opt/upstart/sbin:$PATH # ADD THIS LINE
exec shutdown -r now "Control-Alt-Delete pressed" # REMOVE /sbin/ FROM THIS LINE
Boot the system with Upstart
To boot with upstart you have to create a modified grub entry. Therefore, open
/boot/grub/grub.conf and create a copy of your current entry. Afterwards, change the ”init” parameter of the kernel line to:
If you want to enter the debug mode, you should also add
Benchmarking with bootstart
Of course you can also use bootchart with upstart to benchmark the init system. To do so you have to modify a normal kernel line in
grub.conf in this way:
The first parameter tells the kernel to start bootchart instead of the default init system, and the second parameter tells bootchart to start Upstat instead of the usual init system.
I haven’t done any bootchart testing (yet) because I only tested Upstart in a virtual machine. If I bring it up on my normal machine I will post some statistics about the performance.