2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-08-22 18:07:57 +00:00
criu/test/empty-netns-prep.sh

17 lines
406 B
Bash
Raw Permalink Normal View History

#!/bin/bash
set -ex
if [ "$CRTOOLS_SCRIPT_ACTION" == "setup-namespaces" ]; then
echo "Will up lo at $CRTOOLS_INIT_PID netns"
mkdir -p /var/run/netns
mount -t tmpfs xxx /var/run/netns
touch /var/run/netns/emptyns
mount --bind /proc/$CRTOOLS_INIT_PID/ns/net /var/run/netns/emptyns
ip netns exec emptyns ip link set up dev lo || exit 1
ip netns exec emptyns ip a
umount -l /var/run/netns
fi
exit 0