Bug 433599 - packagekit blocked by needrestart
Summary: packagekit blocked by needrestart
Status: RESOLVED UPSTREAM
Alias: None
Product: Discover
Classification: Applications
Component: PackageKit (other bugs)
Version First Reported In: 5.19.5
Platform: Ubuntu Linux
: NOR normal
Target Milestone: ---
Assignee: Dan Leinir Turthra Jensen
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-02-25 15:20 UTC by p92
Modified: 2021-03-01 01:27 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description p92 2021-02-25 15:20:09 UTC
SUMMARY
if needrestart is installed, discover update never ends if an update requires a system restart (ie: a kernel update has been applied)

STEPS TO REPRODUCE
1. install needrestart package
2. do an update in kde with discover while there is a kernel update pending

OBSERVED RESULT
discover updates system but the update never ends on discover

EXPECTED RESULT
discover update system, then says a restart is required and give back control

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: 
(available in About System)
KDE Plasma Version: 5.19.5
KDE Frameworks Version: 5.74.0
Qt Version: 5.14.2

ADDITIONAL INFORMATION

the process hangs currently present :

# pgrep  -a -f need
1639236 sh -c test -x /usr/lib/needrestart/apt-pinvoke && /usr/lib/needrestart/apt-pinvoke || true
1639237 /usr/bin/perl /usr/sbin/needrestart

# pstree -p 1639236
sh(1639236)───needrestart(1639237)

# pstree -p 1639236
sh(1639236)───needrestart(1639237)

# pstree  1639236
sh───needrestart

# pstree -p  1639236
sh(1639236)───needrestart(1639237)

# pstree -p 1639237
needrestart(1639237)

# ps -ef | grep 1639236
root     1639236 1639226  0 15:55 pts/1    00:00:00 sh -c test -x /usr/lib/needrestart/apt-pinvoke && /usr/lib/needrestart/apt-pinvoke || true
root     1639237 1639236  0 15:55 pts/1    00:00:00 /usr/bin/perl /usr/sbin/needrestart
root     1640398  235137  0 16:06 pts/3    00:00:00 grep --color=auto 1639236

# ps -ef | grep 1639226
root     1639226 1638529  0 15:55 pts/1    00:00:00 /usr/lib/packagekit/packagekitd
root     1639236 1639226  0 15:55 pts/1    00:00:00 sh -c test -x /usr/lib/needrestart/apt-pinvoke && /usr/lib/needrestart/apt-pinvoke || true
root     1640448  235137  0 16:07 pts/3    00:00:00 grep --color=auto 1639226

# ps -ef | grep 1638529
root     1638529 1636890  0 15:55 pts/1    00:00:00 /usr/lib/packagekit/packagekitd
root     1639226 1638529  0 15:55 pts/1    00:00:00 /usr/lib/packagekit/packagekitd
root     1640474  235137  0 16:07 pts/3    00:00:00 grep --color=auto 1638529

# ps -ef | grep 1636890
root     1636890       1  1 15:54 ?        00:00:13 /usr/lib/packagekit/packagekitd
root     1638529 1636890  0 15:55 pts/1    00:00:00 /usr/lib/packagekit/packagekitd
root     1640478  235137  0 16:07 pts/3    00:00:00 grep --color=auto 1636890
Comment 1 Aleix Pol 2021-02-26 02:40:54 UTC
Sounds like an issue in packagekit, can you please report it there?
https://github.com/hughsie/PackageKit/issues

Your assessment here will surely help devs figure it out.
Comment 2 Harald Sitter 2021-02-26 09:49:12 UTC
I've taken a brief look and this really isn't a problem with packagekit but rather needrestart.
It has a hook on apt from which it never returns as per the pgrep output: ` sh -c test -x /usr/lib/needrestart/apt-pinvoke && /usr/lib/needrestart/apt-pinvoke || true` is the hook, until it returns apt can't finish, and the reason it doesn't return is the needrestart process (gets exec'd by apt-pinvoke).

The reason the update never ends is something inside needrestart that leads to needrestart never exiting -> blocking the hook -> blocking apt -> blocking packagekit -> blocking discover.
Comment 3 Aleix Pol 2021-02-28 00:46:55 UTC
Oh boy, where does it need to be reported then?
Comment 4 Harald Sitter 2021-03-01 01:10:24 UTC
https://github.com/liske/needrestart
Comment 5 Aleix Pol 2021-03-01 01:27:02 UTC
Reported it there before it gets lost:
https://github.com/liske/needrestart/issues/208