Closed VVelox closed 3 years ago
Hmm... seems to be parsing it improperly and into three keys, intering along the spaces to the left.
[root@nibbles1]0|/storage/cbsd>rg ssh-ed25519 vm/foo/rc.conf_foo
32:ci_user_pubkey="ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOhVHrUkDDwsgSWGwm3f8rReFZ8m7awoVnM8McFMTVU4 kitsune@vixen42.vulpes.vvelox.net"
33:ci_user_pubkey="ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOhVHrUkDDwsgSWGwm3f8rReFZ8m7awoVnM8McFMTVU4"
34:ci_user_pubkey="ssh-ed25519"
[root@nibbles1]0|/storage/cbsd>
@VVelox can you check https://github.com/cbsd/cbsd/commit/1a6ff07bad1c99ae4f7fade2ef43d91fe232acbe (as work-around) ?
in subr/nc.subr:
-- [ ${_tofile} -eq 1 ] && printf "${ARG}=\"${VAL}\"\n" >> ${CBSD_INIT_SAVE2FILE}
++ [ ${_tofile} -eq 1 ] && ${SYSRC_CMD} -qf ${CBSD_INIT_SAVE2FILE} ${ARG}="${VAL}" > /dev/null 2>&1
the init() in CBSD is very difficult for shell due to the /bin/sh restriction. For a long time I wanted to rewrite this piece in C, but still not ;)
Looks good!
And well if you don't mind Perl, that is a hell of a lot cleaner than shell and very robust. If there are any tasks that can be broken out in that area, I would be happy to help.
In most cases, the shell is a suitable tool for CBSD, because there are not very many libraries for components ( libzfs, libjail appeared after the cbsd ), but 'ifconfig', carp, hast, ipfw, pf, pkg - tons of external tools do not have necessary bindings.
So in any language most of the CBSD-like projects will look like: 'system("extcmd"), popen("extcmd", exec*("extcmd").'
I believe that at the moment the CBSD is at the end of its development and the project is nearing completion (this is not about the termination of support), so at the moment there are no plans to rewrite it in another language. Further development should go with higher-level abstractions ( DRS (host recomendation), controllers, monitoring, service-discovery, networking and other) - from my point of view, this is a further development of the project and they will require other programming languages. CBSD should remain as a framework for low-level operations only (e.g. attach disk/nic, restart jail ..).
I will be optimizing for bottlenecks soon ( init() function is one of them), but these will be spot improvements.
I will close PR if the problem is solved. Refactoring of init() in long-term/todo.
Mandatory info for bug reports:
FreeBSD version ( uname -a ): FreeBSD nibbles1.vvelox.net 12.2-STABLE FreeBSD 12.2-STABLE stable/12-n232902-2225c9780af vixen42 amd64
CBSD version ( cbsd version ): 13.0.15