From a22fd5a2a92d32c1ee1a056c45422e441a8ed261 Mon Sep 17 00:00:00 2001 From: Clark Boylan Date: Mon, 26 Oct 2015 23:17:38 -0700 Subject: [PATCH] Set higher nofile limit for node in init script You must build additional pylons ... I mean we need more file descriptors. Set that in upstart directly since it does not respect limits.conf. This rewrites the upstart job to be more upstarty so that the limits can be applied without su undoing the work. Change-Id: Ibf670f07d75c4ffcf333c971d03c620f839b04d3 --- templates/upstart.erb | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/templates/upstart.erb b/templates/upstart.erb index f49ec6f..1281da7 100644 --- a/templates/upstart.erb +++ b/templates/upstart.erb @@ -12,15 +12,18 @@ respawn pre-start script chdir $EPHOME mkdir $EPLOGS ||true - chown $EPUSER:admin $EPLOGS ||true + chown -R $EPUSER:admin $EPLOGS ||true chmod 0755 $EPLOGS ||true chown -R $EPUSER:admin $EPHOME/var ||true bin/installDeps.sh >> $EPLOGS/error.log || { stop; exit 1; } end script +setuid <%= @ep_user %> +setgid <%= @ep_user %> +limit nofile 8192 16384 script cd $EPHOME - exec su -s /bin/sh -c 'exec "$0" "$@"' $EPUSER -- /usr/local/bin/node --stack_size=1968 node_modules/ep_etherpad-lite/node/server.js \ + /usr/local/bin/node --stack_size=1968 node_modules/ep_etherpad-lite/node/server.js \ >> $EPLOGS/access.log \ 2>> $EPLOGS/error.log end script