diff options
author | Pedro Alvarez <pedro.alvarez@codethink.co.uk> | 2014-12-16 17:51:15 +0000 |
---|---|---|
committer | Pedro Alvarez <pedro.alvarez@codethink.co.uk> | 2014-12-23 16:27:56 +0100 |
commit | 8da19218ba4b6000be39794296deb30827f3f3b5 (patch) | |
tree | 6db34953b16c8d5c11e564ca6969370f0e44b379 /pxeboot.check | |
parent | 201ecd52efd3cb5a44a5e9b6928146934b66012e (diff) | |
download | definitions-8da19218ba4b6000be39794296deb30827f3f3b5.tar.gz |
pxeboot.check: Check if nfs-server is running when is needed
Diffstat (limited to 'pxeboot.check')
-rwxr-xr-x | pxeboot.check | 10 |
1 files changed, 10 insertions, 0 deletions
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) |