1 |
On Thu, 21 May 2020 12:54:49 +0100 |
2 |
Neil Bothwick <neil@××××××××××.uk> wrote: |
3 |
|
4 |
> On Thu, 21 May 2020 11:20:18 +0100, Neil Bothwick wrote: |
5 |
> |
6 |
> > On Thu, 21 May 2020 06:44:35 +0200, Andreas Fink wrote: |
7 |
> > |
8 |
> > > recently emerge started to get stuck after an upgrade of dovecot, and |
9 |
> > > it is somehow related to my /etc/portage/bashrc, which has the |
10 |
> > > following content: function post_pkg_postinst() { |
11 |
> > > if test "$CATEGORY/$PN" = "dev-db/mariadb"; then |
12 |
> > > /etc/init.d/mysql status && /etc/init.d/mysql restart |
13 |
> > > elif test "$CATEGORY/$PN" = "www-servers/apache"; then |
14 |
> > > /etc/init.d/apache2 status && /etc/init.d/apache2 restart |
15 |
> > > elif test "$CATEGORY/$PN" = "net-mail/dovecot"; then |
16 |
> > > /etc/init.d/dovecot status && /etc/init.d/dovecot restart |
17 |
> > > echo 'going to sleep' |
18 |
> > > sleep 5 |
19 |
> > > echo 'finished sleeping' |
20 |
> > > elif test "$CATEGORY/$PN" = "mail-mta/postfix"; then |
21 |
> > > /etc/init.d/postfix status && /etc/init.d/postfix restart |
22 |
> > > elif test "$CATEGORY/$PN" = "net-misc/openssh"; then |
23 |
> > > /etc/init.d/sshd status && /etc/init.d/sshd restart |
24 |
> > > fi |
25 |
> > > } |
26 |
> > > |
27 |
> > > |
28 |
> > > I restart dovecot after an upgrade, in the same way as I restart e.g. |
29 |
> > > postfix. However for dovecot emerge gets stuck and does not continue |
30 |
> > > and is sitting there quietly (killable only via `pkill -9 emerge`). |
31 |
> > |
32 |
> > I can confirm this. I tried your bashrc (nice idea by the way, I |
33 |
> > normally manually run needrestart after an update) and the dovecot |
34 |
> > install completed but then hung. The next step is to add set +x to |
35 |
> > bashrc to see where the hang occurs. |
36 |
> |
37 |
> It seems the final echo is executed, but then the function doesn't exit |
38 |
> for some reason. I tried rewriting it using case, which looks cleaner to |
39 |
> me but fails in the same way. |
40 |
> |
41 |
> |
42 |
> function post_pkg_postinst() { |
43 |
> set +x |
44 |
> case "$CATEGORY/$PN" in |
45 |
> "net-mail/dovecot") |
46 |
> /etc/init.d/dovecot status && /etc/init.d/dovecot restart |
47 |
> echo 'going to sleep' |
48 |
> sleep 5 |
49 |
> echo 'finished sleeping' |
50 |
> ;; |
51 |
> |
52 |
> "mail-mta/postfix") |
53 |
> /etc/init.d/postfix status && /etc/init.d/postfix restart |
54 |
> ;; |
55 |
> esac |
56 |
> } |
57 |
> |
58 |
> |
59 |
|
60 |
I do not think that it is stuck in the bashrc itself, but something that happens in the |
61 |
bashrc makes the emerge python process not realizing that everything finished. These are |
62 |
the interesting running processes after the command |
63 |
`ebuild /usr/portage/net-mail/dovecot/dovecot-2.3.10.1.ebuild qmerge` |
64 |
gets stuck (I cannot see any bash still running, that's why I assume that the bashrc itself finishes): |
65 |
root 5281 2.0 0.7 71060 63412 pts/0 SN+ 16:19 0:01 /usr/bin/python3.7 -b /usr/lib/python-exec/python3.7/ebuild /usr/portage/net-mail/dovecot/dovecot-2.3.10.1.ebuild qmerge |
66 |
root 5286 8.5 0.0 0 0 pts/0 ZN+ 16:19 0:06 [ebuild] <defunct> |
67 |
root 5869 0.0 0.0 4284 2388 ? SNs 16:19 0:00 /usr/sbin/dovecot -c /etc/dovecot/dovecot.conf |
68 |
root 5876 0.0 0.0 4152 2620 ? SN 16:19 0:00 dovecot/log |
69 |
root 5879 0.0 0.0 6236 4568 ? SN 16:19 0:00 dovecot/config |
70 |
root 5883 0.0 0.0 19632 8048 ? SN 16:19 0:00 dovecot/auth |
71 |
|
72 |
Cheers |
73 |
Andreas |