Use cat instead of read<file
Use cat instead of read<file

When reading a file, it is expected that
the read process will exit 1 as this is
expected whenever the input reaches an EOF.

Because it is not clear if the 'exit 1' is
from a successful read or a more serious error,
and as this edge-case of 'read' is not well-known,
we instead change this code to read the file using
'cat'.

The new code is moved into a function, is_docker_running.

Furthermore, we now quote the variables and check
for the existance of the pid file for better and safer
error handling.

Change-Id: Idb56b87349a5a84d5d255715cfb7191341363118
Closes-Bug: 1286441

pacinete/devstack,mmasaki/devstack,vishnugonela/devstack,nawawi/openstack,LoHChina/devstack,atulpatil301/devstack,richliu/devstack,upadhyay-prashant/devstack,j4/devstack,vishnugonela/devstack,JioCloud/devstack,BSJAIN92/OpenStack,nuxeh/devstack,pombredanne/devstack,openstack-dev/devstack,flavio-fernandes/devstack,ozamiatin/devstack,sequenceiq/devstack,nawawi/openstack,rushiagr/devstack,promptworks/devstack,olivierlemasle/devstack,parul24/devstack,Juniper/devstack,bswartz/devstack,TwinkleChawla/devstack,bigswitch/devstack,bswartz/devstack,jamielennox/devstack,varunarya10/devstack,bljgaurav/openstack-test,BSJAIN92/OpenStack,vsham20/devstack,nuxeh/devstack,costingalan/devstack,noironetworks/devstack,avvocatodemarchis/devstack,herrsechs/devstack,bljgaurav/openstack-test,group-policy/devstack,NaokiMiyata/devstack,vsham20/devstack,sc68cal/devstack,dtroyer/devstack,affo/devstack,bq-xiao/devstack,olivierlemasle/devstack,NaokiMiyata/devstack,avvocatodemarchis/devstack,liuquansheng47/devstack,mssumanth/devstack,wenhuizhang/devstack,parul24/devstack,Mahito/devstack,neerja28/Devstack_GlusterFS,Mahito/devstack,openstack-dev/devstack,group-policy/devstack,LoHChina/devstack,mssumanth/devstack,varunarya10/devstack,rushiagr/devstack,atulpatil301/devstack,sequenceiq/devstack,CloudServer/devstack,dtroyer/devstack,prithivm/branch01,samgoon/devstack,eharney/devstack,TwinkleChawla/devstack,bq-xiao/devstack,wenhuizhang/devstack,costingalan/devstack,dirkmueller/devstack,tianweizhang/devstack,ozamiatin/devstack,bigswitch/devstack,prithivm/branch01,mc2014/devstack,liuquansheng47/devstack,kplus/devstack-moonshot,herrsechs/devstack,mmasaki/devstack,samgoon/devstack,pombredanne/devstack,virtualopensystems/devstack,eshnil2000/devstack,pczerkas/devstack,HPCHub/devstack,promptworks/devstack,richliu/devstack,flavio-fernandes/devstack,srics/devstack,andrewrothstein/devstack,williamthegrey/devstack,j4/devstack,kplus/devstack-moonshot,neerja28/Devstack_GlusterFS,mc2014/devstack,tianweizhang/devstack,eharney/devstack,thomasem/devstack,sc68cal/devstack,dirkmueller/devstack,pacinete/devstack,HPCHub/devstack,innodee/openstackk,noironetworks/devstack,CloudServer/devstack,thomasem/devstack,affo/devstack,andrewrothstein/devstack,pczerkas/devstack,upadhyay-prashant/devstack