| 1 |
#!/bin/sh |
| 2 |
|
| 3 |
set -e |
| 4 |
|
| 5 |
# This script can be called in the following ways: |
| 6 |
# |
| 7 |
# After the package was installed: |
| 8 |
# <postinst> configure <old-version> |
| 9 |
# |
| 10 |
# |
| 11 |
# If prerm fails during upgrade or fails on failed upgrade: |
| 12 |
# <old-postinst> abort-upgrade <new-version> |
| 13 |
# |
| 14 |
# If prerm fails during deconfiguration of a package: |
| 15 |
# <postinst> abort-deconfigure in-favour <new-package> <version> |
| 16 |
# removing <old-package> <version> |
| 17 |
# |
| 18 |
# If prerm fails during replacement due to conflict: |
| 19 |
# <postinst> abort-remove in-favour <new-package> <version> |
| 20 |
|
| 21 |
case "$1" in |
| 22 |
configure) |
| 23 |
# We cannot restart lxcfs itself because containers will become |
| 24 |
# unable to read /proc/uptime etc. |
| 25 |
if [ -f /run/lxcfs.pid ]; then |
| 26 |
# send it a USR1 signal to reload the new liblxcfs. |
| 27 |
kill -USR1 `cat /run/lxcfs.pid` || true |
| 28 |
fi |
| 29 |
# lxcfs was not running, so just wait for systemd to start it. |
| 30 |
;; |
| 31 |
|
| 32 |
esac |
| 33 |
|
| 34 |
#DEBHELPER# |
| 35 |
|
| 36 |
case "$1" in |
| 37 |
configure|abort-upgrade|abort-deconfigure|abort-remove) |
| 38 |
if deb-systemd-helper --quiet is-enabled 'lxcfs.service'; then |
| 39 |
deb-systemd-helper start 'lxcfs.service' > /dev/null |
| 40 |
fi |
| 41 |
;; |
| 42 |
esac |
| 43 |
|
| 44 |
exit 0 |