Mandrake Linux: cooker@mandrivalinux.org
[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]
Hi, Thanks to the work from Couriousous, we're moving to a robust and fast initialization system. As you've probably noticed, most of the initscripts containing parallel initialization headers have been converted to use LSB headers. Here's a summary of the migration process to LSB headers in the initscripts. The previous X-Parallel-* tags of the parallel init system will be abandonned soon, and prcsys (the parallel init process) has been modified by Couriousous to support LSB dependencies. So, it's now encouraged to use LSB headers to describe the initscripts dependencies. o Migration to LSB headers Let's take the previous dm init script as an example. It contained the following comments: # chkconfig: 5 30 09 # description: This startup script launches the graphical display manager. # X-Parallel-Init # X-Parallel-Requires: xfs network harddrake We can add LSB headers in a block delimited by the following lines: ### BEGIN INIT INFO ### END INIT INFO X-Parallel-Provides tags should be converted to Provides tags, to describe a dependency facility. # Provides: dm The services should preferably be named using this policy: http://www.lanana.org/lsbreg/init/init.txt X-Parallel-Requires tags have to be converted to Required-Start (mandatory service) or Should-Start (optionnal service) tags. # Required-Start: xfs # Should-Start: $network harddrake Dependency facilities that begin with a '$' sign are reserved system facilities, such as $network. A complete list is available here: http://www.linuxbase.org/spec/booksets/LSB-Core-generic/LSB-Core-generic/facilname.html If another service has to be available during stop, the mandatory dependency should be described using a Required-Stop tag (this is an example, it may not be true): # Required-Stop: xfs The same is available for optionnal dependencies, using the Should-Stop flag. You can specify which runlevels the service should be started in using the Default-Start tag. # Default-Start: 5 Descriptions have to be provided using the Short-Description and Description (potentially multi-line) tags: # Short-Description: Launches the graphical display manager # Description: This startup script launches the graphical display # manager. The dm initscript will finally end up with the following LSB header: ### BEGIN INIT INFO # Provides: dm # Required-Start: xfs # Required-Stop: xfs # Should-Start: $network harddrake # Default-Start: 5 # Short-Description: Launches the graphical display manager # Description: This startup script launches the graphical display manager. ### END INIT INFO o Interactive initscripts Some initscripts request some user input, such as harddrake when a new device is found. These scripts used the X-Parallel-Interactive tag. Since this will be quite Mandriva specific, we will now use the X-Mandriva-Interactive tag, since the LSB asks for an X-implementor-extension format. # X-Mandriva-Interactive Mandriva should probably request a vendor tag to the Linux Assigned Names And Numbers Authority, see: http://www.lanana.org/lsbreg/providers/providers.txt o References For a more complete reference about the LSB headers, please see: - LSB specs http://www.linuxbase.org/spec/booksets/LSB-Core-generic/LSB-Core-generic/tocsysinit.html http://refspecs.freestandards.org/LSB_3.1.0/LSB-Core-generic/LSB-Core-generic/tocsysinit.html - Suse initscripts specs http://forgeftp.novell.com/library/SUSE%20Package%20Conventions/spc_init_scripts.html - Linux Assigned Names And Numbers Authority http://www.lanana.org/ - Parallel Init on the wiki http://qa.mandriva.com/twiki/bin/view/Main/Pinit Adding LSB headers will allow to have a robust services dependency check, and to provide a base for parallel initialization, so packagers are all encouraged to add LSB headers to their pacakges. Thanks again to Couriousous for his time and all the remarks that helped to improve this system! (and allowed me to write this small document and start the work) Regards -- Olivier Blin - Mandriva