Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix certbot process getting stuck in dstack-proxy (#2143)
**Problem**: if obtaining a certificate times out, `subprocess.run` cancels the certbot command with SIGKILL. However, the command is run with sudo, so SIGKILL actually kills the sudo process, while its child certbot process is adopted by init and keeps running indefinitely. This breaks adding or updating services on the gateway, since certbot refuses to run if another certbot process exists. Attempts to implement graceful cancelling by sending SIGTERM to the sudo process were not successful - for some reason sudo ignores SIGTERM originating from its parent. The solution in this commit uses the `timeout` shell command to set the timeout on the actual certbot process instead of the sudo process.
- Loading branch information