Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to stop bokeh server?

Tags:

python

bokeh

I do use bokeh to plot sensor data live on the local LAN. Bokeh is started from within my python application using popen: Popen("bokeh serve --host=localhost:5006 --host=192.168.8.100:5006", shell=True)

I would like to close bokeh server from within the application. However, I cannot find anything in the documentation. Also bokeh serve --help does not give any hint how to do that.

EDIT: based on the accepted answer I came up with following solution:

        self.bokeh_serve = subprocess.Popen(shlex.split(command),
                             shell=False, stdout=subprocess.PIPE)

I used self.bokeh_serve.kill() for ending the process. Maybe .terminate() would be better. I will try it.

like image 576
Moritz Avatar asked Sep 14 '16 09:09

Moritz


1 Answers

if you are using Linux based OS then open terminal and type

ps -ef

Search for the bokeh application file running in the process and note down the PID i.e. Process ID, suppose process ID id 3366 then using command

kill 3366

kill the process.

like image 64
Shahraan Hussain Avatar answered Sep 17 '22 14:09

Shahraan Hussain