Disabling machine learning does not allow Elasticsearch to stop

Thanks @yoshioiwamoto - the stack trace narrows down the problem. There are two more things you could do that would be useful for working out what's going wrong.

Firstly, while Elasticsearch is running, but before you shut it down, can you also see a process called controller running. In other words, what does ps -ef | grep controller return while Elasticsearch is running?

Secondly, open 3 terminal windows. In the first terminal run this:

/usr/share/elasticsearch/plugins/x-pack/platform/linux-x86_64/bin/controller

When you run it with no arguments it should just wait. Leave it running, move to the next terminal and run:

ls -ltr /tmp

Do you see a recent entry like this one?

prw-------  1 dave  dev       0 Jun 12 15:24 controller_log_908

The number at the end will be different, and obviously the owner too, but it should have those permissions and the name should begin with controller_log_. If you do see such a file, tail it like this:

tail -f /tmp/controller_log_908

Replace the 908 with the correct number for the file you see.

Finally, move to the next terminal and run this again:

ls -ltr /tmp

Now you should see a recent file that looks similar to this:

prw-------  1 dave  dev       0 Jun 12 15:24 controller_command_908

If you do, then run this:

yes > /tmp/controller_command_908

Once again replace the 908 with the number you see.

Now look back to the first terminal. Is the controller process still running?

Now go back to the terminal running yes. Use CTRL+C to stop it. Now look back to the first terminal. The controller process should have stopped.

Finally, look in the terminal running tail. It should have printed a number of error messages. These are due to controller not understanding the output of yes and are not relevant to the problem - just CTRL+C the tail command.

If something different happens for you then please let me know what you get.