Add lxc.haltsignal to container configs
This change adds the lxc.haltsignal option to the container config which ensures containers are gracefully stopped but quickly. Presently, when a container is restart they can hang for 20 - 30 seconds which is due to the fact that the default stop signal is SIGPWR. While the hang when stopping a container is not 100% reproducible in all environments it can be seen when simply executing `lxc-stop`. If the user were to stream the container journal while stopping the container it's would be seen that the container hangs when trying to shutdown some systemd services. If the `lxc-stop` command is executed a second time the container is stopped more forcibly with SIGRTMIN+3. This change is using an example stop signal from the lxc documentation [0] which is implementing a Real-time signal, SIGRTMIN+n. More on the signal used can be found here [1]. [0] http://manpages.ubuntu.com/manpages/xenial/en/man5/lxc.container.conf.5.html [1] http://manpages.ubuntu.com/manpages/xenial/en/man7/signal.7.html Change-Id: I01e82eabf17d2ac5a89c13ef56616fd1fe0607dd Signed-off-by: Kevin Carter <kevin.carter@rackspace.com>
This commit is contained in:
parent
f2b3780c8d
commit
a372183af9
@ -165,8 +165,7 @@
|
||||
mode: "0755"
|
||||
delegate_to: "{{ physical_host }}"
|
||||
|
||||
# This is being defined due to an issue with dangling veth pairs.
|
||||
- name: Defines a pre and post hook script
|
||||
- name: Defines a pre, post, and haltsignal configs
|
||||
lineinfile:
|
||||
dest: "/var/lib/lxc/{{ inventory_hostname }}/config"
|
||||
line: "{{ item }}"
|
||||
@ -174,6 +173,7 @@
|
||||
with_items:
|
||||
- "lxc.hook.pre-start = /var/lib/lxc/{{ inventory_hostname }}/veth-cleanup.sh"
|
||||
- "lxc.hook.post-stop = /var/lib/lxc/{{ inventory_hostname }}/veth-cleanup.sh"
|
||||
- "lxc.haltsignal = SIGRTMIN+4"
|
||||
delegate_to: "{{ physical_host }}"
|
||||
|
||||
- name: Run veth wiring
|
||||
|
Loading…
Reference in New Issue
Block a user