Browse Source

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
Clark Boylan 3 years ago
parent
commit
a22fd5a2a9
1 changed files with 5 additions and 2 deletions
  1. 5
    2
      templates/upstart.erb

+ 5
- 2
templates/upstart.erb View File

@@ -12,15 +12,18 @@ respawn
12 12
 pre-start script
13 13
     chdir $EPHOME
14 14
     mkdir $EPLOGS                              ||true
15
-    chown $EPUSER:admin $EPLOGS                ||true
15
+    chown -R $EPUSER:admin $EPLOGS             ||true
16 16
     chmod 0755 $EPLOGS                         ||true
17 17
     chown -R $EPUSER:admin $EPHOME/var         ||true
18 18
     bin/installDeps.sh >> $EPLOGS/error.log || { stop; exit 1; }
19 19
 end script
20 20
 
21
+setuid <%= @ep_user %>
22
+setgid <%= @ep_user %>
23
+limit nofile 8192 16384
21 24
 script
22 25
   cd $EPHOME
23
-  exec su -s /bin/sh -c 'exec "$0" "$@"' $EPUSER -- /usr/local/bin/node --stack_size=1968 node_modules/ep_etherpad-lite/node/server.js \
26
+  /usr/local/bin/node --stack_size=1968 node_modules/ep_etherpad-lite/node/server.js \
24 27
                         >> $EPLOGS/access.log \
25 28
                         2>> $EPLOGS/error.log
26 29
 end script

Loading…
Cancel
Save