I want to run code-server as a system service so I was using PM2 to keep the process stay alive.
pm2 start code-server seems not working
pm2 start ./code-server
I actually want to use with the ecosystem config file, here is my config but it doesn't work
module.exports = {
/**
* Application configuration section
* http://pm2.keymetrics.io/docs/usage/application-declaration/
*/
apps: [
{
name: 'code-server',
script: 'code-server',
env: {
PASSWORD: 'mypassword',
PORT: 8443,
},
args: [
'--allow-http',
'--port=8443',
'--cert=path/to/cert.pem',
'--cert-key=path/to/privkey.pem',
],
interpreter: 'bash',
exec_interpreter: 'none',
exec_mode: 'fork_mode',
},
],
}
just change the script entry to point to the binary
e.g.
...
script: "./path/to/code-server",
...
Hey I was experiencing an issue with PM2 as well, created an issue about it here #690 along with a work around for it. Hopefully this helps
@xdarkzlightz Currently using exactly the same workaround, I'll leave this issue open until it don't need a workaround.
Track it on GH-690 now. Closing this.
Most helpful comment
@xdarkzlightz Currently using exactly the same workaround, I'll leave this issue open until it don't need a workaround.