[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#211992: post operation hook/trigger run additional configuration scripts



Package: apt
Version: 0.5.4
Severity: wishlist

It would be most useful if were possible to configure a hook in apt
such that all of the apt client tools, apt-get, aptitude, dselect,
etc., would run a local configuration script after the current
operation has completed.  This would allow site local policies to be
configured to automatically perform additional configuration after
system changes have been performed with apt.  This would be run after
the package maintainer postinst scripts have run.

Among other things I am thinking of something similar to
/etc/kernel-img.conf's ability to set postinst_hook to a script to
trigger additional actions.  This trigger allows another level of
configuration and allows grub to adjust the boot menu automatically.
(Although obviously this item for apt should be specified within the
/etc/apt/apt.conf.d/ option framework.)

Alternatively a subsystem operating along the lines of dpkg-divert or
dpkg-statoverride might be a good interface.  Then a site local
package could be created and installed which would register triggers
to be called when certain actions occurred to certain packages.  When
mail-transport-agent is changed a trigger depending upon it could
perform additional configuration.  And this way when the package was
removed all of the associated triggers would also be removed and
everything would be left in a clean and tidy state.

One example use would be for a site to use a script to configure bind
or postfix or other package for the site network.  A postinst_hook
script could automatically configure the local files beyond what is
possible for the package to know about generically.

I do this currently.  After an apt install I run a script which
finishes the configuration.  My site local script modifies the
configuration files, including conffiles, as is desired for local site
operation.  But today the scripts need to be run manually because
there is no way to have them run automatically.  The ability to run
them automatically would make the user interface simpler.  Things
would have the ability to "just work" more completely even when
additional site specific configuration is needed.

On an individual package basis a package could create their own hooks
in their maintainer scripts.  But I think that if implemented at the
package level each package would be different and it would be terribly
inconsistent.  Putting this in the management software framework would
keep this consistent for all packages.

Thanks
Bob Proulx <bob@proulx.com>




Reply to: