Note that there are some explanatory texts on larger screens.

plurals
  1. POcentos+nodejs+forever(startstop)
    text
    copied!<p>Good day i have some problem with forever start\stop script. </p> <p>CentOS 6.2 <br> kernel 2.6.32-220.el6.x86_64 <br> nodejs v0.6.19<br> npm v 1.1.24<br> forever@0.9.2<br></p> <p>i create nologin user for running my script </p> <p><strong>/etc/passwd <br></strong> node:x:501:501::/usr/sbin/nologin:/bin/bash:/usr/local/bin/node:/usr/local/bin/forever:/usr/local/bin:/usr/local/lib/node_modules/forever/bin</p> <p>i create script and named hello2.js</p> <pre><code> #!/bin/bash echo "aight" </code></pre> <p>and try to running</p> <pre><code> [max@localhost Desktop]$ forever start hello2.js info: Forever processing file: hello2.js [max@localhost Desktop]$ forever list info: Forever processes running data: uid command script forever pid logfile uptime data: [0] n4EB node hello2.js 2675 2728 /home/max/.forever/n4EB.log 0:0:0:0.130 </code></pre> <p>Everything all right. And the next i create start-stop script for hello2.js and named him node</p> <p>===========================</p> <pre><code>#!/bin/bash #proccessname: node USER=node PWD=node node=node forever=forever start() { forever start -l forever.log -o out.log -e err.log /home/max/Desktop/hello2.js } stop(){ /usr/local/bin/forever stopall } restart() { stop start } status(){ /usr/local/bin/forever list } #see how we were called case "$1" in start) start ;; stop) stop ;; restart) stop start ;; status) status ;; *) echo $ "usage $0 {start | stop | status | restart}" exit 1 esac exit 0 </code></pre> <p>========================================= made it executable. </p> <p>And the next i want to look how this working</p> <pre><code>[max@localhost Desktop]$ ./node $ usage ./node {start | stop | status | restart} [max@localhost Desktop]$ ./node start info: Forever processing file: /home/max/Desktop/hello2.js [max@localhost Desktop]$ ./node status **info: No forever processes running** </code></pre> <p>But</p> <pre><code>[max@localhost Desktop]$ forever start hello2.js info: Forever processing file: hello2.js [max@localhost Desktop]$ forever list info: Forever processes running data: uid command script forever pid logfile uptime data: [0] n4EB node hello2.js 2675 2728 /home/max/.forever/n4EB.log 0:0:0:0.130 [max@localhost Desktop]$ </code></pre> <p>where my mistake? </p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload