Поставил, настроил, запустил, работатет.
Перезапустил, не работает. Точнее, не запускается:
FATAL: Cannot open 'on' for writing.
The parent directory must be writeable by the
user 'squid', which is the cache_effective_user
set in squid.conf.
Squid Cache (Version 2.5.STABLE9): Terminated abnormally.
Это он пишет в cache.log, находящийся в /var/log/squid/logs
root@gw:~# ls -la /var/log/squid/logs/
total 171236
drwxr-xr-x 2 squid squid 4096 2005-04-26 10:41 ./
drwxr-xr-x 3 squid squid 4096 2005-04-26 10:35 ../
-rw-r--r-- 1 squid squid 71334486 2005-04-25 12:20 access.log
-rw-r--r-- 1 squid squid 476789 2005-04-26 10:41 cache.log
-rw-r--r-- 1 squid squid 103337773 2005-04-25 12:20 store.log
root@gw:~# cat /etc/squid/squid.conf|grep -v ^#|grep effective
cache_effective_user squid
cache_effective_group squid
Что ему нужно, а? Создавал ему этот 'on' не помогло :)
А что говорит такое ?
grep on /etc/squid/squid.conf|grep -v ^#
А если запускать через strace ? На консоль при запуске squid что-нибудь пишет (сообщения об ошибках) ?
В исходниках есть такое (src/logfile.c):
Logfile *
logfileOpen(const char *path, size_t bufsz, int fatal_flag)
{
int fd;
Logfile *lf;
fd = file_open(path, O_WRONLY | O_CREAT | O_TEXT);
if (DISK_ERROR == fd) {
if (ENOENT == errno && fatal_flag) {
fatalf("Cannot open '%s' because\n"
"\tthe parent directory does not exist.\n"
"\tPlease create the directory.\n", path);
} else if (EACCES == errno && fatal_flag) {
fatalf("Cannot open '%s' for writing.\n"
"\tThe parent directory must be writeable by the\n"
"\tuser '%s', which is the cache_effective_user\n"
"\tset in squid.conf.", path, Config.effectiveUser);
} else {
debug(50, 1) ("logfileOpen: %s: %s\n", path, xstrerror());
return NULL;
}
}
...
}
Что там в конфиге указано на счет логов ?
grep log squid.conf|grep -v ^#
есть у меня бааальшое подозрение, что в конфиге надо сказать не
useragent_log on , а useragent_log /full_path_to/useragent.log
, создать оный лог и пробровать запускать сквид.
Все верно, так и есть:
# TAG: useragent_log
# Note: This option is only available if Squid is rebuilt with the
# --enable-useragent-log option
#
# Squid will write the User-Agent field from HTTP requests
# to the filename specified here. By default useragent_log
# is disabled.
#
#Default:
# none
Ключевые слова: "to the filename specified here".