Running CTP as a Linux Service: Difference between revisions

From MircWiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 33: Line 33:
  /etc/init/CTP.conf
  /etc/init/CTP.conf


Start the service by typing
== Commands to control the CTP service ==
 
To start CTP (it will start automatically when the machine boots)
  start CTP
  start CTP
 
To stop CTP:
This will also start automatically when the machine boots
stop CTP
To check if CTP is running:
status CTP
To restart CTP:
restart CTP


<div align="right">''Any questions or comments please email me at timothy.john.phillips@gmail.com - Tim Phillips.''</div>
<div align="right">''Any questions or comments please email me at timothy.john.phillips@gmail.com - Tim Phillips.''</div>

Revision as of 04:57, 10 September 2011

Important

Using an UpStart Script

Ubuntu and many other Linux distros use UpStart to run services. The below example assumes CTP is installed at

/usr/share/CTP/

You can modify it to suit a different locations.

Cut and paste the below code

description "CTP Service on Linux"
author "Tim Phillips <timothy.john.phillips@gmail.com>"

start on (local-filesystems and net-device-up IFACE!=lo)
stop on stopping network-services

respawn

expect fork

script
cd /usr/share/CTP/
java -jar ./CTP-runner.jar
end script

into a file named

/etc/init/CTP.conf

Commands to control the CTP service

To start CTP (it will start automatically when the machine boots)

start CTP

To stop CTP:

stop CTP

To check if CTP is running:

status CTP

To restart CTP:

restart CTP
Any questions or comments please email me at timothy.john.phillips@gmail.com - Tim Phillips.