Skip to content

Instantly share code, notes, and snippets.

@gbraad
Last active November 29, 2018 07:07
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save gbraad/676c2a0102552bd38cacfb5fda61685c to your computer and use it in GitHub Desktop.
Save gbraad/676c2a0102552bd38cacfb5fda61685c to your computer and use it in GitHub Desktop.
Start C9 IDE from systemd

Start C9 IDE from systemd

Install Cloud9 first as [username]

$ su - [username]
$ wget https://github.com/gbraad/ansible-playbooks/raw/master/playbooks/install-c9sdk.yml
$ ansible-playbook install-c9sdk.yml

Create service unit /etc/systemd/system/c9.service

[Unit]
Description=Cloud9 IDE
Requires=network.target

[Service]
Type=simple
User=[username]
ExecStart=/home/[username]/.local/bin/c9
Restart=on-failure

[Install]
WantedBy=multi-user.target

Create shell script /home/[username]/.local/bin/c9

#!/bin/sh
USERNAME=""
PASSWORD=""

$HOME/.c9/node/bin/node /opt/c9sdk/server.js \
    --listen 0.0.0.0 \
    --port 8181 \
    -a $USERNAME:$PASSWORD \
    -w /workspace
$ sudo -i
$ systemctl daemon-reload
$ systemctl start c9
$ systemctl enable c9

Note: substitute username

@gbraad
Copy link
Author

gbraad commented Nov 29, 2018

You might want to do the following after installation: c9/core#454 which sets the project name/page title to whatever you prefer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment