简体   繁体   中英

Supervisor wont run file located in /usr/bin but I can run it if I cd to it and run it manually

I can't get supervisor to run the laravel echo server on my Ubuntu 16.04 AWS EC2 instance but it runs fine on my Homestead Ubuntu 16.04 VM. The error I get it is can't find command '/usr/bin/laravel-echo-server. If I cd directly to /usr/bin and run laravel-echo-server start it starts up in dev mode just fine

I am running node V8.9.1

Here is what is inside my config file

[program:laravel-worker]
process_name=%(program_name)s_%(process_num)04d
command=/usr/bin/laravel-echo-server start --dir=/var/www/html/bcbAPI
autostart=true
autorestart=true
user=root
redirect_stderr=true
stdout_logfile=/var/www/html/bcbAPI/storage/logs/echoserver.log
stderr_logfile=/var/www/html/bcbAPI/storage/logs/echoserver-error.log

laravel-echo-server.json

{
    "authHost": "http://myip.com/b3",
    "authEndpoint": "/broadcasting/auth",
    "clients": [
        {
            "appId": "aa41c60c83ffa7f7",
            "key": "70e24d91c54f9f30d1fbdb2ed3f2cce8"
        }
    ],
    "database": "redis",
    "databaseConfig": {
        "redis": {
                "port": "6379",
                "host": "localhost"
        },
        "sqlite": {
            "databasePath": "/database/laravel-echo-server.sqlite"
        }
    },
    "devMode": true,
    "host": null,
    "port": "6001",
    "protocol": "http",
    "socketio": {
        "wsEngine": "uws"
    },
    "sslCertPath": "",
    "sslKeyPath": "",
    "sslCertChainPath": "",
    "sslPassphrase": "",
    "apiOriginAllow": {
        "allowCors": true,
        "allowOrigin": "myiphere/b2",
        "allowMethods": "GET,POST,PUT",
        "allowHeaders": "Origin, Content-Type, X-Auth-Token, X-Requested-With, Accept, Authorization, X-CSRF-TOKEN, X-Socket-Id"
    }
}

Before everything, check the absolute paths for NodeJS and laravel-echo-server :

which node
which laravel-echo-server

After add nodejs and laravel-echo-server PATH into your command:

command=/bin/node /bin/laravel-echo-server start --dir=YOUR_ABSOLUTE_PROJECT_PATH

Problem solved!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM