run 1.1 KB

12345678910111213141516171819202122232425262728293031
  1. #!/bin/bash
  2. NODE_PARAMS=""
  3. if [ "$DEBUG_NODE" == "true" ]; then
  4. echo "running debug - clsi"
  5. NODE_PARAMS="--inspect=0.0.0.0:30130"
  6. fi
  7. # Set permissions on docker.sock if present,
  8. # To enable sibling-containers (see entrypoint.sh in clsi project)
  9. if [ -e '/var/run/docker.sock' ]; then
  10. echo ">> Setting permissions on docker socket"
  11. DOCKER_GROUP=$(stat -c '%g' /var/run/docker.sock)
  12. groupadd --non-unique --gid ${DOCKER_GROUP} dockeronhost
  13. usermod -aG dockeronhost www-data
  14. fi
  15. # Copies over CSLI synctex to the host mounted volume, so it
  16. # can be subsequently mounted in TexLive containers on Sandbox Compilation
  17. SYNCTEX=/var/lib/sharelatex/bin/synctex
  18. if [ ! -f "$SYNCTEX" ]; then
  19. if [ "$DISABLE_SYNCTEX_BINARY_COPY" == "true" ]; then
  20. echo ">> Copy of synctex executable disabled by DISABLE_SYNCTEX_BINARY_COPY flag, feature may not work"
  21. else
  22. echo ">> Copying synctex executable to the host"
  23. mkdir -p $(dirname $SYNCTEX )
  24. cp /var/www/sharelatex/clsi/bin/synctex $SYNCTEX
  25. fi
  26. fi
  27. exec /sbin/setuser www-data /usr/bin/node $NODE_PARAMS /var/www/sharelatex/clsi/app.js >> /var/log/sharelatex/clsi.log 2>&1