On Mon, Feb 05, 2007 at 02:08:39PM -0800, David Bustos wrote: > I also wonder if we should be more general in deciding when the upgrade > method needs to be run. Shouldn't it be executed if the user upgrades > by manually pkgrm'ing and pkgadd'ing? I think we should require service > developers to deliver a version number with their service and record it > in the repository. Then we can execute the upgrade method whenever the > version number changes. If we exposed the version number to the service > developer, this would also make it much easier to tell what needs to be > changed, since he could easily determine exactly which older version of > the configuration is present. Or we could just execute the upgrade > method every time the service starts, and let it decide whether anything > needs to be done.
If you don't provide a notion of versioning and instead run the upgrade method whenever the manifest has changed or what have you, then developers are free to come up with their own versioning scheme. I'm not sure which is better, but I think I would prefer that the upgrade method be run whenever the manifest has changed (even if it's only been touch(1)ed). > Finally since the upgrade method might migrate the administrator's > customizations, we should probably record that the upgrade method ran, > and what the configuration was beforehand. I suppose snapshots can be > used for the latter and a log message could be used for the former. Snapshots? Like ZFS snapshots? Or an SMF-specific notion of snapshots?