How to stop Solr service from command line

11,687

You started the process and put it in the background. List background processes with the jobs command.

To bring background processes to the foreground, use fg [job number]. From there, you can exit them as normal.


EDIT 1

In light of new information, the problem has nothing to do with foreground and background processes. Apparently the process is being started in the background, and then the terminal window is being closed. Thus, it's not a job attached to the terminal anymore.

In this case, you simply kill the process associated with Solr. Use ps to find the process and kill to stop it.

Share:
11,687

Related videos on Youtube

JakeRow123
Author by

JakeRow123

Updated on September 18, 2022

Comments

  • JakeRow123
    JakeRow123 over 1 year

    I used to start Solr with this command:

    java -jar start.jar
    

    and all I had to do to stop it was press Control + C

    But then I started it this way:

    java -jar start.jar &
    

    Which starts it as a background process so I can get the shell back after it starts. But now I don't know how to stop it. I am using Ubuntu Server.

  • JakeRow123
    JakeRow123 about 12 years
    I don't have the "jobs" command, do you know the package name so I install is via apt-get? "sudo apt-get install jobs" didn't work.
  • Wesley
    Wesley about 12 years
    @JakeRow123 jobs should be a bash builtin, not a package. What is the result of running echo $SHELL?
  • JakeRow123
    JakeRow123 about 12 years
    result is "/bin/bash", according to this post: superuser.com/questions/152767/…, "jobs displays the status of jobs in the current session". I started Solr inside vmware a few days ago from another terminal window than the one I am working in atm. So maybe that's why it doesn't display anything. I tried "ps -e" which shows several "jetty" processes but when I try to bring them to the foreground using fg [their job number], it just says "no such jobs". Solr runs via jetty so I figured stopping that would stop Solr.
  • JakeRow123
    JakeRow123 about 12 years
    killing the jetty services didn't work, after killing them and doing another ps -e command, they showed up again. But killing the java service did stop solr. Don't think this is the proper way but it will do for now. Thanks.