Bug 40913 - [univention-system-activation] Remove call to dpkg-reconfigure from postinst
[univention-system-activation] Remove call to dpkg-reconfigure from postinst
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: System setup
UCS 4.1
Other Linux
: P5 normal (vote)
: UCS 4.1-2-errata
Assigned To: Jürn Brodersen
Alexander Kläser
:
Depends on: 39700 40728 41631
Blocks:
  Show dependency treegraph
 
Reported: 2016-03-17 10:26 CET by Alexander Kläser
Modified: 2016-07-07 14:31 CEST (History)
5 users (show)

See Also:
What kind of report is it?: ---
What type of bug is this?: ---
Who will be affected by this bug?: ---
How will those affected feel about the bug?: ---
User Pain:
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number:
Bug group (optional): Cleanup
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alexander Kläser univentionstaff 2016-03-17 10:26:52 CET
Currently, a call to dpkg-reconfigure univention-pam is executed in the postinst script of univention-system-activation (introduced by r68147).

The check for the installation status of univention-pam via "dpkg -l" is not ideal, better would be:
---------- 8< -----------
reconf_dpkg () {
  [ -z "${DPKG_MAINTSCRIPT_PACKAGE:-}" ] || return
  case "$(dpkg-query -f '${Status}' -W "$1" 2>/dev/null)" in
  *' ok installed') dpkg-reconfigure "$1"
  esac
}
reconf_dpkg 'univention-pam'
---------- 8< -----------

The call to dpkg-reconfigure yields at setting PAM UCR variable to their default values as those are not set since values are given via the force layer by univention-system-activation. It would be therefore even better to extract these logic from the postinst script of univention-pam into a separate script that can be executed by univention-system-activation without any call to dpkg tools.
Comment 1 Jürn Brodersen univentionstaff 2016-03-17 13:47:28 CET
I looked at package again and I think we actually don't need that logic anymore at all.
"univention-system-activation start" is now first called in a hook and not in the postinst.
That means that "univention-pam" should have no problems setting its default values and there should be no need to reconfigure the package.
Adding "univention-pam" as a dependency should ensure that the default values are set before they are overwritten by "univention-system-activation start".
Comment 2 Alexander Kläser univentionstaff 2016-03-23 10:41:38 CET
(In reply to Jürn Brodersen from comment #1)
> I looked at package again and I think we actually don't need that logic
> anymore at all.
> "univention-system-activation start" is now first called in a hook and not
> in the postinst.
> That means that "univention-pam" should have no problems setting its default
> values and there should be no need to reconfigure the package.
> Adding "univention-pam" as a dependency should ensure that the default
> values are set before they are overwritten by "univention-system-activation
> start".

"univention-system-activation restrict-root" will be called when building an appliance image. This restricts the access to the machine. Therefore, this logic is still relevant.
Comment 3 Alexander Kläser univentionstaff 2016-06-02 11:07:49 CEST

*** This bug has been marked as a duplicate of bug 40728 ***
Comment 4 Jürn Brodersen univentionstaff 2016-06-21 16:57:45 CEST
Reopened because bug 40728 is fixed.
Comment 5 Jürn Brodersen univentionstaff 2016-06-22 10:34:08 CEST
r70519: "dpkg-reconfigure univention-pam" not necessary anymore
Package: univention-system-activation
Version: 1.0.1-11.59.201606221019
Branch: ucs_4.1-0
Scope: errata4.1-2

r70520: YAML
Comment 6 Alexander Kläser univentionstaff 2016-07-01 16:17:10 CEST
Changes: OK, look good! Functional tests together with the generic appliance tests.
YAML: I adjusted the entry [r70774] as the entry was too detailed.

→ VERIFIED
Comment 7 Janek Walkenhorst univentionstaff 2016-07-07 14:31:30 CEST
<http://errata.software-univention.de/ucs/4.1/209.html>