Alpine S6: Executables

Various helper executables for interacting with S6 and the container environment.

Output

bf-svc-finish

Outputs service closing down debug message and optionally terminates all running services. Usually used in /etc/services.d/xxx/finish file to show

Arguments

  • -s X outputs a message that service "X" is shutting down

  • -t terminates all other services as well

Usage

$ bf-svc-finish -s cron
[bf] 2021-09-23 10:21:52 | cron/finish: Service closing down.

$ bf-svc-finish -s cron -t
[bf] 2021-09-19 18:00:00 | cron/finish: Service closing down.
[bf] 2021-09-19 18:00:00 | bf-env: BF_TERMINATING=1.
[bf] 2021-09-19 18:00:00 | bf-svc-terminate: Terminating all services.
[bf] 2021-09-19 18:00:00 | cron-log/finish: Service closing down.
[cont-finish.d] executing container finish scripts...
[cont-finish.d] 00-clear: executing...
[bf] 2021-09-19 18:00:00 | 00-clear: Clearing /tmp... (bf-clear)
[bf] 2021-09-19 18:00:00 | 00-clear: done. (bf-clear)
[bf] 2021-09-19 18:00:00 | 00-clear: Clearing caches... (bf-clear)
[bf] 2021-09-19 18:00:00 | 00-clear: done. (bf-clear)
[cont-finish.d] 00-clear: exited 0.
[cont-finish.d] done.
[s6-finish] waiting for services.
[s6-finish] sending all processes the TERM signal.
[s6-finish] sending all processes the KILL signal and exiting.

Helpers

bf-clear-src

Clears contents of /etc/bf/src.

Usage

bf-cron

Run all scripts within a cron directory.

Arguments

  • -h Show usage

  • -q Run quietly (otherwise it will output that the cron is being run to the logs - individual scripts may still send output)

  • DIRECTORY - the directory within /etc/periodic to run

Usage

bf-env

Adds a container environment variable called $1 with value $2.

Arguments

  1. Variable name

  2. Variable value

Usage

bf-fix-attrs

Re-applies attributes and permissions defined in /etc/fix-attrs.d. Based on code from S6 Overlay.

Usage

bf-forward

Forwards errors logged in $2 to Docker logs; if $2 is not set, disables service $1.

Arguments

  1. Service name.

  2. Absolute path to log file.

Usage

bf-svc

Uses S6 to control the service named $2.

Arguments

  1. Control action: 'disable', 'restart', 'start', 'stop'

  2. Service name

Usage

bf-svc-terminate

Terminates all running services - usually used in /etc/services.d/xxx/finish file - which also closes down (and potentially restarts) the whole container.

Usage

Last updated