Operating System - Linux
1753912 Members
8661 Online
108810 Solutions
New Discussion

Re: Raid Manager problem with a script

 

Raid Manager problem with a script

Good day,

I have a script (which works very fine under HP-UX 11.110 that I want to make it work under
Suse Linux Enterprise Server 10 SP2.

In one of the script, there is a function

function instance_running
#
# Verify if the specified instance is running
# Returns 0 if it is, 1 if it isn't
#
# The instance to test must be passed as the first
# parameter
#
{
INSTANCE=$1
for wInstance in $( running_instances )
do

if [[ $INSTANCE -eq $wInstance ]]
then
# Check if socket file is there
if [ -S /var/tmp/.lcmep0${wInstance} ]
then
return 0
else
return 2
fi
fi
done
return 1
}

The problem is that there is no such thing as /var/tmp/.lcmep0 under Linux.

Does someone knows a workaround for this ?

Regards,

3 REPLIES 3
Ivan Ferreira
Honored Contributor

Re: Raid Manager problem with a script

The /var/tmp/.lcmep0 file should be created by a service/daemon. ¿What do you want to check? ¿An instance of what?
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?

Re: Raid Manager problem with a script

We are porting some stuff from HP-UX to Linux (Suse).

This script (called from another) is checking if the horcm instance is running or not and do proper action.

This function checks for the existence of the /var/tmp/.lcmdp0*. If not, it is supposed to start the horcm instance.

Under HP-UX this works fine. Under Linux, it seems that horcm uses something else since the /var/tmp/.lcmdp0 does not exists.

I need a workaround or know what Linux uses.

Regards,

Re: Raid Manager problem with a script

I think I have found a workaround for this script to work properly under Linux

function instance_running
#
# Verify if the specified instance is running
# Returns 0 if it is, 1 if it isn't
#
# The instance to test must be passed as the first
# parameter
#
{
INSTANCE=$1
for wInstance in $( running_instances )
do

if [[ $INSTANCE -eq $wInstance ]]
then
# Check if socket file is there
if [ 'ps -ef | grep horcmd_${wInstance}' ]
then
return 0
else
return 2
fi
fi
done
return 1
}

I changed the line to check if the process is running. Simple... but effective.

if [ 'ps -ef | grep horcmd_${wInstance}' ]

Regards,