Configuring a customised Knoppix as an automatic client for distributed.net and uptime-project.net
by Mathieu Rouvinez <mathieu.rouvinez[at]gmx[dot]net>
Here is a description of how I managed to turn Knoppix into a fully automatized operating system on a PC without any hard drive (for noise disturbances reasons).
What are we going to talk about ?
1.The genesis, concept and objectives to reach
The genesis, concept and objectives to reach
2.The customisation steps
2.1. Configure the environnement
2.2. Install your own components (dnetc and yasuc)
2.3. Set up the crontab and scripts to be launched at startup
2.4. Make the configuration file
2.5. Enhance you knoppix image file
3.The result - conclusion
Once upon a time a friend told me « Would you like to join our league on uptime-project.net ? Do you have a spare PC for that ? » Sure I have one, but my parents will not really like a PC running 24/7... The only way for such a project to become real is to make this spare PC 'invisible', i.e. without any visual or audible emissions...
The customisation steps
And this is the very starting point of the oddysey !
Objective of the mission: eliminate every source of disturbances: no PC case front LEDs, make all fans run with an input voltage reduced to 5 volt instead of 12, and... no alternative, I had to remove the hard drive which made a big unpleasant noise. This meant I had to run a live Linux distribution on CD like the well-known Knoppix.
At this point I thought about the abilities to give to the system. It would have to be able to:
- boot and automatically load my own configuration and settings, all from CD
- start dnetc (the distributed.net client)
- periodically run yasuc (the uptime-project.net client) with crontab to send the uptime of the computer
Before beginning any explanations about the steps to follow to get a working customised Knoppix system, you first have to know that only the modified or added contents of the /etc and /home directories will be saved in the configuration file which is actually called config.tbz (bzipped tar archive) that we are going to add to the root of the knoppix .iso file.
Configure the environnement
When you first boot Knoppix, you may want to change some basic default settings like the keyboard layout, the wallpaper, the decoration of windows, and so on to make the environnement more suitable for you. Do it now.
Install your own components (dnetc and yasuc)
: the default user environnement
: my windows-like user-friendly environnement
The only suitable path available to store your additional files and be sure they will be saved in the configuration archive is /home/knoppix/Desktop. This means all your own programs will be found in here. Please note that all binaries or configuration files put in /bin or /usr will not be saved in config.tbz.
Set up the crontab and scripts to be launched at startup
I personnaly decided to keep things organised in a single folder on the desktop containing dnetc, yasuc, the wallpaper and the crontab profile.
: contents of my folder on desktop
Because we want dnetc to start automaticaly at the end of the boot, we will put a script in /home/knoppix/.kde/Autostart.
Make the configuration file
Here is the content of my script /home/knoppix/.kde/Autostart/dnetc.sh:
: detailed content and location of configuration files
Things are slightly different for yasuc because we want it to run periodically instead of running only once like dnetc. So we need to use crontab and we have to face two difficulties at this point : in the first place the cron module is not started during the boot process of knoppix, and in the second place you cannot use /etc/crontab to schedule tasks.
It's easy to start the cron module with KDE, again we create a script that we place in /home/knoppix/.kde/Autostart.
Here is the content of my /home/knoppix/.kde/Autostart/cron_start.sh:
Now that the cron service is started we can schedule the periodical execution of yasuc. As said previously, we cannot use the regular crontab file /etc/crontab (for an unknown reason). Instead we simply copy a simple crontab file renamed to the session name 'knoppix' in /var/spool/cron/crontabs.
Here is the content of my /home/knoppix/Desktop/knoppix:
And now we simply need to add 2 lines to the previous script cron_start.sh to copy /home/knoppix/Desktop/knoppix to /var/spool/cron/crontabs, the final result would be:
We just changed the permissions (chmod) of the copied knoppix file to make things cleaner and to make sure it will be executed.
At this point we suppose that you set up everything necessary on your knoppix and you checked eveything was working.
Enhance you knoppix image file
Go to the KDE Launch Bar, and click
KDE Vitruvian Knoppix --> Configure --> Save KNOPPIX Configuration
All files on the desktop and then select a peripheral to store your configuration files config.tbz and knoppix.sh on. I used a USB pen drive to store these configuration files. You will see a progress bar and finally a message box will tell you you can load your configuration at startup using the boot command
: step 1
: step 2
: step 3
You may have to reboot and modify your configuration many times as I had to do to finally obtain what you really wanted to have.
: boot splash and boot command prompt
Because it is not very convenient to systematically type
The result - conclusion
knoppix myconfig=scan at boot prompt and load the configuration file from a USB pen drive (in my example), we would like to put our configuration file directly on the knoppix boot CD.
This is the final step of the project where we copy our configuration files knoppix.sh and config.tbz to the root of the knoppix .iso file and modify the file /boot/isolinux/isolinux.cfg to enable the loading of configuration files from the root of the boot CD.
Here is the content of the original /boot/isolinux/isolinux.cfg :
myconfig=/mnt/cdrom to the 2nd line, we get:
Now save your Knoppix .iso with the following new files within:
I used UltraISO on Windows to modify the .iso.
Eventually burn it on a CD and enjoy.
During the boot process you will now see:
: boot process like it should now be
You now have a fully automatized system ready to run.
I wanted to create an automatic system because I wanted not to worry about the state of the system on the host computer: if it reboots for an unknown reason (e.g. power failure) it will at least reboot on its own and launch the clients again.
Thank you for reading.