Skip to content

Commit

Permalink
workbench: supervisord.conf components following the docs and scripts…
Browse files Browse the repository at this point in the history
… order
  • Loading branch information
fmaste committed May 30, 2023
1 parent f170cb5 commit a27f9a3
Showing 1 changed file with 49 additions and 33 deletions.
82 changes: 49 additions & 33 deletions nix/workbench/backend/supervisor-conf.nix
Expand Up @@ -29,12 +29,45 @@ let
## Refer to:
## - http://supervisord.org/configuration.html
supervisorConf =
##
## [unix_http_server] Section Settings
##
## Refer to:
## - http://supervisord.org/configuration.html#unix-http-server-section-settings
lib.attrsets.optionalAttrs (unixHttpServerPort != null) {
unix_http_server = {
file = unixHttpServerPort;
chmod = "0777";
};
}
##
## [inet_http_server] Section Settings
##
## Refer to:
## - http://supervisord.org/configuration.html#inet-http-server-section-settings
//
lib.attrsets.optionalAttrs (inetHttpServerPort != null) {
inet_http_server = {
port = inetHttpServerPort;
};
}
//
{
##
## [supervisord] Section Settings
##
## Refer to:
## http://supervisord.org/configuration.html#supervisord-section-settings
supervisord = {
logfile = "${stateDir}/supervisor/supervisord.log";
pidfile = "${stateDir}/supervisor/supervisord.pid";
strip_ansi = true;
};
##
## [supervisorctl] Section Settings
##
## Refer to:
## http://supervisord.org/configuration.html#supervisorctl-section-settings
supervisorctl = {};
"rpcinterface:supervisor" = {
"supervisor.rpcinterface_factory" = "supervisor.rpcinterface:make_main_rpcinterface";
Expand All @@ -46,24 +79,6 @@ let
## Refer to:
## - http://supervisord.org/configuration.html#program-x-section-settings
//
{
"program:generator" = {
# "command" below assumes "directory" is set accordingly.
directory = "${stateDir}/generator";
command = "${command}";
stdout_logfile = "${stateDir}/generator/stdout";
stderr_logfile = "${stateDir}/generator/stderr";
stopasgroup = false;
killasgroup = false;
autostart = false;
autorestart = false;
# Don't attempt any restart!
startretries = 0;
# Seconds it needs to stay running to consider the start successful
startsecs = 5;
};
}
//
lib.attrsets.optionalAttrs withTracer
{
"program:tracer" = {
Expand Down Expand Up @@ -106,23 +121,24 @@ let
## Refer to:
## - http://supervisord.org/configuration.html#unix-http-server-section-settings
//
lib.attrsets.optionalAttrs (unixHttpServerPort != null) {
unix_http_server = {
file = unixHttpServerPort;
chmod = "0777";
{
"program:generator" = {
# "command" below assumes "directory" is set accordingly.
directory = "${stateDir}/generator";
command = "${command}";
stdout_logfile = "${stateDir}/generator/stdout";
stderr_logfile = "${stateDir}/generator/stderr";
stopasgroup = false;
killasgroup = false;
autostart = false;
autorestart = false;
# Don't attempt any restart!
startretries = 0;
# Seconds it needs to stay running to consider the start successful
startsecs = 5;
};
}
##
## [inet_http_server] Section Settings
##
## Refer to:
## - http://supervisord.org/configuration.html#inet-http-server-section-settings
//
lib.attrsets.optionalAttrs (inetHttpServerPort != null) {
inet_http_server = {
port = inetHttpServerPort;
};
};
;

in {
value = supervisorConf;
Expand Down

0 comments on commit a27f9a3

Please sign in to comment.