summaryrefslogtreecommitdiff
path: root/ctdb/config/events.d/40.vsftpd
diff options
context:
space:
mode:
authorMartin Schwenke <martin@meltin.net>2011-08-11 09:39:25 +1000
committerMartin Schwenke <martin@meltin.net>2011-08-11 10:46:20 +1000
commit428e32d6475c7ef8ecc70cf61731cd94a22c2fbb (patch)
tree525b1db33d7f473745a9db029fd064c7357eca73 /ctdb/config/events.d/40.vsftpd
parentf60802c77600c6503f19060ee90791817236fe13 (diff)
downloadsamba-428e32d6475c7ef8ecc70cf61731cd94a22c2fbb.tar.gz
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)
Diffstat (limited to 'ctdb/config/events.d/40.vsftpd')
-rwxr-xr-xctdb/config/events.d/40.vsftpd11
1 files changed, 9 insertions, 2 deletions
diff --git a/ctdb/config/events.d/40.vsftpd b/ctdb/config/events.d/40.vsftpd
index 72190db2a64..8ce20663488 100755
--- a/ctdb/config/events.d/40.vsftpd
+++ b/ctdb/config/events.d/40.vsftpd
@@ -5,8 +5,15 @@
service_name="vsftpd"
# make sure the service is stopped first
-service_start="service $service_name stop > /dev/null 2>&1 ; service $service_name start"
-service_stop="service $service_name stop > /dev/null 2>&1"
+service_start ()
+{
+ service $service_name stop > /dev/null 2>&1
+ service $service_name start
+}
+service_stop ()
+{
+ service $service_name stop > /dev/null 2>&1
+}
service_reconfigure="service $service_name restart"
service_fail_limit=2
service_tcp_ports=21