Code-server: How to use the binary with PM2

Created on 7 May 2019  路  6Comments  路  Source: cdr/code-server

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

question

Most helpful comment

@xdarkzlightz Currently using exactly the same workaround, I'll leave this issue open until it don't need a workaround.

All 6 comments

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

oonqt picture oonqt  路  3Comments

justmao945 picture justmao945  路  3Comments

infogulch picture infogulch  路  3Comments

avelino picture avelino  路  3Comments

korzq picture korzq  路  3Comments