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.

33 lines
590 B

  1. #!/bin/sh /etc/rc.common
  2. # Copyright (C) 2006-2011 OpenWrt.org
  3. START=50
  4. STOP=50
  5. USE_PROCD=1
  6. PROG=/usr/sbin/lighttpd
  7. validate_conf() {
  8. $PROG -tt -f /etc/lighttpd/lighttpd.conf >/dev/null 2>&1 || {
  9. echo "validation failed"
  10. return 1
  11. }
  12. }
  13. start_service() {
  14. user_exists http || user_add http
  15. [ -d /var/log/lighttpd ] || {
  16. mkdir -m 0775 -p /var/log/lighttpd
  17. chgrp www-data /var/log/lighttpd
  18. }
  19. validate_conf || exit 1
  20. procd_open_instance
  21. procd_set_param command $PROG -D -f /etc/lighttpd/lighttpd.conf
  22. procd_close_instance
  23. }
  24. reload_service() {
  25. procd_send_signal lighttpd
  26. }