[Spark-5889] Remove pid file after stopping service.
[Spark-5889] Remove pid file after stopping service.

Currently the pid file is not deleted, and potentially may cause some problem after service is stopped. The fix remove the pid file after service stopped.

Author: Zhan Zhang <zhazhan@gmail.com>

Closes #4676 from zhzhan/spark-5889 and squashes the following commits:

eb01be1 [Zhan Zhang] solve review comments
b4c009e [Zhan Zhang] solve review comments
018110a [Zhan Zhang] spark-5889: remove pid file after stopping service
088d2a2 [Zhan Zhang] squash all commits
c1f1fa5 [Zhan Zhang] test

cin/spark,cin/spark,adrian-ionescu/apache-spark,JerryLead/spark,hhbyyh/spark,nlalevee/spark,yanboliang/spark,xuanyuanking/spark,wangyum/spark,jkbradley/spark,lvdongr/spark,HyukjinKwon/spark,bravo-zhang/spark,JoshRosen/spark,Aegeaner/spark,WeichenXu123/spark,ddna1021/spark,icexelloss/spark,1haodian/spark,andrewor14/iolap,rekhajoshm/spark,metamx/spark,jrshust/spark,michalsenkyr/spark,lxsmnv/spark,ahnqirage/spark,tengpeng/spark,alunarbeach/spark,ioana-delaney/spark,eyalfa/spark,andrewor14/spark,alunarbeach/spark,dhruve/spark,markhamstra/spark,mahak/spark,rednaxelafx/apache-spark,gengliangwang/spark,dongjoon-hyun/spark,gioenn/xSpark,milliman/spark,caneGuy/spark,nilsgrabbert/spark,akopich/spark,patrick-nicholson/spark,byakuinss/spark,jiangxb1987/spark,xuanyuanking/spark,sachintyagi22/spark,SnappyDataInc/spark,UndeadBaneGitHub/spark,esi-mineset/spark,JerryLead/spark,bravo-zhang/spark,aosagie/spark,hvanhovell/spark,rednaxelafx/apache-spark,gengliangwang/spark,haowu80s/spark,shuangshuangwang/spark,wangmiao1981/spark,tengpeng/spark,setjet/spark,highfei2011/spark,SHASHANKB/spark,WeichenXu123/spark,Panos-Bletsos/spark-cost-model-optimizer,cin/spark,witgo/spark,rezasafi/spark,ConeyLiu/spark,xflin/spark,markhamstra/spark,witgo/spark,patrick-nicholson/spark,ddna1021/spark,lxsmnv/spark,mdespriee/spark,pgandhi999/spark,pronix/spark,chuckchen/spark,adrian-ionescu/apache-spark,mzl9039/spark,Aegeaner/spark,dhruve/spark,SnappyDataInc/spark,apache-spark-on-k8s/spark,LantaoJin/spark,ron8hu/spark,janewangfb/spark,zhouyejoe/spark,big-pegasus/spark,MLnick/spark,vinodkc/spark,metamx/spark,kimoonkim/spark,actuaryzhang/spark,JoshRosen/spark,jianran/spark,esi-mineset/spark,kiszk/spark,markhamstra/spark,darionyaphet/spark,rezasafi/spark,shaneknapp/spark,patrick-nicholson/spark,sachintyagi22/spark,vinodkc/spark,bravo-zhang/spark,ron8hu/spark,alunarbeach/spark,goldmedal/spark,guoxiaolongzte/spark,ibm-research-ireland/sparkoscope,rikima/spark,panfengfeng/spark,pronix/spark,LantaoJin/spark,spark-test/spark,holdenk/spark,big-pegasus/spark,nilsgrabbert/spark,michalsenkyr/spark,hvanhovell/spark,kevinyu98/spark,jlopezmalla/spark,zero323/spark,jianran/spark,ahnqirage/spark,ahnqirage/spark,facaiy/spark,someorz/spark,szhem/spark,taroplus/spark,shuangshuangwang/spark,aokolnychyi/spark,shuangshuangwang/spark,markhamstra/spark,UndeadBaneGitHub/spark,spark-test/spark,jlopezmalla/spark,chuckchen/spark,ajaysaini725/spark,rekhajoshm/spark,kevinyu98/spark,kissmetrics/spark,mike0sv/spark,brad-kaiser/spark,michalsenkyr/spark,ahnqirage/spark,aosagie/spark,zzcclp/spark,joseph-torres/spark,hhbyyh/spark,MLnick/spark,andrewor14/spark,kiszk/spark,minixalpha/spark,Aegeaner/spark,bOOm-X/spark,spark-test/spark,shubhamchopra/spark,saltstar/spark,pgandhi999/spark,lvdongr/spark,andrewor14/iolap,apache-spark-on-k8s/spark,stanzhai/spark,sureshthalamati/spark,narahari92/spark,HyukjinKwon/spark,someorz/spark,ajaysaini725/spark,liutang123/spark,debugger87/spark,shuangshuangwang/spark,mzl9039/spark,1haodian/spark,tengpeng/spark,jiangxb1987/spark,actuaryzhang/spark,wzhfy/spark,janewangfb/spark,aosagie/spark,highfei2011/spark,szhem/spark,BryanCutler/spark,tejasapatil/spark,mike0sv/spark,tejasapatil/spark,taroplus/spark,pgandhi999/spark,haowu80s/spark,apache-spark-on-k8s/spark,byakuinss/spark,milliman/spark,michalsenkyr/spark,ddna1021/spark,aosagie/spark,zuotingbing/spark,icexelloss/spark,publicRoman/spark,lvdongr/spark,liyichao/spark,rekhajoshm/spark,ajaysaini725/spark,loneknightpy/spark,mdespriee/spark,wzhfy/spark,Panos-Bletsos/spark-cost-model-optimizer,pgandhi999/spark,byakuinss/spark,panfengfeng/spark,jrshust/spark,techaddict/spark,JerryLead/spark,ConeyLiu/spark,tejasapatil/spark,apache-spark-on-k8s/spark,dbtsai/spark,JerryLead/spark,zhouyejoe/spark,spark-test/spark,lvdongr/spark,zuotingbing/spark,kissmetrics/spark,liyichao/spark,holdenk/spark,loneknightpy/spark,metamx/spark,sahilTakiar/spark,yanboliang/spark,aray/spark,mahak/spark,liutang123/spark,bravo-zhang/spark,kissmetrics/spark,aokolnychyi/spark,bOOm-X/spark,big-pegasus/spark,pronix/spark,icexelloss/spark,yanboliang/spark,JoshRosen/spark,bOOm-X/spark,map222/spark,milliman/spark,mzl9039/spark,gengliangwang/spark,saturday-shi/spark,SHASHANKB/spark,ericvandenbergfb/spark,gioenn/xSpark,wangyum/spark,metamx/spark,Aegeaner/spark,apache/spark,esi-mineset/spark,eyalfa/spark,huang1900/spark,wangyum/spark,WindCanDie/spark,markhamstra/spark,byakuinss/spark,zhouyejoe/spark,apache/spark,maropu/spark,SnappyDataInc/spark,LantaoJin/spark,aokolnychyi/spark,sachintyagi22/spark,bOOm-X/spark,huang1900/spark,mahak/spark,goldmedal/spark,ericvandenbergfb/spark,lxsmnv/spark,loneknightpy/spark,ibm-research-ireland/sparkoscope,kevinyu98/spark,BryanCutler/spark,gioenn/xSpark,eyalfa/spark,rikima/spark,nchammas/spark,huang1900/spark,actuaryzhang/spark,kissmetrics/spark,caneGuy/spark,xuanyuanking/spark,techaddict/spark,andrewor14/spark,andrewor14/iolap,nlalevee/spark,ueshin/apache-spark,mike0sv/spark,rezasafi/spark,patrick-nicholson/spark,poffuomo/spark,mike0sv/spark,ahnqirage/spark,zuotingbing/spark,ConeyLiu/spark,xflin/spark,milliman/spark,UndeadBaneGitHub/spark,zuotingbing/spark,szhem/spark,tejasapatil/spark,rikima/spark,loneknightpy/spark,JerryLead/spark,zhouyejoe/spark,ptkool/spark,SnappyDataInc/spark,stanzhai/spark,minixalpha/spark,ptkool/spark,akopich/spark,milliman/spark,byakuinss/spark,nchammas/spark,maropu/spark,sahilTakiar/spark,panfengfeng/spark,kimoonkim/spark,liutang123/spark,facaiy/spark,narahari92/spark,shubhamchopra/spark,joseph-torres/spark,shaneknapp/spark,apache-spark-on-k8s/spark,spark-test/spark,MLnick/spark,ptkool/spark,techaddict/spark,dongjoon-hyun/spark,adrian-ionescu/apache-spark,UndeadBaneGitHub/spark,jiangxb1987/spark,yanboliang/spark,debugger87/spark,mdespriee/spark,dbtsai/spark,SHASHANKB/spark,ericvandenbergfb/spark,panfengfeng/spark,narahari92/spark,jianran/spark,wangmiao1981/spark,bdrillard/spark,poffuomo/spark,wangyum/spark,SnappyDataInc/spark,minixalpha/spark,apache/spark,guoxiaolongzte/spark,bdrillard/spark,SHASHANKB/spark,saltstar/spark,xflin/spark,guoxiaolongzte/spark,ibm-research-ireland/sparkoscope,holdenk/spark,setjet/spark,andrewor14/spark,SHASHANKB/spark,hvanhovell/spark,markhamstra/spark,ajaysaini725/spark,witgo/spark,setjet/spark,vinodkc/spark,nlalevee/spark,ueshin/apache-spark,sahilTakiar/spark,ueshin/apache-spark,big-pegasus/spark,techaddict/spark,zzcclp/spark,mike0sv/spark,ericvandenbergfb/spark,JerryLead/spark,HyukjinKwon/spark,eyalfa/spark,ptkool/spark,nlalevee/spark,goldmedal/spark,milliman/spark,setjet/spark,ajaysaini725/spark,tejasapatil/spark,someorz/spark,minixalpha/spark,lxsmnv/spark,nilsgrabbert/spark,cloud-fan/spark,zero323/spark,eyalfa/spark,hhbyyh/spark,Aegeaner/spark,rikima/spark,huang1900/spark,JerryLead/spark,WindCanDie/spark,actuaryzhang/spark,1haodian/spark,zzcclp/spark,akopich/spark,lvdongr/spark,liyichao/spark,taroplus/spark,setjet/spark,darionyaphet/spark,maropu/spark,nilsgrabbert/spark,aokolnychyi/spark,witgo/spark,jianran/spark,narahari92/spark,1haodian/spark,map222/spark,jlopezmalla/spark,sahilTakiar/spark,aosagie/spark,WindCanDie/spark,WindCanDie/spark,esi-mineset/spark,janewangfb/spark,szhem/spark,JoshRosen/spark,someorz/spark,panfengfeng/spark,skonto/spark,poffuomo/spark,holdenk/spark,rednaxelafx/apache-spark,witgo/spark,saturday-shi/spark,patrick-nicholson/spark,haowu80s/spark,huang1900/spark,jkbradley/spark,techaddict/spark,wzhfy/spark,lxsmnv/spark,UndeadBaneGitHub/spark,saltstar/spark,gioenn/xSpark,zero323/spark,vinodkc/spark,hhbyyh/spark,patrick-nicholson/spark,map222/spark,SHASHANKB/spark,big-pegasus/spark,aokolnychyi/spark,hvanhovell/spark,nchammas/spark,aray/spark,Panos-Bletsos/spark-cost-model-optimizer,pgandhi999/spark,pronix/spark,debugger87/spark,minixalpha/spark,dongjoon-hyun/spark,michalsenkyr/spark,UndeadBaneGitHub/spark,brad-kaiser/spark,apache/spark,highfei2011/spark,panfengfeng/spark,MLnick/spark,map222/spark,lvdongr/spark,actuaryzhang/spark,zero323/spark,srowen/spark,witgo/spark,WeichenXu123/spark,jrshust/spark,poffuomo/spark,xflin/spark,1haodian/spark,LantaoJin/spark,someorz/spark,aokolnychyi/spark,WeichenXu123/spark,yanboliang/spark,aray/spark,ptkool/spark,hvanhovell/spark,shaneknapp/spark,jianran/spark,brad-kaiser/spark,xuanyuanking/spark,sureshthalamati/spark,mdespriee/spark,janewangfb/spark,guoxiaolongzte/spark,shaneknapp/spark,jkbradley/spark,skonto/spark,LantaoJin/spark,skonto/spark,xflin/spark,dongjoon-hyun/spark,kimoonkim/spark,lxsmnv/spark,stanzhai/spark,andrewor14/spark,holdenk/spark,MLnick/spark,liyichao/spark,rekhajoshm/spark,xflin/spark,matthewfranglen/spark,MLnick/spark,metamx/spark,highfei2011/spark,big-pegasus/spark,kimoonkim/spark,nchammas/spark,andrewor14/iolap,haowu80s/spark,shuangshuangwang/spark,xuanyuanking/spark,zhouyejoe/spark,WeichenXu123/spark,saltstar/spark,dongjoon-hyun/spark,adrian-ionescu/apache-spark,highfei2011/spark,yanboliang/spark,BryanCutler/spark,rednaxelafx/apache-spark,srowen/spark,Panos-Bletsos/spark-cost-model-optimizer,bdrillard/spark,cloud-fan/spark,icexelloss/spark,JoshRosen/spark,publicRoman/spark,saturday-shi/spark,guoxiaolongzte/spark,sahilTakiar/spark,liyichao/spark,andrewor14/spark,mike0sv/spark,akopich/spark,ConeyLiu/spark,sureshthalamati/spark,mahak/spark,brad-kaiser/spark,LantaoJin/spark,ptkool/spark,rikima/spark,metamx/spark,gengliangwang/spark,rezasafi/spark,big-pegasus/spark,pgandhi999/spark,BryanCutler/spark,ahnqirage/spark,joseph-torres/spark,1haodian/spark,adrian-ionescu/apache-spark,dhruve/spark,markhamstra/spark,JoshRosen/spark,alunarbeach/spark,rezasafi/spark,actuaryzhang/spark,kiszk/spark,minixalpha/spark,vinodkc/spark,ron8hu/spark,apache/spark,Panos-Bletsos/spark-cost-model-optimizer,brad-kaiser/spark,tengpeng/spark,kevinyu98/spark,wzhfy/spark,dongjoon-hyun/spark,shubhamchopra/spark,WeichenXu123/spark,shaneknapp/spark,loneknightpy/spark,mzl9039/spark,aray/spark,narahari92/spark,publicRoman/spark,gioenn/xSpark,joseph-torres/spark,facaiy/spark,WindCanDie/spark,Aegeaner/spark,jiangxb1987/spark,zero323/spark,hvanhovell/spark,shaneknapp/spark,darionyaphet/spark,Panos-Bletsos/spark-cost-model-optimizer,pronix/spark,ibm-research-ireland/sparkoscope,janewangfb/spark,someorz/spark,tejasapatil/spark,poffuomo/spark,dbtsai/spark,saturday-shi/spark,joseph-torres/spark,aray/spark,joseph-torres/spark,cloud-fan/spark,icexelloss/spark,zhouyejoe/spark,stanzhai/spark,alunarbeach/spark,srowen/spark,liutang123/spark,lvdongr/spark,srowen/spark,rekhajoshm/spark,MLnick/spark,sahilTakiar/spark,ericvandenbergfb/spark,brad-kaiser/spark,bOOm-X/spark,actuaryzhang/spark,SnappyDataInc/spark,kimoonkim/spark,apache/spark,huang1900/spark,cloud-fan/spark,kissmetrics/spark,jrshust/spark,ddna1021/spark,dhruve/spark,sachintyagi22/spark,HyukjinKwon/spark,shaneknapp/spark,alunarbeach/spark,shubhamchopra/spark,esi-mineset/spark,hhbyyh/spark,SnappyDataInc/spark,ioana-delaney/spark,taroplus/spark,goldmedal/spark,ericvandenbergfb/spark,alunarbeach/spark,gioenn/xSpark,ioana-delaney/spark,Aegeaner/spark,ioana-delaney/spark,saturday-shi/spark,milliman/spark,ioana-delaney/spark,chuckchen/spark,caneGuy/spark,kevinyu98/spark,kiszk/spark,facaiy/spark,byakuinss/spark,apache-spark-on-k8s/spark,dbtsai/spark,hhbyyh/spark,goldmedal/spark,witgo/spark,zero323/spark,wzhfy/spark,chuckchen/spark,jiangxb1987/spark,ron8hu/spark,ConeyLiu/spark,maropu/spark,loneknightpy/spark,WindCanDie/spark,WeichenXu123/spark,jrshust/spark,ddna1021/spark,rezasafi/spark,jiangxb1987/spark,bOOm-X/spark,nchammas/spark,skonto/spark,michalsenkyr/spark,sureshthalamati/spark,BryanCutler/spark,esi-mineset/spark,nlalevee/spark,shubhamchopra/spark,kevinyu98/spark,techaddict/spark,facaiy/spark,setjet/spark,rikima/spark,aokolnychyi/spark,metamx/spark,guoxiaolongzte/spark,darionyaphet/spark,zuotingbing/spark,wangmiao1981/spark,debugger87/spark,wangyum/spark,wangmiao1981/spark,ahnqirage/spark,brad-kaiser/spark,rekhajoshm/spark,haowu80s/spark,taroplus/spark,setjet/spark,kissmetrics/spark,mahak/spark,aray/spark,mike0sv/spark,stanzhai/spark,jkbradley/spark,HyukjinKwon/spark,jianran/spark,saturday-shi/spark,chuckchen/spark,andrewor14/iolap,srowen/spark,dbtsai/spark,publicRoman/spark,jianran/spark,nlalevee/spark,publicRoman/spark,kiszk/spark,someorz/spark,dongjoon-hyun/spark,sureshthalamati/spark,ajaysaini725/spark,wangmiao1981/spark,shubhamchopra/spark,mahak/spark,bdrillard/spark,rezasafi/spark,taroplus/spark,liyichao/spark,bdrillard/spark,shuangshuangwang/spark,shuangshuangwang/spark,joseph-torres/spark,jrshust/spark,aray/spark,wzhfy/spark,ioana-delaney/spark,nilsgrabbert/spark,liutang123/spark,adrian-ionescu/apache-spark,vinodkc/spark,darionyaphet/spark,janewangfb/spark,cin/spark,tengpeng/spark,nchammas/spark,map222/spark,spark-test/spark,cin/spark,bravo-zhang/spark,pgandhi999/spark,andrewor14/iolap,hhbyyh/spark,janewangfb/spark,maropu/spark,wangyum/spark,vinodkc/spark,mzl9039/spark,mahak/spark,dhruve/spark,zero323/spark,taroplus/spark,patrick-nicholson/spark,rekhajoshm/spark,JoshRosen/spark,zzcclp/spark,ddna1021/spark,1haodian/spark,cloud-fan/spark,ron8hu/spark,nlalevee/spark,eyalfa/spark,adrian-ionescu/apache-spark,dhruve/spark,panfengfeng/spark,caneGuy/spark,szhem/spark,szhem/spark,ptkool/spark,goldmedal/spark,xflin/spark,bdrillard/spark,jkbradley/spark,rednaxelafx/apache-spark,skonto/spark,jkbradley/spark,jlopezmalla/spark,zzcclp/spark,chuckchen/spark,gengliangwang/spark,ueshin/apache-spark,techaddict/spark,rednaxelafx/apache-spark,kevinyu98/spark,sachintyagi22/spark,goldmedal/spark,map222/spark,icexelloss/spark,mzl9039/spark,Panos-Bletsos/spark-cost-model-optimizer,tengpeng/spark,debugger87/spark,nilsgrabbert/spark,ddna1021/spark,cloud-fan/spark,ueshin/apache-spark,minixalpha/spark,nilsgrabbert/spark,jkbradley/spark,wangmiao1981/spark,akopich/spark,aosagie/spark,xuanyuanking/spark,maropu/spark,skonto/spark,SHASHANKB/spark,jrshust/spark,debugger87/spark,yanboliang/spark,guoxiaolongzte/spark,jiangxb1987/spark,sachintyagi22/spark,tengpeng/spark,akopich/spark,ajaysaini725/spark,ibm-research-ireland/sparkoscope,narahari92/spark,srowen/spark,BryanCutler/spark,holdenk/spark,saltstar/spark,zzcclp/spark,saturday-shi/spark,cin/spark,loneknightpy/spark,mdespriee/spark,ueshin/apache-spark,kiszk/spark,lxsmnv/spark,jlopezmalla/spark,poffuomo/spark,andrewor14/iolap,ron8hu/spark,publicRoman/spark,highfei2011/spark,wangyum/spark,maropu/spark,saltstar/spark,zuotingbing/spark,caneGuy/spark,zuotingbing/spark,mzl9039/spark,sureshthalamati/spark,ConeyLiu/spark,holdenk/spark,zhouyejoe/spark,publicRoman/spark,kimoonkim/spark,gengliangwang/spark,hvanhovell/spark,jlopezmalla/spark,ron8hu/spark,BryanCutler/spark,nchammas/spark,rednaxelafx/apache-spark,kiszk/spark,eyalfa/spark,sureshthalamati/spark,bravo-zhang/spark,aosagie/spark,kissmetrics/spark,akopich/spark,HyukjinKwon/spark,zzcclp/spark,tejasapatil/spark,dbtsai/spark,bOOm-X/spark,bravo-zhang/spark,liutang123/spark,cin/spark,debugger87/spark,map222/spark,michalsenkyr/spark,gioenn/xSpark,LantaoJin/spark,srowen/spark,esi-mineset/spark,caneGuy/spark,narahari92/spark,ericvandenbergfb/spark,ConeyLiu/spark,dbtsai/spark,mdespriee/spark,stanzhai/spark,icexelloss/spark,kimoonkim/spark,sachintyagi22/spark,dhruve/spark,facaiy/spark,wzhfy/spark,byakuinss/spark,andrewor14/spark,sahilTakiar/spark,wangmiao1981/spark,darionyaphet/spark,darionyaphet/spark,xuanyuanking/spark,HyukjinKwon/spark,mdespriee/spark,shubhamchopra/spark,liyichao/spark,skonto/spark,stanzhai/spark,jlopezmalla/spark,ioana-delaney/spark,bdrillard/spark,chuckchen/spark,highfei2011/spark,ibm-research-ireland/sparkoscope,liutang123/spark,haowu80s/spark,poffuomo/spark,UndeadBaneGitHub/spark,ueshin/apache-spark,rikima/spark,ibm-research-ireland/sparkoscope,saltstar/spark,apache-spark-on-k8s/spark,apache/spark,huang1900/spark,facaiy/spark,cloud-fan/spark,gengliangwang/spark,WindCanDie/spark,pronix/spark,szhem/spark,spark-test/spark,caneGuy/spark