diff --git a/apps/core0/bootstrap/bootstrap.go b/apps/core0/bootstrap/bootstrap.go index 055099a9..44ee976a 100644 --- a/apps/core0/bootstrap/bootstrap.go +++ b/apps/core0/bootstrap/bootstrap.go @@ -209,7 +209,7 @@ func (b *Bootstrap) setupNetworking() error { <-time.After(3 * time.Second) } - log.Warning("can not reach interent, continue booting anyway") + log.Warning("can not reach internet, continue booting anyway") return nil } diff --git a/apps/core0/conf/getty.toml b/apps/core0/conf/getty.toml new file mode 100644 index 00000000..246e8ea7 --- /dev/null +++ b/apps/core0/conf/getty.toml @@ -0,0 +1,22 @@ +# NOTICE: +# This file will give any user with physical access to the node +# full access to the system, include in the image on your own risk +# +# busybox setsid getty -I -n -l /sbin/login.sh 0 /dev/tty3 + +[startup.getty] +name = 'core.system' +after = ['init'] +condition = 'development' +# the job is not marked as protected, instead we respawn the shell +# from the direct-login.sh script, because busybox setsid doesn't +# support the -w flag (wait for process to exit), it means with protected=true +# the system will keep spawning gettys infinitely. + +[startup.getty.args] +name = "busybox" +args = [ + 'setsid', + 'getty', '-l', '/usr/bin/direct-login.sh', + '0', '/dev/tty3' +] \ No newline at end of file diff --git a/apps/core0/conf/zerotier.toml b/apps/core0/conf/zerotier.toml index 5be55118..6fbdc9e2 100644 --- a/apps/core0/conf/zerotier.toml +++ b/apps/core0/conf/zerotier.toml @@ -4,11 +4,10 @@ [startup."zerotier-init"] name = "bash" running_delay = -1 -after = ["init"] [startup."zerotier-init".args] "not(ztid)|script" = """ -ztid -out /tmp/zt +ztid -debug -out /tmp/zt """ "ztid|script" = """ @@ -21,7 +20,7 @@ chmod 0400 /tmp/zt/identity.secret [startup.zerotier] name = "core.system" -after = ["net", "zerotier-init"] +after = ["zerotier-init"] protected = true [startup.zerotier.args] diff --git a/tools/direct-login.sh b/tools/direct-login.sh new file mode 100755 index 00000000..7b2525cc --- /dev/null +++ b/tools/direct-login.sh @@ -0,0 +1,7 @@ +#!/bin/sh + +# this script relates to the core0/conf/getty.toml file +while true; do + /bin/sh + echo "respawing shell" +done