Translated message

A translation of this page exists in English.

/etc/ ディレクトリーにログを書き込む際に logrotate スクリプトが原因で "Read-only file system" エラーが発生する

Solution In Progress - Updated -

Issue

  • /etc/ ディレクトリーにログを書き込む際に、logrotate postrotate スクリプトが原因で "Read only filesystem" エラーが発生しますが、このスクリプトは RHEL 8 で動作し、RHEL 9 でも対話型実行で正常に動作します。

    /var/log/myservice/*.log
    {
      weekly
      rotate 7
    ...
      postrotate        
        sh /etc/myservice/myscript.sh     <<==== this script output logs to /etc/myservice/log/*.log, and it fails with `Read-only file system`
      endscript
    }
    

    ログの例:

    Aug 22 00:01:07 myrhel9 logrotate[33408]: /etc/myservice/myscript.sh: line 4: /etc/myservice/log/myservice.log: Read only filesystem
    

Environment

  • Red Hat Enterprise Linux 9
  • logrotate

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content