Fix check for nfsd presence

Check for nfsd has been implemented incorrectly and has
apparently checked nothing. This change fixes that.

Change-Id: I2cc735744fcb588e9945e34de4cd4cc2270078f8
Closes-Bug: 1616061
This commit is contained in:
Alexey Ovchinnikov 2016-09-23 15:37:47 +03:00
parent 4b77503863
commit 332cbf253a
1 changed files with 2 additions and 2 deletions

View File

@ -606,7 +606,7 @@ function init_manila {
# check_nfs_kernel_service_state_ubuntu- Make sure nfsd is running
function check_nfs_kernel_service_state_ubuntu {
# (aovchinnikov): Workaround for nfs-utils bug 1052264
if [ ! sudo service nfs-kernel-server status | grep "nfsd running" -eq 0 ]; then
if [[ $(sudo service nfs-kernel-server status | grep -c "nfsd running") -eq 0 ]]; then
echo "Apparently nfsd is not running. Trying to fix that."
sudo mkdir -p "/media/nfsdonubuntuhelper"
# (aovchinnikov): shell wrapping is needed for cases when a file to be written
@ -614,7 +614,7 @@ function check_nfs_kernel_service_state_ubuntu {
sudo sh -c "echo '/media/nfsdonubuntuhelper 127.0.0.1(ro)' >> /etc/exports"
sudo service nfs-kernel-server start
fi
if [ ! sudo service nfs-kernel-server status | grep "nfsd running" -eq 0 ]; then
if [[ $(sudo service nfs-kernel-server status | grep -c "nfsd running") -eq 0 ]]; then
echo "Failed to start nfsd. Exiting."
exit 1
fi