/etc/ ディレクトリーにログを書き込む際に logrotate スクリプトが原因で "Read-only file system" エラーが発生する
Issue
-
/etc/ディレクトリーにログを書き込む際に、logrotatepostrotate スクリプトが原因で "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.