1
0
Fork 0
mirror of https://gitlab.alpinelinux.org/alpine/aports.git synced 2025-07-23 03:05:48 +03:00
aports/testing/anbox/anbox-container-manager.initd
Antoine Fontaine 99308c8d8a testing/anbox: upgrade to 20200408, drop lxc dependency and fix init script
drop lxc dependency, as apk detects the lxc-libs dep and the init
script creates the required directory itself.

fix the init script: when the container manager failed, the openRC
service wasn't able to start. It could not be started again because
anbox-bridge.sh errored out: it was unable to create an already
existing interface.
2020-04-13 15:40:34 +00:00

38 lines
847 B
Text

#!/sbin/openrc-run
supervisor=supervise-daemon
name="Anbox container manager"
command=/usr/bin/anbox
command_args="container-manager --daemon --privileged --data-path=/var/lib/anbox --android-image=/usr/share/anbox/android.img"
depend() {
need localmount sysfs cgroups fuse
use net
after firewall
}
start_pre() {
# that's all you need to avoid the lxc dependency
checkpath --directory /usr/lib/lxc
checkpath --directory /usr/lib/lxc/rootfs
modprobe loop
modprobe tun
if ip link show anbox0 >/dev/null 2>&1; then
ewarn "anbox0 network interface already exists"
else
ebegin "Creating anbox0 network interface"
/usr/share/anbox/anbox-bridge.sh start
eend $?
fi
}
stop_post() {
if ip link show anbox0 >/dev/null 2>&1; then
ebegin "Removing anbox0 network interface"
/usr/share/anbox/anbox-bridge.sh stop
eend $?
fi
}