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:
11
example/rootfs/etc/services.d/example/finish
Normal file → Executable file
11
example/rootfs/etc/services.d/example/finish
Normal file → Executable 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
2
example/rootfs/etc/services.d/example/run
Normal file → Executable 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
|
||||
|
||||
3
example/rootfs/usr/bin/my_program
Executable file
3
example/rootfs/usr/bin/my_program
Executable file
@@ -0,0 +1,3 @@
|
||||
#!/bin/bash
|
||||
|
||||
echo "All done!" > /share/example_addon_output.txt
|
||||
Reference in New Issue
Block a user