![]() ![]() It assumes that most rc.d scripts have nothing to do at that time. When the system is going to shut down, /etc/rc.shutdown runs. It can help /etc/rc.shutdown, too, because the proper order for the shutdown sequence is opposite to that of startup. Now a typical script can be just a few lines' worth of sh(1) code.įinally, an important part of the rc.d framework is rcorder(8), which helps /etc/rc to run the small scripts orderly with respect to dependencies between them. Note how closely this follows the Unix way of having a set of small specialized tools, each fulfilling its task as well as possible.Ĭode reuse means that common operations are implemented as sh(1) functions and collected in /etc/rc.subr. It is easy to perform shutdown tasks as well by running the same set of scripts with the stop argument, which is done by /etc/rc.shutdown. The /etc/rc script still drives system startup, but now it merely invokes the smaller scripts one by one with the start argument. The basic ideas behind BSD rc.d are fine modularity and code reuse.įine modularity means that each basic "service" such as a system daemon or primitive startup task gets its own sh(1) script able to start the service, stop it, reload it, check its status.Ī particular action is chosen by the command-line argument to the script.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |