Skip to content

nopkg item is recorded as Installed when its postinstall script exits non-zero #118

Description

@rodchristiansen

InstallerService runs an item's postinstall_script after the installer succeeds and, when the script exits non-zero, logs Postinstall script failed and continues to Successfully installed (comment: "Don't fail the installation for postinstall script failures (legacy behavior)").

For installer.type: nopkg the postinstall script is the install. A nopkg item whose script aborts (a guard that refuses to proceed, a missing prerequisite, an msiexec failure inside the script) is therefore recorded as Installed, registered in the ManagedInstalls registry, and then immediately re-flagged by its own installcheck_script. The convergence probe reports "installcheck did not converge ... fix the pkgsinfo installcheck/installs criteria", which points the admin at the wrong thing, and LoopGuard suppresses the item, so the real failure is never surfaced as an error.

Observed with a cleanup item whose guard exits 1 on hosts that lack a prerequisite directory: 17 hosts reported Installed + loop-suppressed while the script had done nothing.

Suggested behaviour: when installer.type is nopkg (or there is no installer and only a postinstall script), a non-zero postinstall exit should be an install failure, with the script output as the error. Packages with a real installer can keep the legacy leniency, though a CIMIAN-WARNING: marker line already exists for scripts that want to degrade gracefully.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions