stop being nice does not work

Bug #1422345 reported by Harald Staub
22
This bug affects 2 people
Affects Status Importance Assigned to Milestone
unattended-upgrades (Debian)
Fix Released
Unknown
unattended-upgrades (Ubuntu)
Fix Released
High
Brian Murray
Trusty
Fix Released
High
Brian Murray
Utopic
Fix Released
High
Brian Murray

Bug Description

Test Case
---------
1) Install apache2 from the -release pocket
2) Run unattended-upgrades
3) Observe apache2 running with a niceness of 19
4) Downgrade apache2 to the version from the -release pocket
5) Install the version of unattended-upgrades from -proposed
6) Run unattended-upgrades
7) Observe apache2 running with a niceness of 0 i.e. no niceness

Since version 0.81, unattended-upgrades does the upgrade calculation with os.nice(19). To finish the nice block in /usr/bin/unattended-upgrade, the following call is used:
os.nice(0)

Since the argument is interpreted as incremental, this should be:
os.nice(-19)

Without this fix, this problem is back:
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=701850
"unattended-upgrades: nice 19/ionice idle inherited by restarted processes"

Found in the trusty version (0.82.1ubuntu2), but probably in any version (including Debian) since 0.81.

tags: added: regression-release
tags: added: trusty
Revision history for this message
Brian Murray (brian-murray) wrote :

I was able to confirm this by downgrading the version of apache2 installed to the one from the -release pocket and then running unattended upgrades:

 5867 root 39 19 284732 15232 9748 S 0.0 0.4 0:00.04 apache2
 5871 www-data 39 19 284764 5916 420 S 0.0 0.2 0:00.00 apache2
 5872 www-data 39 19 284764 5916 420 S 0.0 0.2 0:00.00 apache2
 5873 www-data 39 19 284764 5916 420 S 0.0 0.2 0:00.00 apache2
 5874 www-data 39 19 284764 5916 420 S 0.0 0.2 0:00.00 apache2
 5875 www-data 39 19 284764 5916 420 S 0.0 0.2 0:00.00 apache2

Changed in unattended-upgrades (Ubuntu):
status: New → In Progress
importance: Undecided → High
assignee: nobody → Brian Murray (brian-murray)
tags: added: utopic vivid
Changed in unattended-upgrades (Ubuntu Trusty):
status: New → In Progress
Changed in unattended-upgrades (Ubuntu Utopic):
status: New → In Progress
Changed in unattended-upgrades (Ubuntu Trusty):
importance: Undecided → High
Changed in unattended-upgrades (Ubuntu Utopic):
importance: Undecided → High
Changed in unattended-upgrades (Ubuntu Trusty):
assignee: nobody → Brian Murray (brian-murray)
Changed in unattended-upgrades (Ubuntu Utopic):
assignee: nobody → Brian Murray (brian-murray)
Revision history for this message
Brian Murray (brian-murray) wrote :

Thanks for bringing this up.

description: updated
Revision history for this message
Chris J Arges (arges) wrote : Please test proposed package

Hello Harald, or anyone else affected,

Accepted unattended-upgrades into trusty-proposed. The package will build now and be available at http://launchpad.net/ubuntu/+source/unattended-upgrades/0.82.1ubuntu2.1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, and change the tag from verification-needed to verification-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Changed in unattended-upgrades (Ubuntu Trusty):
status: In Progress → Fix Committed
tags: added: verification-needed
Changed in unattended-upgrades (Ubuntu Utopic):
status: In Progress → Fix Committed
Revision history for this message
Chris J Arges (arges) wrote :

Hello Harald, or anyone else affected,

Accepted unattended-upgrades into utopic-proposed. The package will build now and be available at http://launchpad.net/ubuntu/+source/unattended-upgrades/0.82.8ubuntu0.1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, and change the tag from verification-needed to verification-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Revision history for this message
Harald Staub (staub) wrote :

Tried the trusty version 0.82.1ubuntu2.1, works fine :-)
(Sorry, no utopic here ATM.)

Cheers
 Harry

tags:added: verification-done-trusty

Changed in unattended-upgrades (Ubuntu Trusty):
status: Fix Committed → In Progress
status: In Progress → Fix Committed
Revision history for this message
Harald Staub (staub) wrote :

(Oops, sorry, I may have messed around with the Status trying to update the Tag.)

tags: added: verification-done-trusty
Revision history for this message
Harald Staub (staub) wrote :

FYI: Opened a corresponding Debian bug:
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=778769

Revision history for this message
Brian Murray (brian-murray) wrote :

The fix was already merged upstream for what it is worth.

https://github.com/murraybd/unattended-upgrades/tree/lp-bug-1422345

Revision history for this message
Harald Staub (staub) wrote :

Thank you (sorry, should have asked before). Do you think that it is best for me to close the Debian bug report?

Revision history for this message
Brian Murray (brian-murray) wrote :

Given that the changelog entry has already been written and doesn't include a debian bug reference I think it'd be best to close and maybe include the changelog entry.

Changed in unattended-upgrades (Debian):
status: Unknown → New
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package unattended-upgrades - 0.83.5

---------------
unattended-upgrades (0.83.5) unstable; urgency=medium

  [ Brian Murray ]
  * properly restore niceness (LP: #1422345)

 -- Michael Vogt <email address hidden> Thu, 19 Feb 2015 15:06:58 +0100

Changed in unattended-upgrades (Ubuntu):
status: In Progress → Fix Released
Mathew Hodson (mhodson)
tags: added: verification-needed-utopic
removed: verification-needed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package unattended-upgrades - 0.82.1ubuntu2.1

---------------
unattended-upgrades (0.82.1ubuntu2.1) trusty-proposed; urgency=medium

  *Properly remove the niceness given. (LP: #1422345)
 -- Brian Murray <email address hidden> Tue, 17 Feb 2015 14:32:54 -0800

Changed in unattended-upgrades (Ubuntu Trusty):
status: Fix Committed → Fix Released
Revision history for this message
Brian Murray (brian-murray) wrote : Update Released

The verification of the Stable Release Update for unattended-upgrades has completed successfully and the package has now been released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

Revision history for this message
Brian Murray (brian-murray) wrote :

stgraber indicates this is causing issues in lxc containers:

11:14 < stgraber> bdmurray: your unattended-upgrade SRU
                  is making all my containers crash
                  once an hour ;)
11:14 < bdmurray> stgraber: hunh?
11:15 < stgraber> you can't set negative nice values in
                  an unprivileged LXC container even if
                  you're root inside it
11:15 < stgraber> so now every time unattended-upgrade
                  runs (in my case every hour), it
                  crashes on that os.nice call
11:18 < stgraber> what we've done in other tools (like
                  systemd) is make this non-fatel if
                  the error is EACCES (typical for
                  unprivileged containers) or EPERM
                  (typical for apparmor preventing it)
11:19 < bdmurray> stgraber: but then wouldn't bug
                  1422345 still happen?
11:22 < stgraber> bdmurray: sure, the bug would still
                  happen in this case
11:23 < stgraber> bdmurray: root in a userns has the
                  same rights as a regular user with
                  regard to process priorities
11:23 < stgraber> bdmurray: and as a regular user, you
                  can increase the niceness but never
                  decrease it
11:24 < bdmurray> would it better to first try
                  decreasing and only increase it if
                  decreasing works?
11:25 < stgraber> yep, that'd be a good trick
11:25 < stgraber> so -1, if that works then 20,
                  otherwise keep is it is

Revision history for this message
Brian Murray (brian-murray) wrote :
Revision history for this message
Brian Murray (brian-murray) wrote :

I've uploaded the improvements for this to the utopic and trusty queues.

Revision history for this message
Timo Aaltonen (tjaalton) wrote : Please test proposed package

Hello Harald, or anyone else affected,

Accepted unattended-upgrades into utopic-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/unattended-upgrades/0.82.8ubuntu0.2 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, and change the tag from verification-needed to verification-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

tags: added: verification-needed
Revision history for this message
Brian Murray (brian-murray) wrote :

Hello Harald, or anyone else affected,

Accepted unattended-upgrades into trusty-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/unattended-upgrades/0.82.1ubuntu2.2 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, and change the tag from verification-needed to verification-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Changed in unattended-upgrades (Ubuntu Trusty):
status: Fix Released → Fix Committed
Mathew Hodson (mhodson)
tags: added: verification-needed-trusty
removed: verification-done-trusty verification-needed
Revision history for this message
Harald Staub (staub) wrote :

Tried the newest trusty version 0.82.1ubuntu2.2, on hardware, works fine :-)
I leave the verification-needed flag since the test should also be done in a container.

Cheers
 Harry

Revision history for this message
Stéphane Graber (stgraber) wrote :

Works fine in an unprivileged container. Thanks!

tags: added: verification-done-trusty verification-done-utopic
removed: verification-needed-trusty verification-needed-utopic
Revision history for this message
Rolf Wojtech (rolf-g) wrote :

I can confirm, worked fine in my LXC containers.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package unattended-upgrades - 0.82.8ubuntu0.2

---------------
unattended-upgrades (0.82.8ubuntu0.2) utopic-proposed; urgency=medium

  * Handle the situation where you may not be able to decrease process
    niceness e.g on an LXC container. (LP: #1422345)
 -- Brian Murray <email address hidden> Thu, 05 Mar 2015 15:03:10 -0800

Changed in unattended-upgrades (Ubuntu Utopic):
status: Fix Committed → Fix Released
Revision history for this message
Foo (foo-foo-ch) wrote :

Tested on unprivileged Docker container (Ubuntu 14.04.1 LTS) and confirmed that it worked fine.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package unattended-upgrades - 0.82.1ubuntu2.2

---------------
unattended-upgrades (0.82.1ubuntu2.2) trusty-proposed; urgency=medium

  * Handle the situation where you may not be able to decrease process
    niceness e.g on an LXC container. (LP: #1422345)
 -- Brian Murray <email address hidden> Thu, 05 Mar 2015 15:03:10 -0800

Changed in unattended-upgrades (Ubuntu Trusty):
status: Fix Committed → Fix Released
Changed in unattended-upgrades (Debian):
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.