Cool Solutions

Script to stop a GroupWise agent in a cluster resource


November 11, 2013 11:51 am




If you cannot calculate the time needed so that the GroupWise agents can shut down normally on your cluster without being inadvertently killed by the pkill, you may find this useful script.

The secret is to check for the state of GroupWise agent, while the status is “running” do a sleep. When the status changes to “unused” the script executes the next command.

I hope this helps.

#Cluster unload GroupWise Domain resource
. /opt/novell/ncs/lib/ncsfuncs
# define the IP address
# define the file system type
#define the volume group name
# define the device
# define the mount point
# define NCP server name
# define NCP volume name
# Stop domain
ignore_error /etc/init.d/grpwise stop gwdom

# Checking running status  <--------- HERE
while [[ `rcgrpwise status gwdom|grep running` == 'Checking status [gwdom]..running' ]]; do sleep 1;done

# Kill domain process
pkill -fx "/opt/novell/groupwise/agents/bin/gwdom @/media/ext3/vmta/vmta/groupwise/agents/share/gwdom.mta"
# Remove GroupWise Domain Secondary IP address
ignore_error del_secondary_ipaddress
# Unbind ncpcon
ignore_error ncpcon unbind --ncpservername=$NCP_SERVER --ipaddress=$RESOURCE_IP
# dismount the NCP volume
ignore_error ncpcon dismount $NCP_VOLUME
# Remove resources  the IP address
ignore_error del_secondary_ipaddress $RESOURCE_IP
# Close volume
fuser -km $MOUNT_POINT
# unmount the volume
exit_on_error umount_fs $MOUNT_DEV $MOUNT_POINT $MOUNT_FS
# deactivate the volume group
exit_on_error vgchange -a en $VOLGROUP_NAME
ignore_error rmdir $MOUNT_POINT
exit 0
1 vote, average: 1.00 out of 51 vote, average: 1.00 out of 51 vote, average: 1.00 out of 51 vote, average: 1.00 out of 51 vote, average: 1.00 out of 5 (1 votes, average: 1.00 out of 5)
You need to be a registered member to rate this post.
Loading ... Loading ...

Categories: Cool Tools, GroupWise, Open Enterprise Server, Technical

Disclaimer: This content is not supported by Novell. It was contributed by a community member and is published "as is." It seems to have worked for at least one person, and might work for you. But please be sure to test it thoroughly before using it in a production environment.