Проблема с компилированием
Проблема с компилированием
Доброе время суток.
Пытаюсь скомпилить Редиректор 3.2.1 под ASP Linux 11
Библиотека pcre поставилась давно вместе с дистром:
[root@serv redirector-3.2.1]# rpm -qa | grep pcre
pcre-5.0-4.1.fc4
Squid у меня запускается под root:root (основной демон), потомки от squid:squid. Подправил переменные SQUID_USER и SQUID_GROUP на =root в обоих случаях.
Пытаюсь компилить:
[root@serv redirector-3.2.1]# make
rm -f pass.o raw_change.o load_cache.o pcre.o parse_input.o init_vars.o check_urls.o run_make_cache.o new_url.o redirect.o err_mes.o now.o get_opt.o parse_urls.o cache2url.o ip.o id.o comparing.o load_urls.o prune_urls.o write_cache.o need_cache_update.o err_mes.o now.o get_opt.o parse_urls.o cache2url.o ip.o id.o comparing.o redirector make-cache OUT
gcc -Wall -I/usr/include -I/usr/local/include -I/usr/include/pcre -c pass.c
pass.c:1:19: error: stdio.h: Нет такого файла или каталога
pass.c:2:20: error: string.h: Нет такого файла или каталога
In file included from pass.c:3:
vars.h:2:18: error: pcre.h: Нет такого файла или каталога
In file included from pass.c:3:
vars.h:49: error: syntax error before ‘*’ token
vars.h:49: warning: type defaults to ‘int’ in declaration of ‘change_log’
vars.h:49: warning: data definition has no type or storage class
vars.h:142: error: syntax error before ‘pcre’
vars.h:142: warning: no semicolon at end of struct or union
vars.h:143: warning: type defaults to ‘int’ in declaration of ‘ban_pcre_s’
vars.h:143: warning: data definition has no type or storage class
vars.h:149: error: syntax error before ‘}’ token
vars.h:149: warning: type defaults to ‘int’ in declaration of ‘redir’
vars.h:149: warning: data definition has no type or storage class
pass.c: In function ‘pass’:
pass.c:14: warning: implicit declaration of function ‘printf’
pass.c:14: warning: incompatible implicit declaration of built-in function ‘printf’
pass.c:15: warning: implicit declaration of function ‘fflush’
pass.c:15: error: ‘stdout’ undeclared (first use in this function)
pass.c:15: error: (Each undeclared identifier is reported only once
pass.c:15: error: for each function it appears in.)
make: *** [pass.o] Ошибка 1
В чем может быть проблема ? Спасибо.
Пытаюсь скомпилить Редиректор 3.2.1 под ASP Linux 11
Библиотека pcre поставилась давно вместе с дистром:
[root@serv redirector-3.2.1]# rpm -qa | grep pcre
pcre-5.0-4.1.fc4
Squid у меня запускается под root:root (основной демон), потомки от squid:squid. Подправил переменные SQUID_USER и SQUID_GROUP на =root в обоих случаях.
Пытаюсь компилить:
[root@serv redirector-3.2.1]# make
rm -f pass.o raw_change.o load_cache.o pcre.o parse_input.o init_vars.o check_urls.o run_make_cache.o new_url.o redirect.o err_mes.o now.o get_opt.o parse_urls.o cache2url.o ip.o id.o comparing.o load_urls.o prune_urls.o write_cache.o need_cache_update.o err_mes.o now.o get_opt.o parse_urls.o cache2url.o ip.o id.o comparing.o redirector make-cache OUT
gcc -Wall -I/usr/include -I/usr/local/include -I/usr/include/pcre -c pass.c
pass.c:1:19: error: stdio.h: Нет такого файла или каталога
pass.c:2:20: error: string.h: Нет такого файла или каталога
In file included from pass.c:3:
vars.h:2:18: error: pcre.h: Нет такого файла или каталога
In file included from pass.c:3:
vars.h:49: error: syntax error before ‘*’ token
vars.h:49: warning: type defaults to ‘int’ in declaration of ‘change_log’
vars.h:49: warning: data definition has no type or storage class
vars.h:142: error: syntax error before ‘pcre’
vars.h:142: warning: no semicolon at end of struct or union
vars.h:143: warning: type defaults to ‘int’ in declaration of ‘ban_pcre_s’
vars.h:143: warning: data definition has no type or storage class
vars.h:149: error: syntax error before ‘}’ token
vars.h:149: warning: type defaults to ‘int’ in declaration of ‘redir’
vars.h:149: warning: data definition has no type or storage class
pass.c: In function ‘pass’:
pass.c:14: warning: implicit declaration of function ‘printf’
pass.c:14: warning: incompatible implicit declaration of built-in function ‘printf’
pass.c:15: warning: implicit declaration of function ‘fflush’
pass.c:15: error: ‘stdout’ undeclared (first use in this function)
pass.c:15: error: (Each undeclared identifier is reported only once
pass.c:15: error: for each function it appears in.)
make: *** [pass.o] Ошибка 1
В чем может быть проблема ? Спасибо.
Установил pcre-devel
[root@serv redirector-3.2.1]# rpm -qa | grep pcre
pcre-5.0-4.1.fc4
pcre-devel-5.0-4.1.fc4
Компилирую, лог слегка видоизменился:
[root@serv redirector-3.2.1]# make
rm -f pass.o raw_change.o load_cache.o pcre.o parse_input.o init_vars.o check_urls.o run_make_cache.o new_url.o redirect.o err_mes.o now.o get_opt.o parse_urls.o cache2url.o ip.o id.o comparing.o load_urls.o prune_urls.o write_cache.o need_cache_update.o err_mes.o now.o get_opt.o parse_urls.o cache2url.o ip.o id.o comparing.o redirector make-cache OUT
gcc -Wall -I/usr/include -I/usr/local/include -I/usr/include/pcre -c pass.c
pass.c:1:19: error: stdio.h: Нет такого файла или каталога
pass.c:2:20: error: string.h: Нет такого файла или каталога
In file included from vars.h:2,
from pass.c:3:
/usr/include/pcre.h:69:20: error: stdlib.h: Нет такого файла или каталога
In file included from pass.c:3:
vars.h:49: error: syntax error before ‘*’ token
vars.h:49: warning: type defaults to ‘int’ in declaration of ‘change_log’
vars.h:49: warning: data definition has no type or storage class
pass.c: In function ‘pass’:
pass.c:14: warning: implicit declaration of function ‘printf’
pass.c:14: warning: incompatible implicit declaration of built-in function ‘printf’
pass.c:15: warning: implicit declaration of function ‘fflush’
pass.c:15: error: ‘stdout’ undeclared (first use in this function)
pass.c:15: error: (Each undeclared identifier is reported only once
pass.c:15: error: for each function it appears in.)
make: *** [pass.o] Ошибка 1
Замена на squid squid в Makefile ошибки компиляции не изменяет.
При инсталляции pcre-devel файл cpre.h пакет отынсталлил в /usr/include, до этого его (файла) вообще не было.
Файлы stdio.h и string.h поиском не находятся. Они тоже из пакета pcre ? Спасибо.
[root@serv redirector-3.2.1]# rpm -qa | grep pcre
pcre-5.0-4.1.fc4
pcre-devel-5.0-4.1.fc4
Компилирую, лог слегка видоизменился:
[root@serv redirector-3.2.1]# make
rm -f pass.o raw_change.o load_cache.o pcre.o parse_input.o init_vars.o check_urls.o run_make_cache.o new_url.o redirect.o err_mes.o now.o get_opt.o parse_urls.o cache2url.o ip.o id.o comparing.o load_urls.o prune_urls.o write_cache.o need_cache_update.o err_mes.o now.o get_opt.o parse_urls.o cache2url.o ip.o id.o comparing.o redirector make-cache OUT
gcc -Wall -I/usr/include -I/usr/local/include -I/usr/include/pcre -c pass.c
pass.c:1:19: error: stdio.h: Нет такого файла или каталога
pass.c:2:20: error: string.h: Нет такого файла или каталога
In file included from vars.h:2,
from pass.c:3:
/usr/include/pcre.h:69:20: error: stdlib.h: Нет такого файла или каталога
In file included from pass.c:3:
vars.h:49: error: syntax error before ‘*’ token
vars.h:49: warning: type defaults to ‘int’ in declaration of ‘change_log’
vars.h:49: warning: data definition has no type or storage class
pass.c: In function ‘pass’:
pass.c:14: warning: implicit declaration of function ‘printf’
pass.c:14: warning: incompatible implicit declaration of built-in function ‘printf’
pass.c:15: warning: implicit declaration of function ‘fflush’
pass.c:15: error: ‘stdout’ undeclared (first use in this function)
pass.c:15: error: (Each undeclared identifier is reported only once
pass.c:15: error: for each function it appears in.)
make: *** [pass.o] Ошибка 1
Замена на squid squid в Makefile ошибки компиляции не изменяет.
При инсталляции pcre-devel файл cpre.h пакет отынсталлил в /usr/include, до этого его (файла) вообще не было.
Файлы stdio.h и string.h поиском не находятся. Они тоже из пакета pcre ? Спасибо.
Странно.Slava писал(а):Это файлы из пакета glibc.
[root@serv RPMS]# rpm -qa | grep glibc
glibc-common-2.3.5-10.3asp
glibc-2.3.5-10.3asp
glibc-devel-2.3.5-10.3asp
посмотрел содержимое этих пакетов, ни в одном из них нет файлов stdio.h и string.h, более того нет вообще файлов на букву s
В какую сторону еще можно капнуть ? Спасибо.
Посмотрел на другой системе, где они были, какому пакету принадлежат, сейчас поищу этот пакет под свою версию glibc. Спасибо за помощь большое.Slava писал(а):Должно быть. Это стандартные библиотеки, без которых невозможно собрать ни одной программы на С.
Есть ещё kernel-headers, там тоже могут быть библиотеки.
[root@serv include]# rpm -q -f /usr/include/string.h
glibc-headers-2.3.3-27.1asp
[root@serv include]# rpm -q -f /usr/include/stdio.h
glibc-headers-2.3.3-27.1asp
[root@serv include]#
Поставил 
Redirector-check говорит что все ок
Теперь сквид мрет при старте, пока из конфига не уберешь строку redirect_program /usr/local/rejik3/redirector /usr/local/rejik3/redirector.conf
Sep 18 20:10:33 serv squid[17794]: Squid Parent: child process 17796 exited with status 0
Sep 18 20:10:46 serv popa3d[18002]: Authentication passed for rafael
Sep 18 20:10:46 serv popa3d[18002]: 0 messages (0 bytes) loaded
Sep 18 20:10:46 serv popa3d[18002]: 0 (0) deleted, 0 (0) left
Sep 18 20:11:04 serv squid[18016]: Squid Parent: child process 18018 started
Sep 18 20:11:04 serv (squid): The redirector helpers are crashing too rapidly, need help!
Sep 18 20:11:04 serv squid[18016]: Squid Parent: child process 18018 exited due to signal 6
Sep 18 20:11:07 serv squid[18016]: Squid Parent: child process 18029 started
Sep 18 20:11:07 serv (squid): The redirector helpers are crashing too rapidly, need help!
Sep 18 20:11:07 serv squid[18016]: Squid Parent: child process 18029 exited due to signal 6
Sep 18 20:11:10 serv squid[18016]: Squid Parent: child process 18038 started
Sep 18 20:11:10 serv (squid): The redirector helpers are crashing too rapidly, need help!
Sep 18 20:11:10 serv squid[18016]: Squid Parent: child process 18038 exited due to signal 6
Sep 18 20:11:13 serv squid[18016]: Squid Parent: child process 18048 started
Sep 18 20:11:14 serv (squid): The redirector helpers are crashing too rapidly, need help!
Sep 18 20:11:14 serv squid[18016]: Squid Parent: child process 18048 exited due to signal 6
Sep 18 20:11:17 serv squid[18016]: Squid Parent: child process 18057 started
Sep 18 20:1p 18 20:11:17 serv squid[18016]: Squid Parent: child process 18057 exited due to signal 6
Sep 18 20:11:17 serv squid[18016]: Exiting due to repeated, frequent failures

Redirector-check говорит что все ок
Теперь сквид мрет при старте, пока из конфига не уберешь строку redirect_program /usr/local/rejik3/redirector /usr/local/rejik3/redirector.conf
Sep 18 20:10:33 serv squid[17794]: Squid Parent: child process 17796 exited with status 0
Sep 18 20:10:46 serv popa3d[18002]: Authentication passed for rafael
Sep 18 20:10:46 serv popa3d[18002]: 0 messages (0 bytes) loaded
Sep 18 20:10:46 serv popa3d[18002]: 0 (0) deleted, 0 (0) left
Sep 18 20:11:04 serv squid[18016]: Squid Parent: child process 18018 started
Sep 18 20:11:04 serv (squid): The redirector helpers are crashing too rapidly, need help!
Sep 18 20:11:04 serv squid[18016]: Squid Parent: child process 18018 exited due to signal 6
Sep 18 20:11:07 serv squid[18016]: Squid Parent: child process 18029 started
Sep 18 20:11:07 serv (squid): The redirector helpers are crashing too rapidly, need help!
Sep 18 20:11:07 serv squid[18016]: Squid Parent: child process 18029 exited due to signal 6
Sep 18 20:11:10 serv squid[18016]: Squid Parent: child process 18038 started
Sep 18 20:11:10 serv (squid): The redirector helpers are crashing too rapidly, need help!
Sep 18 20:11:10 serv squid[18016]: Squid Parent: child process 18038 exited due to signal 6
Sep 18 20:11:13 serv squid[18016]: Squid Parent: child process 18048 started
Sep 18 20:11:14 serv (squid): The redirector helpers are crashing too rapidly, need help!
Sep 18 20:11:14 serv squid[18016]: Squid Parent: child process 18048 exited due to signal 6
Sep 18 20:11:17 serv squid[18016]: Squid Parent: child process 18057 started
Sep 18 20:1p 18 20:11:17 serv squid[18016]: Squid Parent: child process 18057 exited due to signal 6
Sep 18 20:11:17 serv squid[18016]: Exiting due to repeated, frequent failures
redirector.err:Slava писал(а):что говорит check-redirectir, что в redirector.err?
[root@serv rejik3]# cat redirector.err
2006-09-18 20:01:33 [17651] Run make-cache
2006-09-18 20:01:33 [17651] Make-cache finished
2006-09-18 20:01:33 [17651] Load 658 rules from /usr/local/rejik3/banlists/banners/urls.cache
2006-09-18 20:01:33 [17651] Load 8 pattern from BANNER pcre
2006-09-18 20:01:33 [17651] Load 22283 rules from /usr/local/rejik3/banlists/porno/urls.cache
2006-09-18 20:01:33 [17651] Load 5 pattern from MP3 pcre
2006-09-18 20:01:33 [17651] Load 1 rules from /usr/local/rejik3/banlists/js/urls.cache
2006-09-18 20:01:33 [17651] Redirector start and working
2006-09-18 20:09:31 [17959] Run make-cache
2006-09-18 20:09:31 [17959] Make-cache finished
2006-09-18 20:09:31 [17959] Load 658 rules from /usr/local/rejik3/banlists/banners/urls.cache
2006-09-18 20:09:31 [17959] Load 8 pattern from BANNER pcre
2006-09-18 20:09:31 [17959] Load 22283 rules from /usr/local/rejik3/banlists/porno/urls.cache
2006-09-18 20:09:31 [17959] Load 5 pattern from MP3 pcre
2006-09-18 20:09:31 [17959] Load 1 rules from /usr/local/rejik3/banlists/js/urls.cache
2006-09-18 20:09:31 [17959] Redirector start and working
redirector.log:
[root@serv rejik3]# cat redirector.log
2006-09-18 20:01:33 PORNO: 127.0.0.1 - http://sex.ru (urls rule: sex.ru)
2006-09-18 20:09:31 PORNO: 127.0.0.1 - http://sex.ru (urls rule: sex.ru)
[root@serv local]# su -m squid -c /usr/local/rejik3/redirector /usr/local/rejik3/redirector.conf
/usr/local/rejik3/redirector.conf: /usr/local/rejik3/redirector: Отказано в доступе
Все, победил
Забыл что основной процесс сквида запускается под рутом, а детки под сквидом. Изменил владельца каталогов на сквида и все поехало.
Спасибо за помощь
/usr/local/rejik3/redirector.conf: /usr/local/rejik3/redirector: Отказано в доступе
Все, победил

Спасибо за помощь