Stopping and starting a server in a python script using subprocess -
from python script need stop , start weblogic server multiple number of times.
if need manually (stopping or starting server ) in linux
i go mwhome+"/user_projects/domains/bifoundation_domain/bin , execute command
./stopweblogic.sh
and start server in terminal execute command
./startweblogic.sh
and need replicate in python code.
wlserverstop=mwhome+"/user_projects/domains/bifoundation_domain/bin/stopweblogic.sh" output3 = subprocess.call([ wlserverstop ]) #starting weblogic server wlserver=mwhome+"/user_projects/domains/bifoundation_domain/bin/startweblogic.sh" output4 = subprocess.popen([ wlserver],stderr=stdout, stdout=pipe) time.sleep(200)
1) stopweblogic server terminate , return used subprocess.call() 2) startweblogic server not terminate , process needs running in background used subprocess.popen()
but problem stopping , starting of servers not happening properly. times doesnot start , if server starts when put stopserver command immeadiately runs forever.
any better way ? thanks
Comments
Post a Comment