lsb2rdf parses files looking for special-purpose sh-style comments. An xml/rdf document is generated and sent to standard output. The document is a collection of rdf statements describing services, dependencies and other meta-data associated with each file.
The serel daemon sereld uses collections of lsb2rdf-generated xml/rdf documents in responding to serelhistory queries.
For the syntax expected of the boot script comments, see the STANDARDS selection below.
Linux Standard Base Specification, Section 19. System Initialization, Comment conventions for init scripts, http://www.linuxbase.org/spec/refspecs/LSB_1.1.0/gLSB/initscrcomconv.html
Example 1. lsb2rdf parsing the sendmail boot script
The sendmail boot script: eg, /etc/rc.d/rc3.d/S80sendmail
# This script starts sendmail ### BEGIN INIT INFO # Provides: sendmail # Required-Start: network syslog ### END INIT INFO # # ... start and stop sendmail |
lsb2rdf /etc/rc.d/rc3.d/S80sendmail
generates the following output:
<?xml version="1.0" encoding="utf-8"?> <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:serel="http://www.fastboot.org/2002/03/serel-schema#" xmlns:graph="http://www.fastboot.org/2002/03/graph-schema#" xmlns="http://www.fastboot.org/2002/03/graph-schema#" > <service rdf:ID="sendmail"> <edges> <rdf:Seq> <rdf:li rdf:resource="#edge-network-sendmail" /> <rdf:li rdf:resource="#edge-syslog-sendmail" /> </rdf:Seq> </edges> </service> <edge rdf:ID="edge-network-sendmail" > <source rdf:resource="#network" /> <target rdf:resource="#sendmail" /> </edge> <edge rdf:ID="edge-syslog-sendmail" > <source rdf:resource="#syslog" /> <target rdf:resource="#sendmail" /> </edge> </rdf:RDF> |