balena-labs-research / secure-store

Secure Store is like a YubiKey for your network, providing encryption and remote decryption of files/folders and environment variables for entire IoT fleets.
MIT License
5 stars 0 forks source link

Pass SIGTERM to child process and wait #5

Open maggie44 opened 1 year ago

maggie44 commented 1 year ago

When stopping the secure store container the sigterm/sigkill etc will be passed to the secure store process and will terminate without waiting for the child process (the users app) to exit gracefully.

https://github.com/balena-labs-research/secure-store/blob/3a51a23b033c69c6687a4447303da3fd5161945a/cmd/secure-store/run/run.go#L27

Signal handlers should be added to pass the sigterm commands to the child process to allow graceful exit and to avoid data loss in the users app.