Hello, 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. Suggestions? John.
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On April 4, 2001 09:12 am, john.janmaat@acadiau.ca wrote:
Hello,
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.
Check out the file /etc/rc.d/skeleton You can create your own boot script based on that template and make a symlink to it in the runlevel directory you want called S99foo (if your script is called foo) or whatever. The S99 tells it to start last in that runlevel. You'll probably want to remove most of the stuff in that script if you simply want to run a single command that doesn't daemonise. You can use ksysv to create the symlinks if you want. I find that it gives a nice visual drag-n-drop interface. - -- James Oakley Engineering - SolutionInc Ltd. joakley@solutioninc.com http://www.solutioninc.com -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.4 (GNU/Linux) Comment: For info see http://www.gnupg.org iD8DBQE6yyQe+FOexA3koIgRAjLPAJ9mxRFE4OLlG0FneauTK0CdyDB0jgCcCZfm 8Ee7vsd1iXYxnMNWxyDQzj0= =wQjD -----END PGP SIGNATURE-----
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 __/_/_//_/\_,_/ /_/\_\
Chris Reeves wrote:
It's not all that clear, but I hope it puts you on the right track, Chris
Description was great. Have it now set up to back up critical files when the system is able to attach to the network at boot time, and again when it is shutting down with an active network connection. John.
participants (3)
-
Chris Reeves
-
James Oakley
-
john.janmaat@acadiau.ca