Форум русскоязычного сообщества Ubuntu


Увидели сообщение с непонятной ссылкой, спам, непристойность или оскорбление?
Воспользуйтесь ссылкой «Сообщить модератору» рядом с сообщением!

Автор Тема: squid -k rotate не ротейтит логи  (Прочитано 4831 раз)

0 Пользователей и 1 Гость просматривают эту тему.

Оффлайн bankir82

  • Автор темы
  • Новичок
  • *
  • Сообщений: 14
    • Просмотр профиля
squid -k rotate не ротейтит логи
« : 29 Ноября 2010, 18:28:58 »
Уважаемые, подскажите пожалуйста как заротейтить логи сквида squid -v
Squid Cache: Version 2.7.STABLE7
configure options:  '--prefix=/usr' '--exec_prefix=/usr' '--bindir=/usr/sbin' '--sbindir=/usr/sbin' '--libexecdir=/usr/lib/squid' '--sysconfdir=/etc/squid' '--localstatedir=/var/spool/squid' '--datadir=/usr/share/squid' '--enable-async-io' '--with-pthreads' '--enable-storeio=ufs,aufs,coss,diskd,null' '--enable-linux-netfilter' '--enable-arp-acl' '--enable-epoll' '--enable-removal-policies=lru,heap' '--enable-snmp' '--enable-delay-pools' '--enable-htcp' '--enable-cache-digests' '--enable-underscores' '--enable-referer-log' '--enable-useragent-log' '--enable-auth=basic,digest,ntlm,negotiate' '--enable-negotiate-auth-helpers=squid_kerb_auth' '--enable-carp' '--enable-follow-x-forwarded-for' '--with-large-files' '--with-maxfd=65536' 'i386-debian-linux' 'build_alias=i386-debian-linux' 'host_alias=i386-debian-linux' 'target_alias=i386-debian-linux' 'CFLAGS=-Wall -g -O2' 'LDFLAGS=-Wl,-Bsymbolic-functions' 'CPPFLAGS='
root@srv-vpn2:~#
Делаю squid -k rotate и ничего не происходит, в /var/log/cache.log выводит 2010/11/29 18:26:28| storeDirWriteCleanLogs: Starting...
2010/11/29 18:26:28|   Finished.  Wrote 349 entries.
2010/11/29 18:26:28|   Took 0.0 seconds (450322.6 entries/sec).
2010/11/29 18:26:28| logfileRotate: /var/log/squid/store.log
2010/11/29 18:26:28| logfileRotate (stdio): /var/log/squid/store.log
2010/11/29 18:26:28| logfileRotate: /var/log/squid/access.log
2010/11/29 18:26:28| logfileRotate (stdio): /var/log/squid/access.log
а файлы остаются старыми и с данными.
Хочу парсить данные из ротейтнутого лога и работать с ними, а тут такая засада.
Спасибо

Оффлайн fisher74

  • Заслуженный пользователь
  • Старожил
  • *
  • Сообщений: 13763
    • Просмотр профиля
Re: squid -k rotate не ротейтит логи
« Ответ #1 : 29 Ноября 2010, 20:54:41 »
grep logfile_rotate /etc/squid3/squid.conf

Оффлайн bankir82

  • Автор темы
  • Новичок
  • *
  • Сообщений: 14
    • Просмотр профиля
Re: squid -k rotate не ротейтит логи
« Ответ #2 : 29 Ноября 2010, 21:19:40 »
grep logfile_rotate /etc/squid/squid.conf
#  TAG: logfile_rotate
#       with extensions 0 through 9.  Setting logfile_rotate to 0 will
#       Note2, for Debian/Linux the default of logfile_rotate is
# logfile_rotate 0

Пользователь решил продолжить мысль 29 Ноября 2010, 21:36:12:
всё, въехал в чем дело
#  TAG: logfile_rotate
# Specifies the number of logfile rotations to make when you
# type 'squid -k rotate'.  The default is 10, which will rotate
# with extensions 0 through 9.  Setting logfile_rotate to 0 will
# disable the file name rotation, but the logfiles are still closed
# and re-opened.  This will enable you to rename the logfiles
# yourself just before sending the rotate signal.
#
# Note, the 'squid -k rotate' command normally sends a USR1
# signal to the running squid process.  In certain situations
# (e.g. on Linux with Async I/O), USR1 is used for other
# purposes, so -k rotate uses another signal.  It is best to get
# in the habit of using 'squid -k rotate' instead of 'kill -USR1
# <pid>'.
#
# Note2, for Debian/Linux the default of logfile_rotate is
# zero, since it includes external logfile-rotation methods.

Надо было изменить log_rotate в squid.conf, теперь по команде squid -k rotate логи ротейтятся.

Спасибо fisher74 за наводку :)
« Последнее редактирование: 29 Ноября 2010, 21:36:12 от bankir82 »

 

Страница сгенерирована за 0.027 секунд. Запросов: 24.