]>
Commit | Line | Data |
---|---|---|
27234deb JC |
1 | #! /bin/bash |
2 | ||
3 | set -e | |
4 | ||
5 | LXC_HOOK_DIR="@LXCHOOKDIR@" | |
6 | ||
7 | rootfs="${LXC_ROOTFS_PATH##*:}" | |
8 | pidfile="${rootfs%/*}/dhclient.pid" | |
9 | ||
10 | # XXX Stop hook namespace arguments are wrong for some reason, those are the host namespaces not the container ones. | |
11 | # Retrieve the namespaces from the dhclient pidfile instead. | |
12 | nsenter -u -U -n -t $(< ${pidfile}) -- \ | |
13 | /sbin/dhclient -r -pf ${pidfile} -lf ${rootfs}/var/lib/dhclient/dhclient.leases -e ROOTFS=${rootfs} -sf ${LXC_HOOK_DIR}/dhclient-script | |
14 | ||
15 | rm -f ${pidfile} |