This example for a 'sample' service for a sample.jar located in /usr/local/ folder( you can put jar anywhere in system, but always use absolute path)
Create a sample.conf file in /etc/init in following syntax
description "sample service" 
author "Jinesh" 
start on runlevel [3] 
stop on shutdown 
expect fork 
script 
      java -jar /usr/local/sample.jar
      emit sample_running 
end script 
Then you can start service using
service sample start
and stop using
service sample stop
 
 
No comments:
Post a Comment