Newbie questions and feature requests
I'll simply list what surprised me, a cpu noob :wink:. Could you comment on each of the points?
- Running
cpudon a Linux machine requires PID 1 - why? Shouldn'trootprivileges be enough? This makes it impossible to run on pretty much any ordinary Linux distribution (which I'd say defeats the major use case "to seamlessly perform work on running remote machines"). - Running
cpud -remoteon a Linux machine does run the daemon but in addition to that it executes an interactive shell :open_mouth: - why the shell? cpudoesn't seem to support any way to specify the user to be used to execute the given command at the remote host if the host supports it (yes, this might be a "too high level" request forcpu/cpudbut I stand at it as otherwise this again defeats the purpose of usingcpuwith ordinary running remote machines like Linux/BSD).- On a Linux machine running
cpud -remote(I've tried both asrootand as a non-rootuser) and then in another terminalcpu localhost /bin/bashonly returns the error2022/05/04 10:56:43 SSH error Failed to dial: dial tcp [::1]:23: connect: connection refusedinstead of connecting to the running daemon (and no, there is no firewall on port 23 nor any running SSH daemon nor anything else). Why doesn't this simple case work?
Thanks for explanations, suggestions, etc.!
- Running
cpudon a Linux machine requires PID 1 - why? Shouldn'trootprivileges be enough? This makes it impossible to run on pretty much any ordinary Linux distribution (which I'd say defeats the major use case "to seamlessly perform work on running remote machines").
You can run cpud -d -init, especially if you use systemd.
Thanks for the suggestion @Rubo3 . What is it expected to do? On the Linux machine I currently sit in front of (Arch Linux with systemd), this is what happens (i.e. the daemon doesn't run neither in foreground nor in background):
0$ sudo systemctl status sshd
○ sshd.service - OpenSSH Daemon
Loaded: loaded (/usr/lib/systemd/system/sshd.service; enabled; vendor pres>
Active: inactive (dead) since Fri 2022-05-27 09:53:38 CEST; 1min 11s ago
Process: 589 ExecStart=/usr/bin/sshd -D (code=exited, status=0/SUCCESS)
Main PID: 589 (code=exited, status=0/SUCCESS)
CPU: 149ms
...
$
$ ps -Afl | grep -Ei cpud
0 S xxx 3573884 3573065 0 80 0 - 2627 - 09:50 pts/2 00:00:00 grep --color=auto -Ei cpud
$ echo $?
0
$ cpud -d -init
2022/05/27 09:50:23
CPUD:Args [cpud -d -init] pid 3573910 *runasinit true *remote false
2022/05/27 09:50:23
CPUD:Running as Init
2022/05/27 09:50:23
CPUD:Kicked off startup jobs, now serve ssh
2022/05/27 09:50:23
CPUD:Start the process reaper
2022/05/27 09:50:23 CPUD:starting ssh server on port 23
2022/05/27 09:50:23 CPUD:err listen tcp :23: bind: permission denied
2022/05/27 09:50:23
CPUD:server.ListenAndServer returned
2022/05/27 09:50:23 CPUD: All startup jobs exited
2022/05/27 09:50:23 CPUD: Syncing filesystems
2022/05/27 09:50:23
CPUD:Reaped 1 procs
$ echo $?
0
$ ps -Afl | grep -Ei cpud
0 S xxx 3573939 3573065 0 80 0 - 2627 - 09:50 pts/2 00:00:00 grep --color=auto -Ei cpud
$ echo $?
0
Ok, cpud -d -init under root seems to fix the bind issue and I can connect with cpu localhost on the same machine. Thanks for the pointer!
Would you know something about the other points?