sundialsvcs |
09-24-2012 08:29 AM |
When a system boots, say, using the GRUB boot-loader, then the majority of the boot-time software (including most of GRUB itself) is located in "an ordinary directory on the hard drive." The kernel is also found there, and the boot-loader knows how to navigate the file-system to find it. Although it is customary best-practice to make those files (and often, the entire /boot branch) read-only, those areas can still be writable. Furthermore, although it is frequently the case that areas such as /usr may correspond to other partitions on a multi-partitioned media ... again, there is no physical requirement for this to be so.
You could easily organize your boot-media so that it contains the customary-and-protected boot-folder and, on the very same media, other read/write areas of the file system to which any application may read or write at any time.
When you "shut down the system," what actually happens is that the system switches to a different "run level." (See man inittab e.g.) When this happens, init/systemd begins to execute a prescribed series of programs, the cumulative effect is to shut the system down in an organized fashion. (There's a lot of detail here that I won't go into now ...) But, if you want particular things to be-sure-to happen as you shut the machine down, this is the place and the method by which to do it. On any Unix/Linux system. You can precisely determine what happens and in what sequence it happens.
Look at: man service.
|