diff --git a/CHANGELOG.md b/CHANGELOG.md index 052e5b8..b1f5e47 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,15 @@ # CHANGELOG +## UNRELEASED - Tiny Cloud v3.0.x + +* Replace non-functioning `tiny-cloud --setup` with working `--enable` and + `--disable` to enable/disable the set of Tiny Cloud init scripts. + +## 2023-06-12 - Tiny Cloud v3.0.1 + +* Adds support for additional `ssh-authorized-keys` via userdata for + experimental Alpine auto installer. + ## 2023-05-31 - Tiny Cloud v3.0.0 ### INIT SCRIPTS / PHASES diff --git a/README.md b/README.md index b33a245..346db69 100644 --- a/README.md +++ b/README.md @@ -80,9 +80,9 @@ dependencies for Tiny Cloud to support _``_. Alternately, you can download a release tarball, and use `make` to install it. -Next, set up the RC scripts... +Next, enable the RC scripts... ``` -tiny-cloud --setup +tiny-cloud --enable ``` That's it! On the next boot, Tiny Cloud will bootstrap the instance. diff --git a/lib/tiny-cloud/common b/lib/tiny-cloud/common index 1572d68..c8ebd8d 100644 --- a/lib/tiny-cloud/common +++ b/lib/tiny-cloud/common @@ -27,7 +27,7 @@ log() { shift [ -n "$init" ] && echo "$@" >&2 - logger $stderr -p "$facility.$level" -t "${tag}[$$]" "$@" + logger $stderr -p "$facility.$level" -t "${tag}[$$]" -- "$@" case "$level" in crit|alert|emerg) exit 1 ;; esac diff --git a/sbin/tiny-cloud b/sbin/tiny-cloud index 0de052b..61107ff 100755 --- a/sbin/tiny-cloud +++ b/sbin/tiny-cloud @@ -10,7 +10,7 @@ set -e usage() { cat <<-EOF - Usage: ${0##*/} [-h | --help] { boot | early | main | final | --bootstrap {complete|incomplete|status} | --setup } + Usage: ${0##*/} [-h | --help] { boot | early | main | final | --bootstrap {complete|incomplete|status} | --enable | --disable } EOF } @@ -24,7 +24,7 @@ is_bootstrap_complete() { [ -f "$TINY_CLOUD_VAR/.bootstrap-complete" ] } -args=$(getopt -o hsb: --long help,setup,bootstrap: -n ${0##*/} -- "$@") || { usage >&2; exit 1; } +args=$(getopt -o hEDb: --long help,enable,disable,bootstrap: -n ${0##*/} -- "$@") || { usage >&2; exit 1; } if [ $# -eq 0 ]; then usage >&2 exit 1 @@ -45,17 +45,19 @@ while true; do *) usage >&2; exit 1;; esac exit 0;; - -s|--setup) # just openrc for now - # for installing in mounted volumes - : "${ROOT:=}" - # start with a clean slate - log -i info "- tiny-cloud* services removed from all runlevels" + -[ED]|--enable|disable) # just openrc for now + : "${ROOT:=}" # for mounted volumes + # always start with a clean slate rm -f "$ROOT"/etc/runlevels/*/tiny-cloud* - log -i info "+ tiny-cloud-boot service added to boot runlevel" + log -i info "- tiny-cloud* services removed from all runlevels" + if [ "$1" = '-D' ] || [ "$1" = '--disable' ]; then + exit 0 + fi ln -s /etc/init.d/tiny-cloud-boot "$ROOT"/etc/runlevels/boot + log -i info "+ tiny-cloud-boot service added to boot runlevel" for p in early main final; do - log -i info "+ tiny-cloud-$p service added to default runlevel" ln -s "/etc/init.d/tiny-cloud-$p" "$ROOT"/etc/runlevels/default + log -i info "+ tiny-cloud-$p service added to default runlevel" done exit 0;; --) shift; break;;