allow to customize timeout and env vars for program based hooks

Fixes #847

Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
This commit is contained in:
Nicola Murino
2022-05-20 19:30:54 +02:00
parent 796ea1dde9
commit 751946f47a
16 changed files with 394 additions and 32 deletions

View File

@@ -141,12 +141,6 @@ func (s *Service) Start(disableAWSInstallationCode bool) error {
return err
}
err = s.LoadInitialData()
if err != nil {
logger.Error(logSender, "", "unable to load initial data: %v", err)
logger.ErrorToConsole("unable to load initial data: %v", err)
}
httpConfig := config.GetHTTPConfig()
err = httpConfig.Initialize(s.ConfigDir)
if err != nil {
@@ -154,6 +148,12 @@ func (s *Service) Start(disableAWSInstallationCode bool) error {
logger.ErrorToConsole("error initializing http client: %v", err)
return err
}
commandConfig := config.GetCommandConfig()
if err := commandConfig.Initialize(); err != nil {
logger.Error(logSender, "", "error initializing commands configuration: %v", err)
logger.ErrorToConsole("error initializing commands configuration: %v", err)
return err
}
s.startServices()
go common.Config.ExecuteStartupHook() //nolint:errcheck
@@ -162,6 +162,12 @@ func (s *Service) Start(disableAWSInstallationCode bool) error {
}
func (s *Service) startServices() {
err := s.LoadInitialData()
if err != nil {
logger.Error(logSender, "", "unable to load initial data: %v", err)
logger.ErrorToConsole("unable to load initial data: %v", err)
}
sftpdConf := config.GetSFTPDConfig()
ftpdConf := config.GetFTPDConfig()
httpdConf := config.GetHTTPDConfig()