Patch title: Release 93 bulk changes
Abstract:
File: /fullpliant/shutdown.pli
Key:
    Removed line
    Added line
   
module "/pliant/language/unsafe.pli"
module "/pliant/language/stream.pli"
module "/pliant/language/context.pli"
module "/pliant/protocol/http/server.pli"
module "/pliant/protocol/http/style/default.style"
module "/pliant/language/os/process.pli"
if os_api="linux"
  module "/pliant/linux/kernel/shutdown.pli"


method page shutdown timeout action
  arg_rw HtmlPage page ; arg Float timeout ; arg Str action
  var Pointer:HttpServer server :> page:http_request server
  thread
    sleep 2*timeout
    console "[lf]emergency "+action+"[lf]"
    if os_api="linux" and action="reboot"
      kernel_shutdown true
    eif os_api="linux" and action="poweroff"
      kernel_shutdown false
    process_exit 0
  console "(A"
  tcp_shutdown_sem request
  var DateTime start := datetime
  atomic_add server:clients_count (-1)
  console "Shutdown:" eol
  tcp_servers_stop timeout
  console "B"
  process_shutdown
  console "C"
  var Int sec := cast datetime:seconds-start:seconds Int
  page text "Pliant services have been stopped in "+string:s
  if action<>""
    page text "The server will now "+action+"."
  page:http_stream close
  page:http_request:stream close
  tcp_shutdown_sem release
  console "D)[lf]"
  if os_api="linux" and action="reboot"
    kernel_shutdown true
  eif os_api="linux" and action="poweroff"
    kernel_shutdown false
  if action<>""
module "/pliant/language/unsafe.pli"
module "/pliant/language/stream.pli"
module "/pliant/language/context.pli"
module "/pliant/protocol/http/server.pli"
module "/pliant/protocol/http/style/default.style"
module "/pliant/language/os/process.pli"
if os_api="linux"
  module "/pliant/linux/kernel/shutdown.pli"


method page shutdown timeout action
  arg_rw HtmlPage page ; arg Float timeout ; arg Str action
  var Pointer:HttpServer server :> page:http_request server
  thread
    sleep 2*timeout
    console "[lf]emergency "+action+"[lf]"
    if os_api="linux" and action="reboot"
      kernel_shutdown true
    eif os_api="linux" and action="poweroff"
      kernel_shutdown false
    process_exit 0
  console "(A"
  tcp_shutdown_sem request
  var DateTime start := datetime
  atomic_add server:clients_count (-1)
  console "Shutdown:" eol
  tcp_servers_stop timeout
  console "B"
  process_shutdown
  console "C"
  var Int sec := cast datetime:seconds-start:seconds Int
  page text "Pliant services have been stopped in "+string:s
  if action<>""
    page text "The server will now "+action+"."
  page:http_stream close
  page:http_request:stream close
  tcp_shutdown_sem release
  console "D)[lf]"
  if os_api="linux" and action="reboot"
    kernel_shutdown true
  eif os_api="linux" and action="poweroff"
    kernel_shutdown false
  if action<>""
    (var Stream s) open "file:/log/pliant.log" append+safe
    s writeline "restart "+string:datetime
    s close
    process_exit 0


    process_exit 0