diff --git a/roles/ocluster/templates/worker b/roles/ocluster/templates/worker index 3ea7536..6ad87f1 100644 --- a/roles/ocluster/templates/worker +++ b/roles/ocluster/templates/worker @@ -7,13 +7,22 @@ . /etc/rc.subr name=worker +title=ocluster_worker # Title of the process +# The command to invoke the worker process +worker_command="/usr/local/bin/${name} --connect /etc/ocluster/pool.cap --name {{ inventory_hostname_short }} --state-dir /obuilder/state --obuilder-store zfs:obuilder --obuilder-healthcheck 0 --obuilder-prune-threshold=25 --capacity={{ capacity }} -v" + rcvar=worker_enable PATH=$PATH:/usr/local/bin export PATH -command="/usr/local/bin/${name}" -command_args="--connect /etc/ocluster/pool.cap --name {{ inventory_hostname_short }} --state-dir /obuilder/state --obuilder-store zfs:obuilder --obuilder-healthcheck 0 --obuilder-prune-threshold=25 --capacity={{ capacity }} -v 2>&1 | logger &" +# `daemon` will run the worker process +command="/usr/sbin/daemon" +# --restart-delay : Supervise and restart the program after the specified seconds of delay if it has been terminated. +# --syslog : direct stdout and stderr to the syslog +# --title : the name to give the process +# See https://man.freebsd.org/cgi/man.cgi?daemon(8) +command_args="--restart-delay 60 --syslog --title ${title} ${worker_command}" load_rc_config $name run_rc_command "$1"