The cdpub Publisher

The cdpub device publisher retrieves and publishes information about CDs.

This publisher depends on the following services:
The CD driver. You may use a different driver on your system (e.g., devb-eide-mmx), but regardless of the hardware, the CD driver process runs continuously and manages the CD device path and communication with all CD device types (e.g., DVDs, audio CDs, CD-ROMs).
The mcd utility mounts the filesystems of inserted CDs by making requests to the CD driver. The mountpoints chosen by mcd depend on the rules in its mountpoint file.


Figure 1. CD publisher architecture

The arrows between components in Figure 1 show information flow. For example, when discs are inserted into or removed from the CD drive, the driver updates the state of the CD device object (i.e., /dev/cd0). That filesystem entry exists as long as the driver is running, even when the CD drive is empty. Meanwhile, mcd monitors the device object for state changes and when it notices that a new CD has been inserted, mcd consults its mount rules (based on the device's type) and if warranted, sends a mount request to the devb-eide driver process, which manages the device path.

The cdpub publisher also monitors the /dev entry (i.e., device object) and when it notices a state change, cdpub communicates with the devb-eide process to obtain the latest device and mount information, which it then writes to the appropriate PPS objects. Subscribed applications receive PPS updates when CDs are inserted or removed.