mirror of
https://gitlab.alpinelinux.org/alpine/aports.git
synced 2025-07-24 19:55:26 +03:00
38 lines
691 B
Bash
38 lines
691 B
Bash
#!/sbin/openrc-run
|
|
|
|
command="/usr/sbin/lxd"
|
|
command_args="${LXD_OPTIONS}"
|
|
command_background="true"
|
|
pidfile="/run/${RC_SVCNAME}.pid"
|
|
retry="${LXD_TIMEOUT:-60}"
|
|
|
|
depend() {
|
|
need net cgroups dbus
|
|
use lxcfs
|
|
after firewall
|
|
}
|
|
|
|
systemd_ctr() {
|
|
local cmd="$1"
|
|
# Required for running systemd containers
|
|
local cgroup=/sys/fs/cgroup/systemd
|
|
local mnt_opts='rw,nosuid,nodev,noexec,relatime,none,name=systemd'
|
|
|
|
case "$cmd" in
|
|
mount)
|
|
checkpath -d $cgroup
|
|
if ! mount | grep $cgroup >/dev/null; then
|
|
mount -t cgroup -o $mnt_opts cgroup $cgroup
|
|
fi
|
|
;;
|
|
unmount)
|
|
if mount | grep $cgroup >/dev/null; then
|
|
umount $cgroup
|
|
fi
|
|
;;
|
|
esac
|
|
}
|
|
|
|
start_pre() {
|
|
systemd_ctr mount
|
|
}
|