Skip to content

Running Che as a Service

Raffi Khatchadourian edited this page Jun 3, 2016 · 1 revision

Using a modified version of the service.sh script found here: https://gist.github.com/naholyr/4275302
One can have Che run as a service.

What was modified?

The name, pidfile, logfile, user, and script were replaced and a new variable, IP, was added. The user should be the same one created in the setup who has a UID of 1000 and is in the docker group. The variable IP should hold the external IP address of che and it is used when declaring the script variable.

The script variable should be '/opt/eclipse-che-4.2.0/bin/che.sh start -r:$IP'.

When placed in the start method the line that runs che should besu - $RUNAS -c "/opt/eclipse-che-4.2.0/bin/che.sh start -r:$IP"

The line to stop che should be: su - $RUNAS -c '/opt/eclipse-che-4.2.0/bin/che.sh stop'

Once you are finished writing your service, move it to the init.d directory and and practice running your service with the following command. sudo service service_name start

Clone this wiki locally