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.

70 lines
2.2 KiB

domoticz: update to 3.9571 and clean up FHS handling Upstream has merged a simplified version of the FHS patch, with a few changes... Scripts are actually configuration. There are examples, but the point is that you write your own. So they should live in the data directory (e.g. /var/lib/domoticz) not in /usr/share/domoticz. The only exception is the dzVents runtime. So.... the upstream patch handles the dzVents runtime bit. Drop the part of our patch which added -scripts, because it can just be based in the userdata directory and we don't need to change that. Ship the default scripts/ directory in /etc/domoticz/scripts, and on startup make a *symlink* to it from /var/lib/domoticz/scripts. Symlink from /etc/domoticz/scripts/dzVents{data,generated_scripts} to temporary directories under /var/lib/domoticz/dzVents so that those directories (which are written to by Domoticz) don't land on the root file system. Anyone with a writeable file system who *wants* the data/ directory to be persistent, can change that. Just as they can change the userdata config option to point to a real file system somewhere. Also drop the renaming of the OpenZWave Config/ directory. It's purely cosmetric so there's no need for us to carry that change. It can go upstream first, if it really offends anyone. Drop the patches which are now merged upstream, and turn off the newly added USE_OPENSSL_STATIC. Add -noupdates to the command line. Finally, gzip the static www files to save space. In the common case, clients will use "Accept-Encodiong: gzip" and Domoticz will serve them as-is. It can also decompress on the fly if it really has to, but now we aren't asking it to *compress* on the fly, which is probably a losing proposition on an OpenWRT box. Signed-off-by: David Woodhouse <dwmw2@infradead.org>
7 years ago
domoticz: update to 3.9571 and clean up FHS handling Upstream has merged a simplified version of the FHS patch, with a few changes... Scripts are actually configuration. There are examples, but the point is that you write your own. So they should live in the data directory (e.g. /var/lib/domoticz) not in /usr/share/domoticz. The only exception is the dzVents runtime. So.... the upstream patch handles the dzVents runtime bit. Drop the part of our patch which added -scripts, because it can just be based in the userdata directory and we don't need to change that. Ship the default scripts/ directory in /etc/domoticz/scripts, and on startup make a *symlink* to it from /var/lib/domoticz/scripts. Symlink from /etc/domoticz/scripts/dzVents{data,generated_scripts} to temporary directories under /var/lib/domoticz/dzVents so that those directories (which are written to by Domoticz) don't land on the root file system. Anyone with a writeable file system who *wants* the data/ directory to be persistent, can change that. Just as they can change the userdata config option to point to a real file system somewhere. Also drop the renaming of the OpenZWave Config/ directory. It's purely cosmetric so there's no need for us to carry that change. It can go upstream first, if it really offends anyone. Drop the patches which are now merged upstream, and turn off the newly added USE_OPENSSL_STATIC. Add -noupdates to the command line. Finally, gzip the static www files to save space. In the common case, clients will use "Accept-Encodiong: gzip" and Domoticz will serve them as-is. It can also decompress on the fly if it really has to, but now we aren't asking it to *compress* on the fly, which is probably a losing proposition on an OpenWRT box. Signed-off-by: David Woodhouse <dwmw2@infradead.org>
7 years ago
domoticz: update to 3.9571 and clean up FHS handling Upstream has merged a simplified version of the FHS patch, with a few changes... Scripts are actually configuration. There are examples, but the point is that you write your own. So they should live in the data directory (e.g. /var/lib/domoticz) not in /usr/share/domoticz. The only exception is the dzVents runtime. So.... the upstream patch handles the dzVents runtime bit. Drop the part of our patch which added -scripts, because it can just be based in the userdata directory and we don't need to change that. Ship the default scripts/ directory in /etc/domoticz/scripts, and on startup make a *symlink* to it from /var/lib/domoticz/scripts. Symlink from /etc/domoticz/scripts/dzVents{data,generated_scripts} to temporary directories under /var/lib/domoticz/dzVents so that those directories (which are written to by Domoticz) don't land on the root file system. Anyone with a writeable file system who *wants* the data/ directory to be persistent, can change that. Just as they can change the userdata config option to point to a real file system somewhere. Also drop the renaming of the OpenZWave Config/ directory. It's purely cosmetric so there's no need for us to carry that change. It can go upstream first, if it really offends anyone. Drop the patches which are now merged upstream, and turn off the newly added USE_OPENSSL_STATIC. Add -noupdates to the command line. Finally, gzip the static www files to save space. In the common case, clients will use "Accept-Encodiong: gzip" and Domoticz will serve them as-is. It can also decompress on the fly if it really has to, but now we aren't asking it to *compress* on the fly, which is probably a losing proposition on an OpenWRT box. Signed-off-by: David Woodhouse <dwmw2@infradead.org>
7 years ago
domoticz: update to 3.9571 and clean up FHS handling Upstream has merged a simplified version of the FHS patch, with a few changes... Scripts are actually configuration. There are examples, but the point is that you write your own. So they should live in the data directory (e.g. /var/lib/domoticz) not in /usr/share/domoticz. The only exception is the dzVents runtime. So.... the upstream patch handles the dzVents runtime bit. Drop the part of our patch which added -scripts, because it can just be based in the userdata directory and we don't need to change that. Ship the default scripts/ directory in /etc/domoticz/scripts, and on startup make a *symlink* to it from /var/lib/domoticz/scripts. Symlink from /etc/domoticz/scripts/dzVents{data,generated_scripts} to temporary directories under /var/lib/domoticz/dzVents so that those directories (which are written to by Domoticz) don't land on the root file system. Anyone with a writeable file system who *wants* the data/ directory to be persistent, can change that. Just as they can change the userdata config option to point to a real file system somewhere. Also drop the renaming of the OpenZWave Config/ directory. It's purely cosmetric so there's no need for us to carry that change. It can go upstream first, if it really offends anyone. Drop the patches which are now merged upstream, and turn off the newly added USE_OPENSSL_STATIC. Add -noupdates to the command line. Finally, gzip the static www files to save space. In the common case, clients will use "Accept-Encodiong: gzip" and Domoticz will serve them as-is. It can also decompress on the fly if it really has to, but now we aren't asking it to *compress* on the fly, which is probably a losing proposition on an OpenWRT box. Signed-off-by: David Woodhouse <dwmw2@infradead.org>
7 years ago
  1. #!/bin/sh /etc/rc.common
  2. START=99
  3. USE_PROCD=1
  4. PROG=/usr/bin/domoticz
  5. PIDFILE=/var/run/domoticz.pid
  6. start_domoticz() {
  7. local section="$1"
  8. local loglevel sslcert sslpass sslwww syslog userdata
  9. config_get loglevel "$section" "loglevel"
  10. config_get sslcert "$section" "sslcert"
  11. config_get sslkey "$section" "sslkey"
  12. config_get sslpass "$section" "sslpass"
  13. config_get ssldhparam "$section" "ssldhparam"
  14. config_get sslwww "$section" "sslwww"
  15. config_get syslog "$section" "syslog"
  16. config_get userdata "$section" "userdata" userdata /var/lib/domoticz
  17. [ -n "$loglevel" ] && procd_append_param command -loglevel "$loglevel"
  18. [ -n "$syslog" ] && procd_append_param command -syslog "$syslog"
  19. [ -d "${userdata}" ] || {
  20. mkdir -p "${userdata}"
  21. chmod 0770 "$userdata"
  22. chown domoticz:domoticz "$userdata"
  23. }
  24. # By default, ${userdata}/scripts is a symlink to /etc/domoticz/scripts
  25. # and the two dzVents directories under there which Domoticz will actually
  26. # write to at runtime are symlinked back to /var/lib again.
  27. [ -d "${userdata}/scripts" ] || ln -sf /etc/domoticz/scripts "${userdata}/scripts"
  28. for DIR in data generated_scripts; do
  29. [ -d /var/lib/domoticz/dzVents/$DIR ] || {
  30. mkdir -p /var/lib/domoticz/dzVents/$DIR
  31. chown domoticz.domoticz /var/lib/domoticz/dzVents/$DIR
  32. }
  33. done
  34. procd_append_param command -userdata "$userdata"
  35. [ -n "$sslcert" -a "${sslwww:-0}" -gt 0 ] && {
  36. procd_append_param command -sslcert "$sslcert"
  37. procd_append_param command -sslwww "$sslwww"
  38. [ -n "$sslkey" ] && procd_append_param command -sslkey "$sslkey"
  39. [ -n "$sslpass" ] && procd_append_param command -sslpass "$sslpass"
  40. [ -n "$ssldhparam" ] && procd_append_param command -ssldhparam "$ssldhparam"
  41. } || procd_append_param command -sslwww 0
  42. }
  43. start_service() {
  44. procd_open_instance
  45. procd_set_param command "$PROG"
  46. procd_append_param command -noupdates
  47. procd_append_param command -approot /usr/share/domoticz/
  48. config_load "domoticz"
  49. config_get_bool disabled "$section" "disabled" 0
  50. [ "$disabled" -gt 0 ] && return 1
  51. config_foreach start_domoticz domoticz
  52. procd_set_param pidfile "$PIDFILE"
  53. procd_set_param respawn
  54. procd_set_param stdout 0
  55. procd_set_param term_timeout 10
  56. procd_set_param user "domoticz"
  57. procd_close_instance
  58. }