Troubleshooting

A cleanup script running as root cannot delete the expired file /var/log/app/old.log and returns "Operation not permitted." The file is owned by root:root with mode 0644, the filesystem is mounted read-write, and SELinux is in permissive mode. Which action BEST resolves the problem?

Show the answer

Correct answerC. Run lsattr to confirm an immutable attribute, then clear it with chattr -i

The immutable attribute blocks deletion and modification even for root, regardless of permissions. lsattr confirms it and chattr -i clears it. Changing the mode does nothing here, because the attribute check happens separately from permission bits.