lxc-auto: step by 1 sec up to $max_timeout
authorJohn Audia <graysky@archlinux.us>
Sun, 19 Sep 2021 18:35:09 +0000 (14:35 -0400)
committerRafał Miłecki <rafal@milecki.pl>
Fri, 19 May 2023 15:46:13 +0000 (17:46 +0200)
commit7d373e0fcb2946850c8efe0be69357232a1fa964
tree09e29ed625bb6c98d90fd93a21258a52922ca539
parentb881d3dc90c5423ae744b26dd5b41e0c427b708f
lxc-auto: step by 1 sec up to $max_timeout

If the user defines a $max_timeout of 30, the service will wait 30 seconds
before it considers lxc-stop complete even though lxc-stop might actually
finish much sooner.  This introduces an unneeded delay.

This commit changes the behavior to check once per second to see when lxc-stop
actually stops doing so up to $max_timeout.  It also slightly simplifies the
code with logic to append the -t $max_timeout to the script.

Signed-off-by: John Audia <graysky@archlinux.us>
(cherry picked from commit 7984d2d74a2fd83f036310888ad7486bff655c5a)
utils/lxc/files/lxc-auto.init