john.janmaat@acadiau.ca wrote:
I don't have a particular problem with the boot concept. However, I do want to know when various things are loaded and by what scripts. I want to configure my system to backup some critical files to a network drive every time it starts up. (it is a laptop, so I want to save the stuff that I did while not connected.) RH had a script which it executed last, after modules were loaded, but before going to run level 5. boot.local is executed before ifconfig activates networking and dhcpcd gets my ip.
You can't have this happen before going to runlevel 5, as networking isn't started until runlevel 5. The best solution is to create a script and place it into /etc/init.d, then create the appropriate links in the /etc/init.d/rc?.d directories. You can look at other scripts in /etc/init.d and also the skeleton script in the same directory for clues onto how to write this script. A short bit of background on where to make the links follows. When the machine boots, it initialises the kernel and performs a small amount initialisation, before switching to the appropriate runlevel (in your case, runlevel 5). It then moves to the /etc/init.d/rc5.d (for runlevel 5 - rc3.d for runlevel 3, etc.) and executes the scripts linked to from files in rc5.d that begin with the letter 'S'. It executes these scripts from the lowest numbered script to the largest numbered script. When it leaves this runlevel (whether this be on shutdown or switching to another runlevel) it executes the scripts with links beginning with 'K', again, in numerical order. For example, it would execute the script linked to by 'S10dhclient' before 'S15nfsmounts', and on shutdown, it would execute 'K10nfsmounts' before 'K15dhclient'. Basically, just give your link a number greater than the links to the network initialisation scripts. It's not all that clear, but I hope it puts you on the right track, Chris -- __ _ -o)/ / (_)__ __ ____ __ Chris Reeves /\\ /__/ / _ \/ // /\ \/ / ICQ# 22219005 _\_v __/_/_//_/\_,_/ /_/\_\