From 8da19218ba4b6000be39794296deb30827f3f3b5 Mon Sep 17 00:00:00 2001 From: Pedro Alvarez Date: Tue, 16 Dec 2014 17:51:15 +0000 Subject: pxeboot.check: Check if nfs-server is running when is needed --- pxeboot.check | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/pxeboot.check b/pxeboot.check index fabe8138..611708a9 100755 --- a/pxeboot.check +++ b/pxeboot.check @@ -2,6 +2,7 @@ import itertools import os +import subprocess import sys flatten = itertools.chain.from_iterable @@ -74,3 +75,12 @@ else: if mode not in valid_modes: print('%s is not a valid PXEBOOT_MODE' % mode) sys.exit(1) + +if mode != 'existing-server': + with open(os.devnull, 'w') as devnull: + if subprocess.call(['systemctl', 'is-active', 'nfs-server'], + stdout=devnull) != 0: + print ('ERROR: nfs-server.service is not running and is needed ' + 'for this deployment. Please, run `systemctl start nfs-server` ' + 'and try `morph deploy` again.') + sys.exit(1) -- cgit v1.2.1