run 1.2 KB

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