From 843b05a6ecc44367e5872d32406d1e6a0512bb72 Mon Sep 17 00:00:00 2001 From: "Reed A. Cartwright" Date: Tue, 19 Jan 2016 16:17:16 -0700 Subject: [PATCH] Use exec to switch to node process At the end of run, `exec` should be used to switch to the node process. That way node will take over the pid of `sh run.sh`, making it easier to monitor and daemonize the server. ``` exec [command [arg ...]] Unless command is omitted, the shell process is replaced with the specified program (which must be a real program, not a shell built-in command or function). Any redirections on the exec com- mand are marked as permanent, so that they are not undone when the exec command finishes. ``` --- bin/run.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/run.sh b/bin/run.sh index 4d276632d..08cd1da71 100755 --- a/bin/run.sh +++ b/bin/run.sh @@ -35,5 +35,5 @@ bin/installDeps.sh $* || exit 1 echo "Started Etherpad..." SCRIPTPATH=`pwd -P` -node $SCRIPTPATH/node_modules/ep_etherpad-lite/node/server.js $* +exec node $SCRIPTPATH/node_modules/ep_etherpad-lite/node/server.js $*