Eventscript function: change service_start into a function.
authorMartin Schwenke <martin@meltin.net>
Wed, 10 Aug 2011 23:39:25 +0000 (09:39 +1000)
committerMartin Schwenke <martin@meltin.net>
Thu, 11 Aug 2011 00:46:20 +0000 (10:46 +1000)
commit428e32d6475c7ef8ecc70cf61731cd94a22c2fbb
tree525b1db33d7f473745a9db029fd064c7357eca73
parentf60802c77600c6503f19060ee90791817236fe13
Eventscript function: change service_start into a function.

service_start is currently a variable.  This makes passing arguments
hard.  We change it to be a function and put default definitions into
the functions file.

We use a convention that if a service name argument is passed to a
redefined version of service_start() or service_stop() then it will
act unconditionally.  If no argument is passed then it can use
internal logic to decide if services should really be started.  This
is useful when a single eventscript handles multiple services.

This is a cherry-pick of ae38895 that needed to be reset mid-stream.
There is still some breakage following this commit.

Signed-off-by: Martin Schwenke <martin@meltin.net>
(This used to be ctdb commit 86e4aefed9fd1028660c98e3ea758c2b75ffc1d8)
ctdb/config/events.d/31.clamd [changed mode: 0644->0755]
ctdb/config/events.d/40.vsftpd
ctdb/config/events.d/41.httpd
ctdb/config/events.d/50.samba
ctdb/config/events.d/60.nfs
ctdb/config/functions