Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to gracefully stop a rethinkdb server running in the background in linux?

Tags:

rethinkdb

How to stop a rethinkdb server in linux? Is there a command to gracefully shut down a rehinkdb instance? I haven't found anything about in the docs. So if I start a rethinkdb instance in foreground from the commandline, rethinkdb handles the SIGINT sent from the keyboard. But I'm not sure if rethinkdb gracefully handles the SIGTERM signal sent by the kill command when rethinkdb is running in background.So what is the right way to shut down rethinkdb when is running as a background process?

like image 437
nerva13 Avatar asked Oct 17 '15 00:10

nerva13


2 Answers

Use

kill -INT pid

(where pid is the id of the rethinkdb process)

This is what the init.d script uses. It allows you to set it up to start at server start, and use standard linux init.d commands, like

sudo /etc/init.d/rethinkdb restart

This page talks about configuring rethinkdb on server start: https://rethinkdb.com/docs/start-on-startup/

This is the source of the init.d script linked to from the above page. https://github.com/rethinkdb/rethinkdb/blob/next/packaging/assets/init/rethinkdb

like image 162
GregHNZ Avatar answered Sep 21 '22 01:09

GregHNZ


Assuming you are using the init.d startup outlined here,

sudo /etc/init.d/rethinkdb stop

and then

sudo /etc/init.d/rethinkdb restart

to resume.

like image 34
Shawn Rushefsky Avatar answered Sep 19 '22 01:09

Shawn Rushefsky