lighttpd.initd 754 B

123456789101112131415161718192021222324252627282930313233343536
  1. #!/usr/bin/openrc-run
  2. # Copyright 1999-2012 Gentoo Foundation
  3. # Distributed under the terms of the GNU General Public License v2
  4. name="lighttpd"
  5. description="Lighttpd web server"
  6. conf_file="${LIGHTTPD_CONF:-/etc/lighttpd/lighttpd.conf}"
  7. supervisor=supervise-daemon
  8. command="/usr/bin/lighttpd"
  9. command_args="-D -f ${conf_file}"
  10. required_files="${conf_file}"
  11. depend() {
  12. need net
  13. use mysql logger spawn-fcgi ldap slapd netmount dns
  14. after firewall
  15. after famd
  16. after sshd
  17. }
  18. checkconfig() {
  19. ebegin "Checking for ${conf_file}"
  20. if [ ! -f "${conf_file}" ] ; then
  21. eerror "${conf_file} does not exist."
  22. fi
  23. eend $?
  24. /usr/bin/lighttpd -t -f "${conf_file}" >/dev/null
  25. }
  26. start_pre() {
  27. checkconfig || return $?
  28. checkpath -d -q -m 0750 /run/lighttpd/
  29. }