Commit 1b29e33c authored by Martin Peres's avatar Martin Peres
Browse files

initscript: allow overriding the shutdown command

The default is for the machine to shut down.
parent 30e083d8
......@@ -65,6 +65,8 @@ Here is a list of options:
following values:
* none (default): Do not set the time at boot
* auto: Use `pool.ntp.org` as a peer
* **b2c.shutdown_cmd**: Once the execution of all the containers is over,
Please register or sign in to reply
execute this command. Default: `poweroff -f`
## How to?
......@@ -197,4 +199,3 @@ in your `.config`:
* Remove the dependency in bbin (will save a couple of MB)
* Add a swap file
* Remove old images after executing the containers
* Turn the machine off by default after running the containers
......@@ -50,6 +50,7 @@ ARG_CONTAINER=""
ARG_POST_CONTAINER=""
ARG_CACHE_DEVICE="none"
ARG_NTP_PEER="none"
ARG_SHUTDOWN_CMD="poweroff -f"
function parse_cmdline {
cmdline=$(busybox cat /proc/cmdline)
......@@ -79,6 +80,9 @@ function parse_cmdline {
b2c.ntp_peer=*)
ARG_NTP_PEER=$value
;;
b2c.shutdown_cmd=*)
ARG_SHUTDOWN_CMD="$value"
;;
esac
done
IFS=$OLDIFS
......@@ -361,6 +365,6 @@ setup_container_runtime
start_containers "$ARG_CONTAINER"
start_post_containers "$ARG_POST_CONTAINER"
# Emergency shell
log "Done executing the containers, dropping to an emergency shell"
exec /bin/busybox sh
# Shutdown command
sync
$ARG_SHUTDOWN_CMD
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment