Many traditional packaging systems support package scripts -- free form scripts that are invoked at specific points during package operations. For very good reasons OpenSolaris pkg(5) does not support package scripts. Instead it supports well defined package actions plus a feature known as Actuators.
Actuators are used to trigger SMF services when a file is installed, updated or removed. This provides a way for packages to trigger some logic that is executed when a file's state changes, but have that execution occur outside of the install context -- and instead occur inside the context of a running OS image. It's an alternative to package scripting that is more robust in the OS context.
The current Actuator implementation supports OpenSolaris system images. It was not designed to support cross-platform user images. An Actuator implementation for user images has some unique requirements:
The UC project needs an implementation of Actuators that supports user images. This proposal is to create a new class of Actuator that would be used when operating on a user image: UserImageActuator.
Some example uses of UserImageActuators:
Related Issues
205 | install-time config support via IPS |
6994(IPS) | Need actuator implementation for user images |
577 (IPS) | need service action for smf(5) manifests |
578 (IPS) | need restart action or equivalent to poke smf(5) services |
| # | Description | Priority | Rationale |
|---|---|---|---|
| 1.0 | User Image Support | ||
| 1.1 | Must not require super user privileges | P1 | User images support non-root users. |
| 1.2 | Must not require SMF | P1 | User images are supported on multiple platforms -- most of which do not support SMF |
| 1.3 | Must optimize the case where files are installed by pkg(5) exclusively into a User image | P1 | User images are self-contained install images -- files are not installed by pkg(5) outside of the user image. |
| 1.4 | Must support Windows, Linux, MacOS X, Windows | P1 | User images are supported on multiple platforms. |
| 2.0 | OpenSolaris Integrity | ||
| 2.1 | Must not alter the current Actuator behavior when operating on a system image | P1 | Must not alter the current Actuator implementation for OpenSolaris. |
| 2.2 | Must only be used when operating on a user image | P1 | Ditto |
| 3.0 | General | ||
| 3.1 | Must provide a pre-remove hook | P1 | To handle operations that need to be performed before a file is removed |
| 3.2 | Must provide a post-install/update hook | P1 | To handle operations that need to be performed after a file is modified |
| 3.3 | Any failure of a UserImageAcutator hook must not cause an imageplan evaluation to fail | P1 | Configuration operations must not impact package operations. This is also consistent with the current SMF Actuator implementation where hook failures occur in the context of the running SMF service and do not impact imageplan evaluation. |
| 3.4 | Any output from a UserImageAcutator hook must be captured and displayed to the user and logged to the IPS log file | P2 | For diagnosis |
| 3.5 | Must not support actuator hooks that perform any form of user interaction | P1 | Hooks may not block package installation for an indefinite period of time. |
| 3.6 | Need not support SMF Actuator attributes | P1 |
The current OpenSolaris/SMF implementation of Actuators support the following file action attributes:
| Attribute | Behavior |
|---|---|
| disable_fmri=service fmri | Run 'svcadm disable -t service_fmri' before file is removed |
| suspend_fmri=service fmri | Run 'svcadm disable -t service_fmri' beforefile is installed, updated or removed, and then run 'svcadm enable service_fmri' after file is installed, updated, or removed |
| restart_fmri=service fmri | Run 'svcadm restart service_fmri' after file is installed, updated or removed |
| refresh_fmri=service fmri | Run 'svcadm refresh service_fmri' after file is installed, updated or removed |
Notes:
To generalize this for UserImageActuator the proposal is to replace the service fmri's with a path to a command. The command is passed a single parameter that reflects the disposition of the hook.
| Attribute | Behavior |
|---|---|
| user_disable_cmd=cmd | Run 'cmd disable' before file is removed |
| user_suspend_cmd=cmd | Run 'cmd disable' before file is installed, updated or removed, and then run 'cmd enable' after file is installed, updated, or removed |
| user_restart_cmd=cmd | Run 'cmd restart' after file is installed, updated or removed |
| user_refresh_cmd=cmd | Run 'cmd refresh' after file is installed, updated or removed |
Notes:
The approach described in section 4.0 attempts to maintain some consistency with the SMF Actuator implementation. This may be misleading since the UserImageActuator is not providing an interface to a service framework. The following attributes represent an alternative that may be a bit more straightforward:
| Attribute | Behavior |
|---|---|
| user_preremove_cmd=cmd | Run 'cmd preremove' before file is removed |
| user_postinstall_cmd=cmd | Run 'cmd postinstall' after file is installed |
| user_postupdate_cmd=cmd | Run 'cmd postupdate' after file is updated |
The same notes that apply in 4.0 also apply here.