Jayad / enterprise-log-search-and-archive

Automatically exported from code.google.com/p/enterprise-log-search-and-archive
0 stars 0 forks source link

install.sh uses curl without -L #206

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
- - - - What steps will reproduce the problem?

so... found something else with ELSA failing to install properly... looks like 
eventlog and syslog-ng isn't being downloaded properly... the install script 
(install.sh) uses: curl 
"http://www.balabit.com/downloads/files/syslog-ng/open-source-edition/3.2.4/sour
ce/eventlog_0.2.12.tar.gz" > "eventlog_0.2.12.tar.gz"

example:

[root@stlabvnode05 elsa]# curl 
"http://www.balabit.com/downloads/files/syslog-ng/open-source-edition/3.2.4/sour
ce/eventlog_0.2.12.tar.gz" > "eventlog_0.2.12.tar.gz"
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0    20    0    20    0     0     28      0 --:--:-- --:--:-- --:--:--    29
[root@stlabvnode05 elsa]# ls -al
drwxr-xr-x   3 root root  4096 Mar 12 04:52 .
dr-xr-x---. 10 root root  4096 Mar 12 04:52 ..
-rw-r--r--   1 root root    20 Mar 12 04:52 eventlog_0.2.12.tar.gz
-rw-r--r--   1 root root 73851 Jan 26 23:27 install.sh
drwxr-xr-x  14 root root  4096 Mar 12 04:46 syslog-ng-3.2.4
-rw-r--r--   1 root root    20 Mar 12 04:55 syslog-ng_3.2.4.tar.gz

- - - -  What is the expected output? What do you see instead?

But if you look at the files... it's actually empty (eventlog and syslog-ng) 

[root@stlabvnode05 elsa]# hexdump -C eventlog_0.2.12.tar.gz 
00000000  1f 8b 08 00 00 00 00 00  00 03 03 00 00 00 00 00  |................|
00000010  00 00 00 00                                       |....|
00000014
[root@stlabvnode05 elsa]# hexdump -C syslog-ng_3.2.4.tar.gz 
00000000  1f 8b 08 00 00 00 00 00  00 03 03 00 00 00 00 00  |................|
00000010  00 00 00 00                                       |....|
00000014

So, the install script is using curl ... which should work... even with the 
redirection to file (even curl man page says to use redir > or -o )...

But if we look at tcpdump we can see that balabit.com responds with a 302 found 
redirect:

GET 
/downloads/files/syslog-ng/open-source-edition/3.2.4/source/syslog-ng_3.2.4.tar.
gz HTTP/1.1
User-Agent: curl/7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/3.14.0.0 
zlib/1.2.3 libidn/1.18 libssh2/1.4.2
Host: www.balabit.com
Accept: */*

Cache-Control: no-cache, must-revalidate, post-check=0, pre-check=0
ETag: "1394600388"
Location: 
https://balabit-www.s3.amazonaws.com/syslog-ng/open-source-edition/3.2.4/source/
syslog-ng_3.2.4.tar.gz?AWSAccessKeyId=AKIAICTJ5MANGPMOH7JA&Expires=1394600509&Si
gnature=6A0hZud7pJd3KTHdGkd9LBMdbZc%3D
Vary: Accept-Encoding
Content-Encoding: gzip
CF-RAY: 109d6cb48efc0098-IAD

so the install.sh should be using -L to follow the redirect and it is not... 
hence the reason why ELSA install is breaking...

- - - - What version of the product are you using? On what operating system?

Recent install.sh, on CentOS 6.5

Please provide any additional information below.

Just need to add -L option to follow redirects in the curl command...

Original issue reported on code.google.com by amint...@gmail.com on 12 Mar 2014 at 5:20

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
temporarily you can do this to get stuff installed on:

wget 
http://enterprise-log-search-and-archive.googlecode.com/svn/trunk/elsa/contrib/i
nstall.sh
sed -i -E 's#^USE_LOCAL_INSTALL="0"#USE_LOCAL_INSTALL="1"#' install.sh
sed -i -E 's#curl "http://www\.balabit\.com#curl -L 
"http://www\.balabit\.com#g' install.sh
sudo sh -c "sh install.sh node" && sudo sh -c "sh install.sh web"

Original comment by amint...@gmail.com on 14 Mar 2014 at 11:52