Application Packaging Developer's Guide

Approach

To modify /etc/inittab during installation, using classes and class action scripts, you must complete the following tasks:

This case study is more complicated than the next one; see Modifying a File Using the sed Class and a postinstall Script. Instead of providing two files, three are needed and the delivered /etc/inittab file is actually just a place holder containing a fragment of the entry to be inserted. This could have been placed into the i.inittab file except that the pkgadd command must have a file to pass to the i.inittab file. Also, the removal procedure must be placed into a separate file (r.inittab). While this method works fine, it is best reserved for cases involving very complicated installations of multiple files. See Modifying crontab Files During Installation.

The sed program used in Modifying a File Using the sed Class and a postinstall Script supports multiple package instances since the comment at the end of the inittab entry is based on package instance. The case study in Modifying a File Using The build Class shows a more streamlined approach to editing /etc/inittab during installation.