Jump to content
Калькуляторы

TProxy, Lusca не компилируется

Доброго времени суток,

 

Никак не могу скомпилировать Lusca с включенным TProxy (пробовал разные линуксы, ядра):

./configure --prefix=/usr/local/squid  --enable-storeio=aufs --w~--enable-large-cache-files --enable-snmp --enable-linux-tproxy4
Все Ok

make all
...
comm_ips_tproxy4.c: In function ‘comm_ips_restoreCapabilities’:
comm_ips_tproxy4.c:95: error: ‘cap_user_header_t’ undeclared (first use in this function)
comm_ips_tproxy4.c:95: error: (Each undeclared identifier is reported only once
comm_ips_tproxy4.c:95: error: for each function it appears in.)
comm_ips_tproxy4.c:95: error: expected ‘;’ before ‘head’
comm_ips_tproxy4.c:96: error: ‘cap_user_data_t’ undeclared (first use in this function)
comm_ips_tproxy4.c:96: error: expected ‘;’ before ‘cap’
comm_ips_tproxy4.c:98: error: ‘head’ undeclared (first use in this function)
comm_ips_tproxy4.c:98: error: ‘_LINUX_CAPABILITY_VERSION’ undeclared (first use in this function)
comm_ips_tproxy4.c:99: warning: implicit declaration of function ‘capget’
comm_ips_tproxy4.c:99: error: ‘cap’ undeclared (first use in this function)
comm_ips_tproxy4.c:110: error: ‘CAP_NET_BIND_SERVICE’ undeclared (first use in this function)
comm_ips_tproxy4.c:112: error: ‘CAP_NET_ADMIN’ undeclared (first use in this function)
comm_ips_tproxy4.c:112: error: ‘CAP_NET_BROADCAST’ undeclared (first use in this function)
comm_ips_tproxy4.c:115: warning: implicit declaration of function ‘capset’
make[1]: *** [comm_ips_tproxy4.o] Error 1
make[1]: Leaving directory `/root/LUSCA_HEAD-r14809/libiapp'
make: *** [all-recursive] Error 1

 

Какая-то фигня, то ли с кодировкой что-то, какие-то символы непонятные вылезают. Гугл ничего про это не знает... Что я делаю не так?

 

root@server:~/LUSCA_HEAD-r14809# uname -a
Linux server 2.6.32-5-686 #1 SMP Mon Sep 23 23:00:18 UTC 2013 i686 GNU/Linux

Share this post


Link to post
Share on other sites

поставил libcap - same shit:

 

Making all in libiapp
make[1]: Entering directory `/root/LUSCA_HEAD-r14809/libiapp'
source='comm_ips_tproxy4.c' object='comm_ips_tproxy4.o' libtool=no \
       DEPDIR=.deps depmode=none /bin/bash ../cfgaux/depcomp \
       gcc -DHAVE_CONFIG_H -I. -I. -I../include     -m32 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -Wall -g -O2 -D_REENTRANT -c comm_ips_tproxy4.c
comm_ips_tproxy4.c: In function ‘comm_ips_restoreCapabilities’:
comm_ips_tproxy4.c:95: error: ‘cap_user_header_t’ undeclared (first use in this function)
comm_ips_tproxy4.c:95: error: (Each undeclared identifier is reported only once
comm_ips_tproxy4.c:95: error: for each function it appears in.)
comm_ips_tproxy4.c:95: error: expected ‘;’ before ‘head’
comm_ips_tproxy4.c:96: error: ‘cap_user_data_t’ undeclared (first use in this function)
comm_ips_tproxy4.c:96: error: expected ‘;’ before ‘cap’
comm_ips_tproxy4.c:98: error: ‘head’ undeclared (first use in this function)
comm_ips_tproxy4.c:98: error: ‘_LINUX_CAPABILITY_VERSION’ undeclared (first use in this function)
comm_ips_tproxy4.c:99: warning: implicit declaration of function ‘capget’
comm_ips_tproxy4.c:99: error: ‘cap’ undeclared (first use in this function)
comm_ips_tproxy4.c:110: error: ‘CAP_NET_BIND_SERVICE’ undeclared (first use in this function)
comm_ips_tproxy4.c:112: error: ‘CAP_NET_ADMIN’ undeclared (first use in this function)
comm_ips_tproxy4.c:112: error: ‘CAP_NET_BROADCAST’ undeclared (first use in this function)
comm_ips_tproxy4.c:115: warning: implicit declaration of function ‘capset’
make[1]: *** [comm_ips_tproxy4.o] Error 1
make[1]: Leaving directory `/root/LUSCA_HEAD-r14809/libiapp'
make: *** [all-recursive] Error 1

Share this post


Link to post
Share on other sites

libcap заголовки тоже?

Файлик /usr/include/sys/capability.h есть?

 

Там должен быть "typedef struct __user_cap_header_struct {

<------>__u32 version;

<------>int pid;

} *cap_user_header_t;"

Share this post


Link to post
Share on other sites

libcap заголовки тоже?

Файлик /usr/include/sys/capability.h есть?

 

Там должен быть "typedef struct __user_cap_header_struct {

<------>__u32 version;

<------>int pid;

} *cap_user_header_t;"

 

root@server:~/LUSCA_HEAD-r14809# ls /usr/include/sys/capability.h

ls: cannot access /usr/include/sys/capability.h: No such file or directory

 

apt-get install libcap-dev

 

root@server:~/LUSCA_HEAD-r14809# ls /usr/include/sys/capability.h

/usr/include/sys/capability.h

 

root@server:~/LUSCA_HEAD-r14809# cat /usr/include/sys/capability.h | grep user_cap_header_struct

пусто

 

make all

 

make[1]: Entering directory `/root/LUSCA_HEAD-r14809/libiapp'
if gcc -DHAVE_CONFIG_H -I. -I. -I../include     -m32 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -Wall -g -O2 -D_REENTRANT -MT comm_ips_tproxy4.o -MD -MP -MF ".deps/comm_ips_tproxy4.Tpo" -c -o comm_ips_tproxy4.o comm_ips_tproxy4.c; \
       then mv -f ".deps/comm_ips_tproxy4.Tpo" ".deps/comm_ips_tproxy4.Po"; else rm -f ".deps/comm_ips_tproxy4.Tpo"; exit 1; fi
comm_ips_tproxy4.c: In function ‘comm_ips_restoreCapabilities’:
comm_ips_tproxy4.c:95: error: ‘cap_user_header_t’ undeclared (first use in this function)
comm_ips_tproxy4.c:95: error: (Each undeclared identifier is reported only once
comm_ips_tproxy4.c:95: error: for each function it appears in.)
comm_ips_tproxy4.c:95: error: expected ‘;’ before ‘head’
comm_ips_tproxy4.c:96: error: ‘cap_user_data_t’ undeclared (first use in this function)
comm_ips_tproxy4.c:96: error: expected ‘;’ before ‘cap’
comm_ips_tproxy4.c:98: error: ‘head’ undeclared (first use in this function)
comm_ips_tproxy4.c:98: error: ‘_LINUX_CAPABILITY_VERSION’ undeclared (first use in this function)
comm_ips_tproxy4.c:99: warning: implicit declaration of function ‘capget’
comm_ips_tproxy4.c:99: error: ‘cap’ undeclared (first use in this function)
comm_ips_tproxy4.c:110: error: ‘CAP_NET_BIND_SERVICE’ undeclared (first use in this function)
comm_ips_tproxy4.c:112: error: ‘CAP_NET_ADMIN’ undeclared (first use in this function)
comm_ips_tproxy4.c:112: error: ‘CAP_NET_BROADCAST’ undeclared (first use in this function)
comm_ips_tproxy4.c:115: warning: implicit declaration of function ‘capset’
make[1]: *** [comm_ips_tproxy4.o] Error 1
make[1]: Leaving directory `/root/LUSCA_HEAD-r14809/libiapp'
make: *** [all-recursive] Error 1

 

Методом перебора обнаружил что на lenny (с ядром 2.6.26) прекрасно компилируется... Однако, хотелось бы на чем-то не таком древнем.

Share this post


Link to post
Share on other sites

это всё в /usr/include/linux/capability.h, это ядерные хеадеры

Edited by f13

Share this post


Link to post
Share on other sites

Скорее всего из-за того, что lusca перестали обновлять. Нужно искать кого-то, кто подправит сырки.

Share this post


Link to post
Share on other sites

Получилось поднять работающий tproxy (последний lusca - LUSCA_HEAD-r14809) на последнем squeeze:

cat /etc/debian_version
6.0.9

 

с дефолтным ядром и iptables:

uname -a
Linux tproxy 2.6.32-5-686 #1

iptables -h
iptables v1.4.8

 

Оказалось, что после установки пакетов libcap-dev libpcap-dev нужно сделать... reboot!!!

тогда make all не дает ошибки:

make[1]: Entering directory `/root/LUSCA_HEAD-r14809/libiapp'
if gcc -DHAVE_CONFIG_H -I. -I. -I../include     -m32 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -Wall -g -O2 -D_REENTRANT -MT comm_ips_tproxy4.o -MD -MP -MF ".deps/comm_ips_tproxy4.Tpo" -c -o comm_ips_tproxy4.o comm_ips_tproxy4.c; \
       then mv -f ".deps/comm_ips_tproxy4.Tpo" ".deps/comm_ips_tproxy4.Po"; else rm -f ".deps/comm_ips_tproxy4.Tpo"; exit 1; fi
comm_ips_tproxy4.c: In function ‘comm_ips_restoreCapabilities’:
comm_ips_tproxy4.c:95: error: ‘cap_user_header_t’ undeclared (first use in this function)
comm_ips_tproxy4.c:95: error: (Each undeclared identifier is reported only once
comm_ips_tproxy4.c:95: error: for each function it appears in.)
comm_ips_tproxy4.c:95: error: expected ‘;’ before ‘head’
comm_ips_tproxy4.c:96: error: ‘cap_user_data_t’ undeclared (first use in this function)
comm_ips_tproxy4.c:96: error: expected ‘;’ before ‘cap’
comm_ips_tproxy4.c:98: error: ‘head’ undeclared (first use in this function)
comm_ips_tproxy4.c:98: error: ‘_LINUX_CAPABILITY_VERSION’ undeclared (first use in this function)
comm_ips_tproxy4.c:99: warning: implicit declaration of function ‘capget’
comm_ips_tproxy4.c:99: error: ‘cap’ undeclared (first use in this function)
comm_ips_tproxy4.c:110: error: ‘CAP_NET_BIND_SERVICE’ undeclared (first use in this function)
comm_ips_tproxy4.c:112: error: ‘CAP_NET_ADMIN’ undeclared (first use in this function)
comm_ips_tproxy4.c:112: error: ‘CAP_NET_BROADCAST’ undeclared (first use in this function)
comm_ips_tproxy4.c:115: warning: implicit declaration of function ‘capset’
make[1]: *** [comm_ips_tproxy4.o] Error 1
make[1]: Leaving directory `/root/LUSCA_HEAD-r14809/libiapp'
make: *** [all-recursive] Error 1

 

и все прекрасно работает.

Share this post


Link to post
Share on other sites

А ldconfig вместо ребута не пробовали?

Share this post


Link to post
Share on other sites

да я и ребут не особо "пробовал"... так в отчаянии зашатдаунил вечером сервер, а утром почему то решил еще раз проверить - оказалось все работает!

Share this post


Link to post
Share on other sites

Что по поводу кэширования видео? все файлы идут в кэш, или только какие-то расширения?

 

 

Какая эффективность LUSCA при кэшировании видео youtube/vk/facebook ?

Что скажете по такой реализации LUSCA -> http://bandi-tech.blogspot.com/2013/07/cara-install-dan-konfigurasi-lusca-head.html

Share this post


Link to post
Share on other sites

^rage^, Вы используете squid в качестве кэширующего сервера ? Как обстоят дела с видео контентом youtube/vk/ok/ И другие ?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this