LoginSignup
30
14

More than 5 years have passed since last update.

logrotateしたときに`because parent directory has insecure permissions`というエラーが出る

Posted at

環境情報

  • CentOS 7
  • logrotate 3.8.6

事象

  • logrotateした際にerrorが出力される。

検証

回避策

logrotate.confにsuディレクティブを追加する

suディレクティブでrotateするユーザを指定してあげればいいようです。

/var/log/nginx/*.log {
    daily
    missingok
    compress
    dateext
    ifempty
    sharedscripts
    rotate 10
    su nginx nginx
}

30
14
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
30
14