You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

43 lines
1.0 KiB

  1. #!/bin/sh
  2. case "$1" in
  3. 'master')
  4. ARGS="-mdir=/data -volumePreallocate -volumeSizeLimitMB=1024"
  5. exec /usr/bin/weed $@ $ARGS
  6. ;;
  7. 'volume')
  8. ARGS="-dir=/data -max=0"
  9. exec /usr/bin/weed $@ $ARGS
  10. ;;
  11. 'server')
  12. ARGS="-dir=/data -volume.max=0 -master.volumePreallocate -master.volumeSizeLimitMB=1024"
  13. exec /usr/bin/weed $@ $ARGS
  14. ;;
  15. 'filer')
  16. ARGS=""
  17. exec /usr/bin/weed $@ $ARGS
  18. ;;
  19. 's3')
  20. ARGS="-domainName=$S3_DOMAIN_NAME -key.file=$S3_KEY_FILE -cert.file=$S3_CERT_FILE"
  21. exec /usr/bin/weed $@ $ARGS
  22. ;;
  23. 'cronjob')
  24. MASTER=${WEED_MASTER-localhost:9333}
  25. FIX_REPLICATION_CRON_SCHEDULE=${CRON_SCHEDULE-*/7 * * * * *}
  26. echo "$FIX_REPLICATION_CRON_SCHEDULE" 'echo "volume.fix.replication" | weed shell -master='$MASTER > /crontab
  27. BALANCING_CRON_SCHEDULE=${CRON_SCHEDULE-25 * * * * *}
  28. echo "$BALANCING_CRON_SCHEDULE" 'echo "volume.balance -c ALL -force" | weed shell -master='$MASTER >> /crontab
  29. echo "Running Crontab:"
  30. cat /crontab
  31. exec supercronic /crontab
  32. ;;
  33. *)
  34. exec /usr/bin/weed $@
  35. ;;
  36. esac