Operating System - Linux
1752610 Members
4353 Online
108788 Solutions
New Discussion юеВ

Re: inter-package communication

 

inter-package communication

Hi all!

Is there any way to "stick" two packages together, ie. they always have run on the same node?

I want to share a particular filesystem via NFS and Samba at the same time - on the same node.

Another solution could be to modify the toolkit.sh script to start two HA scripts (hasmb.sh and hanfs.sh), and combine two packages into one this way.

What is the best way?

Krisztian

5 REPLIES 5
renarios
Trusted Contributor

Re: inter-package communication

Hi

In the /etc/cmcluster/.ascii file add a resource or use SAM and choose "Additional Package Dependencies" in the "Package Configuration" subarea.

Cheerio,

Renarios
Nothing is more successfull as failure
Steven E. Protter
Exalted Contributor

Re: inter-package communication

IPC from one node to antoher node?

I don't see how that can work. Memory is not a resource that SG shares.

I think you do have to run both packages on the same node. I think the suggestion in the prior post is an excellent solution quality post.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Serviceguard for Linux
Honored Contributor

Re: inter-package communication

Probably best to combine the two toolkits into one.

Extract the "startup" and "shutdown" portion of each toolkit and put them into combined startup and shutdown sections. Make to packages dependant on all of the monitors instead of just the individual ones.

Re: inter-package communication

My solution was to modify toolkit.sh:

HA_SERVER=NFS_SAMBA_HOME
HA_SCRIPT=${0%/*}/hanfs.sh
HA_SCRIPT2=${0%/*}/hasmb.sh
ACT=$1
R1=0
R2=0

function test_return
{
if (( $R1 + $R2 != 0 ))
then
echo "ERROR: $(date '+%b %e %T') - Failed to $ACT $HA_SERVER."
exit 1
fi
}

function log_info
{
[...]
}

# Invoke the application toolkit

if [ -x $HA_SCRIPT -a -x $HA_SCRIPT2 ]; then
./$HA_SCRIPT $ACT
R1=$?
./$HA_SCRIPT2 $ACT
R2=$?
test_return
else
log_info
fi

exit 0;

Thanks for all the replies!

Krisztian

Re: inter-package communication

One more thing I forget to mention:

I had to modify test_return function in pkg.sh at case 50:

50)
echo "ERROR: Function verify_ha_server; Failed to $action HA servers"

if [[ "$action" = "start" ]]
then
if [[ "$HA_APP_SERVER" = "post-IP" ]]
then
remove_ip_address
fi

#ADDED:

action=stop
verify_ha_server stop

#END OF MODS

umount_fs
deactivate_volume_group
deactivate_md
verify_physical_data_replication stop
to_exit=1
else
exit_value=1
fi
;;

I had to add "verify_ha_server stop" because at startup failure of smbd the NFS shares were not unexported, so umount_fs failed. "action=stop" were added to avoid recursion (verify_ha_server calls test_return again, but $action should be "stop" at this time)

Hope this helps those wanting something similar.

Krisztian