Why not work " forever stop forever/development.json "? - json

I install forever npm package using follow command
sudo npm install forever -g
npm install forever-monitor
My server.js file run using follow command
forever start server.js
Result :
warn: --minUptime not set. Defaulting to: 1000ms
warn: --spinSleepTime not set. Your script will exit if it does not stay up for at least 1000ms
info: Forever processing file: server.js
Now server.js running background
Next server.js file stop using follow command
forever start server.js
Result :
info: Forever stopped process:
uid command script forever pid id logfile uptime
[0] uiip /usr/bin/nodejs server.js 5763 5765 /home/amila/.forever/uiip.log 0:0:1:38.529
Finally reading documentation, I added development.json inside forever directory
{
"uid": "app",
"append": true,
"watch": true,
"script": "server.js",
"sourceDir": "./"
}
Now Type :
forever start forever/development.json
Result :
warn: --minUptime not set. Defaulting to: 1000ms
warn: --spinSleepTime not set. Your script will exit if it does not stay up for at least 1000ms
info: Forever processing file: server.js
Now server.js file working.
Problem here : Type follow command
forever stop forever/development.json
Result :
error: Forever cannot find process with id: forever/development.json
However when type
forever stop server.js
Result :
info: Forever stopped process:
uid command script forever pid id logfile uptime
[0] app /usr/bin/nodejs server.js 6437 6443 /home/amila/.forever/app.log 0:0:1:44.323
I need now, Why when type forever stop forever/development.json comes error

If the forever process does not start properly, then it will automatically be stopped.
So stopping a process, which is already stopped due to an error, then forever will throw an error for that
error: Forever cannot find process with id: forever/development.json
Is development.json file contains below line?
{ "script" : "server.js" }
Update:
Valid Parameters
forever stop Id|Uid|Pid|Index|Script

Related

ERROR: Failed to start "mysql": cannot start service: /opt/lampp/bin/mysql.server: 263: kill: No such process

I was working on a project when mysql suddenly stopped working. (I'm working through XAMPP) I'm getting the following error
ERROR: Failed to start "mysql": cannot start service: /opt/lampp/bin/mysql.server: 263: kill: No such process
I read so many answers but none could solve my problem.
When I stop mysql from the terminal, it shuts down. After typing the following command:
sudo /opt/lampp/lampp start
I get the following error:
sudo: /opt/lampp/lampp: command not found
I tried to reinstall the program, nothing changed.
Note: I'm working on a macos

how to run pm2 with "npm run start"

So i have an app that was built for me and I need to keep it running. but the app was built with the instructions of running it with
npm run start
I am trying to figure our how to do this using either the ecosystem.config.js or command line arguments.
I tryed
pm2 start npm --name "myApp" -- run "start-test"
But the pm2 log shows an exit code of 1.
So what is the propepr way to accomplish this?

Cannot start json-server with forever on ubuntu

I am using below command to start json-server forever on my ubuntu:
forever start /usr/local/bin/json-server --watch db.json --port 3001
But as I list all processes using forever list, I see that the process is stopped. I have also tried to set --host flag by putting my private instance ip, but that is also not working. Can you help me to start the json-server correctly?
Below are the logs:
error: Script restart attempt #1
\{^_^}/ hi!
Loading db.json
Oops, db.json doesn't seem to exist
Creating db.json with some default data
Error: EACCES: permission denied, open 'db.json'
at Object.openSync (fs.js:454:3)
at Object.writeFileSync (fs.js:1247:35)
at /usr/local/lib/node_modules/json-server/lib/cli/utils/load.js:44:12
at new Promise (<anonymous>)
at module.exports (/usr/local/lib/node_modules/json-server/lib/cli/utils/load.js:38:10)
at start (/usr/local/lib/node_modules/json-server/lib/cli/run.js:112:12)
at module.exports (/usr/local/lib/node_modules/json-server/lib/cli/run.js:149:3)
at module.exports (/usr/local/lib/node_modules/json-server/lib/cli/index.js:86:3)
at Object.<anonymous> (/usr/local/lib/node_modules/json-server/lib/cli/bin.js:6:14)
at Module._compile (internal/modules/cjs/loader.js:759:30) {
errno: -13,
syscall: 'open',
code: 'EACCES',
path: 'db.json'
}
error: Forever detected script exited with code: 1
i can confirm that I am running the command in the same folder as that of db.json.
I also get below warning:
warn: --minUptime not set. Defaulting to: 1000ms
warn: --spinSleepTime not set. Your script will exit if it does not stay up for at least 1000ms
info: Forever processing file: /usr/local/bin/json-server
I have some more logs:
Cannot bind to the port 3002. Please specify another port number either through --port argument or through the json-server.json configuration file
error: Forever detected script exited with code: 1
I have tried using other ports as well but that is also not working.

Orion Context Broker functional test failure

I have successfully forked and built the Context Broker source code on a CentOS 6.9 VM and now I am trying to run the functional tests as the official documentation suggests. First, I installed the accumulator-server.py script:
$ make install_scripts INSTALL_DIR=~
Verified that it is installed:
$ accumulator-server.py -u
Usage: accumulator-server.py --host <host> --port <port> --url <server url> --pretty-print -v -u
Parameters:
--host <host>: host to use database to use (default is '0.0.0.0')
--port <port>: port to use (default is 1028)
--url <server url>: server URL to use (default is /accumulate)
--pretty-print: pretty print mode
--https: start in https
--key: key file (only used if https is enabled)
--cert: cert file (only used if https is enabled)
-v: verbose mode
-u: print this usage message
And then run the functional tests:
$ make functional_test INSTALL_DIR=~
But the test fails and exits with the message below:
024/927: 0000_ipv6_support/ipv4_ipv6_both.test ........................................................................ (FAIL 11 - SHELL-INIT exited with code 1) testHarness.sh/IPv6 IPv4 Both : (0000_ipv6_support/ipv4_ipv6_both.test)
make: *** [functional_test] Error 11
$
I checked the file ../0000_ipv6_support/ipv4_ipv6_both.shellInit.stdout for any hint on what may be going wrong but error log does not lead me anywhere:
{ "dropped" : "ftest", "ok" : 1 }
accumulator running as PID 6404
Unable to start listening application after waiting 30
Does anyone have any idea about what may be going wrong here?
I checked the script which prints the error line Unable to start listening application after waiting 30 and noticed that stderr for accumulator-server.py is logged into the /tmp folder.
The accumulator_9977_stderr file had this log: 0000_ipv6_support/ipv4_ipv6_both.shellInit: line 27: accumulator-server.py: command not found
Once I saw this log I understood the mistake I made. I was running the
functional tests with sudo and the secure_path was being used instead of my PATH variable.
So at the end, running the functional tests with the command below solved the issue for me.
$ sudo "PATH=$PATH" make functional_test INSTALL_DIR=~
This can also be solved by editing the /etc/sudoers file by:
$ sudo visudo
and modifying the secure_path value.

Connection Timeout at "./rebar get-deps" / compiling EJabberd

I am trying to compile eJabberd on CentOS6. I am following the steps mentioned # [https://www.process-one.net/docs/ejabberd/guide_en.html#htoc12][1]
However, this aborts with connection-timeout error while executing "make".
Following is the error snipet from command prompt:
*
[root#CentOS-6-64-EN ejabberd-15.04]# make
rm -rf deps/.got
rm -rf deps/.built
/usr/lib64/erlang/bin/escript rebar get-deps && :> deps/.got
==> rel (get-deps)
==> ejabberd-15.04 (get-deps)
Pulling p1_cache_tab from {git,"git://github.com/processone/cache_tab",
"cca096330ce39e8b56fe0e0c478df1ff452e7751"}
github.com[0: 192.30.252.131]: errno=Connection timed out
fatal: unable to connect a socket (Connection timed out)
Initialized empty Git repository in /root/Desktop/eJabberd/ejabberd-15.04/deps/p1_cache_tab/.git/
ERROR: git clone -n git://github.com/processone/cache_tab p1_cache_tab failed with error: 128 and output:
github.com[0: 192.30.252.131]: errno=Connection timed out
fatal: unable to connect a socket (Connection timed out)
Initialized empty Git repository in /root/Desktop/eJabberd/ejabberd-15.04/deps/p1_cache_tab/.git/
ERROR: 'get-deps' failed while processing /root/Desktop/eJabberd/ejabberd-15.04: rebar_abort
make: *** [deps/.got] Error 1
*
On trying the command "./rebar get-deps", I get the same connection timeout error.
My network connectivity is fine and it seems the github link is broken. Please Help!
You should try replacing the dependancy link to Github using https:// instead of git://
It should fix your issue.
We will check the project to make sure all our dependancies use https url scheme instead of ssh.