ranch.appup 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. %% ranch_conns_sup is a custom supervisor (special process),
  2. %% not an OTP supervisor. When "supervisor" is used, the
  3. %% module is always loaded before calling system_code_change,
  4. %% for both upgrade and downgrade operations. This is so that
  5. %% the supervisor's init callback of the upgraded/downgraded
  6. %% module gets called. But the custom supervisors in Ranch
  7. %% do not have an init callback and therefore can function
  8. %% like other special processes: when upgrading, load the
  9. %% module then call system_code_change; and when downgrading,
  10. %% call system_code_change and then load the module.
  11. {"2.1.0",
  12. [{<<"2\\.0\\.[0-9]+.*">>, [
  13. {apply, {ranch, stop_all_acceptors, []}},
  14. {load_module, ranch},
  15. {load_module, ranch_acceptor},
  16. {update, ranch_acceptors_sup, supervisor},
  17. {load_module, ranch_app},
  18. {update, ranch_server, {advanced, []}},
  19. {update, ranch_conns_sup_sup, supervisor},
  20. %% See comments at the top of the file about ranch_conns_sup.
  21. {update, ranch_conns_sup, {advanced, []}},
  22. {load_module, ranch_crc32c},
  23. {update, ranch_embedded_sup, supervisor},
  24. {update, ranch_listener_sup, supervisor},
  25. {load_module, ranch_protocol},
  26. {load_module, ranch_proxy_header},
  27. {update, ranch_server_proxy, {advanced, []}},
  28. {load_module, ranch_ssl},
  29. {update, ranch_sup, supervisor},
  30. {load_module, ranch_tcp},
  31. {load_module, ranch_transport},
  32. {apply, {ranch, restart_all_acceptors, []}}
  33. ]}],
  34. [{<<"2\\.0\\.[0-9]+.*">>, [
  35. {apply, {ranch, stop_all_acceptors, []}},
  36. {load_module, ranch},
  37. {load_module, ranch_acceptor},
  38. {update, ranch_acceptors_sup, supervisor},
  39. {load_module, ranch_app},
  40. %% See comments at the top of the file about ranch_conns_sup.
  41. {update, ranch_conns_sup, {advanced, []}},
  42. {update, ranch_conns_sup_sup, supervisor},
  43. {load_module, ranch_crc32c},
  44. {update, ranch_embedded_sup, supervisor},
  45. {update, ranch_listener_sup, supervisor},
  46. {load_module, ranch_protocol},
  47. {load_module, ranch_proxy_header},
  48. {update, ranch_server, {advanced, []}},
  49. {update, ranch_server_proxy, {advanced, []}},
  50. {load_module, ranch_ssl},
  51. {update, ranch_sup, supervisor},
  52. {load_module, ranch_tcp},
  53. {load_module, ranch_transport},
  54. {apply, {ranch, restart_all_acceptors, []}}
  55. ]}]
  56. }.
  57. {"2.0.0",
  58. [{<<"2\\.0\\.[0-9]+.*">>, [
  59. {apply, {ranch, stop_all_acceptors, []}},
  60. {load_module, ranch},
  61. {load_module, ranch_acceptor},
  62. {update, ranch_acceptors_sup, supervisor},
  63. {load_module, ranch_app},
  64. {update, ranch_server, {advanced, []}},
  65. {update, ranch_conns_sup_sup, supervisor},
  66. %% See comments at the top of the file about ranch_conns_sup.
  67. {update, ranch_conns_sup, {advanced, []}},
  68. {load_module, ranch_crc32c},
  69. {update, ranch_embedded_sup, supervisor},
  70. {update, ranch_listener_sup, supervisor},
  71. {load_module, ranch_protocol},
  72. {load_module, ranch_proxy_header},
  73. {update, ranch_server_proxy, {advanced, []}},
  74. {load_module, ranch_ssl},
  75. {update, ranch_sup, supervisor},
  76. {load_module, ranch_tcp},
  77. {load_module, ranch_transport},
  78. {apply, {ranch, restart_all_acceptors, []}}
  79. ]}],
  80. [{<<"2\\.0\\.[0-9]+.*">>, [
  81. {apply, {ranch, stop_all_acceptors, []}},
  82. {load_module, ranch},
  83. {load_module, ranch_acceptor},
  84. {update, ranch_acceptors_sup, supervisor},
  85. {load_module, ranch_app},
  86. %% See comments at the top of the file about ranch_conns_sup.
  87. {update, ranch_conns_sup, {advanced, []}},
  88. {update, ranch_conns_sup_sup, supervisor},
  89. {load_module, ranch_crc32c},
  90. {update, ranch_embedded_sup, supervisor},
  91. {update, ranch_listener_sup, supervisor},
  92. {load_module, ranch_protocol},
  93. {load_module, ranch_proxy_header},
  94. {update, ranch_server, {advanced, []}},
  95. {update, ranch_server_proxy, {advanced, []}},
  96. {load_module, ranch_ssl},
  97. {update, ranch_sup, supervisor},
  98. {load_module, ranch_tcp},
  99. {load_module, ranch_transport},
  100. {apply, {ranch, restart_all_acceptors, []}}
  101. ]}]
  102. }.