ctdb-config: depend on /etc/ctdb/nodes file
authorRafael David Tinoco <rafaeldtinoco@ubuntu.com>
Thu, 27 Jun 2019 20:12:25 +0000 (20:12 +0000)
committerAmitay Isaacs <amitay@samba.org>
Fri, 5 Jul 2019 06:49:16 +0000 (06:49 +0000)
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14017

CTDB should start as a disabled unit (systemd) in most of the
distributions and, when trying to enable it for the first time, user
should get an unconfigured, or similar, error.

Depending on /etc/ctdb/nodes file will give a clear direction to final
user on what is needed in order to get cluster up and running. It should
work like previous ENABLED=NO variables in SySV like initialization
scripts.

Signed-off-by: Rafael David Tinoco <rafaeldtinoco@ubuntu.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
ctdb/config/ctdb.service

index 675b3147417e8aebd15fa1a8b8285eccf90f3d47..fd81c38e26daff89c3e220f19ea5df5f4c110278 100644 (file)
@@ -2,6 +2,7 @@
 Description=CTDB
 Documentation=man:ctdbd(1) man:ctdb(7)
 After=network-online.target time-sync.target
+ConditionFileNotEmpty=/etc/ctdb/nodes
 
 [Service]
 Type=forking