ot: fuser rh 4 and 5 differences

From: Herring Dave - dherri <Dave.Herring_at_acxiom.com>
Date: Wed, 29 Sep 2010 20:53:02 -0500
Message-ID: <7ED53A68952D3B4C9540B4EFA5C76E360852AAFE_at_CWYMSX04.Corp.Acxiom.net>

I know this is a Linux question/issue, but it's related to a difference in Redhat 4 and 5 and with folks upgrading RH to handle 11g, I thought others might run into this. From a line in the man page for "fuser" under RH 5:

       fuser outputs only the PIDs to stdout, everything else is sent to stderr.

This is new, as before all non-error output went to stdout. It bit us, as we have a DBA script where we cleanup various Oracle files and use "fuser" to check if it's open before messing with the file. So the command:

              for active_file in `fuser $dir/$sub/* | cut -d\: -f1`

behaves differently under RH 4 than in 5.

A simple test can be done using "fuser $ORACLE_HOME/lib/libclntsh* | cut -d\: -f1" across RH 4 and 5.

The obvious solution is to add "2>&1" to the "fuser" command, but I'm bringing this up because I'm sure there are other DBAs out there with scripts using "fuser" and having to support these scripts across RH releases.

Dave Herring  | DBA
Acxiom Global Technology Solutions   

630-944-4762 office | 630-430-5988 cell | 630-944-4989 fax 1501 Opus Pl | Downers Grove, IL, 60515 | U.S.A. | www.acxiom.com Service Desk: 888-243-4566, https://servicedesk.acxiom.com, GSCA_at_DNB.com

The information contained in this communication is confidential, is intended only for the use of the recipient named above, and may be legally privileged.

If the reader of this message is not the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited.

If you have received this communication in error, please resend this communication to the sender and delete the original message or any copy of it from your computer system.

Thank You.

Received on Wed Sep 29 2010 - 20:53:02 CDT

Original text of this message