[SCM] Samba Shared Repository - branch master updated

Amitay Isaacs amitay at samba.org
Tue Jul 14 11:04:05 UTC 2015


The branch, master has been updated
       via  1023db2 ctdb-daemon: Return correct sequence number for CONTROL_GET_DB_SEQNUM
       via  b6a3c1d ctdb-scripts: Implement registration in nfs-linux-kernel-callout
       via  fa6f22d ctdb-scripts: Add registration for CTDB_NFS_CALLOUT operations
       via  3b32c64 ctdb-tests: Add some simple tests for CTDB_NFS_CALLOUT
       via  bb7093a ctdb-scripts: Add portmapper NFS .check file
       via  a02bdb9 ctdb-scripts: Move NFS support functions to 60.nfs
       via  a3a443d ctdb-scripts: Drop configuration variable CTDB_NFS_DUMP_STUCK_THREADS
       via  f3a4c4f ctdb-scripts: Remove unused function startstop_ganesha()
       via  6586651 ctdb-scripts: Remove 60.ganesha, replace with callout for 60.nfs
       via  713ec21 ctdb-scripts: Extend NFS .check files with service_check_cmd variable
       via  d332013 ctdb-scripts: Remove functions startstop_nfs() and startstop_nfslock()
       via  1e40160 ctdb-scripts: Remove configuration variable CTDB_MONITOR_NFS_THREAD_COUNT
       via  9c87d1d ctdb-scripts: Parameterise 60.nfs with $CTDB_NFS_CALLOUT
       via  49c4d19 ctdb-scripts: Remove old NFS checking code
       via  74428e5 ctdb-scripts: Switch NFS checks to new style
       via  3161d61 ctdb-scripts: Add new NFS service checking infrastructure
       via  dfeb5b8 ctdb-scripts: Factor out new function ctdb_counter_get()
       via  9f4f1c5 ctdb-scripts: Move "ERROR:" prefix out of ctdb_check_rpc()
       via  1a9687f ctdb-scripts: Clean up ctdb_check_rpc()
       via  6f3ee81 ctdb-scripts: NFS RPC checks should be simple and consistent
       via  a04cced ctdb-tests: setup_nfs() should mark nfslock as started/stopped
       via  8b044d8 ctdb-tests: Remove function iterate_test()
       via  a496c8b ctdb-tests: Remove remaining uses of iterate_test()
       via  0bcb4df ctdb-tests: New NFS test with all services up and 10 iterations
       via  7f6a5fc ctdb-tests: Allow 2nd argument of nfs_iterate_test() to be null
       via  90607e7 ctdb-tests: Automate expected NFS test results instead of hard-coding
       via  5c7cd20 ctdb-tests: Update NFS tests to use nfs_iterate_test()
       via  e795429 ctdb-tests: New function nfs_iterate_test()
       via  c72c5b7 ctdb-tests: rpc_set_service_failure_response() should take RPC service name
       via  87b215c ctdb-tests: Don't flag failure when there are no rpcinfo check failures
       via  d170a20 ctdb-tests: Default fail count for rpc_set_service_failure_response() is 1
       via  57146b08 ctdb-tests: Factor out stack dumping and background marking code
       via  182ebc0 ctdb-daemon: Allow a new monitor event to cancel one already in progress
       via  122a4fd ctdb-daemon: Improve error messages when eventscript control is cancelled
       via  b71d18d ctdb-tools: Avoiding printing "(null)" on "ctdb eventscript" error
       via  f951ff1 ctdb-daemon: Avoid double-free during monitor cancellation
       via  8ed0cac ctdb-tests: Add some 10.interfaces VLAN tests
       via  8e41cb1 ctdb-tests: Add VLAN support to the "ip link" stub
       via  4f84d42 ctdb-tests: Interface number in "ip link show" stub defaults to 42
       via  bc71251 ctdb-scripts: Support monitoring of interestingly named VLANs on bonds
       via  87c5c96 ctdb-scripts: Fix regression in VLAN interface support
      from  539125c ctdbd_conn: Move release_ip handling into process.c

https://git.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 1023db2543f7785e4527a4565db91edcde4ca7f1
Author: Amitay Isaacs <amitay at gmail.com>
Date:   Tue Jul 14 16:54:59 2015 +1000

    ctdb-daemon: Return correct sequence number for CONTROL_GET_DB_SEQNUM
    
    Due to the missing cast of uint64_t, CONTROL_GET_DB_SEQNUM always returned
    seqnum <= 256.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=11398
    
    Signed-off-by: Amitay Isaacs <amitay at gmail.com>
    Reviewed-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Volker Lendecke <vl at samba.org>
    
    Autobuild-User(master): Amitay Isaacs <amitay at samba.org>
    Autobuild-Date(master): Tue Jul 14 13:03:25 CEST 2015 on sn-devel-104

commit b6a3c1decd92d6b7e9b65d6ed9a5e6ca04b1ed1a
Author: Martin Schwenke <martin at meltin.net>
Date:   Tue Jul 14 12:13:58 2015 +1000

    ctdb-scripts: Implement registration in nfs-linux-kernel-callout
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Amitay Isaacs <amitay at gmail.com>

commit fa6f22d7ae4bbec9449572f312bd89dce815e561
Author: Martin Schwenke <martin at meltin.net>
Date:   Tue Jul 14 12:11:39 2015 +1000

    ctdb-scripts: Add registration for CTDB_NFS_CALLOUT operations
    
    This is an optimisation to avoid forking the callout for operations
    that are not implemented.
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Amitay Isaacs <amitay at gmail.com>

commit 3b32c641894c3f5a86c93b613110be6edbfe98d2
Author: Martin Schwenke <martin at meltin.net>
Date:   Tue Jul 14 10:59:55 2015 +1000

    ctdb-tests: Add some simple tests for CTDB_NFS_CALLOUT
    
    One always passes, the other fails early.
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Amitay Isaacs <amitay at gmail.com>

commit bb7093ab0939894194a8cc4efa79060638d0b452
Author: Martin Schwenke <martin at meltin.net>
Date:   Mon Jul 13 21:00:29 2015 +1000

    ctdb-scripts: Add portmapper NFS .check file
    
    Unhealthy after 1 failed attempt to contact the portmapper.
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Amitay Isaacs <amitay at gmail.com>

commit a02bdb97f9c957a411263597ed37d8607810e40a
Author: Martin Schwenke <martin at meltin.net>
Date:   Mon Jul 13 15:22:23 2015 +1000

    ctdb-scripts: Move NFS support functions to 60.nfs
    
    Now that there is only a single NFS eventscript, other eventscripts no
    longer need to load all of this.
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Amitay Isaacs <amitay at gmail.com>

commit a3a443dcf42fb737a4417a7bba165d9e41cd5e06
Author: Martin Schwenke <martin at meltin.net>
Date:   Mon Jul 13 14:54:07 2015 +1000

    ctdb-scripts: Drop configuration variable CTDB_NFS_DUMP_STUCK_THREADS
    
    This is now handled by passing the desired number of threads to the
    command specified in the dump_stuck_threads variable in .check files.
    
    Remove unused function nfs_dump_some_threads().
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Amitay Isaacs <amitay at gmail.com>

commit f3a4c4f10b66300baa95b1d4367f93a3616ba408
Author: Martin Schwenke <martin at meltin.net>
Date:   Mon Jul 13 14:49:02 2015 +1000

    ctdb-scripts: Remove unused function startstop_ganesha()
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Amitay Isaacs <amitay at gmail.com>

commit 6586651508a17eea0da7bf32af4b41163924eca9
Author: Martin Schwenke <martin at meltin.net>
Date:   Wed Jul 1 18:32:35 2015 +1000

    ctdb-scripts: Remove 60.ganesha, replace with callout for 60.nfs
    
    This isn't a straightforward move of code from 60.ganesha to the
    callout.  Simplifications have been made to allow better
    interoperation with the new NFS checking logic.
    
    The following configuration variables have been removed:
    
      CTDB_GANESHA_REC_SUBDIR
    
        Edit NFS ganesha callout to change this location
    
      CTDB_NFS_SERVER_MODE, NFS_SERVER_MODE
    
        Use CTDB_NFS_CALLOUT instead
    
      CTDB_NFS_SKIP_KNFSD_ALIVE_CHECK, CTDB_SKIP_GANESHA_NFSD_CHECK
    
        Disable the corresponding .check file instead
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Amitay Isaacs <amitay at gmail.com>

commit 713ec217507d2f0d5f516efc45c8cd8773fccc14
Author: Martin Schwenke <martin at meltin.net>
Date:   Mon Jul 13 11:30:51 2015 +1000

    ctdb-scripts: Extend NFS .check files with service_check_cmd variable
    
    $service_check_cmd specifies a command to run instead of the regular
    rpcinfo-based check.
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Amitay Isaacs <amitay at gmail.com>

commit d33201312325056d38cafe57f5387887497c2771
Author: Martin Schwenke <martin at meltin.net>
Date:   Wed Jun 24 22:28:33 2015 +1000

    ctdb-scripts: Remove functions startstop_nfs() and startstop_nfslock()
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Amitay Isaacs <amitay at gmail.com>

commit 1e4016036c4c2812250c286574e16e2c77603b33
Author: Martin Schwenke <martin at meltin.net>
Date:   Mon Jul 13 15:02:48 2015 +1000

    ctdb-scripts: Remove configuration variable CTDB_MONITOR_NFS_THREAD_COUNT
    
    This is now always enabled.  If nfsd thread monitoring is not required
    then make CTDB_NFS_CALLOUT point to a wrapper around
    nfs-linux-kernel-callout that does not implement "monitor-post".
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Amitay Isaacs <amitay at gmail.com>

commit 9c87d1dd29165beca570dbf015953e24b967ec98
Author: Martin Schwenke <martin at meltin.net>
Date:   Wed Jun 24 21:36:14 2015 +1000

    ctdb-scripts: Parameterise 60.nfs with $CTDB_NFS_CALLOUT
    
    The goal is to have a single NFS eventscript.
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Amitay Isaacs <amitay at gmail.com>

commit 49c4d1900cb6daae0b1eb822663f211726f88bcc
Author: Martin Schwenke <martin at meltin.net>
Date:   Fri Jun 19 16:54:33 2015 +1000

    ctdb-scripts: Remove old NFS checking code
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Amitay Isaacs <amitay at gmail.com>

commit 74428e5c1463d6c60880ba593c880bc36a8f1ff4
Author: Martin Schwenke <martin at meltin.net>
Date:   Fri Jun 19 16:35:12 2015 +1000

    ctdb-scripts: Switch NFS checks to new style
    
    Note that the 60.ganesha RPC checks need to be identical to those in
    the nfs-checks.d/ directory.  This is because the NFS unit test
    infrastructure checks output against what should be produced by the
    checks in nfs-checks.d/.  This is a minor issue, since one of the aims
    of this work is to remove the need for a separate 60.ganesha.
    
    In most cases configuration variable CTDB_NFS_DUMP_STUCK_THREADS is
    now ignored.  This is now handled by passing the desired number of
    threads to the command specified in the service_debug_cmd variable in
    a .check file.
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Amitay Isaacs <amitay at gmail.com>

commit 3161d611bb2931019a7d40c7795c12f0b70a903c
Author: Martin Schwenke <martin at meltin.net>
Date:   Wed Jun 17 20:53:12 2015 +1000

    ctdb-scripts: Add new NFS service checking infrastructure
    
    Provides a new extensible format for .check files, using simple
    variables instead of the unwieldy extended test(1) syntax now used.
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Amitay Isaacs <amitay at gmail.com>

commit dfeb5b84fd2953a5f038897073c8f10861bb00c8
Author: Martin Schwenke <martin at meltin.net>
Date:   Sat Jul 11 11:02:54 2015 +1000

    ctdb-scripts: Factor out new function ctdb_counter_get()
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Amitay Isaacs <amitay at gmail.com>

commit 9f4f1c51fc58b38f483802a99560bb780264519c
Author: Martin Schwenke <martin at meltin.net>
Date:   Mon Jun 29 11:22:48 2015 +1000

    ctdb-scripts: Move "ERROR:" prefix out of ctdb_check_rpc()
    
    There will be warnings in addition to errors.
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Amitay Isaacs <amitay at gmail.com>

commit 1a9687f94871243191fca25549b6fcc4eacb8d3f
Author: Martin Schwenke <martin at meltin.net>
Date:   Wed Jun 17 20:24:33 2015 +1000

    ctdb-scripts: Clean up ctdb_check_rpc()
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Amitay Isaacs <amitay at gmail.com>

commit 6f3ee81d17f6b0eba05b8f14ac1d592c85e916b1
Author: Martin Schwenke <martin at meltin.net>
Date:   Wed Jun 17 19:35:21 2015 +1000

    ctdb-scripts: NFS RPC checks should be simple and consistent
    
    Change status, nlockmgr, mountd, rquotad to be unhealthy after 6
    rpcinfo check failures and do a verbose restart after every 2
    failures.  Change 60.ganesha for consistency, since 60.ganesha tests
    are broken and depend on the consistency.
    
    Apart from the consistency aspect, the check infrastructure will soon
    be simplified so that it only allows the equivalent of "unhealthy" and
    "verbose restart:b" actions.
    
    Update tests to have a corresponding numbers of iterations.  Run 1
    extra iteration in most tests to check there are no unexpected
    behaviour changes after the designated number of iterations completes.
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Amitay Isaacs <amitay at gmail.com>

commit a04ccedd244033d3bfd4c644ad94a442eba59559
Author: Martin Schwenke <martin at meltin.net>
Date:   Wed Jun 17 20:51:23 2015 +1000

    ctdb-tests: setup_nfs() should mark nfslock as started/stopped
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Amitay Isaacs <amitay at gmail.com>

commit 8b044d88fd7d35741b25fe51fbb351032a117903
Author: Martin Schwenke <martin at meltin.net>
Date:   Wed Jun 17 17:26:21 2015 +1000

    ctdb-tests: Remove function iterate_test()
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Amitay Isaacs <amitay at gmail.com>

commit a496c8bca69d1b4a41326be1198edff7b8fb94a6
Author: Martin Schwenke <martin at meltin.net>
Date:   Wed Jun 17 17:25:02 2015 +1000

    ctdb-tests: Remove remaining uses of iterate_test()
    
    They are contrived and hard to read.  Better to just enumerate the few
    sub-tests in these testcases.
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Amitay Isaacs <amitay at gmail.com>

commit 0bcb4dfe614996ce3f4e569f56e0f5bdd1a120a5
Author: Martin Schwenke <martin at meltin.net>
Date:   Thu Jun 18 14:11:55 2015 +1000

    ctdb-tests: New NFS test with all services up and 10 iterations
    
    A useful baseline test to ensure that certain things (e.g. rpcinfo)
    aren't consistently broken.
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Amitay Isaacs <amitay at gmail.com>

commit 7f6a5fce72027fb59173fbb9b71154dc862a6c1f
Author: Martin Schwenke <martin at meltin.net>
Date:   Thu Jun 18 14:08:02 2015 +1000

    ctdb-tests: Allow 2nd argument of nfs_iterate_test() to be null
    
    This means that required result will not be calculated on each
    iteration.  This is useful in baseline tests where, say, all
    iterations should succeed and produce no output.  This is useful for
    confirming that the eventscript and test infrastructure is working
    correctly.
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Amitay Isaacs <amitay at gmail.com>

commit 90607e75d2c8f9af4f916f82813471145cd408e5
Author: Martin Schwenke <martin at meltin.net>
Date:   Wed Jun 17 17:13:31 2015 +1000

    ctdb-tests: Automate expected NFS test results instead of hard-coding
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Amitay Isaacs <amitay at gmail.com>

commit 5c7cd209cbd928e36a188dcfc483aeb25d31e20f
Author: Martin Schwenke <martin at meltin.net>
Date:   Wed Jun 17 17:12:25 2015 +1000

    ctdb-tests: Update NFS tests to use nfs_iterate_test()
    
    ... instead of iterate_test()
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Amitay Isaacs <amitay at gmail.com>

commit e7954298022b94a48ac18fef8c7f7b40281846cb
Author: Martin Schwenke <martin at meltin.net>
Date:   Wed Jun 17 17:05:44 2015 +1000

    ctdb-tests: New function nfs_iterate_test()
    
    Much clearer than using iterate_test() for this purpose.  This also
    does failover counting by calling rpcinfo in each iteration.
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Amitay Isaacs <amitay at gmail.com>

commit c72c5b754f590ecc26cfff077b20d04e684c2ea9
Author: Martin Schwenke <martin at meltin.net>
Date:   Wed Jun 17 16:45:28 2015 +1000

    ctdb-tests: rpc_set_service_failure_response() should take RPC service name
    
    ... not a process name
    
    Update the tests that matter.
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Amitay Isaacs <amitay at gmail.com>

commit 87b215c39028a40c280485ded5232ca572fa32ef
Author: Martin Schwenke <martin at meltin.net>
Date:   Wed Jun 17 16:44:20 2015 +1000

    ctdb-tests: Don't flag failure when there are no rpcinfo check failures
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Amitay Isaacs <amitay at gmail.com>

commit d170a20b46017cadc6ba0b3ae82aeff508e15431
Author: Martin Schwenke <martin at meltin.net>
Date:   Mon Jun 15 20:12:31 2015 +1000

    ctdb-tests: Default fail count for rpc_set_service_failure_response() is 1
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Amitay Isaacs <amitay at gmail.com>

commit 57146b0875e953925c3efe9d3092e9c878a4c9d7
Author: Martin Schwenke <martin at meltin.net>
Date:   Mon Jun 15 20:04:16 2015 +1000

    ctdb-tests: Factor out stack dumping and background marking code
    
    This makes the code that uses it easier to modify.
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Amitay Isaacs <amitay at gmail.com>

commit 182ebc07289c776ca104e648911a53209bcdaf00
Author: Martin Schwenke <martin at meltin.net>
Date:   Tue Jul 14 13:43:14 2015 +1000

    ctdb-daemon: Allow a new monitor event to cancel one already in progress
    
    Before commit cbffbb7c2f406fc1d8ebad3c531cc2757232690e this was
    possible and some users depend on this behaviour.
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Amitay Isaacs <amitay at gmail.com>

commit 122a4fda7272ec4d63452037f0b838d2bdc5a79a
Author: Martin Schwenke <martin at meltin.net>
Date:   Mon Jul 6 12:02:00 2015 +1000

    ctdb-daemon: Improve error messages when eventscript control is cancelled
    
    Warn specifically about cancellation instead of printing a generic
    error message.  Also pass back an error message for the tool - it
    could just rely on the status but it already looks at the error
    message.
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Amitay Isaacs <amitay at gmail.com>

commit b71d18d2dc090e99d67c6bd8552380b44f8db810
Author: Martin Schwenke <martin at meltin.net>
Date:   Mon Jul 6 11:48:28 2015 +1000

    ctdb-tools: Avoiding printing "(null)" on "ctdb eventscript" error
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Amitay Isaacs <amitay at gmail.com>

commit f951ff13838e796cd6661d800daf460247cac60b
Author: Amitay Isaacs <amitay at gmail.com>
Date:   Fri Jul 10 14:02:29 2015 +1000

    ctdb-daemon: Avoid double-free during monitor cancellation
    
    The eventscript state should never be freed externally, so it should
    never be allocated off a temporary context.  It will either be freed
    by the handler or in the cancellation code.
    
    Signed-off-by: Amitay Isaacs <amitay at gmail.com>
    Pair-programmed-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Martin Schwenke <martin at meltin.net>

commit 8ed0cacaf4aa9fc63b8c8d610a6164c5d01e473a
Author: Martin Schwenke <martin at meltin.net>
Date:   Wed Jul 8 22:22:09 2015 +1000

    ctdb-tests: Add some 10.interfaces VLAN tests
    
    One without a bond, one with a bond.
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Amitay Isaacs <amitay at gmail.com>

commit 8e41cb1e4e7b4a7d92628771260649ded4432772
Author: Martin Schwenke <martin at meltin.net>
Date:   Wed Jul 8 22:14:51 2015 +1000

    ctdb-tests: Add VLAN support to the "ip link" stub
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Amitay Isaacs <amitay at gmail.com>

commit 4f84d42b511a4c9a79bd835eeca0a80082e76227
Author: Martin Schwenke <martin at meltin.net>
Date:   Wed Jul 8 21:39:51 2015 +1000

    ctdb-tests: Interface number in "ip link show" stub defaults to 42
    
    It needs to have a default for the standalone case, when it is not run
    in a loop inside "ip addr show".
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Amitay Isaacs <amitay at gmail.com>

commit bc71251433ce618c95c674d7cbe75b01a94adad9
Author: Martin Schwenke <martin at meltin.net>
Date:   Wed Jul 8 21:23:48 2015 +1000

    ctdb-scripts: Support monitoring of interestingly named VLANs on bonds
    
    VLAN interfaces on bonds with a name other than <iface>.<id>@<iface>
    are not currently supported.  That is, where the VLAN name isn't based
    on the underlying bond name.  Such VLAN interfaces can be created with
    the "ip link" command, as opposed to the "vconfig" command, or by
    renaming a VLAN interface.
    
    This is improved by determining the underlying interface name for a
    VLAN from the output of "ip link".
    
    No serious attempt is made to support VLANs with '@' in their name,
    although this seems to be legal.  Why would you do that?
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Amitay Isaacs <amitay at gmail.com>

commit 87c5c96b767aa317dd620f89ac3e11bb40dae70f
Author: Martin Schwenke <martin at meltin.net>
Date:   Tue Jul 7 20:49:38 2015 +1000

    ctdb-scripts: Fix regression in VLAN interface support
    
    Commit 6471541d6d2bc9f2af0ff92b280abbd1d933cf88 broke support for VLAN
    interfaces.  Releasing a public IP address depends on
    ip_maskbits_iface() and for a VLAN interface this will return an
    interface of the form <vlan>@<iface>, which can't be fed back into
    "ip" commands.
    
    Update ip_maskbits_iface() to drop the '@' and everything after it.
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Amitay Isaacs <amitay at gmail.com>
    Reported-by: Jan Schwaratzki <jschwaratzki at ddn.com>

-----------------------------------------------------------------------

Summary of changes:
 ctdb/config/events.d/10.interface                  |  28 +-
 ctdb/config/events.d/60.ganesha                    | 253 -------------
 ctdb/config/events.d/60.nfs                        | 314 +++++++++++++---
 ctdb/config/functions                              | 397 +--------------------
 ctdb/config/nfs-checks.d/00.portmapper.check       |   2 +
 ctdb/config/nfs-checks.d/10.status.check           |   7 +
 ctdb/config/nfs-checks.d/20.nfs.check              |   7 +
 ctdb/config/nfs-checks.d/20.nfs_ganesha.disabled   |   8 +
 ctdb/config/nfs-checks.d/30.nlockmgr.check         |   6 +
 ctdb/config/nfs-checks.d/40.mountd.check           |   7 +
 ctdb/config/nfs-checks.d/50.rquotad.check          |   7 +
 ctdb/config/nfs-checks.d/README                    |  31 ++
 ctdb/config/nfs-ganesha-callout                    | 299 ++++++++++++++++
 ctdb/config/nfs-linux-kernel-callout               | 223 ++++++++++++
 ctdb/config/nfs-rpc-checks.d/10.statd.check        |   4 -
 ctdb/config/nfs-rpc-checks.d/20.nfsd.check         |   2 -
 ctdb/config/nfs-rpc-checks.d/30.lockd.check        |   2 -
 ctdb/config/nfs-rpc-checks.d/40.mountd.check       |   2 -
 ctdb/config/nfs-rpc-checks.d/50.rquotad.check      |   1 -
 ctdb/config/statd-callout                          |  18 +-
 ctdb/doc/ctdbd.conf.5.xml                          | 107 +-----
 ctdb/doc/examples/cluster.conf                     |   1 -
 ctdb/doc/examples/external.conf                    |   1 -
 ctdb/doc/examples/natgw.conf                       |   1 -
 ctdb/packaging/RPM/ctdb.spec.in                    |  16 +-
 ctdb/server/ctdb_persistent.c                      |   5 +-
 ctdb/server/eventscript.c                          |  23 +-
 .../tests/eventscripts/10.interface.monitor.008.sh |  14 +-
 .../tests/eventscripts/10.interface.monitor.017.sh |  20 ++
 .../tests/eventscripts/10.interface.monitor.018.sh |  20 ++
 ctdb/tests/eventscripts/10.interface.takeip.003.sh |  15 +-
 ctdb/tests/eventscripts/60.ganesha.monitor.101.sh  |  11 -
 ctdb/tests/eventscripts/60.ganesha.monitor.131.sh  |  17 -
 ctdb/tests/eventscripts/60.ganesha.monitor.141.sh  |  55 ---
 ctdb/tests/eventscripts/60.nfs.monitor.102.sh      |   3 +-
 ctdb/tests/eventscripts/60.nfs.monitor.103.sh      |   3 +-
 ctdb/tests/eventscripts/60.nfs.monitor.104.sh      |   3 +-
 ctdb/tests/eventscripts/60.nfs.monitor.105.sh      |  10 +
 ctdb/tests/eventscripts/60.nfs.monitor.106.sh      |  10 +
 ...60.nfs.monitor.101.sh => 60.nfs.monitor.107.sh} |   5 +-
 ctdb/tests/eventscripts/60.nfs.monitor.108.sh      |  12 +
 ctdb/tests/eventscripts/60.nfs.monitor.112.sh      |   4 +-
 ctdb/tests/eventscripts/60.nfs.monitor.113.sh      |   8 +-
 ctdb/tests/eventscripts/60.nfs.monitor.114.sh      |   8 +-
 ctdb/tests/eventscripts/60.nfs.monitor.121.sh      |   7 +-
 ctdb/tests/eventscripts/60.nfs.monitor.122.sh      |  10 +-
 ctdb/tests/eventscripts/60.nfs.monitor.131.sh      |   4 +-
 ctdb/tests/eventscripts/60.nfs.monitor.132.sh      |   9 +-
 ctdb/tests/eventscripts/60.nfs.monitor.141.sh      |   7 +-
 ctdb/tests/eventscripts/60.nfs.monitor.142.sh      |   5 +-
 ctdb/tests/eventscripts/60.nfs.monitor.143.sh      |   6 +-
 ctdb/tests/eventscripts/60.nfs.monitor.144.sh      |  47 +--
 ctdb/tests/eventscripts/60.nfs.monitor.152.sh      |   8 +-
 ctdb/tests/eventscripts/60.nfs.monitor.153.sh      |   9 +-
 ctdb/tests/eventscripts/README                     |   9 +-
 ctdb/tests/eventscripts/etc-ctdb/nfs-checks.d      |   1 +
 .../eventscripts/etc-ctdb/nfs-linux-kernel-callout |   1 +
 ctdb/tests/eventscripts/etc-ctdb/nfs-rpc-checks.d  |   1 -
 ctdb/tests/eventscripts/scripts/local.sh           | 369 ++++++++++---------
 ctdb/tests/eventscripts/stubs/ip                   |  50 ++-
 ctdb/tools/ctdb.c                                  |   7 +-
 ctdb/wscript                                       |   6 +-
 62 files changed, 1330 insertions(+), 1216 deletions(-)
 delete mode 100755 ctdb/config/events.d/60.ganesha
 create mode 100644 ctdb/config/nfs-checks.d/00.portmapper.check
 create mode 100644 ctdb/config/nfs-checks.d/10.status.check
 create mode 100644 ctdb/config/nfs-checks.d/20.nfs.check
 create mode 100644 ctdb/config/nfs-checks.d/20.nfs_ganesha.disabled
 create mode 100644 ctdb/config/nfs-checks.d/30.nlockmgr.check
 create mode 100644 ctdb/config/nfs-checks.d/40.mountd.check
 create mode 100644 ctdb/config/nfs-checks.d/50.rquotad.check
 create mode 100644 ctdb/config/nfs-checks.d/README
 create mode 100755 ctdb/config/nfs-ganesha-callout
 create mode 100755 ctdb/config/nfs-linux-kernel-callout
 delete mode 100644 ctdb/config/nfs-rpc-checks.d/10.statd.check
 delete mode 100644 ctdb/config/nfs-rpc-checks.d/20.nfsd.check
 delete mode 100644 ctdb/config/nfs-rpc-checks.d/30.lockd.check
 delete mode 100644 ctdb/config/nfs-rpc-checks.d/40.mountd.check
 delete mode 100644 ctdb/config/nfs-rpc-checks.d/50.rquotad.check
 create mode 100755 ctdb/tests/eventscripts/10.interface.monitor.017.sh
 create mode 100755 ctdb/tests/eventscripts/10.interface.monitor.018.sh
 delete mode 100755 ctdb/tests/eventscripts/60.ganesha.monitor.101.sh
 delete mode 100755 ctdb/tests/eventscripts/60.ganesha.monitor.131.sh
 delete mode 100755 ctdb/tests/eventscripts/60.ganesha.monitor.141.sh
 create mode 100755 ctdb/tests/eventscripts/60.nfs.monitor.105.sh
 create mode 100755 ctdb/tests/eventscripts/60.nfs.monitor.106.sh
 copy ctdb/tests/eventscripts/{60.nfs.monitor.101.sh => 60.nfs.monitor.107.sh} (55%)
 create mode 100755 ctdb/tests/eventscripts/60.nfs.monitor.108.sh
 create mode 120000 ctdb/tests/eventscripts/etc-ctdb/nfs-checks.d
 create mode 120000 ctdb/tests/eventscripts/etc-ctdb/nfs-linux-kernel-callout
 delete mode 120000 ctdb/tests/eventscripts/etc-ctdb/nfs-rpc-checks.d


Changeset truncated at 500 lines:

diff --git a/ctdb/config/events.d/10.interface b/ctdb/config/events.d/10.interface
index 69da210..acc0fc8 100755
--- a/ctdb/config/events.d/10.interface
+++ b/ctdb/config/events.d/10.interface
@@ -52,6 +52,30 @@ get_all_interfaces ()
     all_interfaces=$(echo $all_interfaces $ctdb_ifaces | tr ' ' '\n' | sort -u)
 }
 
+get_real_iface ()
+{
+    # Output of "ip link show <iface>"
+    _iface_info="$1"
+
+    # Extract the full interface description to see if it is a VLAN
+    _t=$(echo "$_iface_info" |
+		awk 'NR == 1 { iface = $2; sub(":$", "", iface) ; \
+			       print iface }')
+    case "$_t" in
+	*@*)
+	    # VLAN: use the underlying interface, after the '@'
+	    echo "${_t##*@}"
+	    ;;
+	*)
+	    # Not a regular VLAN.  For backward compatibility, assume
+	    # there is some other sort of VLAN that doesn't have the
+	    # '@' in the output and only use what is before a '.'.  If
+	    # there is no '.' then this will be the whole interface
+	    # name.
+	    echo "${_t%%.*}"
+    esac
+}
+
 monitor_interfaces()
 {
 	get_all_interfaces
@@ -65,7 +89,7 @@ monitor_interfaces()
 	# problem with an interface then set fail=true and continue.
 	for iface in $all_interfaces ; do
 
-	    ip link show $iface 2>/dev/null >/dev/null || {
+	    _iface_info=$(ip link show $iface 2>&1) || {
 		echo "ERROR: Interface $iface does not exist but it is used by public addresses."
 		mark_down $iface
 		continue
@@ -74,7 +98,7 @@ monitor_interfaces()
 	    # These interfaces are sometimes bond devices
 	    # When we use VLANs for bond interfaces, there will only
 	    # be an entry in /proc for the underlying real interface
-	    realiface=`echo $iface |sed -e 's/\..*$//'`
+	    realiface=$(get_real_iface "$_iface_info")
 	    bi=$(get_proc "net/bonding/$realiface" 2>/dev/null) && {
 		echo "$bi" | grep -q 'Currently Active Slave: None' && {
 			echo "ERROR: No active slaves for bond device $realiface"
diff --git a/ctdb/config/events.d/60.ganesha b/ctdb/config/events.d/60.ganesha
deleted file mode 100755
index 662d84c..0000000
--- a/ctdb/config/events.d/60.ganesha
+++ /dev/null
@@ -1,253 +0,0 @@
-#!/bin/sh
-# script to manage nfs in a clustered environment
-
-[ -n "$CTDB_BASE" ] || \
-    export CTDB_BASE=$(cd -P $(dirname "$0") ; dirname "$PWD")
-
-. $CTDB_BASE/functions
-
-GANRECDIR="/var/lib/nfs/ganesha"
-GANRECDIR2="/var/lib/nfs/ganesha/recevents"
-GPFS_STATE="/usr/lpp/mmfs/bin/mmgetstate"
-GANRECDIR3="/var/lib/nfs/ganesha_local"
-
-
-service_start ()
-{
-    startstop_ganesha stop
-    startstop_ganesha start
-    set_proc "sys/net/ipv4/tcp_tw_recycle" 1
-}
-
-service_stop ()
-{
-    startstop_ganesha stop
-}
-
-service_reconfigure ()
-{
-    # Restart lock manager, notify clients
-    if [ -x "${CTDB_BASE}/statd-callout" ] ; then
-	"${CTDB_BASE}/statd-callout" notify &
-    fi >/dev/null 2>&1
-}
-
-loadconfig "nfs"
-
-
-[ -n "$CTDB_CLUSTER_FILESYSTEM_TYPE" ] || CTDB_CLUSTER_FILESYSTEM_TYPE="gpfs"
-
-service_name="nfs-ganesha-$CTDB_CLUSTER_FILESYSTEM_TYPE"
-
-[ "${CTDB_NFS_SERVER_MODE:-${NFS_SERVER_MODE}}" = "ganesha" ] || exit 0
-
-ctdb_setup_service_state_dir
-
-ctdb_start_stop_service
-
-is_ctdb_managed_service || exit 0
-
-ctdb_service_check_reconfigure
-
-nodenum_file="${service_state_dir}/gpfs_nodenum"
-
-get_cluster_fs_state  ()
-{
-    case $CTDB_CLUSTER_FILESYSTEM_TYPE in
-        gpfs)
-            STATE=`$GPFS_STATE | awk 'NR <= 3 {next} {printf "%-6s", $3}'`
-            echo $STATE
-            ;;
-        *)
-            die "File system $CTDB_CLUSTER_FILESYSTEM_TYPE not supported"
-            ;;
-   esac
-}
-
-create_nodenum_file()
-{
-    NNUM=$(/usr/lpp/mmfs/bin/mmlsconfig myNodeConfigNumber | awk '{print $2}')
-    echo $NNUM > $nodenum_file
-}
-
-get_nodenum()
-{
-    if [ ! -f $nodenum_file ]; then
-        create_nodenum_file
-    fi
-    cat $nodenum_file
-}
-
-
-create_ganesha_recdirs ()
-{
-    [ -n "$CTDB_GANESHA_REC_SUBDIR" ] || CTDB_GANESHA_REC_SUBDIR=".ganesha"
-
-    _mounts=$(mount -t $CTDB_CLUSTER_FILESYSTEM_TYPE)
-    if [ -z "$_mounts" ]; then
-      echo "startup $CTDB_CLUSTER_FILESYSTEM_TYPE not ready"
-      exit 0
-    fi
-    _mntpt=$(echo "$_mounts" | sort | awk 'NR == 1 {print $3}')
-    _link_dst="${_mntpt}/${CTDB_GANESHA_REC_SUBDIR}"
-    mkdir -vp "$_link_dst"
-    if [ -e "$GANRECDIR" ]; then
-        if [ ! -L "$GANRECDIR" ] ; then
-            rm -vrf "$GANRECDIR"
-	else
-	    _t=$(readlink "$GANRECDIR")
-	    if [ "$_t" != "$_link_dst" ] ; then
-		rm -v "$GANRECDIR"
-	    fi
-        fi
-    fi
-    # This is not an "else".  It also re-creates the link if it was
-    # removed above!
-    if [ ! -e "$GANRECDIR" ]; then
-        ln -sv "$_link_dst" "$GANRECDIR"
-    fi
-
-    mkdir -p $GANRECDIR2
-    mkdir -p $GANRECDIR3
-}
-
-monitor_ganesha_nfsd ()
-{
-	create_ganesha_recdirs
-	service_name=${service_name}_process
-
-	PIDFILE="/var/run/ganesha.pid"
-	CUR_STATE=`get_cluster_fs_state`
-	GANESHA="/usr/bin/$CTDB_CLUSTER_FILESYSTEM_TYPE.ganesha.nfsd"
-	if { read PID < $PIDFILE && \
-	    grep "$GANESHA" "/proc/$PID/cmdline" ; } >/dev/null 2>&1 ; then
-		ctdb_counter_init "$service_name"
-	else
-	    if [ $CUR_STATE = "active" ]; then
-		echo "Trying fast restart of NFS service"
-		startstop_ganesha restart
-		ctdb_counter_incr "$service_name"
-		ctdb_check_counter "error" "-ge" "6" "$service_name"
-	    fi
-	fi
-
-	service_name="nfs-ganesha-$CTDB_CLUSTER_FILESYSTEM_TYPE"_service
-	# check that NFS is posting forward progress
-	if [ $CUR_STATE = "active" -a "$CTDB_NFS_SKIP_KNFSD_ALIVE_CHECK" != "yes" ] ; then
-	    MAXREDS=2
-	    MAXSTALL=120
-	    RESTART=0
-
-	    NUMREDS=`ls $GANRECDIR3 | grep "red" | wc -l`
-	    LASTONE=`ls -t $GANRECDIR3 | sed 's/_/ /' | awk 'NR > 1 {next} {printf $1} '`
-	    # Beware of startup
-	    if [ -z $LASTONE ] ; then
-		LASTONE=`date +"%s"`
-	    fi
-	    TNOW=$(date +"%s")
-	    TSTALL=$(($TNOW - $LASTONE))
-	    if [ $NUMREDS -ge $MAXREDS ] ; then
-		echo restarting because of $NUMREDS red conditions
-		RESTART=1
-		ctdb_counter_incr "$service_name"
-		ctdb_check_counter "error" "-ge" "6" "$service_name"
-	    fi
-	    if [ $TSTALL -ge $MAXSTALL ] ; then
-		echo restarting because of $TSTALL second stall
-		RESTART=1
-		ctdb_counter_incr "$service_name"
-		ctdb_check_counter "error" "-ge" "6" "$service_name"
-	    fi
-	    if [ $RESTART -gt 0 ] ; then
-		startstop_ganesha restart
-	    else
-		ctdb_counter_init "$service_name"
-	    fi
-	fi
-}
-
-############################################################
-
-case "$1" in
-     init)
-	# read statd from persistent database
-	;;
-     startup)
-	create_ganesha_recdirs
-	ctdb_service_start
-	create_nodenum_file
-	;;
-
-     shutdown)
-	ctdb_service_stop
-	;;
-
-     takeip)
-	if [ -n "$2" ] ; then
-	    case  $CTDB_CLUSTER_FILESYSTEM_TYPE in
-		gpfs)
-		    NNUM=$(get_nodenum)
-		    TDATE=`date +"%s"`
-		    TOUCHTGT=$1"_"$TDATE"_"$NNUM"_"$3"_"$4"_"$2
-		    touch $GANRECDIR2/$TOUCHTGT
-		    ;;
-	    esac
-	fi
-	ctdb_service_set_reconfigure
-	;;
-
-     releaseip)
-	if [ -n "$2" ] ; then
-	    case  $CTDB_CLUSTER_FILESYSTEM_TYPE in
-		gpfs)
-		    NNUM=$(get_nodenum)
-		    TDATE=`date +"%s"`
-		    TOUCHTGT=$1"_"$TDATE"_"$NNUM"_"$3"_"$4"_"$2
-		    touch $GANRECDIR2/$TOUCHTGT
-		    TOUCHTGT="my"$TOUCHTGT
-		    touch $GANRECDIR2/$TOUCHTGT
-		;;
-	    esac
-	fi
-	ctdb_service_set_reconfigure
-	;;
-
-     monitor)
-	# Check that directories for shares actually exist.
-	[ "$CTDB_NFS_SKIP_SHARE_CHECK" = "yes" ] || {
-	    grep Path /etc/ganesha/$CTDB_CLUSTER_FILESYSTEM_TYPE.ganesha.exports.conf |
-	    cut -f2 -d\" | sort -u | ctdb_check_directories
-	} || exit $?
-
-	update_tickles 2049
-	nfs_update_lock_info
-
-	# check that statd responds to rpc requests
-	# if statd is not running we try to restart it
-	# we only do this IF we have a rpc.statd command.
-	# For platforms where rpc.statd does not exist, we skip
-        # the check completely
-	p="rpc.statd"
-	type $p >/dev/null 2>/dev/null && \
-	    nfs_check_rpc_service "statd" \
-		%  10 "verbose restart:b unhealthy" \
-		-ge 6 "verbose unhealthy" \
-		-eq 4 "verbose restart" \
-		-eq 2 "restart:b"
-
-	if [ "$CTDB_SKIP_GANESHA_NFSD_CHECK" != "yes" ] ; then
-	    monitor_ganesha_nfsd
-	fi
-
-	# rquotad is sometimes not started correctly on RHEL5
-	# not a critical service so we dont flag the node as unhealthy
-	nfs_check_rpc_service "rquotad" \
-	    -gt 0 "verbose restart:b"
-	;;
-
-     *)
-	ctdb_standard_event_handler "$@"
-        ;;
-esac
-
-exit 0
diff --git a/ctdb/config/events.d/60.nfs b/ctdb/config/events.d/60.nfs
index babff1e..fce6beb 100755
--- a/ctdb/config/events.d/60.nfs
+++ b/ctdb/config/events.d/60.nfs
@@ -7,16 +7,57 @@
 . $CTDB_BASE/functions
 
 service_name="nfs"
-service_start ()
+loadconfig
+ctdb_setup_service_state_dir
+
+######################################################################
+
+if [ -z "$CTDB_NFS_CALLOUT" ] ; then
+    CTDB_NFS_CALLOUT="${CTDB_BASE}/nfs-linux-kernel-callout"
+fi
+# Always export, for statd callout
+export CTDB_NFS_CALLOUT
+
+nfs_callout_cache="${service_state_dir}/nfs_callout_cache"
+nfs_callout_cache_callout="${nfs_callout_cache}/CTDB_NFS_CALLOUT"
+nfs_callout_cache_ops="${nfs_callout_cache}/ops"
+
+nfs_callout_register ()
 {
-    startstop_nfs stop
-    startstop_nfs start
-    set_proc "sys/net/ipv4/tcp_tw_recycle" 1
+    mkdir -p "$nfs_callout_cache_ops"
+    rm -f "$nfs_callout_cache_ops"/*
+
+    echo "$CTDB_NFS_CALLOUT" >"$nfs_callout_cache_callout"
+
+    _t=$(eval "$CTDB_NFS_CALLOUT" "register")
+    if [ -n "$_t" ] ; then
+	echo "$_t" |
+	    while IFS="" read _op ; do
+		touch "${nfs_callout_cache_ops}/${_op}"
+	    done
+    else
+	touch "${nfs_callout_cache_ops}/ALL"
+    fi
 }
-service_stop ()
+
+nfs_callout ()
 {
-    startstop_nfs stop
+    # Re-run registration if $CTDB_NFS_CALLOUT has changed
+    _prev=""
+    if [ -r "$nfs_callout_cache_callout" ] ; then
+	read _prev <"$nfs_callout_cache_callout"
+    fi
+    if [ "$CTDB_NFS_CALLOUT" != "$_prev" ] ; then
+	nfs_callout_register
+    fi
+
+    # Run the operation if it is registered...
+    if [ -e "${nfs_callout_cache_ops}/${1}" ] || \
+	   [ -e "${nfs_callout_cache_ops}/ALL" ]; then
+	eval "$CTDB_NFS_CALLOUT" "$@"
+    fi
 }
+
 service_reconfigure ()
 {
     # Restart lock manager, notify clients
@@ -25,34 +66,212 @@ service_reconfigure ()
     fi >/dev/null 2>&1
 }
 
-nfs_check_thread_count ()
+######################################################################
+
+######################################################
+# Check the health of NFS services
+#
+# Use .check files in given directory.
+# Default is "${CTDB_BASE}/nfs-checks.d/"
+######################################################
+nfs_check_services ()
+{
+    _dir="${1:-${CTDB_NFS_CHECKS_DIR:-${CTDB_BASE}/nfs-checks.d}}"
+
+    # Files must end with .check - avoids editor backups, RPM fu, ...
+    for _f in "$_dir"/[0-9][0-9].*.check ; do
+	_t="${_f%.check}"
+	_progname="${_t##*/[0-9][0-9].}"
+
+	nfs_check_service "$_progname" <"$_f"
+    done
+}
+
+######################################################
+# Check the health of an NFS service
+#
+# $1 - progname, passed to rpcinfo (looked up in /etc/rpc)
+#
+# Reads variables from stdin
+#
+# Variables are:
+#
+# * family             - "tcp" or "udp" or space separated list
+#                        default: tcp, not used with "service_check_cmd"
+# * version            - optional, RPC service version number
+#                        default is to omit to check for any version,
+#                        not used with "service_check_cmd"
+# * unhealthy_after    - number of check fails before unhealthy
+#                        default: 1
+# * restart_every      - number of check fails before restart
+#                        default: 0, meaning no restart
+# * service_stop_cmd   - command to stop service
+#                        default: no default, must be provided if
+#                                 restart_every > 0
+# * service_start_cmd  - command to start service
+#                        default: no default, must be provided if
+#                                 restart_every > 0
+# * service_check_cmd  - command to check health of service
+#                        default is to check RPC service using rpcinfo
+# * service_debug_cmd  - command to debug a service after trying to stop it;
+#                        for example, it can be useful to print stack
+#                        traces of threads that have not exited, since
+#                        they may be stuck doing I/O;
+#                        no default, see also function program_stack_traces()
+#
+# Quoting in values is not preserved
+#
+######################################################
+nfs_check_service ()
 {
-    [ "$CTDB_MONITOR_NFS_THREAD_COUNT" = "yes" ] || return 0
-
-    # If $RPCNFSDCOUNT/$USE_KERNEL_NFSD_NUMBER isn't set then we could
-    # guess the default from the initscript.  However, let's just
-    # assume that those using the default don't care about the number
-    # of threads and that they have switched on this feature in error.
-    _configured_threads="${RPCNFSDCOUNT:-${USE_KERNEL_NFSD_NUMBER}}"
-    [ -n "$_configured_threads" ] || return 0
-
-    # nfsd should be running the configured number of threads.  If
-    # there are a different number of threads then tell nfsd the
-    # correct number.  
-    _running_threads=$(get_proc "fs/nfsd/threads")
-    # Intentionally not arithmetic comparison - avoids extra errors
-    # when get_proc() fails...
-    if [ "$_running_threads" != "$_configured_threads" ] ; then
-	echo "Attempting to correct number of nfsd threads from ${_running_threads} to ${_configured_threads}"
-	set_proc "fs/nfsd/threads" "$_configured_threads"
+    _progname="$1"
+
+    (
+	# Subshell to restrict scope variables...
+
+	# Defaults
+	family="tcp"
+	version=""
+	unhealthy_after=1
+	restart_every=0
+	service_stop_cmd=""
+	service_start_cmd=""
+	service_check_cmd=""
+	service_debug_cmd=""
+
+	# Eval line-by-line.  Expands variable references in values.
+	# Also allows variable name checking, which seems useful.
+	while read _line ; do
+	    case "$_line" in
+		\#*|"") : ;; # Ignore comments, blank lines
+
+		family=*|version=*|\
+		unhealthy_after=*|restart_every=*|\
+		service_stop_cmd=*|service_start_cmd=*|\
+		service_check_cmd=*|service_debug_cmd=*)
+
+		    eval "$_line"
+		    ;;
+		*)
+		    echo "ERROR: Unknown variable for ${_progname}: ${_line}"
+		    exit 1
+	    esac
+	done
+
+	_service_name="nfs_${_progname}"
+
+	_ok=false
+	if [ -n "$service_check_cmd" ] ; then
+	    # Using eval means variables can contain semicolon separated commands


-- 
Samba Shared Repository



More information about the samba-cvs mailing list