1 |
On Thu, 21 May 2020 11:20:18 +0100, Neil Bothwick wrote: |
2 |
|
3 |
> On Thu, 21 May 2020 06:44:35 +0200, Andreas Fink wrote: |
4 |
> |
5 |
> > recently emerge started to get stuck after an upgrade of dovecot, and |
6 |
> > it is somehow related to my /etc/portage/bashrc, which has the |
7 |
> > following content: function post_pkg_postinst() { |
8 |
> > if test "$CATEGORY/$PN" = "dev-db/mariadb"; then |
9 |
> > /etc/init.d/mysql status && /etc/init.d/mysql restart |
10 |
> > elif test "$CATEGORY/$PN" = "www-servers/apache"; then |
11 |
> > /etc/init.d/apache2 status && /etc/init.d/apache2 restart |
12 |
> > elif test "$CATEGORY/$PN" = "net-mail/dovecot"; then |
13 |
> > /etc/init.d/dovecot status && /etc/init.d/dovecot restart |
14 |
> > echo 'going to sleep' |
15 |
> > sleep 5 |
16 |
> > echo 'finished sleeping' |
17 |
> > elif test "$CATEGORY/$PN" = "mail-mta/postfix"; then |
18 |
> > /etc/init.d/postfix status && /etc/init.d/postfix restart |
19 |
> > elif test "$CATEGORY/$PN" = "net-misc/openssh"; then |
20 |
> > /etc/init.d/sshd status && /etc/init.d/sshd restart |
21 |
> > fi |
22 |
> > } |
23 |
> > |
24 |
> > |
25 |
> > I restart dovecot after an upgrade, in the same way as I restart e.g. |
26 |
> > postfix. However for dovecot emerge gets stuck and does not continue |
27 |
> > and is sitting there quietly (killable only via `pkill -9 emerge`). |
28 |
> |
29 |
> I can confirm this. I tried your bashrc (nice idea by the way, I |
30 |
> normally manually run needrestart after an update) and the dovecot |
31 |
> install completed but then hung. The next step is to add set +x to |
32 |
> bashrc to see where the hang occurs. |
33 |
|
34 |
It seems the final echo is executed, but then the function doesn't exit |
35 |
for some reason. I tried rewriting it using case, which looks cleaner to |
36 |
me but fails in the same way. |
37 |
|
38 |
|
39 |
function post_pkg_postinst() { |
40 |
set +x |
41 |
case "$CATEGORY/$PN" in |
42 |
"net-mail/dovecot") |
43 |
/etc/init.d/dovecot status && /etc/init.d/dovecot restart |
44 |
echo 'going to sleep' |
45 |
sleep 5 |
46 |
echo 'finished sleeping' |
47 |
;; |
48 |
|
49 |
"mail-mta/postfix") |
50 |
/etc/init.d/postfix status && /etc/init.d/postfix restart |
51 |
;; |
52 |
esac |
53 |
} |
54 |
|
55 |
|
56 |
-- |
57 |
Neil Bothwick |
58 |
|
59 |
Vuja De: the feeling that you've never been here before. |