Cool Solutions

Script to stop a GroupWise agent in a cluster resource



By:

November 11, 2013 11:51 am

Reads:508

Comments:0

Score:1

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
#!/bin/bash
. /opt/novell/ncs/lib/ncsfuncs
# define the IP address
RESOURCE_IP=192.168.1.1
# define the file system type
MOUNT_FS=ext3
#define the volume group name
VOLGROUP_NAME=vmta
# define the device
MOUNT_DEV=/dev/vmta/vmta
# define the mount point
MOUNT_POINT=/media/ext3/vmta
# define NCP server name
NCP_SERVER=c-lnx-mail-vmta-server
# define NCP volume name
NCP_VOLUME=vmta
# 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 192.168.1.2
# 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 ...

Tags:
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.

Comment

RSS