Novell Cluster Services 'pkill -fx' command in unload script errors out with killing GroupWise .

  • 7013218
  • 06-Sep-2013
  • 11-Sep-2013

Environment

Novell Cluster Services 1.8.4
Novell Open Enterprise Server 11 (OES 11) Linux Support Pack 1
Novell GroupWise 2012

Situation

Running GroupWise 2012 on Open Enterprise Server 11 SP1 in a High Availability mode using Novell Cluster Services.
The Cluster Services Unload script is configured as described in the GroupWise 2012 Interoperability guide.

Snippet of the sample Cluster resource unload script  :

<snip/>
...
ignore_error pkill -fx "/opt/novell/groupwise/agents/bin/gwmta  @/media/nss/volume_name/groupwise/agents/share/domain_name.mta"
ignore_error pkill -fx "/opt/novell/groupwise/agents/bin/gwpoa  @/media/nss/volume_name/groupwise/agents/share/post_office_name.poa"
ignore_error pkill -fx "/opt/novell/groupwise/agents/bin/gwdva  @/media/nss/volume_name/groupwise/agents/share/gwdva.dva"
...
</snip>

When Off-lining or Migrating the cluster resource running Novell GroupWise, the 'pkill' command from the sample above, which supposedly terminates (SIGTERM) any daemon that does not gracefully shutdown, does not work well.

This is revealed by a closer inspection of the relevant snippet for the particular resource unload.out file as found in /var/opt/novell/log/ncs :

<snip/>
...
+ date

Thu Sep  5 16:20:59 CEST 2013
+ return 0
+ ignore_error pkill -fx '/opt/novell/groupwise/agents/bin/gwmta @/media/nss/VGWISE/groupwise/agents/share/oesdom1.mta'
+ eval pkill -fx /opt/novell/groupwise/agents/bin/gwmta @/media/nss/VGWISE/groupwise/agents/share/oesdom1.mta
++ pkill -fx /opt/novell/groupwise/agents/bin/gwmta @/media/nss/VGWISE/groupwise/agents/share/oesdom1.mta
Usage: pkill [-SIGNAL] [-fvx] [-n|-o] [-P PPIDLIST] [-g PGRPLIST] [-s SIDLIST]
        [-u EUIDLIST] [-U UIDLIST] [-G GIDLIST] [-t TERMLIST] [PATTERN]
...

<snip>

Note:
- The command line as specified above, was listed as valid in an earlier version of the GroupWise 2012 documentation.
- Initiating this command from a terminal windows using the cli works well.

Resolution

The key to make this work properly is to specify the 'pkill' command line using both a double (") and a single (') quote in the NCS unload script.

Cause

The 'ignore_error' command from NCS removed the double quotes from the command line, causing pkill to not being able and identify the specified pattern properly.

Using 'pkill' used in conjunction with '-f' requires pkill to SIGTERM the exact pattern as specified.
Since the 'ignore_error' command from NCS strips the double quotes from the command line, 'pkill'  the pattern does not look correct for pkill, and therefor the pkill command is not executed and errors out .

Additional Information

As per April 16, 2013, the GroupWise 2012 documentation has been modified to reflect this change.


Example on how the GroupWise resource unload script should look  :

<snip/>
...
ignore_error pkill -fx "'/opt/novell/groupwise/agents/bin/gwmta  @/media/nss/volume_name/groupwise/agents/share/domain_name.mta'"
ignore_error pkill -fx "'/opt/novell/groupwise/agents/bin/gwpoa  @/media/nss/volume_name/groupwise/agents/share/post_office_name.poa'"
ignore_error pkill -fx "'/opt/novell/groupwise/agents/bin/gwdva  @/media/nss/volume_name/groupwise/agents/share/gwdva.dva'"
...
</snip>


After escaping the lines in the resource unload script using both a double (") and a single (') quote, and re-testing the resource migration on the cluster again, the relevant snippet for the resource unload.out file now reveals the migration of the GroupWise resource behaves properly :

Inspecting the relevant snippet for the resource unload.out file as found in /var/opt/novell/log/ncs :

<snip/>
...
Thu Sep  5 18:12:01 CEST 2013
+ return 0
+ ignore_error pkill -fx ''\''/opt/novell/groupwise/agents/bin/gwmta @/media/nss/VGWISE/groupwise/agents/share/oesdom1.mta'\'''
+ eval pkill -fx ''\''/opt/novell/groupwise/agents/bin/gwmta' '@/media/nss/VGWISE/groupwise/agents/share/oesdom1.mta'\'''
++ pkill -fx '/opt/novell/groupwise/agents/bin/gwmta @/media/nss/VGWISE/groupwise/agents/share/oesdom1.mta'
+ date
Thu Sep  5 18:12:01 CEST 2
...
</snip>