I want to build an interface, that, using ssh and tmux will be able to start/stop daemons.
My approach to start the daemon was:
tmux new-session -s myDaemonID -d /path/to/daemon/exec /path/to/daemon/config
stopping the daemon is as simple as:
tmux send-key -t myDaemonID C-c
(I need to send C-c, becose juste killing the session wouldn't make my daemon unsubscribe properly.
This works great, now I want to move on the network. We can here assume that path to the deamon and it's config are valid on the remote machine.
I noticed that, when started locally, I can kill my deamon using
ssh localhost tmux send-key -t myDaemonID C-c
However, I cannot manage to start it remotly. Doing so wont work, and I have no log/message/code that tells me what happens:
ssh localhost tmux new-session -s myDaemonID -d /path/to/daemon/exec /path/to/daemon/config
Any idea what I am missing here ?