Created
September 19, 2021 17:44
-
-
Save Daniel-Abrecht/806c4c6049381bdf8c8bf69dcc8b6af8 to your computer and use it in GitHub Desktop.
Anboxinit scripts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# /etc/init.d/anbox-container-manager | |
### BEGIN INIT INFO | |
# Provides: anbox-container-manager | |
# Required-Start: dbus $network $local_fs $remote_fs | |
# Required-Stop: $local_fs $remote_fs | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: Start daemon at boot time | |
# Description: init script for anbox container manager. | |
### END INIT INFO | |
[ -n "$1" ] | |
PIDFILE=/run/anbox-container-manager.pid | |
do_start(){ | |
echo "Starting anbox container-manager..." | |
set -e | |
/sbin/modprobe ashmem_linux | |
/sbin/modprobe binder_linux | |
/usr/share/anbox/anbox-bridge.sh start | |
set +e | |
start-stop-daemon -C --start --oknodo --make-pidfile --pidfile "$PIDFILE" --background --exec /usr/bin/anbox -- container-manager --daemon --privileged --data-path=/var/lib/anbox 2>&1 | ( ( logger -t anbox-container-manager 0<&9 & ) 9<&0; ) | |
sleep 1 | |
do_status | |
} | |
do_stop(){ | |
echo "Stopping anbox container-manager..." | |
start-stop-daemon --stop --oknodo --remove-pidfile --pidfile "$PIDFILE" | |
/usr/share/anbox/anbox-bridge.sh stop | |
echo "Anbox container-manager stopped" | |
} | |
do_status(){ | |
start-stop-daemon --status --oknodo --pidfile "$PIDFILE" | |
status=$? | |
if [ $status = 0 ] | |
then echo "Anbox container-manager is running" | |
else echo "Anbox container-manager is not running" | |
fi | |
return $status | |
} | |
"do_$1" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Desktop Entry] | |
# /etc/xdg/autostart/anbox-session-manager.desktop | |
Name=Anbox Session Manager | |
Exec=anbox session-manager | |
Icon=anbox | |
Type=Application | |
NoDisplay=true | |
X-GNOME-AutoRestart=true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# (run this once) | |
sudo update-rc.d anbox-container-manager defaults | |
sudo update-rc.d anbox-container-manager enable | |
sudo service anbox-container-manager start |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment