Timeline for SSH process won't end when I run a background command on remote host
Current License: CC BY-SA 4.0
16 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Jan 10, 2020 at 16:06 | answer | added | Eduardo Trápani | timeline score: 3 | |
| Dec 3, 2019 at 20:47 | comment | added | JdeBP |
The sh in BusyBox is of course the Almquist shell, as the BusyBox doco tells you. Confusing to people who erroneously think that the Bourne Again shell is definitive, but not actually the problem here.
|
|
| Dec 3, 2019 at 20:24 | history | edited | void.pointer | CC BY-SA 4.0 |
added 497 characters in body
|
| Dec 3, 2019 at 20:08 | comment | added | void.pointer | Let us continue this discussion in chat. | |
| Dec 3, 2019 at 20:07 | comment | added | Kusalananda♦ |
Where's that final & in your last command? Not there.
|
|
| Dec 3, 2019 at 20:06 | comment | added | void.pointer |
cat ./do_sync | ssh "root@$ip" "cat > /do_sync && chmod 777 /do_sync && nohup /do_sync" this still blocks, now I'm really confused....
|
|
| Dec 3, 2019 at 20:02 | history | edited | void.pointer | CC BY-SA 4.0 |
added 406 characters in body
|
| Dec 3, 2019 at 20:00 | comment | added | Kusalananda♦ |
ssh remote 'cat >./do_sync && nohup sh ./do_sync &' <./do_sync or something (untested)
|
|
| Dec 3, 2019 at 19:54 | comment | added | void.pointer |
How should I transfer a copy of the script? I do not have scp on the remote host and it cannot be added.
|
|
| Dec 3, 2019 at 19:50 | comment | added | Kusalananda♦ | What would be wrong with transferring the script to a file and running it on the remote system? The next time you run the command, you would transfer a new copy of the script. | |
| Dec 3, 2019 at 19:48 | history | edited | void.pointer | CC BY-SA 4.0 |
added 10 characters in body
|
| Dec 3, 2019 at 19:48 | answer | added | Bram | timeline score: 0 | |
| Dec 3, 2019 at 19:47 | history | edited | void.pointer | CC BY-SA 4.0 |
added 10 characters in body
|
| Dec 3, 2019 at 19:40 | comment | added | void.pointer | the script changes constantly. i cant do that. | |
| Dec 3, 2019 at 19:13 | comment | added | Kusalananda♦ |
The sh -s process may not actually read the whole script to the end as soon as possibly, but only to the point it needs to to run it. This keeps the connection open. I'm assuming that when it reaches the end of input, the connection is terminated. Transferring the script to the remote host and running it there would alleviate this.
|
|
| Dec 3, 2019 at 19:07 | history | asked | void.pointer | CC BY-SA 4.0 |