Bug 38570 - Check for free space before upgrade dynamically
Check for free space before upgrade dynamically
Status: RESOLVED WONTFIX
Product: UCS
Classification: Unclassified
Component: Update - univention-updater
UCS 4.0
Other Linux
: P5 normal (vote)
: ---
Assigned To: UCS maintainers
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2015-05-20 13:28 CEST by Philipp Hahn
Modified: 2019-01-03 07:17 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

Note You need to log in before you can comment on or make changes to this bug.
Description Philipp Hahn univentionstaff 2015-05-20 13:28:32 CEST
univention-updater/script/preup.sh contains a hard-coded minimum free space size, but the actual download size heavily depends on the number of installed packages (from unstable).

We should use APT instead:

python -c '
from os import statvfs
from sys import exit
from apt import Cache

BLOCK_SIZE = 512  # != f_bsize
ret = 0

a = Cache()
a.upgrade(dist_upgrade=True)

s = statvfs('/var/cache/apt/archives')
if s.f_bavail * BLOCK_SIZE < a.required_download:
  ret |= 1 << 0

s = statvfs('/usr')
if s.f_bavail * BLOCK_SIZE < a.required_space
  ret |= 1 << 1

exit(ret)'
Comment 1 Stefan Gohmann univentionstaff 2015-05-26 16:10:39 CEST
(In reply to Philipp Hahn from comment #0)
> univention-updater/script/preup.sh contains a hard-coded minimum free space
> size, but the actual download size heavily depends on the number of
> installed packages (from unstable).
> 
> We should use APT instead:

I guess it doesn't work because we often upgrade packages in the preup.sh.
Comment 2 Florian Best univentionstaff 2017-06-19 16:49:05 CEST
I think this is now already done?
Comment 3 Stefan Gohmann univentionstaff 2019-01-03 07:17:30 CET
This issue has been filled against UCS 4.0. The maintenance with bug and security fixes for UCS 4.0 has ended on 31st of May 2016.

Customers still on UCS 4.0 are encouraged to update to UCS 4.3. Please contact
your partner or Univention for any questions.

If this issue still occurs in newer UCS versions, please use "Clone this bug" or simply reopen the issue. In this case please provide detailed information on how this issue is affecting you.