[CentOS] CentOS 5 file system read only issue

Wed Aug 21 13:35:16 UTC 2019
Xinhuan Zheng <xzheng at christianbook.com>

Hello Everyone,

We are using CentOS 5 system for certain application. Those are VM guests
running in VMware. There is datastore issue occasionally, causing all file
systems becoming read only file systems. So application stop working, and
opened files cannot be written either. We cannot even ssh login to the
system. Typically we had to power cycle the VM. We are trying to add
reliability to the application so that if files cannot be written,
application should time out. We are trying to use IO::Select to handle
timeout. Per investigation, we found below does not work as expected:

my $s = IO::Select->new( $fh );
if ( $io->can_write( 10 ) {
  # print to the file
}


It seems like can_write returns true even we manually made file system
read only in our testing case.

Is this something we can accomplish using select system call with timeout
value?

Thanks in advance,

- Xinhuan Zheng