最近,我在运行 Debian Linux 的服务器上删除了 nginx,从那时起,我每天都会收到以下电子邮件:
root@server:~# tail /var/mail/root
Content-Type: text/plain; charset=UTF-8
X-Cron-Env: <SHELL=/bin/sh>
X-Cron-Env: <PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin>
X-Cron-Env: <HOME=/root>
X-Cron-Env: <LOGNAME=root>
/etc/cron.daily/logrotate:
error: error running shared postrotate script for '/var/log/nginx/*.log '
run-parts: /etc/cron.daily/logrotate exited with return code 1
在某些情况下,使用 删除软件会有所帮助dpkg --purge
,但在这种情况下,配置文件似乎放在其他地方,不会被 dpkg 删除。我还浏览了logrotate
我能找到的每个配置文件,但找不到任何有关 nginx 的内容。
以下是我的/etc/cron.daily/logrotate
(没什么特别的):
#!/bin/sh
test -x /usr/sbin/logrotate || exit 0
/usr/sbin/logrotate /etc/logrotate.conf
这是我的/etc/logrotate.conf
(我认为 nginx 应该列在这里?):
# see "man logrotate" for details
# rotate log files weekly
weekly
# keep 4 weeks worth of backlogs
rotate 4
# create new (empty) log files after rotating old ones
create
# uncomment this if you want your log files compressed
#compress
# packages drop log rotation information into this directory
include /etc/logrotate.d
# no packages own wtmp, or btmp -- we'll rotate them here
/var/log/wtmp {
missingok
monthly
create 0664 root utmp
rotate 1
}
/var/log/btmp {
missingok
monthly
create 0660 root utmp
rotate 1
}
# system-specific logs may be configured here
还有链接目录/etc/logrotate.d
:
root@server:~# ls -la /etc/logrotate.d
total 40
drwxr-xr-x 2 root root 4096 Apr 19 00:33 .
drwxr-xr-x 76 root root 4096 Mai 28 14:44 ..
-rw-r--r-- 1 root root 326 Mär 4 2013 apache2
-rw-r--r-- 1 root root 173 Nov 16 2013 apt
-rw-r--r-- 1 root root 79 Nov 7 2012 aptitude
-rw-r--r-- 1 root root 232 Okt 1 2013 dpkg
-rw-r--r-- 1 root root 880 Jan 20 16:36 mysql-server
-rw-r--r-- 1 root root 163 Feb 17 10:32 php5-fpm
-rw-r--r-- 1 root root 799 Sep 28 2013 proftpd-basic
-rw-r--r-- 1 root root 515 Mär 5 2013 rsyslog
那么 nginx 的配置文件在哪里?我认为删除这样的配置文件可以解决我的问题吗?