setup-apkcache hangs on non-existent directory
I’ve tried to regenerate apk’s cache with setup-apkcache passing invalid path (to non-existent directory) as an argument, like this:
localhost:~# setup-apkcache /ponies
The command doesn’t return to prompt, doesn’t print any error message about invalid argument. It just sits there, doing apparently nothing.
“top” shows that it consumes 50% of CPU time. “ps -A” returns:
1552 root 0:00 {setup-apkcache} /bin/sh /sbin/setup-apkcache /ponies
1555 root 1:26 {setup-apkcache} /bin/sh /sbin/setup-apkcache /ponies
(two setup-apkcache processes for one command issued).
With valid dir path provided as argument, the command completes in a fraction of a second, and APKINDEX is stored correctly in specified location after issuing “apk update”.
Linux 3.14.30-0-grsec #1-Alpine SMP, x86_64
Alpine Linux 3.1
VERSION_ID=3.1.2
(from redmine: issue id 3976, created on 2015-03-10, closed on 2015-03-20)
- Changesets:
- Revision b0b109a06f1f890b8833c6afa38c357a084c65bc by Natanael Copa on 2015-03-19T12:44:41Z:
setup-apkcache: fix infinite loop when non-existing dir specified
to reproduce: setup-apkcache /ponies
ref #3976
- Revision 8751d8ee by Natanael Copa on 2015-03-19T13:47:18Z:
main/alpine-conf: fix setup-apkcache
ref #3976
- Revision 888b332e by Natanael Copa on 2015-03-19T13:50:13Z:
main/alpine-conf: fix setup-apkcache
fixes #3976
(cherry picked from commit 8751d8eebf4ec79352ab99ea542e4ff8e7611ff1)