Package gavo :: Package user :: Module serve
[frames] | no frames]

Module serve

source code

A wrapper script suitable for starting the server.

Classes
  ExitPage
Functions
 
setupServer(rootPage) source code
 
manageResourceLimits()
raises some resource limits to their hard limits.
source code
 
daemonize(logFile, callable) source code
 
getLogFile(baseName)
returns a log file group-writable by gavo.
source code
 
start(args) source code
 
stop(args) source code
 
waitForUnloadedServer(stopTimeout)
delays while the service [web]serverURL appears to serve clients or stopTimeout seconds are over.
source code
 
restart(args) source code
 
reload(args) source code
 
debug(args) source code
 
expireRDs(args) source code
 
updateCertificate(args) source code
 
main() source code
Variables
  PIDManager = <gavo.user.serve._PIDManager object>
  __package__ = 'gavo.user'
Function Details

manageResourceLimits()

source code 

raises some resource limits to their hard limits.

This is, in particular, the number of open FDs, as DaCHS may need a lot of those.

start(args)

source code 
Decorators:
  • @exposedFunction(help= "start the server and put it in the background.")

stop(args)

source code 
Decorators:
  • @exposedFunction(help= "stop a running server.")

waitForUnloadedServer(stopTimeout)

source code 

delays while the service [web]serverURL appears to serve clients or stopTimeout seconds are over.

This will also return fine if no server is running. If the service keeps having clients after stopTimeout, a ReportableError is raised.

restart(args)

source code 
Decorators:
  • @exposedFunction([Arg("--if-unloaded-within", type= int, dest= "stopTimeout", default= None, metavar= "SECS", help= "Wait SECS seconds until the server seems unloaded before" " stopping it; give up if it doesn't seem to get unloaded.")], help= "restart the server")

reload(args)

source code 
Decorators:
  • @exposedFunction(help= "reload server configuration (incomplete)")

debug(args)

source code 
Decorators:
  • @exposedFunction(help= "run a server and remain in the foreground, dumping" " all kinds of stuff to the terminal")

expireRDs(args)

source code 
Decorators:
  • @exposedFunction([Arg("rdIds", help= "one or more rdIds", nargs= "+"),], help= "reload RDs listed in the server named by [web]serverURL.")

updateCertificate(args)

source code 
Decorators:
  • @exposedFunction([], help= "Create or renew a letsencrypt certificate" " for hazmat/server.key using hazmat/account.key (this is for https" " operation); you need to run this as a user that can read and write" " hazmat (typically root).")