tlaverdure / laravel-echo-server

Socket.io server for Laravel Echo
MIT License
2.65k stars 510 forks source link

Setting up supervisor with echo #119

Closed Cannonb4ll closed 5 years ago

Cannonb4ll commented 7 years ago

I wanted to have supervisor manage the laravel echo server, I have set it up like following;

[program:project]
process_name=%(program_name)s_%(process_num)02d
directory=/home/user/domains/example.com/project
command=/usr/bin/laravel-echo-server start
autostart=true
autorestart=true
user=user
redirect_stderr=true
stdout_logfile=/home/user/domains/example.com/project/worker-echo-server.log

The problem im getting is that the server is not booting, instead im getting errors like these inside the worker-echo-server.log:

Native thread-sleep not available.
This will result in much slower performance, but it will still work.
You should re-install spawn-sync or upgrade to the lastest version of node if possible.
Check /usr/lib/node_modules/laravel-echo-server/node_modules/inquirer/node_modules/external-editor/node_modules/spawn-sync/error.log for more details
Options:
  -h, --help  Show help  [boolean]

Object #<Object> has no method 'access'
Native thread-sleep not available.
This will result in much slower performance, but it will still work.
You should re-install spawn-sync or upgrade to the lastest version of node if possible.
Check /usr/lib/node_modules/laravel-echo-server/node_modules/inquirer/node_modules/external-editor/node_modules/spawn-sync/error.log for more details
Options:
  -h, --help  Show help  [boolean]

Object #<Object> has no method 'access'
Native thread-sleep not available.
This will result in much slower performance, but it will still work.
You should re-install spawn-sync or upgrade to the lastest version of node if possible.
Check /usr/lib/node_modules/laravel-echo-server/node_modules/inquirer/node_modules/external-editor/node_modules/spawn-sync/error.log for more details
Options:
  -h, --help  Show help  [boolean]

Object #<Object> has no method 'access'
Native thread-sleep not available.
This will result in much slower performance, but it will still work.
You should re-install spawn-sync or upgrade to the lastest version of node if possible.
Check /usr/lib/node_modules/laravel-echo-server/node_modules/inquirer/node_modules/external-editor/node_modules/spawn-sync/error.log for more details
Options:
  -h, --help  Show help  [boolean]

Object #<Object> has no method 'access'
Native thread-sleep not available.
This will result in much slower performance, but it will still work.
You should re-install spawn-sync or upgrade to the lastest version of node if possible.
Check /usr/lib/node_modules/laravel-echo-server/node_modules/inquirer/node_modules/external-editor/node_modules/spawn-sync/error.log for more details
Options:
  -h, --help  Show help  [boolean]

Object #<Object> has no method 'access'
tlaverdure commented 7 years ago

Can you install the latest version and try:

command=/usr/bin/laravel-echo-server start --dir=/home/user/domains/example.com/project

Also make sure that your laravel-echo-server.json file is in that directory.

Cannonb4ll commented 7 years ago

Sadly enough, seems to keep returning the same errors.. :(

tlaverdure commented 7 years ago

What version of node?

Cannonb4ll commented 7 years ago

Version 7.4.0

Laravel echo server version: 1.2.4

tlaverdure commented 7 years ago

Ok, will need to do some digging. Looks a dependency of inquirer which is a dependency of the CLI used to start the server.

Does this also start of you start the server from the command line or just when you try to run with supervisor?

Cannonb4ll commented 7 years ago

Running it with command laravel-echo-server start works perfect, the server boots right away then. I have also tried to put the command inside a bash script and run that script with supervisor but same negative result.

Cannonb4ll commented 7 years ago

Have you had any time to check upon this issue?

jonnywilliamson commented 7 years ago

Have you tried using PM2 instead of supervisor?

https://serversforhackers.com/node-process-management-with-pm2 http://pm2.keymetrics.io/

ethanhann commented 7 years ago

I couldn't get supervisor to work either. I ended up using pm2. This comment was helpful: https://github.com/tlaverdure/laravel-echo-server/issues/65#issuecomment-258872299

zcodes commented 6 years ago

it works use command like this:

command=/path/to/node /path/to/laravel-echo-server start --dir=/path/to/project_root