module Daemonize: Ketrew_daemonize
Ketrew_long_running.LONG_RUNNING
plugin-API.
Shell commands are put in a Ketrew_monitored_script.t
, and
run in the background (detached in a new process group).
There are two methods for starting/detaching the computation
(set with the ~using
parameter):
`Nohup_setsid
(the default) means that the script will be started with
"nohup setsid bash <script> &"
.
This method is the POSIX-ly portable one; but, sadly,
it is broken on MacOSX
(c.f. people having
TMux problems,
Nohup problems).`Python_daemon
means that the script will be started by
a generated Python script.
Obviously, this works only when the host can run Python scripts (which
includes MacOSX).update
function uses the log-file of the monitored-script, and the
command "ps -p <Group-PID>"
.
The kill
function kills the process group (created thanks to "setsid"
)
with "kill -- <N>"
(where "<N>"
is the negative PID of the group).
type
run_parameters
val run_parameters_to_yojson : run_parameters -> Yojson.Safe.json
val run_parameters_of_yojson : Yojson.Safe.json ->
[ `Error of string | `Ok of run_parameters ]
include Ketrew_long_running.LONG_RUNNING
val create : ?starting_timeout:float ->
?call_script:(string -> string list) ->
?using:[ `Nohup_setsid | `Python_daemon ] ->
?host:Ketrew_host.t ->
?no_log_is_ok:bool ->
Ketrew_program.t -> [> `Long_running of string * string ]
Ketrew_target.build_process
(run parameters
are already serialized), see Ketrew_edsl.daemonize
for more
details