Use pkill for lxc-dnsmasq systemd unit file

Previously psmisc was not installed by default, causing
the killall in the lxc-dnsmasq systemd unit file to
silently fail if killall wasn't found.  This prevented
running instances of dnsmasq to be torn down when
restarting the service.

This would exhibit as a problem during upgrades as
the older dnsmasq service would be running and the
new service would be unable to take over the port.
This would cause lxc containers to lose connectivity.

This commit switches to using pkill and ensures procps
is always installed by default.

Change-Id: I4fa838706f1163fd68ff68258bfc66cbf13bad94
This commit is contained in:
Antony Messerli 2019-04-10 12:37:06 -05:00
parent 7c767a6e78
commit d1c45fb0cb
7 changed files with 7 additions and 1 deletions

View File

@ -13,7 +13,7 @@ User=root
ExecStartPre=/usr/local/bin/lxc-system-manage iptables-create
{% endif %}
ExecStartPre=-/usr/bin/killall -u lxc-dnsmasq --regexp "^dnsmasq"
ExecStartPre=-/usr/bin/pkill -u {{ lxc_net_dnsmasq_user }} "^dnsmasq"
ExecStart=/usr/local/bin/lxc-system-manage dnsmasq-start

View File

@ -34,6 +34,7 @@ _lxc_hosts_distro_packages:
- liblxc1
- lxc
- lxc-dev
- procps
- python-dev
- python-lxc
- python3-lxc

View File

@ -32,6 +32,7 @@ lxc_hosts_distro_packages:
- dev-python/python3-lxc
- app-arch/xz-utils
- sys-apps/ethtool
- sys-process/procps
# Package to remove from the host
lxc_hosts_remove_distro_packages:

View File

@ -30,6 +30,7 @@ _lxc_hosts_distro_packages:
- lxc-libs
- lxc-templates
- policycoreutils-python
- procps
- python2-lxc
- unzip
- xz

View File

@ -33,6 +33,7 @@ _lxc_hosts_distro_packages:
- libseccomp2
- lxc
- liblxc-devel
- procps
- python-lxc-python2
- systemd-container
- xz

View File

@ -37,6 +37,7 @@ _lxc_hosts_distro_packages:
- lxc
- lxc-dev
- lxc-templates
- procps
- python-dev
- python-lxc
- python3-lxc

View File

@ -37,6 +37,7 @@ _lxc_hosts_distro_packages:
- lxc
- lxc-dev
- lxc-templates
- procps
- python-dev
- python-lxc
- python3-lxc