How to start Solr automatically?

后端 未结 8 607
深忆病人
深忆病人 2020-11-27 10:07

At the moment I have to go to /usr/java/apache-solr-1.4.0/example and then do:

java -jar start.jar

How do I get this to start

8条回答
  •  情话喂你
    2020-11-27 10:39

    Follow supermagic's comments, then follow this

    http://codingrecipes.com/service-x-does-not-support-chkconfig

    He says,

    1 – Copy your script into /etc/init.d folder
    2 – cd /etc/init.d
    3 – chmod +x myscript
    4 – Add these lines, including #, right after #!/bin/bash or #!/bin/sh:
    
    # chkconfig: 2345 95 20
    # description: Some description
    # What your script does (not sure if this is necessary though)
    # processname: myscript
    
    

    Then you can do

    chkconfig --add myscript

提交回复
热议问题