Very similar thing happened on Lubuntu 20.04, `apt-get dist-upgrade`
said

    Unpacking snapd (2.47.1+20.04) over (2.46.1+20.04) ...
    Setting up snapd (2.47.1+20.04) ...
    Installing new version of config file 
/etc/apparmor.d/usr.lib.snapd.snap-confine.real ...

and hung.  `pstree` just showed `apt-get---dpkg---snapd.postinst` (no
children).  It ignored `SIGINT` and `SIGTERM`.  `ps auxwww` shows

    root        4091  0.0  0.0   2608  1740 pts/1    S+   09:42   0:00
/bin/sh /var/lib/dpkg/info/snapd.postinst configure 2.46.1+20.04

and `ls -l /proc/4091/fd` gives

    lrwx------ 1 root root 64 Nov  3 11:43 0 -> /dev/pts/1
    l-wx------ 1 root root 64 Nov  3 11:44 1 -> /dev/null
    lr-x------ 1 root root 64 Nov  3 11:44 10 -> 
/var/lib/dpkg/info/snapd.postinst
    lrwx------ 1 root root 64 Nov  3 11:44 11 -> /dev/pts/1
    lrwx------ 1 root root 64 Nov  3 11:44 2 -> /dev/pts/1

(timestamps being the current time of the `ls`, not the process start
time which was about 2 hours earlier)  I was connecting to the machine
via `ssh` from elsewhere on our home network.

After `kill -9 4091` the parent `dpkg` process was still hung, `ps
auxwww` gives:

    root        4090  0.0  0.2  18092  9932 pts/1    Ss+  09:42   0:00
/usr/bin/dpkg --status-fd 55 --configure --pending

and `ls -l /proc/4090/fd` gives:

    lrwx------ 1 root root 64 Nov  3 11:49 0 -> /dev/pts/1
    lrwx------ 1 root root 64 Nov  3 11:49 1 -> /dev/pts/1
    lrwx------ 1 root root 64 Nov  3 11:49 2 -> /dev/pts/1
    lrwx------ 1 root root 64 Nov  3 11:49 3 -> /var/lib/dpkg/lock
    l-wx------ 1 root root 64 Nov  3 11:49 4 -> /var/lib/dpkg/updates/tmp.i
    lrwx------ 1 root root 64 Nov  3 11:49 5 -> /var/lib/dpkg/triggers/Lock
    l-wx------ 1 root root 64 Nov  3 11:49 55 -> 'pipe:[55607]'
    lr-x------ 1 root root 64 Nov  3 11:49 6 -> /var/lib/dpkg/triggers/Unincorp
    l-wx------ 1 root root 64 Nov  3 11:49 7 -> /var/log/dpkg.log
    lr-x------ 1 root root 64 Nov  3 11:49 8 -> /var/lib/dpkg/diversions

After `kill -9 4090` the original SSH session gets

    E: Sub-process /usr/bin/dpkg exited unexpectedly
    W: Operation was interrupted before it could finish

and dropped back to root prompt.  I then tried `dpkg --configure -a` and
it apparently went straight through:

    Setting up snapd (2.47.1+20.04) ...
    snapd.failure.service is a disabled or a static unit, not starting it.
    snapd.snap-repair.service is a disabled or a static unit, not starting it.

and then carried on setting up the other packages.  So I'm logging the
above in the hope that somebody can read more meaning into it than I
can.

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1868706

Title:
  Snapd postinst script hangs

To manage notifications about this bug go to:
https://bugs.launchpad.net/snapd/+bug/1868706/+subscriptions

-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to