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
This commit is contained in:
Clark Boylan 2015-10-26 23:17:38 -07:00
parent 957ecb6cef
commit a22fd5a2a9
1 changed files with 5 additions and 2 deletions

View File

@ -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