Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I am running CentOS release 6.3 (Final). This issue occurs for every VM on my server. When connected over SSH, wget hangs after download certain URLs.

I am running the following command:

wget --no-http-keep-alive -O test http://downloads.sourceforge.net/project/nagiosplug/nagiosplug/1.4.16/nagios-plugins-1.4.16.tar.gz?r=http%3A%2F%2Fwww.nagios.org%2Fdownload%2Fplugins%2F

If I run strace on wget I get the following output at the end:

clock_gettime(CLOCK_MONOTONIC, {2670737, 421643851}) = 0
write(3, "\316\206\257'\323\4\241\262\322\"\326I\236\37\327\365\27295\310\t\210\"\212$\350[\214\346\177$\320"..., 745) = 745
write(2, ".", 1.)                        = 1
write(2, " ", 1 )                        = 1
write(2, " ", 1 )                        = 1
write(2, " ", 1 )                        = 1
write(2, " ", 1 )                        = 1
write(2, " ", 1 )                        = 1
write(2, " ", 1 )                        = 1
write(2, " ", 1 )                        = 1
write(2, " ", 1 )                        = 1
write(2, " ", 1 )                        = 1
write(2, " ", 1 )                        = 1
write(2, " ", 1 )                        = 1
write(2, " ", 1 )                        = 1
write(2, " ", 1 )                        = 1
write(2, "100%", 4100%)                     = 4
write(2, "  508K", 6  508K)                   = 6
write(2, "=4.3s", 5=4.3s)                    = 5
write(2, "\n\n", 2

)                     = 2
close(5)                                = 0
time(NULL)                              = 1365435671
stat64("/etc/localtime", {st_mode=S_IFREG|0644, st_size=3424, ...}) = 0
time(NULL)                              = 1365435671
utime("test", [2013/04/08-12:41:11, 2012/06/27-14:39:15]) = 0
write(2, "2013-04-08 12:41:11 (478 KB/s) -"..., 692013-04-08 12:41:11 (478 KB/s) - “test” saved [2087089/2087089]

) = 69
close(2)                                = 0
close(3)                                = 0
munmap(0xb77fb000, 4096)                = 0
exit_group(0)                           = ?

Best I can tell, the file has completely finished downloading. Sending a command interrupt kills wget and the file is intact.

This is very inconvenient and is causing issues with automated scripts.

share|improve this question
add comment

1 Answer 1

up vote 2 down vote accepted

Use quotes:

wget --no-http-keep-alive -O test "http://downloads.sourceforge.net/project/nagiosplug/nagiosplug/1.4.16/nagios-plugins-1.4.16.tar.gz?r=http%3A%2F%2Fwww.nagios.org%2Fdownload%2Fplugins%2F"
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.