web-dev-qa-db-ja.com

ファイルモードが正しくないため、/ etc / logrotate.confを無視します

Logrotateを実行するにはどうすればよいですか、logrotateを実行しても効果がありません

root@me-Latitude-E5550:/etc/logrotate.d# cd ..
root@me-Latitude-E5550:/etc# cd ..
root@me-Latitude-E5550:/# logrotate -d /etc/logrotate.conf
Ignoring /etc/logrotate.conf because of bad file mode.

Handling 0 logs
root@me-Latitude-E5550:/# chmod 644 /etc/logrotate.d/*
root@me-Latitude-E5550:/# cd /etc/logrotate.d
root@me-Latitude-E5550:/etc/logrotate.d# ls
apport       custom   pm-utils  speech-dispatcher    upstart
apt          dpkg     ppp       ufw
cups-daemon  lightdm  rsyslog   unattended-upgrades
root@me-Latitude-E5550:/etc/logrotate.d# cd ..
root@me-Latitude-E5550:/etc# cd ..
root@me-Latitude-E5550:/# logrotate -d /etc/logrotate.conf
Ignoring /etc/logrotate.conf because of bad file mode.

Handling 0 logs
root@me-Latitude-E5550:/# cd /var/log
root@me-Latitude-E5550:/var/log# ls -larth
total 34M
drwxrwxrwx  2 root root   4,0K Feb 18  2016 speech-dispatcher
drwxrwxrwx  2 root root   4,0K Mai 19  2016 upstart
drwxrwxrwx  2 root root   4,0K Jul 19  2016 fsck
-rwxrwxrwx  1 root root     31 Jul 19  2016 dmesg
-rwxrwxrwx  1 root root    57K Jul 19  2016 bootstrap.log
drwxrwxrwx  3 root root   4,0K Jul 19  2016 hp
drwxr-xr-x 14 root root   4,0K Jul 19  2016 ..
drwxrwxrwx  2 root root   4,0K Jun 14 13:17 apt
drwxrwxrwx  2 root root   4,0K Jun 14 13:20 installer
drwxrwxrwx  2 root root   4,0K Jun 19 09:50 unattended-upgrades
-rwxrwxrwx  1 root root   3,8K Jun 19 09:55 fontconfig.log
-rwxrwxrwx  1 root root    554 Jun 19 15:02 apport.log.1
drwxrwxrwx  2 root root   4,0K Jun 20 07:35 lightdm
-rwxrwxrwx  1 root root   836K Jun 20 07:35 syslog.1
-rwxrwxrwx  1 root root    32K Jun 20 14:31 faillog
-rw-------  1 root utmp    768 Jul 14 09:28 btmp
drwxrwxrwx  2 root root   4,0K Jul 14 10:38 dist-upgrade
-rwxrwxrwx  1 root root    43K Jul 14 10:45 alternatives.log
-rwxrwxrwx  1 root root   286K Jul 14 11:04 lastlog
drwxrwxrwx  2 root root   4,0K Jul 18 08:59 sysstat
-rwxrwxrwx  1 root root   1,8M Jul 18 11:13 dpkg.log
drwxrwxrwx  2 root root   4,0K Jul 18 12:19 cups
-rw-r-----  1 root adm     14K Jul 18 12:20 apport.log
-rw-r--r--  1 root root    32K Jul 18 18:38 Xorg.0.log.old
-rwxrwxrwx  1 root root   1,9K Jul 18 18:44 gpu-manager.log
-rw-r--r--  1 root root   1009 Jul 18 18:44 boot.log
drwxrwxr-x 13 root syslog 4,0K Jul 18 18:44 .
-rw-rw-r--  1 root utmp    85K Jul 18 18:45 wtmp
-rw-r--r--  1 root root    29K Jul 18 21:17 Xorg.0.log
-rwxrwxrwx  1 root root   5,7M Jul 18 21:18 kern.log
-rwxrwxrwx  1 root root   580K Jul 18 21:50 auth.log
-rwxrwxrwx  1 root root    24M Jul 18 21:54 syslog
root@me-Latitude-E5550:/var/log# logrotate -f /etc/logroate.conf
error: cannot stat /etc/logroate.conf: No such file or directory
root@me-Latitude-E5550:/var/log# logrotate -f /etc/logrotate.conf
root@me-Latitude-E5550:/var/log# ls -larth
total 34M
drwxrwxrwx  2 root root   4,0K Feb 18  2016 speech-dispatcher
drwxrwxrwx  2 root root   4,0K Mai 19  2016 upstart
drwxrwxrwx  2 root root   4,0K Jul 19  2016 fsck
-rwxrwxrwx  1 root root     31 Jul 19  2016 dmesg
-rwxrwxrwx  1 root root    57K Jul 19  2016 bootstrap.log
drwxrwxrwx  3 root root   4,0K Jul 19  2016 hp
drwxr-xr-x 14 root root   4,0K Jul 19  2016 ..
drwxrwxrwx  2 root root   4,0K Jun 14 13:17 apt
drwxrwxrwx  2 root root   4,0K Jun 14 13:20 installer
drwxrwxrwx  2 root root   4,0K Jun 19 09:50 unattended-upgrades
-rwxrwxrwx  1 root root   3,8K Jun 19 09:55 fontconfig.log
-rwxrwxrwx  1 root root    554 Jun 19 15:02 apport.log.1
drwxrwxrwx  2 root root   4,0K Jun 20 07:35 lightdm
-rwxrwxrwx  1 root root   836K Jun 20 07:35 syslog.1
-rwxrwxrwx  1 root root    32K Jun 20 14:31 faillog
-rw-------  1 root utmp    768 Jul 14 09:28 btmp
drwxrwxrwx  2 root root   4,0K Jul 14 10:38 dist-upgrade
-rwxrwxrwx  1 root root    43K Jul 14 10:45 alternatives.log
-rwxrwxrwx  1 root root   286K Jul 14 11:04 lastlog
drwxrwxrwx  2 root root   4,0K Jul 18 08:59 sysstat
-rwxrwxrwx  1 root root   1,8M Jul 18 11:13 dpkg.log
drwxrwxrwx  2 root root   4,0K Jul 18 12:19 cups
-rw-r-----  1 root adm     14K Jul 18 12:20 apport.log
-rw-r--r--  1 root root    32K Jul 18 18:38 Xorg.0.log.old
-rwxrwxrwx  1 root root   1,9K Jul 18 18:44 gpu-manager.log
-rw-r--r--  1 root root   1009 Jul 18 18:44 boot.log
drwxrwxr-x 13 root syslog 4,0K Jul 18 18:44 .
-rw-rw-r--  1 root utmp    85K Jul 18 18:45 wtmp
-rw-r--r--  1 root root    29K Jul 18 21:17 Xorg.0.log
-rwxrwxrwx  1 root root   5,7M Jul 18 21:18 kern.log
-rwxrwxrwx  1 root root   580K Jul 18 21:50 auth.log
-rwxrwxrwx  1 root root    24M Jul 18 21:55 syslog
root@me-Latitude-E5550:/var/log# 
7
jenny

Logrotate.dの権限を変更します。必要がある chmod 644 /etc/logrotate.confおよびchown root:root /etc/logrotate.confそして、それはうまくいくかもしれません

7

このエラーは、logrotate.confに存在しないログファイルがリストされている場合に発生することがわかりました(これは、ログを生成することになっているサービスが実行されていないために発生している可能性があります)。エントリを削除するか、それらに関連付けられているパッケージを削除します。

0