package devkit

  1. Overview
  2. Docs

daemon utilities

module U = ExtUnix.Specific
val log : Log.logger
val logfile : string option Stdlib.ref
val pidfile : string option Stdlib.ref
val runas : Unix.passwd_entry option Stdlib.ref
val foreground : bool Stdlib.ref
val managed : bool Stdlib.ref
val should_exit_ : bool Stdlib.ref

global flag indicating that process should exit, manage will automatically set this flag on SIGTERM unless default signal handling is overriden

val should_exit_lwt : unit Lwt.t

should_exit_lwt usage is discouraged. Use wait_exit instead, which makes it harder to ignore "should exit" state and loop infinitely

val signal_exit_lwt : unit Lwt.u

should_exit_lwt usage is discouraged. Use wait_exit instead, which makes it harder to ignore "should exit" state and loop infinitely

val should_exit : unit -> bool
val should_run : unit -> bool
exception ShouldExit

exception to be raised by functions that wish to signal premature termination due to !should_exit = true

val signal_exit : unit -> unit
val break : unit -> unit
  • raises ShouldExit

    if should_exit condition is set, otherwise do nothing

val wait_exit : unit -> 'a Lwt.t

wait until should_exit is set and raise ShouldExit

val break_lwt : unit -> unit Lwt.t

break_lwt = Lwt.wrap break

val unless_exit : 'a Lwt.t -> 'a Lwt.t

unless_exit x resolves promise x or raises ShouldExit

val get_args : unit -> (string * Stdlib.Arg.spec * string) list
val args : (string * Stdlib.Arg.spec * string) list
val install_signal_handlers : unit -> unit
val manage : unit -> unit
OCaml

Innovation. Community. Security.