forked from solita/docker-systemd
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup
More file actions
executable file
·17 lines (15 loc) · 739 Bytes
/
setup
File metadata and controls
executable file
·17 lines (15 loc) · 739 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/bin/sh
set -eu
if nsenter --mount=/host/proc/1/ns/mnt -- mount | grep /sys/fs/cgroup/systemd >/dev/null 2>&1; then
echo 'The systemd cgroup hierarchy is already mounted at /sys/fs/cgroup/systemd.'
else
if [ -d /host/sys/fs/cgroup/systemd ]; then
echo 'The mount point for the systemd cgroup hierarchy already exists at /sys/fs/cgroup/systemd.'
else
echo 'Creating the mount point for the systemd cgroup hierarchy at /sys/fs/cgroup/systemd.'
mkdir -p /host/sys/fs/cgroup/systemd
fi
echo 'Mounting the systemd cgroup hierarchy.'
nsenter --mount=/host/proc/1/ns/mnt -- mount -t cgroup cgroup -o none,name=systemd /sys/fs/cgroup/systemd
fi
echo 'Your Docker host is now configured for running systemd containers!'