code-server icon indicating copy to clipboard operation
code-server copied to clipboard

PM2 not working with binary (and a work around)

Open xdarkzlightz opened this issue 7 years ago • 1 comments

  • code-server version: Any release after 1.408-vsc1.32.0
  • OS Version: Ubuntu Server 18.04.2 LTS

Description

When trying to run the binary with pm2 you can't use command flags & the binary doesn't work (no output). Running the binary by itself works perfectly fine. Releases before 1.408-vsc1.32.0 work with pm2, any release after 1.408-vsc1.32.0 doesn't work with it. I've tested this with releases 1.32.0-310, 1.604-vsc1.32.0, and the latest release 1.939-vsc1.33.1.

Here's a work around you can use to get it working with pm2 You have to create a js file with the following contents:

const { execSync } = require('child_process');
execSync(`./code-server`,{stdio:['inherit','inherit','inherit']})

Replace ./code-server with your entire command and then run pm2 start ./yourFile.js

Steps to Reproduce

  1. Download any release after 1.408-vsc1.32.0
  2. Run the command pm2 start ./code-server or pm2 start ./code-server -- --anyArgument

xdarkzlightz avatar May 18 '19 05:05 xdarkzlightz

If this still occurs, please feel free to reopen.

nhooyr avatar Jan 28 '20 01:01 nhooyr