Skip to content

BusyBox setsid command does not recognize --waitΒ #561

@waynevanson

Description

@waynevanson

Prerequisites

  • I have updated to the latest version using nix run --refresh github:nix-community/nixos-anywhere
  • I have reproduced the issue with the --debug flag
  • I have searched existing issues to make sure this isn't a duplicate

Bug Description

I'm trying to get the hardware information of an Alpine Server that I host locally (downloaded the alpine binary 3 weeks ago, [email protected]) and receive errors.

Steps to Reproduce

  1. Open terminal
  2. nix shell --refresh github:nix-community/nixos-anywhere
  3. Add the three config files below.
  4. nix flake lock
  5. nixos-anywhere --flake .#generic --generate-hardware-config nixos-generate-config ./hardware-configuration.nix [email protected] --debug

Debug Logs

nixos-anywhere --flake .#generic --generate-hardware-config nixos-generate-config ./hardware-configuration.nix [email protected] --debug
+ shift
+ [[ 0 -gt 0 ]]
+ [[ '' != '' ]]
+ diskoMode=disko
+ diskoAttr=diskoScript
+ [[ y == \n ]]
+ [[ y == \y ]]
+ nixOptions+=("-L")
+ [[ y == \y ]]
+ nixCopyOptions+=("--substitute-on-destination")
+ [[ n == \n ]]
+ [[ -z [email protected] ]]
+ [[ auto == \l\o\c\a\l ]]
+ [[ -n .#generic ]]
+ [[ .#generic =~ ^(.*)#([^#"]*)$ ]]
+ flake=.
+ flakeAttr=generic
+ [[ -z generic ]]
+ [[ generic != nixosConfigurations.* ]]
+ flakeAttr='nixosConfigurations."generic".config'
+ [[ n == y ]]
+ [[ auto == \a\u\t\o ]]
+ checkBuildLocally
+ local system extraPlatforms machineSystem
++ nix --extra-experimental-features 'nix-command flakes' config show system
+ system=x86_64-linux
++ nix --extra-experimental-features 'nix-command flakes' config show extra-platforms
+ extraPlatforms='i686-linux x86_64-v1-linux x86_64-v2-linux x86_64-v3-linux x86_64-v4-linux'
+ [[ 0 -gt 0 ]]
+ [[ -n '' ]]
++ nix --extra-experimental-features 'nix-command flakes' eval --raw '.#nixosConfigurations."generic".config.pkgs.system'
++ echo unknown
+ machineSystem=unknown
+ [[ unknown == \u\n\k\n\o\w\n ]]
+ buildOn=auto
+ return
+ [[ -n . ]]
+ [[ auto == \l\o\c\a\l ]]
+ [[ -n '' ]]
++ ssh -o IdentitiesOnly=yes -i /tmp/tmp.c0oHBpBrVx/nixos-anywhere -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -G [email protected]
Warning: Identity file /tmp/tmp.c0oHBpBrVx/nixos-anywhere not accessible: No such file or directory.
+ sshSettings='host 192.168.1.103
user root
hostname 192.168.1.103
port 22
addressfamily any
batchmode no
canonicalizefallbacklocal yes
canonicalizehostname false
checkhostip no
compression no
controlmaster false
enablesshkeysign no
clearallforwardings no
exitonforwardfailure no
fingerprinthash SHA256
forwardx11 no
forwardx11trusted no
gatewayports no
hashknownhosts no
hostbasedauthentication no
identitiesonly yes
kbdinteractiveauthentication yes
nohostauthenticationforlocalhost no
passwordauthentication yes
permitlocalcommand no
proxyusefdpass no
pubkeyauthentication true
requesttty auto
sessiontype default
stdinnull no
forkafterauthentication no
streamlocalbindunlink no
stricthostkeychecking false
tcpkeepalive yes
tunnel false
verifyhostkeydns false
visualhostkey no
updatehostkeys false
enableescapecommandline no
canonicalizemaxdots 1
connectionattempts 1
forwardx11timeout 1200
numberofpasswordprompts 3
serveralivecountmax 3
serveraliveinterval 0
requiredrsasize 1024
obscurekeystroketiming yes
ciphers [email protected],aes128-ctr,aes192-ctr,aes256-ctr,[email protected],[email protected]
hostkeyalgorithms [email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],ssh-ed25519,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,[email protected],[email protected],rsa-sha2-512,rsa-sha2-256
hostbasedacceptedalgorithms [email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],ssh-ed25519,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,[email protected],[email protected],rsa-sha2-512,rsa-sha2-256
kexalgorithms sntrup761x25519-sha512,[email protected],mlkem768x25519-sha256,curve25519-sha256,[email protected],ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512,diffie-hellman-group14-sha256
casignaturealgorithms ssh-ed25519,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,[email protected],[email protected],rsa-sha2-512,rsa-sha2-256
loglevel INFO
macs [email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],hmac-sha2-256,hmac-sha2-512,hmac-sha1
securitykeyprovider internal
pubkeyacceptedalgorithms [email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],ssh-ed25519,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,[email protected],[email protected],rsa-sha2-512,rsa-sha2-256
xauthlocation /nix/store/hf7z5z3a1nz7211x6ajnsf0dfyvj50yw-xauth-1.1.3/bin/xauth
identityfile ~/.ssh/id_rsa
identityfile ~/.ssh/id_ecdsa
identityfile ~/.ssh/id_ecdsa_sk
identityfile ~/.ssh/id_ed25519
identityfile ~/.ssh/id_ed25519_sk
identityfile ~/.ssh/id_xmss
canonicaldomains none
globalknownhostsfile /etc/ssh/ssh_known_hosts
userknownhostsfile /dev/null
logverbose none
channeltimeout none
permitremoteopen any
addkeystoagent false
forwardagent no
connecttimeout none
tunneldevice any:any
canonicalizePermittedcnames none
controlpersist no
escapechar ~
ipqos af21 cs1
rekeylimit 0 0
streamlocalbindmask 0177
syslogfacility USER'
++ echo 'host 192.168.1.103
user root
hostname 192.168.1.103
port 22
addressfamily any
batchmode no
canonicalizefallbacklocal yes
canonicalizehostname false
checkhostip no
compression no
controlmaster false
enablesshkeysign no
clearallforwardings no
exitonforwardfailure no
fingerprinthash SHA256
forwardx11 no
forwardx11trusted no
gatewayports no
hashknownhosts no
hostbasedauthentication no
identitiesonly yes
kbdinteractiveauthentication yes
nohostauthenticationforlocalhost no
passwordauthentication yes
permitlocalcommand no
proxyusefdpass no
pubkeyauthentication true
requesttty auto
sessiontype default
stdinnull no
forkafterauthentication no
streamlocalbindunlink no
stricthostkeychecking false
tcpkeepalive yes
tunnel false
verifyhostkeydns false
visualhostkey no
updatehostkeys false
enableescapecommandline no
canonicalizemaxdots 1
connectionattempts 1
forwardx11timeout 1200
numberofpasswordprompts 3
serveralivecountmax 3
serveraliveinterval 0
requiredrsasize 1024
obscurekeystroketiming yes
++ awk '/^user / { print $2 }'
ciphers [email protected],aes128-ctr,aes192-ctr,aes256-ctr,[email protected],[email protected]
hostkeyalgorithms [email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],ssh-ed25519,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,[email protected],[email protected],rsa-sha2-512,rsa-sha2-256
hostbasedacceptedalgorithms [email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],ssh-ed25519,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,[email protected],[email protected],rsa-sha2-512,rsa-sha2-256
kexalgorithms sntrup761x25519-sha512,[email protected],mlkem768x25519-sha256,curve25519-sha256,[email protected],ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512,diffie-hellman-group14-sha256
casignaturealgorithms ssh-ed25519,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,[email protected],[email protected],rsa-sha2-512,rsa-sha2-256
loglevel INFO
macs [email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],hmac-sha2-256,hmac-sha2-512,hmac-sha1
securitykeyprovider internal
pubkeyacceptedalgorithms [email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],ssh-ed25519,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,[email protected],[email protected],rsa-sha2-512,rsa-sha2-256
xauthlocation /nix/store/hf7z5z3a1nz7211x6ajnsf0dfyvj50yw-xauth-1.1.3/bin/xauth
identityfile ~/.ssh/id_rsa
identityfile ~/.ssh/id_ecdsa
identityfile ~/.ssh/id_ecdsa_sk
identityfile ~/.ssh/id_ed25519
identityfile ~/.ssh/id_ed25519_sk
identityfile ~/.ssh/id_xmss
canonicaldomains none
globalknownhostsfile /etc/ssh/ssh_known_hosts
userknownhostsfile /dev/null
logverbose none
channeltimeout none
permitremoteopen any
addkeystoagent false
forwardagent no
connecttimeout none
tunneldevice any:any
canonicalizePermittedcnames none
controlpersist no
escapechar ~
ipqos af21 cs1
rekeylimit 0 0
streamlocalbindmask 0177
syslogfacility USER'
+ sshUser=root
++ echo 'host 192.168.1.103
user root
hostname 192.168.1.103
port 22
addressfamily any
batchmode no
canonicalizefallbacklocal yes
canonicalizehostname false
checkhostip no
compression no
controlmaster false
enablesshkeysign no
clearallforwardings no
exitonforwardfailure no
fingerprinthash SHA256
forwardx11 no
forwardx11trusted no
gatewayports no
hashknownhosts no
hostbasedauthentication no
identitiesonly yes
kbdinteractiveauthentication yes
nohostauthenticationforlocalhost no
passwordauthentication yes
permitlocalcommand no
proxyusefdpass no
pubkeyauthentication true
requesttty auto
sessiontype default
stdinnull no
forkafterauthentication no
streamlocalbindunlink no
stricthostkeychecking false
tcpkeepalive yes
tunnel false
verifyhostkeydns false
visualhostkey no
updatehostkeys false
enableescapecommandline no
canonicalizemaxdots 1
connectionattempts 1
forwardx11timeout 1200
numberofpasswordprompts 3
serveralivecountmax 3
serveraliveinterval 0
requiredrsasize 1024
obscurekeystroketiming yes
ciphers [email protected],aes128-ctr,aes192-ctr,aes256-ctr,[email protected],[email protected]
hostkeyalgorithms [email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],ssh-ed25519,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,[email protected],[email protected],rsa-sha2-512,rsa-sha2-256
hostbasedacceptedalgorithms [email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],ssh-ed25519,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,[email protected],[email protected],rsa-sha2-512,rsa-sha2-256
kexalgorithms sntrup761x25519-sha512,[email protected],mlkem768x25519-sha256,curve25519-sha256,[email protected],ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512,diffie-hellman-group14-sha256
casignaturealgorithms ssh-ed25519,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,[email protected],[email protected],rsa-sha2-512,rsa-sha2-256
loglevel INFO
macs [email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],hmac-sha2-256,hmac-sha2-512,hmac-sha1
securitykeyprovider internal
pubkeyacceptedalgorithms [email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],ssh-ed25519,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,[email protected],[email protected],rsa-sha2-512,rsa-sha2-256
xauthlocation /nix/store/hf7z5z3a1nz7211x6ajnsf0dfyvj50yw-xauth-1.1.3/bin/xauth
identityfile ~/.ssh/id_rsa
identityfile ~/.ssh/id_ecdsa
identityfile ~/.ssh/id_ecdsa_sk
identityfile ~/.ssh/id_ed25519
identityfile ~/.ssh/id_ed25519_sk
identityfile ~/.ssh/id_xmss
canonicaldomains none
globalknownhostsfile /etc/ssh/ssh_known_hosts
userknownhostsfile /dev/null
++ awk '/^hostname / { print $2 }'
logverbose none
channeltimeout none
permitremoteopen any
addkeystoagent false
forwardagent no
connecttimeout none
tunneldevice any:any
canonicalizePermittedcnames none
controlpersist no
escapechar ~
ipqos af21 cs1
rekeylimit 0 0
streamlocalbindmask 0177
syslogfacility USER'
+ sshHost=192.168.1.103
+ uploadSshKey
+ local sshCopyHome=/home/waynevanson
+ mkdir -p /home/waynevanson/.ssh/
+ [[ -n '' ]]
+ ssh-keygen -t ed25519 -f /tmp/tmp.c0oHBpBrVx/nixos-anywhere -P '' -C nixos-anywhere
+ step Uploading install SSH keys
+ echo '### Uploading install SSH keys ###'
### Uploading install SSH keys ###
+ [[ n == y ]]
+ HOME=/home/waynevanson
+ ssh-copy-id -o IdentitiesOnly=no -o ConnectTimeout=10 -o IdentitiesOnly=yes -i /tmp/tmp.c0oHBpBrVx/nixos-anywhere -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no [email protected]
/run/current-system/sw/bin/ssh-copy-id: INFO: Source of key(s) to be installed: "/tmp/tmp.c0oHBpBrVx/nixos-anywhere.pub"
/run/current-system/sw/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed
/run/current-system/sw/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys
Warning: Permanently added '192.168.1.103' (ED25519) to the list of known hosts.
[email protected]'s password: 

Number of key(s) added: 1

Now try logging into the machine, with: "ssh -i /tmp/tmp.c0oHBpBrVx/nixos-anywhere -o 'IdentitiesOnly=no' -o 'ConnectTimeout=10' -o 'IdentitiesOnly=yes' -o 'UserKnownHostsFile=/dev/null' -o 'StrictHostKeyChecking=no' '[email protected]'"
and check to make sure that only the key(s) you wanted were added.

+ importFacts
+ step Gathering machine facts
+ echo '### Gathering machine facts ###'
### Gathering machine facts ###
+ local facts filteredFacts
++ runSsh -o ConnectTimeout=10 enableDebug=-x sh --
++ ssh -t -o IdentitiesOnly=yes -i /tmp/tmp.c0oHBpBrVx/nixos-anywhere -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no [email protected] -o ConnectTimeout=10 enableDebug=-x sh --
Pseudo-terminal will not be allocated because stdin is not a terminal.
Warning: Permanently added '192.168.1.103' (ED25519) to the list of known hosts.
+ test -f /etc/os-release
+ grep -Eq 'ID(_LIKE)?="?nixos"?' /etc/os-release
+ echo n
+ isNixos=n
+ uname
+ uname -m
+ test -f /etc/is_kexec
+ echo n
+ '[' n '=' y ]
+ echo n
+ has systemd-detect-virt
+ command -v systemd-detect-virt
+ echo n
+ '[' n '=' y ]
+ echo none
+ has ip
+ command -v ip
+ echo y
+ '[' y '=' n ]
+ ip r g 1
+ echo n
+ has tar
+ command -v tar
+ echo y
+ has cpio
+ command -v cpio
+ echo y
+ has sudo
+ command -v sudo
+ echo n
+ has doas
+ command -v doas
+ echo y
+ has wget
+ command -v wget
+ echo y
+ has curl
+ command -v curl
+ echo n
+ has setsid
+ command -v setsid
+ echo y
+ command -v nixos-facter
+ echo n
+ cat
+ facts='isOs=Linux
isArch=x86_64
isKexec=n
isNixos=n
isInstaller=n
isContainer=none
hasIpv6Only=n
hasTar=y
hasCpio=y
hasSudo=n
hasDoas=y
hasWget=y
hasCurl=n
hasSetsid=y
hasNixOSFacter=n'
++ echo 'isOs=Linux
isArch=x86_64
isKexec=n
isNixos=n
isInstaller=n
isContainer=none
hasIpv6Only=n
hasTar=y
hasCpio=y
hasSudo=n
hasDoas=y
hasWget=y
hasCurl=n
hasSetsid=y
hasNixOSFacter=n'
++ grep -E '^(has|is)[A-Za-z0-9_]+=\S+'
+ filteredFacts='isOs=Linux
isArch=x86_64
isKexec=n
isNixos=n
isInstaller=n
isContainer=none
hasIpv6Only=n
hasTar=y
hasCpio=y
hasSudo=n
hasDoas=y
hasWget=y
hasCurl=n
hasSetsid=y
hasNixOSFacter=n'
+ [[ -z isOs=Linux
isArch=x86_64
isKexec=n
isNixos=n
isInstaller=n
isContainer=none
hasIpv6Only=n
hasTar=y
hasCpio=y
hasSudo=n
hasDoas=y
hasWget=y
hasCurl=n
hasSetsid=y
hasNixOSFacter=n ]]
++ echo 'isOs=Linux
isArch=x86_64
isKexec=n
isNixos=n
isInstaller=n
isContainer=none
hasIpv6Only=n
hasTar=y
hasCpio=y
hasSudo=n
hasDoas=y
hasWget=y
hasCurl=n
hasSetsid=y
hasNixOSFacter=n'
++ xargs
+ export isOs=Linux isArch=x86_64 isKexec=n isNixos=n isInstaller=n isContainer=none hasIpv6Only=n hasTar=y hasCpio=y hasSudo=n hasDoas=y hasWget=y hasCurl=n hasSetsid=y hasNixOSFacter=n
+ isOs=Linux
+ isArch=x86_64
+ isKexec=n
+ isNixos=n
+ isInstaller=n
+ isContainer=none
+ hasIpv6Only=n
+ hasTar=y
+ hasCpio=y
+ hasSudo=n
+ hasDoas=y
+ hasWget=y
+ hasCurl=n
+ hasSetsid=y
+ hasNixOSFacter=n
+ for var in isOs isArch isKexec isInstaller isContainer hasIpv6Only hasTar hasCpio hasSudo hasDoas hasWget hasCurl hasSetsid
+ [[ -z Linux ]]
+ for var in isOs isArch isKexec isInstaller isContainer hasIpv6Only hasTar hasCpio hasSudo hasDoas hasWget hasCurl hasSetsid
+ [[ -z x86_64 ]]
+ for var in isOs isArch isKexec isInstaller isContainer hasIpv6Only hasTar hasCpio hasSudo hasDoas hasWget hasCurl hasSetsid
+ [[ -z n ]]
+ for var in isOs isArch isKexec isInstaller isContainer hasIpv6Only hasTar hasCpio hasSudo hasDoas hasWget hasCurl hasSetsid
+ [[ -z n ]]
+ for var in isOs isArch isKexec isInstaller isContainer hasIpv6Only hasTar hasCpio hasSudo hasDoas hasWget hasCurl hasSetsid
+ [[ -z none ]]
+ for var in isOs isArch isKexec isInstaller isContainer hasIpv6Only hasTar hasCpio hasSudo hasDoas hasWget hasCurl hasSetsid
+ [[ -z n ]]
+ for var in isOs isArch isKexec isInstaller isContainer hasIpv6Only hasTar hasCpio hasSudo hasDoas hasWget hasCurl hasSetsid
+ [[ -z y ]]
+ for var in isOs isArch isKexec isInstaller isContainer hasIpv6Only hasTar hasCpio hasSudo hasDoas hasWget hasCurl hasSetsid
+ [[ -z y ]]
+ for var in isOs isArch isKexec isInstaller isContainer hasIpv6Only hasTar hasCpio hasSudo hasDoas hasWget hasCurl hasSetsid
+ [[ -z n ]]
+ for var in isOs isArch isKexec isInstaller isContainer hasIpv6Only hasTar hasCpio hasSudo hasDoas hasWget hasCurl hasSetsid
+ [[ -z y ]]
+ for var in isOs isArch isKexec isInstaller isContainer hasIpv6Only hasTar hasCpio hasSudo hasDoas hasWget hasCurl hasSetsid
+ [[ -z y ]]
+ for var in isOs isArch isKexec isInstaller isContainer hasIpv6Only hasTar hasCpio hasSudo hasDoas hasWget hasCurl hasSetsid
+ [[ -z n ]]
+ for var in isOs isArch isKexec isInstaller isContainer hasIpv6Only hasTar hasCpio hasSudo hasDoas hasWget hasCurl hasSetsid
+ [[ -z y ]]
+ [[ y == \n ]]
+ [[ y == \n ]]
+ [[ y == \n ]]
+ maybeSudo=
+ [[ n == \y ]]
+ [[ y == \y ]]
+ maybeSudo=doas
+ [[ Linux != \L\i\n\u\x ]]
+ [[ 1 == 1 ]]
+ runKexec
+ [[ n == \y ]]
+ [[ n == \y ]]
+ [[ none != \n\o\n\e ]]
+ [[ '' == '' ]]
+ case "${isArch}" in
+ kexecUrl=https://github.com/nix-community/nixos-images/releases/download/nixos-25.05/nixos-kexec-installer-noninteractive-x86_64-linux.tar.gz
+ step Switching system into kexec
+ echo '### Switching system into kexec ###'
### Switching system into kexec ###
+ [[ n == \y ]]
+ local remoteCommandTemplate
++ printf '%q ' ''
+ remoteCommandTemplate='
set -eu -x
doas rm -rf /root/kexec
doas mkdir -p /root/kexec
%TAR_COMMAND%
TMPDIR=/root/kexec setsid --wait doas /root/kexec/kexec/run --kexec-extra-flags '\'''\'' 
'
+ localUploadCommand=()
+ local localUploadCommand
+ remoteUploadCommand=()
+ local remoteUploadCommand
+ [[ -f https://github.com/nix-community/nixos-images/releases/download/nixos-25.05/nixos-kexec-installer-noninteractive-x86_64-linux.tar.gz ]]
+ [[ y == \y ]]
+ remoteUploadCommand=(wget "$kexecUrl" -O-)
+ local tarCommand
+ local remoteCommands
+ [[ 0 -eq 0 ]]
++ printf '%q ' wget https://github.com/nix-community/nixos-images/releases/download/nixos-25.05/nixos-kexec-installer-noninteractive-x86_64-linux.tar.gz -O-
+ tarCommand='wget https://github.com/nix-community/nixos-images/releases/download/nixos-25.05/nixos-kexec-installer-noninteractive-x86_64-linux.tar.gz -O-  | doas tar -C /root/kexec -xvzf-'
+ remoteCommands='
set -eu -x
doas rm -rf /root/kexec
doas mkdir -p /root/kexec
wget https://github.com/nix-community/nixos-images/releases/download/nixos-25.05/nixos-kexec-installer-noninteractive-x86_64-linux.tar.gz -O-  | doas tar -C /root/kexec -xvzf-
TMPDIR=/root/kexec setsid --wait doas /root/kexec/kexec/run --kexec-extra-flags '\'''\'' 
'
++ printf %q '
set -eu -x
doas rm -rf /root/kexec
doas mkdir -p /root/kexec
wget https://github.com/nix-community/nixos-images/releases/download/nixos-25.05/nixos-kexec-installer-noninteractive-x86_64-linux.tar.gz -O-  | doas tar -C /root/kexec -xvzf-
TMPDIR=/root/kexec setsid --wait doas /root/kexec/kexec/run --kexec-extra-flags '\'''\'' 
'
+ runSsh sh -c '$'\''\nset -eu -x\ndoas rm -rf /root/kexec\ndoas mkdir -p /root/kexec\nwget https://github.com/nix-community/nixos-images/releases/download/nixos-25.05/nixos-kexec-installer-noninteractive-x86_64-linux.tar.gz -O-  | doas tar -C /root/kexec -xvzf-\nTMPDIR=/root/kexec setsid --wait doas /root/kexec/kexec/run --kexec-extra-flags \'\''\'\'' \n'\'''
+ ssh -t -o IdentitiesOnly=yes -i /tmp/tmp.c0oHBpBrVx/nixos-anywhere -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no [email protected] sh -c '$'\''\nset -eu -x\ndoas rm -rf /root/kexec\ndoas mkdir -p /root/kexec\nwget https://github.com/nix-community/nixos-images/releases/download/nixos-25.05/nixos-kexec-installer-noninteractive-x86_64-linux.tar.gz -O-  | doas tar -C /root/kexec -xvzf-\nTMPDIR=/root/kexec setsid --wait doas /root/kexec/kexec/run --kexec-extra-flags \'\''\'\'' \n'\'''
Warning: Permanently added '192.168.1.103' (ED25519) to the list of known hosts.
+ doas rm -rf /root/kexec
doas ([email protected]) password: 
+ doas mkdir -p /root/kexec
+ wget https://github.com/nix-community/nixos-images/releases/download/nixos-25.05/nixos-kexec-installer-noninteractive-x86_64-linux.tar.gz -O-
+ doas tar -C /root/kexec -xvzf-
Connecting to github.com (4.237.22.38:443)
Connecting to objects.githubusercontent.com (185.199.108.133:443)
writing to stdout
kexec/
kexec/ip
kexec/kexec
kexec/run
kexec/initrd
-                     96% |***********************************************************************************    |  335M  0:00:02 ETAkexec/bzImage
-                    100% |***************************************************************************************|  348M  0:00:00 ETA
written to stdout
+ TMPDIR=/root/kexec setsid --wait doas /root/kexec/kexec/run --kexec-extra-flags 
setsid: unrecognized option: wait
BusyBox v1.37.0 (2025-05-26 20:04:45 UTC) multi-call binary.

Usage: setsid [-c] PROG ARGS

Run PROG in a new session. PROG will have no controlling terminal
and will not be affected by keyboard signals (^C etc).

        -c      Set controlling terminal to stdin
Connection to 192.168.1.103 closed.
+ rm -rf /tmp/tmp.c0oHBpBrVx

Command Used

nixos-anywhere --flake .#generic --generate-hardware-config nixos-generate-config ./hardware-configuration.nix [email protected] --debug

Target System

Bare metal server

NixOS Version

25.05

Environment Information

  • Host OS: 24.11
  • Nix version: 2.24.14
  • Target architecture: x86_64

uname -a
Linux nixos 6.6.87 #1-NixOS SMP PREEMPT_DYNAMIC Thu Apr 10 12:37:44 UTC 2025 x86_64 GNU/Linux

Configuration Files

# flake.nix
{
  inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
  inputs.disko.url = "github:nix-community/disko";
  inputs.disko.inputs.nixpkgs.follows = "nixpkgs";

  outputs = {
    nixpkgs,
    disko,
    ...
  }: {
    # Use this for all other targets
    # nixos-anywhere --flake .#generic --generate-hardware-config nixos-generate-config ./hardware-configuration.nix <hostname>
    nixosConfigurations.generic = nixpkgs.lib.nixosSystem {
      system = "x86_64-linux";
      modules = [
        disko.nixosModules.disko
        ./configuration.nix
        ./hardware-configuration.nix
      ];
    };
  };
}




# configuration.nix
{
  modulesPath,
  lib,
  pkgs,
  ...
} @ args: {
  imports = [
    (modulesPath + "/installer/scan/not-detected.nix")
    (modulesPath + "/profiles/qemu-guest.nix")
    ./disk-config.nix
  ];

  nix.settings.experimental-features = ["nix-command" "flakes"];

  boot.loader.grub = {
    # no need to set devices, disko will add all devices that have a EF02 partition to the list already
    # devices = [ ];
    efiSupport = true;
    efiInstallAsRemovable = true;
  };

  services.openssh.enable = true;
  services.opensshd.enable = true;

  environment.systemPackages = map lib.lowPrio [
    pkgs.curl
    pkgs.gitMinimal
    pkgs.vim
    pkgs.neofetch
    pkgs.git
    pkgs.docker
    pkgs.docker-compose
  ];

  virtualisation.docker.enable = true;
  users.users.admin.extraGroups = ["docker"];

  users.users.root.openssh.authorizedKeys.keys =
    [
      # change this to your ssh key
      "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFAWgWrob43rJ4K3PATVTt1Vz6Pfn7J7Z5lJ8eJCUj0E waynevanson@nixos"
    ]
    ++ (args.extraPublicKeys or []); # this is used for unit-testing this module and can be removed if not needed

  system.stateVersion = "25.05";
}


# disk-config.nix

# Example to create a bios compatible gpt partition
# What I actually want is sda and sdb as normal drives, and raid0 for sdc + sdd
{lib, ...}: {
  disko.devices = {
    disk.disk1 = {
      device = "/dev/sda";
      type = "disk";
      content = {
        type = "gpt";
        partitions = {
          boot = {
            name = "boot";
            size = "1M";
            type = "EF02";
          };
          esp = {
            name = "ESP";
            size = "500M";
            type = "EF00";
            content = {
              type = "filesystem";
              format = "vfat";
              mountpoint = "/boot";
            };
          };
          root = {
            name = "root";
            size = "100%";
            content = {
              type = "filesystem";
              format = "ext4";
              mountpoint = "/";
            };
          };
        };
      };
    };

    disk.disk2 = {
      device = "/dev/sdb";
      type = "disk";
      content = {
        type = "gpt";
        partitions = {
          primary = {
            size = "100%";
            content = {
              type = "filesystem";
              format = "ext4";
              mountpoint = "/opt/classic";
            };
          };
        };
      };
    };

    disk.disk3 = {
      device = "/dev/sdc";
      type = "disk";
      content = {
        type = "gpt";
        partitions = {
          mdadm = {
            size = "100%";
            content = {
              type = "mdraid";
              name = "raid1";
            };
          };
        };
      };
    };
    
    disk.disk4 = {
      device = "/dev/sdd";
      type = "disk";
      content = {
        type = "gpt";
        partitions = {
          mdadm = {
            size = "100%";
            content = {
              type = "mdraid";
              name = "raid1";
            };
          };
        };
      };
    };

    disk.mdadm = {
      raid1 = {
        type = "mdadm";
        level = 1;
        content = {
          type = "gpt";
          partitions = {
            primary = {
              size = "100%";
              content = {
                type = "filesystem";
                format = "ext4";
                mountpoint = "/mnt/raid1";
              };
            };
          };
        };
      };
    };
  };
}

Additional Context

BusyBox setsid command doesn't have wait (as we saw in the logs.

# alpine target machine
setsid --help
BusyBox v1.37.0 (2025-05-26 20:04:45 UTC) multi-call binary.

Usage: setsid [-c] PROG ARGS

Run PROG in a new session. PROG will have no controlling terminal
and will not be affected by keyboard signals (^C etc).

        -c      Set controlling terminal to stdin
# nixos host machine
setsid --help
Usage:
 setsid [options] <program> [arguments ...]

Run a program in a new session.

Options:
 -c, --ctty     set the controlling terminal to the current one
 -f, --fork     always fork
 -w, --wait     wait program to exit, and use the same return
 -h, --help     display this help
 -V, --version  display version

For more details see setsid(1).

I noticed my nix version is a little out of date. I will update it and try again too, but I don't think that's the issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions