Difference between revisions of "Running CTP as a Linux Service"

From MircWiki
Jump to navigation Jump to search
Line 3: Line 3:
 
* This is a small part of what the script at [[Install MIRC Zn on Ubuntu Linux]] will do automatically for you.
 
* This is a small part of what the script at [[Install MIRC Zn on Ubuntu Linux]] will do automatically for you.
 
* If you want to install MIRC on a Linux machine it is recommended you head the [[Install MIRC Zn on Ubuntu Linux]] page.
 
* If you want to install MIRC on a Linux machine it is recommended you head the [[Install MIRC Zn on Ubuntu Linux]] page.
 +
* If you are here because you want to run an existing Linux installation of CTP or MIRC as a service, continue reading.
  
 
=== Using an UpStart Script ===
 
=== Using an UpStart Script ===

Revision as of 04:58, 10 September 2011

1 Suggestion

  • This is a small part of what the script at Install MIRC Zn on Ubuntu Linux will do automatically for you.
  • If you want to install MIRC on a Linux machine it is recommended you head the Install MIRC Zn on Ubuntu Linux page.
  • If you are here because you want to run an existing Linux installation of CTP or MIRC as a service, continue reading.

2 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

3 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.