menu
announcement

Spectrum is now read-only. Learn more about the decision in our official announcement.

Theia

Eclipse Theia - Cloud & Desktop IDE

Channels
Team

Can we configure Theia to be runned after reboot using theia.service?

March 29, 2019 at 12:53pm

Can we configure Theia to be runned after reboot using theia.service?

March 29, 2019 at 12:53pm
Hi, Im running Theia with this command: yarn theia start /home/centos/my-workspace --hostname 0.0.0.0 --port 8080 &
Can you guys show me how i would have to configure theia.service file if its possible?
For nginx is easy:
[Unit] Description=nginx - high performance web server Documentation=https://nginx.org/en/docs/ After=network-online.target remote-fs.target nss-lookup.target Wants=network-online.target
[Service] Type=forking PIDFile=/var/run/nginx.pid ExecStartPre=/usr/sbin/nginx -t -c /etc/nginx/conf/nginx.conf ExecStart=/usr/sbin/nginx -c /etc/nginx/conf/nginx.conf ExecReload=/bin/kill -s HUP $MAINPID ExecStop=/bin/kill -s TERM $MAINPID

March 29, 2019 at 3:41pm
I tried with cron job. And its so annoying. Simple stuff should work immediate but:
vim /etc/crontab
PATH=/root/.nvm/versions/node/v8.15.1/bin:$PATH
* * * * * root cd /opt/my-app && /root/.nvm/versions/node/v8.15.1/bin/yarn theia start /home/centos/my-workspace --hostname 0.0.0.0 --port 8080 &>/tmp/mycommand.log &
Many things tried, i am always getting error: /usr/bin/env: node: No such file or directory
btw, command is working from command line runned as root.
Edited
Solved the cron job issue:
vim /etc/crontab
root "/opt/my-app/start.sh" &>/tmp/mycommand.log &
in bash script:
#!/bin/bash
. $HOME/.bashrc
cd /opt/my-app && /root/.nvm/versions/node/v8.15.1/bin/yarn theia start /home/centos/my-workspace --hostname 0.0.0.0 --port 8080
Edited
like-fill
1