Update for s6 v3 and add apparmor (#41)

* Update for s6 v3 and add apparmor

* Adjust from feedback

* Tweak service functionality instructions

* Logging in finish script

* Remove etc/s6 as not used anymore

* Update example/rootfs/etc/services.d/example/finish

Co-authored-by: Franck Nijhof <frenck@frenck.nl>

Co-authored-by: Pascal Vizeli <pvizeli@syshack.ch>
Co-authored-by: Franck Nijhof <frenck@frenck.nl>
This commit is contained in:
Mike Degatano
2022-05-13 06:03:05 -04:00
committed by GitHub
parent 9bce8fa493
commit c2d080e2b2
8 changed files with 85 additions and 11 deletions

11
example/rootfs/etc/services.d/example/finish Normal file → Executable file
View File

@@ -1,9 +1,12 @@
#!/usr/bin/execlineb -S1
#!/usr/bin/env bashio
# ==============================================================================
# Take down the S6 supervision tree when example fails
# s6-overlay docs: https://github.com/just-containers/s6-overlay
# ==============================================================================
if { s6-test ${1} -ne 0 }
if { s6-test ${1} -ne 256 }
s6-svscanctl -t /var/run/s6/services
if [[ "$1" -ne 0 ]] && [[ "$1" -ne 256 ]]; then
bashio::log.warning "Halt add-on"
/run/s6/basedir/bin/halt
fi
bashio::log.info "Service restart after closing"

2
example/rootfs/etc/services.d/example/run Normal file → Executable file
View File

@@ -16,4 +16,4 @@ message=$(bashio::config 'message')
bashio::log.info "${message:="Hello World..."}"
## Run your program
# exec my_program --with-params
exec /usr/bin/my_program

View File

@@ -0,0 +1,3 @@
#!/bin/bash
echo "All done!" > /share/example_addon_output.txt