Bug 34085 - Adjust pre- and postup.sh to UCS 3.2-1
Adjust pre- and postup.sh to UCS 3.2-1
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: Update - Release updates
UCS 3.2
Other Linux
: P5 enhancement (vote)
: UCS 3.2-1
Assigned To: Janek Walkenhorst
Philipp Hahn
:
Depends on:
Blocks: 33808
  Show dependency treegraph
 
Reported: 2014-02-10 07:32 CET by Stefan Gohmann
Modified: 2014-02-18 06:35 CET (History)
2 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):
Max CVSS v3 score:


Attachments
Findings from early QA: prune old kernels (2.35 KB, patch)
2014-02-11 13:42 CET, Philipp Hahn
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Stefan Gohmann univentionstaff 2014-02-10 07:32:51 CET
pre- and postup.sh should be adjusted.
Comment 1 Janek Walkenhorst univentionstaff 2014-02-10 18:58:27 CET
* preup.sh *
Updated release notes URL
Removed workaround for Bug #33342
Removed check for Bug #27686
Removed workaround for Bug #32634
Fixed typo
Removed packages from preup list.
TODO: update disk space check

* postup.sh * 
Removed workaround for Bug #32634
Removed workaround for Bug #33121
Moved "3.2-0-errata" component to mirror mode
Enabled "3.2-1-errata" component
Removed workaround message for Bug #33426
TODO: set update/reboot/required?
Comment 2 Stefan Gohmann univentionstaff 2014-02-10 20:14:42 CET
(In reply to Janek Walkenhorst from comment #1)
> TODO: set update/reboot/required?

Yes, please. We update the kernel with this update.
Comment 3 Moritz Muehlenhoff univentionstaff 2014-02-11 06:01:58 CET
(In reply to Stefan Gohmann from comment #2)
> (In reply to Janek Walkenhorst from comment #1)
> > TODO: set update/reboot/required?
> 
> Yes, please. We update the kernel with this update.

The univention-kernel-image meta package already sets this variable in the postinst.
Comment 4 Stefan Gohmann univentionstaff 2014-02-11 06:09:53 CET
(In reply to Moritz Muehlenhoff from comment #3)
> (In reply to Stefan Gohmann from comment #2)
> > (In reply to Janek Walkenhorst from comment #1)
> > > TODO: set update/reboot/required?
> > 
> > Yes, please. We update the kernel with this update.
> 
> The univention-kernel-image meta package already sets this variable in the
> postinst.

OK, I don't see another reboot reason. So you don't need to set the variable.
Comment 5 Philipp Hahn univentionstaff 2014-02-11 13:42:06 CET
Created attachment 5789 [details]
Findings from early QA: prune old kernels

preup.sh: +160:
	pruneOldKernel "2.6.18"
	pruneOldKernel "2.6.26"
	pruneOldKernel "2.6.32"
Should be removed, as they were already purged.
	pruneOldKernel "3.2"
Doesn't work, as the kernel is called "3.2*.0*"
	pruneOldKernel "3.10.0"
Should be added.

BTW: "sort -n" is wrong, as it stops at the first [^0-9.] character and thus doesn't sort the "ucs#" suffix; use '-V' AKA '--version-sort'.
Or remove it all-together, as the order is only relevant for get_latest_kernel_pkg(), which already correctly uses "dpkg --compare-version".

The logic will also leave behind at least one 2.6.18, 2.6.26, 2.6.32, 3.2.0 and 3.10.0 kernel (if one was ever installed). Perhaps we should switch to just "pruneOldKernel \*", which leaves behind the currently running and the (second-)newest kernel.
Comment 6 Janek Walkenhorst univentionstaff 2014-02-11 16:51:40 CET
(In reply to Janek Walkenhorst from comment #1)
> TODO: update disk space check
Updated to twice the required amount used by an update with full software.

> TODO: set update/reboot/required?
(In reply to Stefan Gohmann from comment #4)
> OK, I don't see another reboot reason. So you don't need to set the variable.
Removed.

(In reply to Philipp Hahn from comment #5)
> Created attachment 5789 [details]
Good code, applied.

> preup.sh: +160:
> 	pruneOldKernel "2.6.18"
> 	pruneOldKernel "2.6.26"
> 	pruneOldKernel "2.6.32"
> Should be removed, as they were already purged.
Kept, as purge is optional and has thus not necessarily happened.
> 	pruneOldKernel "3.2"
> Doesn't work, as the kernel is called "3.2*.0*"
Correct, fixed.
> 	pruneOldKernel "3.10.0"
> Should be added.
Correct, added.

> The logic will also leave behind at least one 2.6.18, 2.6.26, 2.6.32, 3.2.0
> and 3.10.0 kernel (if one was ever installed). Perhaps we should switch to
> just "pruneOldKernel \*", which leaves behind the currently running and the
> (second-)newest kernel.
Good idea, seems to work, but maybe better suited for a major release.
(Reopen or create a new Bug if this shall be implemented)
Comment 7 Philipp Hahn univentionstaff 2014-02-12 11:45:19 CET
OK: r47750,47715,
OK: <http://apt.knut.univention.de/3.2/maintained/3.2-1/all/preup.sh>
OK: <http://apt.knut.univention.de/3.2/maintained/3.2-1/all/postup.sh>
OK: gpgv  --keyring branches/ucs-3.2/ucs-3.2-0/base/univention-archive-key/univention-archive-key-ucs-3x.gpg postup.sh.gpg postup.sh
OK: gpgv  --keyring branches/ucs-3.2/ucs-3.2-0/base/univention-archive-key/univention-archive-key-ucs-3x.gpg -q preup.sh.gpg preup.sh
OK: ucr set update32/pruneoldkernel=yes ; univention-upgrade

FAIL: Should be removed from postup.sh, as already done for 3.2-0
> # Remove VNC module; Bug #30158
> univention-remove -y --purge univention-management-console-module-vnc >>"$UPDATER_LOG" 2>&1
>
> # Remove Flash plugin installer, Bug #31852
> univention-remove -y --purge univention-flashplugin >>"$UPDATER_LOG" 2>&1

FYI: Unused functions could be removed,  but may be needed by custom pre-/post-update scripts and/or customized DVDs.
preup.sh: conffile_is_unmodified(), #Pre-upgrade
postup.sh: reinstall(), check_and_install(), check_and_reinstall()

(In reply to Janek Walkenhorst from comment #6)
> > preup.sh: +160:
> > 	pruneOldKernel "2.6.18"
> > 	pruneOldKernel "2.6.26"
> > 	pruneOldKernel "2.6.32"
> > Should be removed, as they were already purged.
> Kept, as purge is optional and has thus not necessarily happened.

RFC: Perhaps change it to "2.6.*" to keep only the latest two? Not urgent...

FAIL: "2>/dev/null" should be added to "dpkg-query" in list_passive_kernels()
Comment 8 Janek Walkenhorst univentionstaff 2014-02-12 16:54:34 CET
(In reply to Philipp Hahn from comment #7)
> FAIL: Should be removed from postup.sh, as already done for 3.2-0
Removed

> FYI: Unused functions could be removed,  but may be needed by custom
> pre-/post-update scripts and/or customized DVDs.
> preup.sh: conffile_is_unmodified(), #Pre-upgrade
> postup.sh: reinstall(), check_and_install(), check_and_reinstall()
Kept for writing future releases' pre/postup scripts.

> RFC: Perhaps change it to "2.6.*" to keep only the latest two? Not urgent...
Changed to "2.6.*" so that the old kernel are removed; This is only done when requested anyway and does not remove the current one, so low impact.

> FAIL: "2>/dev/null" should be added to "dpkg-query" in list_passive_kernels()
Added
Comment 9 Philipp Hahn univentionstaff 2014-02-12 20:29:23 CET
OK: r47772
OK: univention-updater_9.0.38-14.1251.201402121654
OK: ucr set update32/pruneoldkernel=yes version/patchlevel=0 ; univention-upgrade --ignoressh --ignoreterm
OK: <http://apt.knut.univention.de/3.2/maintained/3.2-1/all/preup.sh>
OK: <http://apt.knut.univention.de/3.2/maintained/3.2-1/all/postup.sh>
Comment 10 Philipp Hahn univentionstaff 2014-02-13 11:47:43 CET
FAIL: errata-level should be reset only for minor updated, not patchlevel releases:

diff --git a/branches/ucs-3.2/ucs-3.2-1/base/univention-updater/script/postup.sh b/branches/ucs-3.2/ucs-3.2-1/base/univention-updater/script/postup.sh
index 4f87478..852f712 100644
--- a/branches/ucs-3.2/ucs-3.2-1/base/univention-updater/script/postup.sh
+++ b/branches/ucs-3.2/ucs-3.2-1/base/univention-updater/script/postup.sh
@@ -126,9 +126,6 @@ ucr set \
 	repository/online/component/3.2-1-errata/description="Errata updates for UCS 3.2-1" \
 	repository/online/component/3.2-1-errata/version="3.2" >>"$UPDATER_LOG" 2>&1
 
-# Reset errata level
-univention-config-registry set version/erratalevel=0 >>"$UPDATER_LOG" 2>&1
-
 # make sure that UMC server is restarted (Bug #33426)
 echo -n "Restart UMC server components to finish update... " >>"$UPDATER_LOG" 2>&1
 sleep 10s
Comment 11 Janek Walkenhorst univentionstaff 2014-02-13 13:39:07 CET
(In reply to Philipp Hahn from comment #10)
> FAIL: errata-level should be reset only for minor updated, not patchlevel
> releases:
Removed
Comment 12 Philipp Hahn univentionstaff 2014-02-13 15:54:15 CET
OK: r47781
OK: univention-updater_9.0.38-15.1252.201402131339
OK: gpgv  --keyring /home/phahn/GIT/branches/ucs-3.2/ucs-3.2-0/base/univention-archive-key/univention-archive-key-ucs-3x.gpg postup.sh.gpg postup.sh
OK: gpgv  --keyring /home/phahn/GIT/branches/ucs-3.2/ucs-3.2-0/base/univention-archive-key/univention-archive-key-ucs-3x.gpg preup.sh.gpg  preup.sh
OK: <http://apt.knut.univention.de/3.2/maintained/3.2-1/all/postup.sh>
OK: ucr set update32/pruneoldkernel=yes version/patchlevel=0 version/erratalevel=42; univention-upgrade --ignoressh --ignoreterm
Comment 13 Stefan Gohmann univentionstaff 2014-02-16 13:32:58 CET
An update via UMC does not work like expected. The message "THE UPDATE HAS BEEN FINISHED SUCCESSFULLY" has been removed and the Admin only gets a message that the connection was lost. I'm not sure we could remove the UMC restart or we re-add the message again.
Comment 14 Stefan Gohmann univentionstaff 2014-02-16 13:59:37 CET
I've re-added the message.
Comment 15 Philipp Hahn univentionstaff 2014-02-17 09:19:44 CET
(In reply to Stefan Gohmann from comment #14)
> I've re-added the message.

FYI: see original Bug #33426 on the rational for that
OK: r47836,47837,47838
OK: <http://apt.knut.univention.de/3.2/maintained/3.2-1/all/postup.sh>
OK: The message is displayed again in UMC at the end of the installation
Comment 16 Stefan Gohmann univentionstaff 2014-02-18 06:35:06 CET
UCS 3.2-1 has been released:
 http://docs.univention.de/release-notes-3.2-1-en.html
 http://docs.univention.de/release-notes-3.2-1-de.html

If this error occurs again, please use "Clone This Bug".