Skip to content

Commit 1e0f546

Browse files
committed
fix(sshd): detach sshd daemon using nohup and backgrounding in Android configs
1 parent b67ad96 commit 1e0f546

3 files changed

Lines changed: 10 additions & 10 deletions

File tree

machines/aarch64/android/common.nix

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@
2727
#!/bin/sh
2828
if ! pgrep -x "sshd" > /dev/null; then
2929
if command -v proot > /dev/null 2>&1; then
30-
proot -0 ${pkgs.openssh}/bin/sshd -f ${config.home.homeDirectory}/.ssh/sshd_config
30+
nohup proot -0 ${pkgs.openssh}/bin/sshd -f ${config.home.homeDirectory}/.ssh/sshd_config > /dev/null 2>&1 &
3131
else
32-
${pkgs.openssh}/bin/sshd -f ${config.home.homeDirectory}/.ssh/sshd_config
32+
nohup ${pkgs.openssh}/bin/sshd -f ${config.home.homeDirectory}/.ssh/sshd_config > /dev/null 2>&1 &
3333
fi
3434
fi
3535
'';

machines/aarch64/android/smartphone/default.nix

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@ in
2828
export PROMPT="%F{yellow}%n%f@%F{green}${hostName}%f:%F{blue}%~%f%# "
2929
if ! pgrep -x "sshd" > /dev/null; then
3030
if command -v proot > /dev/null 2>&1; then
31-
proot -0 ${pkgs.openssh}/bin/sshd -f ${config.home.homeDirectory}/.ssh/sshd_config
31+
nohup proot -0 ${pkgs.openssh}/bin/sshd -f ${config.home.homeDirectory}/.ssh/sshd_config > /dev/null 2>&1 &
3232
else
33-
${pkgs.openssh}/bin/sshd -f ${config.home.homeDirectory}/.ssh/sshd_config
33+
nohup ${pkgs.openssh}/bin/sshd -f ${config.home.homeDirectory}/.ssh/sshd_config > /dev/null 2>&1 &
3434
fi
3535
fi
3636
'';
@@ -39,9 +39,9 @@ in
3939
export PS1="\[\033[01;33m\]\u\[\033[00m\]@\[\033[01;32m\]${hostName}\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ "
4040
if ! pgrep -x "sshd" > /dev/null; then
4141
if command -v proot > /dev/null 2>&1; then
42-
proot -0 ${pkgs.openssh}/bin/sshd -f ${config.home.homeDirectory}/.ssh/sshd_config
42+
nohup proot -0 ${pkgs.openssh}/bin/sshd -f ${config.home.homeDirectory}/.ssh/sshd_config > /dev/null 2>&1 &
4343
else
44-
${pkgs.openssh}/bin/sshd -f ${config.home.homeDirectory}/.ssh/sshd_config
44+
nohup ${pkgs.openssh}/bin/sshd -f ${config.home.homeDirectory}/.ssh/sshd_config > /dev/null 2>&1 &
4545
fi
4646
fi
4747
'';

machines/aarch64/android/tablet/default.nix

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@ in
2828
export PROMPT="%F{yellow}%n%f@%F{green}${hostName}%f:%F{blue}%~%f%# "
2929
if ! pgrep -x "sshd" > /dev/null; then
3030
if command -v proot > /dev/null 2>&1; then
31-
proot -0 ${pkgs.openssh}/bin/sshd -f ${config.home.homeDirectory}/.ssh/sshd_config
31+
nohup proot -0 ${pkgs.openssh}/bin/sshd -f ${config.home.homeDirectory}/.ssh/sshd_config > /dev/null 2>&1 &
3232
else
33-
${pkgs.openssh}/bin/sshd -f ${config.home.homeDirectory}/.ssh/sshd_config
33+
nohup ${pkgs.openssh}/bin/sshd -f ${config.home.homeDirectory}/.ssh/sshd_config > /dev/null 2>&1 &
3434
fi
3535
fi
3636
'';
@@ -39,9 +39,9 @@ in
3939
export PS1="\[\033[01;33m\]\u\[\033[00m\]@\[\033[01;32m\]${hostName}\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ "
4040
if ! pgrep -x "sshd" > /dev/null; then
4141
if command -v proot > /dev/null 2>&1; then
42-
proot -0 ${pkgs.openssh}/bin/sshd -f ${config.home.homeDirectory}/.ssh/sshd_config
42+
nohup proot -0 ${pkgs.openssh}/bin/sshd -f ${config.home.homeDirectory}/.ssh/sshd_config > /dev/null 2>&1 &
4343
else
44-
${pkgs.openssh}/bin/sshd -f ${config.home.homeDirectory}/.ssh/sshd_config
44+
nohup ${pkgs.openssh}/bin/sshd -f ${config.home.homeDirectory}/.ssh/sshd_config > /dev/null 2>&1 &
4545
fi
4646
fi
4747
'';

0 commit comments

Comments
 (0)