jails CBSD unable to determine the first IP

( during reboot, boot messages show a "CBSD unable to determine the first IP address. Should this be the static private IP of my re0 interface? Thank you. )

I am having trouble dealing with a kwin crash, tried to update kde plasma, portmaster returned several errors, then updated by the pkg upgrade command for kde. Kwin still crashed on start up, then I found a forum thread to check pkg info for updated packages, issued a summary command to list all post installation pkg info suggestion and am going through the process. One suggestion related to replacing cert.pem with empty files, another related to installing scripts for CBSD by a Q&A process, which I am answering without understanding what these choices mean. Please take a look at the following and kindly tell me if there is something that I have done that I ought not to have.

Thank you.

Code:
# mv /usr/local/openssl/cert.pem /usr/local/openssl/certpermreplacedsep082022withanemptyfile.txt
# mv /usr/local/etc/ssl/cert.pem /usr/local/etc/ssl/certpermreplacedsep082022withanemptyfile.txt
# touch /usr/local/etc/ssl/cert.pem
# touch /usr/local/openssl/cert.pem
# env workdir="/path" /usr/local/cbsd/sudoexec/initenv
-------[CBSD v.13.1.3]-------
 This is install/upgrade scripts for CBSD.
 Don't forget to backup.
-----------------------------
Do you want prepare or upgrade hier environment for CBSD now?
[yes(1) or no(0)]
y
>>> Installing or upgrading
[Stage 1: account & dir hier]
 * Check hier and permission...
 * write directory id: jaildatadir
 * write directory id: jailsysdir
 * write directory id: jailrcconfdir
 * write directory id: dbdir
[Stage 2: build tools]
Shall I add the cbsd user into /usr/local/etc/sudoers.d/cbsd_sudoers sudo file to obtain root privileges for most of the cbsd commands?
[yes(1) or no(0)]
y
[Stage 3: local settings]
Shall i modify the /etc/rc.conf to sets cbsd_workdir="/path"?:
[yes(1) or no(0)]
y
/etc/rc.conf: cbsd_workdir:  -> /path
[Stage 4: update default skel resolv.conf]
[Stage 5: refreshing inventory]
nodename: CBSD Nodename for this host e.g. the hostname. Warning: this operation will recreate the ssh keys in /path/.ssh dir: subdomain.domain.TLD

Empty inventory database created: /path/var/db/inv.subdomain.domain.TLD.sqlite
nodeip: Node management IPv4 address (used for node interconnection), e.g: 0

jnameserver: environment default DNS name-server (for jails resolv.conf), e.g.: 9.9.9.9,149.112.112.112,2620:fe::fe,2620:fe::9

nodeippool:  (networks for jails)
Hint: use space as delimiter for multiple networks, e.g.: 10.0.0.0/16

nat_enable: Enable NAT for RFC1918 networks?
[yes(1) or no(0)]
y
Which NAT framework do you want to use: [pf]
(type FW name, eg pf,ipfw,ipfilter, 'disable' or '0' to CBSD NAT, "exit" for break)
ipfw
Set IP address or NIC as the aliasing NAT address or interface, e.g: 0
0
Unable to determine first IP for nic: 0                                                                                                                 
fbsdrepo: Use official FreeBSD repository? When no (0) the repository of CBSD is preferred (useful for stable=1) for fetching base/kernel?              
[yes(1) or no(0)]                                                                                                                                       
1                                                                                                                                                       
zfsfeat: You are running on a ZFS-based system. Enable ZFS feature?                                                                                     
[yes(1) or no(0)]                                                                                                                                       
1                                                                                                                                                       
parallel: Parallel mode stop/start ?                                                                                                                    
(0 - no parallel or positive value (in seconds) as timeout for next parallel sequence) e.g: 5                                                           
5                                                                                                                                                       
stable: Use STABLE branch instead of RELEASE by default? Attention: only the CBSD repository has a binary base for STABLE branch ?                      
(STABLE_X instead of RELEASE_X_Y branch for base/kernel will be used), e.g.: 0 (use release)                                                            
y                                                                                                                                                       
sqlreplica: Enable sqlite3 replication to remote nodes ?                                                                                                
(0 - no replica, 1 - try to replicate all local events to remote nodes) e.g: 1                                                                          
0                                                                                                                                                       
statsd_bhyve_enable: Configure CBSD statsd services for collect RACCT bhyve statistics? ?                                                               
(EXPERIMENTAL FEATURE)? e.g: 0
0
statsd_jail_enable: Configure CBSD statsd services for collect RACCT jail statistics? ?
(EXPERIMENTAL FEATURE)? e.g: 0
0
statsd_hoster_enable: Configure CBSD statsd services for collect RACCT hoster statistics? ?
(EXPERIMENTAL FEATURE)? e.g: 0
0
[Stage 6: authentication keys]
Generating public/private ed25519 key pair.
Your identification has been saved in /path/.ssh/7a2ac461dacb8c3bffa35cfc95d0cebe.id_rsa
Your public key has been saved in /path/.ssh/7a2ac461dacb8c3bffa35cfc95d0cebe.id_rsa.pub
The key fingerprint is:
SHA256:OUwVEEMusbc+Wb3jBwfKlQT6cKq8FV8iVCIb7w3jAt4 [EMAIL='root@bsd.turiya.company']root@[/EMAIL]subdomain.domain.TLD
The key's randomart image is:
+--[ED25519 256]--+
|
 
....  #clipped randomart

|      .     ..   |
+----[SHA256]-----+
[Stage 7: nodes]
[Stage 8: modules]
Installing module pkg.d cmd: pkg
Installing module bsdconf.d cmd: tzsetup
Installing module bsdconf.d cmd: ssh
Installing module bsdconf.d cmd: ftp
Installing module bsdconf.d cmd: adduser
Installing module bsdconf.d cmd: passwd
Installing module bsdconf.d cmd: service
Installing module bsdconf.d cmd: sysrc
Installing module bsdconf.d cmd: userlist
Installing module bsdconf.d cmd: grouplist
Installing module bsdconf.d cmd: adduser-tui
Installing module bsdconf.d cmd: pw
Installing module bsdconf.d cmd: cloudinit
Installing module zfsinstall.d cmd: zfsinstall
[Stage 9: cleanup]
 * Remove obsolete files...
Configure RSYNC services for jail migration?
[yes(1) or no(0)]
1
Shall I modify /etc/rc.conf to set cbsdrsyncd_enable="YES"
[yes(1) or no(0)]
1
/etc/rc.conf: cbsdrsyncd_enable:  -> YES
Do you want to modify /etc/rc.conf to set the cbsdrsyncd_flags="--config=/path/etc/rsyncd.conf" ?
[yes(1) or no(0)]
1
/etc/rc.conf: cbsdrsyncd_flags:  -> --config=/path/etc/rsyncd.conf
/usr/local/etc/rc.d/cbsdrsyncd: required_files:  ->
Starting cbsdrsyncd.
Do you want to enable RACCT feature for resource accounting?
[yes(1) or no(0)]
1
Shall i modify the /etc/rc.conf to sets cbsdd_enable=YES ?
[yes(1) or no(0)]
1
/etc/rc.conf: cbsdd_enable:  -> YES
Shall i modify the /etc/rc.conf to sets rcshutdown_timeout="900"?
[yes(1) or no(0)]
1
/etc/rc.conf: rcshutdown_timeout: 90 -> 900
Shall i modify the /etc/sysctl.conf to sets kern.init_shutdown_timeout="900"?
[yes(1) or no(0)]
1
kern.init_shutdown_timeout: 120 -> 900
[Stage X: upgrading]
>>> Done
  Congratulations! First CBSD initialization complete!

  Now your can run:
  service cbsdd start
  to run CBSD services.                                                                                                                                 

  For change initenv settings in next time, use:
  cbsd initenv-tui
                                                                                                                                                        
  Also don't forget to execute:                                                                                                                         
  cbsd initenv
  every time when you upgrade CBSD version.                                                                                                             

  For an easy start:
  cbsd help

  General information:
  cbsd summary

  To start with jail:
  cbsd jcreate --help
  or: cbsd jconstruct-tui

  To start with bhyve:
  cbsd bcreate --help
  or: cbsd bconstruct-tui

  To start with XEN:
  cbsd xcreate --help
  or: cbsd xconstruct-tui

  To start with QEMU/NVMM:
  cbsd qcreate --help
  or: cbsd qconstruct-tui

  Enjoy CBSD!
[/QUOTE]
I didn't replace "path" in the above command, did that again after specifying path:


[QUOTE]
preseedinit: Would you like a config for "cbsd init" preseed to be printed?
[yes(1) or no(0)]
1

---cut here ---
# cbsd initenv preseed file for subdomain.domain.TLD host
# refer to the /usr/local/cbsd/share/initenv.conf
# for description.
#
nodeip="0"
jnameserver="9.9.9.9,149.112.112.112,2620:fe::fe,2620:fe::9"
nodeippool="10.0.0.0/16"
nat_enable="0"
fbsdrepo="1"
zfsfeat="1"
parallel="5"
stable="y"
sqlreplica="0"
statsd_bhyve_enable="0"
statsd_jail_enable="0"
statsd_hoster_enable="0"
ipfw_enable="1"
nodename="bsd.turiya.company"
racct="1"
natip=""
initenv_modify_sudoers="0"
initenv_modify_rcconf_hostname=""
initenv_modify_rcconf_cbsd_workdir="1"
initenv_modify_rcconf_cbsd_enable="1"
initenv_modify_rcconf_rcshutdown_timeout="1"
initenv_modify_syctl_rcshutdown_timeout="1"
initenv_modify_rcconf_cbsdrsyncd_enable="1"
initenv_modify_rcconf_cbsdrsyncd_flags="1"
initenv_modify_cbsd_homedir="1"
workdir="/path"
---end of cut---

# whereis cbsd
cbsd: /usr/local/bin/cbsd /usr/local/man/man8/cbsd.8.gz /usr/ports/sysutils/cbsd
# env workdir=/usr/local/bin/cbsd /usr/local/cbsd/sudoexec/initenv
-------[CBSD v.13.1.3]-------
 This is install/upgrade scripts for CBSD.
 Don't forget to backup.
-----------------------------
Do you want prepare or upgrade hier environment for CBSD now?
[yes(1) or no(0)]
1
>>> Installing or upgrading
[Stage 0: upgrading and migration data from 13.1.3 to 13.1.3]
  * Update jails tables: add tags
  * Update jails table: gid
  * Update jails tables: add zfs_encryption
  * Update jails tables: add boot_delay
  * Update jails tables: add ci_gw4
  * Update jails table: alter table for state_time
[Stage 1: account & dir hier]
 * Check hier and permission...
    cmdboot: no such optional executable: xl, xen_feat disabled
 * write directory id: jaildatadir
/usr/local/cbsd/sudoexec/initenv: cannot create /usr/local/bin/cbsd/jails-data/dir.id: Not a directory
 * write directory id: jailsysdir
/usr/local/cbsd/sudoexec/initenv: cannot create /usr/local/bin/cbsd/jails-system/dir.id: Not a directory
 * write directory id: jailrcconfdir
/usr/local/cbsd/sudoexec/initenv: cannot create /usr/local/bin/cbsd/jails-rcconf/dir.id: Not a directory
 * write directory id: dbdir
/usr/local/cbsd/sudoexec/initenv: cannot create /usr/local/bin/cbsd/var/db/dir.id: Not a directory
[Stage 2: build tools]
/usr/local/cbsd/sudoexec/initenv: cannot create /usr/local/bin/cbsd/etc/cbsd_sudoers: Not a directory
install: /usr/local/bin/cbsd/share/DragonFly-git_branches.conf: Not a directory
install: /usr/local/bin/cbsd/share/FreeBSD-git_branches.conf: Not a directory
install: /usr/local/bin/cbsd/share/HardenedBSD-git_branches.conf: Not a directory
install: /usr/local/bin/cbsd/etc/Makefile: Not a directory
install: /usr/local/bin/cbsd/.ssh/config: Not a directory
mkdir: /usr/local/bin/cbsd: Not a directory
mkdir: /usr/local/bin/cbsd: Not a directory
mkdir: /usr/local/bin/cbsd: Not a directory
mkdir: /usr/local/bin/cbsd: Not a directory
cp: /usr/local/bin/cbsd/share: Not a directory
cp: /usr/local/bin/cbsd/share: Not a directory
cp: /usr/local/bin/cbsd/share: Not a directory
cp: /usr/local/bin/cbsd/share: Not a directory
mkdir: /usr/local/bin/cbsd: Not a directory
cp: /usr/local/bin/cbsd/share/emulators: Not a directory
[Stage 3: local settings]
[Stage 4: update default skel resolv.conf]
[Stage 5: refreshing inventory]
[Stage 6: authentication keys]
[Stage 7: nodes]
[Stage 8: modules]
[Stage 9: cleanup]
 * Remove obsolete files...
[Stage X: upgrading]
>>> Done
rm: /usr/local/bin/cbsd/tmp/initenv-log.84884: Not a director
 
Not very convenient when several unrelated problems are collected in one message ;-)

Regarding CBSD:
1)
nodeip: Node management IPv4 address (used for node interconnection), e.g: 0

Any static address of your node is expected here. Most likely the 'unable to determine the first IP address' message is related to this field. It can be changed via `cbsd initenv-tui` after first install/init.

2)
env workdir=/usr/local/bin/cbsd /usr/local/cbsd/sudoexec/initenv

Why you initialize a second time with another workdir ? `workdir` on first initialization must point to a non-existent object (or an empty directory). This is where the CBSD will create a working hierarchy. Therefore, the working directory cannot be /usr/local/bin/cbsd (this is the path to the executable ). Try deinstall and re-initializing CBSD again:

Rich (BB code):
rm -rf /usr/local/bin/cbsd
pkg remove -f cbsd
rm -rf /usr/local/cbsd
pkg install -y cbsd

Code:
env workdir=/usr/jails /usr/local/cbsd/sudoexec/initenv
Or like you did in the beginning, init to /path:
Code:
env workdir="/path" /usr/local/cbsd/sudoexec/initenv
 
Thank you :) Will do all this now.

(And, apologies for having made it look like I was addressing multiple issues here. I was providing the context, I will raise the plasma kwin issue seperately.)

Thank you.
 
Back
Top