actions: properly release resources once the external command exits

This commit is contained in:
Nicola Murino 2019-08-30 03:58:54 +02:00
parent 838426b3a4
commit 25fb639465

View file

@ -321,8 +321,11 @@ func executeAction(operation string, username string, path string, target string
if _, err = os.Stat(actions.Command); err == nil {
command := exec.Command(actions.Command, operation, username, path, target)
err = command.Start()
logger.Debug(logSender, "executed command \"%v\" with arguments: %v, %v, %v, %v, error: %v",
logger.Debug(logSender, "start command \"%v\" with arguments: %v, %v, %v, %v, error: %v",
actions.Command, operation, username, path, target, err)
if err == nil {
go command.Wait()
}
} else {
logger.Warn(logSender, "Invalid action command \"%v\" : %v", actions.Command, err)
}