9

I have several times found myself unable to restart my tezos node because I believe I have ended the process but when I try to start it again I get the following message:

Data directory is locked by another process

Most recently I used Ctrl-C, then when I did not see progress, I used Ctrl-Z. I believe this put the process in the background further adding to my confusion.

What method should I use to reliably end the tezos-node process? If I accidentally put the process in the background, is there a way for me to bring it back to the foreground?

12

Your should use "Ctrl+c" (or kill -15 <Process-ID>) to terminate tezos node. This will take some time because the node tries to softly cancel all scheduled actions, and to keep the database in a consistent state.

"Ctrl+z" (or kill -19 <Process-ID>) just pauses the process. You can bring it back by running fg command in the same terminal (or with kill -18 <PID>).

Note that you can also send a SIGKILL signal (kill -9 <PID>) that will terminate the process immediately. But this is not recommended I think, as it may corrupt the database.

Finally, you can get the PID of your tezos-node process(es) with ps -A | grep tezos-node.

| improve this answer | |
  • 2
    I prefer kill -STOP <pid> to kill -19 <pid> (and kill -CONT <pid> to restart it). – lefessan Feb 12 '19 at 12:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.