On Mon, Feb 04, 2008 at 10:41:16AM -0800, John Fischer wrote: > Several software projects ship with programs needed for updating the > project's databases or caches whenever the configuration changes or > new files/data added that invalidate the cache. Examples from the > GNOME world are: > - update-mime-database > - update-desktop-database > - gtk-update-icon-cache > - adding new gconf schemas to the gconf database (gconftool-2) > - gdk-pixbuf image loaders > > [ ... ] > > In these cases, the only choice is to execute the commands at the > first system boot after installation, however, when installing the > packages on a live system, the commands need to be executed > immediately and no reboot is necessary. Such behavior can be > achieved by adding complex procedural scripts to each package that > needs to run any of the above programs after installation. This > would become difficult to maintain and error prone, since very > similar complex postinstall scripts would be repeated in each > package.
For the examples you list, as well as a few others, such as makewhatis and the infodir service that has been proposed, it seems to me that a service per database/cache is precisely what you want. It's something that can be kicked at an arbitrary time, rather than just at boot time (and the first boot after a package was installed, no less), turned on and off, and otherwise manipulated by the standard SMF tools. Indeed, it seems to me that what you'd really want is for a single long-running service to watch directories for file events -- creations, deletions, etc -- and kick off the appropriate updater program to handle the directories where stuff happened. It could have multiple FMRI front-ends for administrator intervention. It could also be extended to the user level, if we should ever end up with a user or session level restarter restarter. Danek
