Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 18 Mar 2016 14:37:35 -0700
From:      Jim Long <list@museum.rain.com>
To:        freebsd-questions@freebsd.org
Subject:   Re: Seeking a solid startup script for node.js/forever
Message-ID:  <20160318213735.GA43466@ns.umpquanet.com>
In-Reply-To: <20160318193603.GA20566@ns.umpquanet.com>
References:  <20160318193603.GA20566@ns.umpquanet.com>

Next in thread | Previous in thread | Raw E-Mail | Index | Archive | Help
On Fri, Mar 18, 2016 at 12:36:03PM -0700, Jim Long wrote:
> How can I modify this script so that it will start cleanly in the
> background?

I guess the obvious, brute force solution is:

--- iws.orig    2016-03-18 14:35:21.206449824 -0700
+++ iws 2016-03-18 14:33:39.770357734 -0700
@@ -31,7 +31,7 @@
 start()
 {
   NODE_ENV=production
-  su -m www -c "exec ${forever} start -a -l ${HOME}/forever.log -o ${HOME}/output.log -e ${HOME}/error.log -p /var/run/forever ${script}"
+  su -m www -c "exec ${forever} start -a -l ${HOME}/forever.log -o ${HOME}/output.log -e ${HOME}/error.log -p /var/run/forever ${script}" &
 }
 
 status()


but if anyone has something more elegant, I'd be grateful to learn of it.

Jim



Want to link to this message? Use this URL: <http://docs.FreeBSD.org/cgi/mid.cgi?20160318213735.GA43466>