Score:0

Starting server in screen with ssh does not create screen session

uy flag

I'm trying to compose a single command that will start server in screen on remote machine. ssh user@host "cd workingdirectory/ ; screen -dmS server ./start.sh" also tried with -t and -f flags for ssh command. When I execute cd workingdirectory/ ; screen -dmS server ./start.sh while connected via ssh it works correctly, but when I run it with ssh part the screen does not launch. I don't understand what I'm doing wrong.

raj avatar
cn flag
raj
Are you running the ssh command from a terminal, or from some environment with no terminal (for example from a webserver script)? From what I remember, `screen` needs a terminal to start.
Marcin K. avatar
uy flag
I tried both from linux terminal and python paramiko with similar results. If it would be the case, do you know any workaround?
raj avatar
cn flag
raj
I would try to write an `expect` script that logs in to server via ssh, starts `screen` and logs out. `expect` explicitly simulates a terminal. If you are able to start `screen` in a ssh session, this solution should work.
Marcin K. avatar
uy flag
I have found paramiko-expect python library and it started the server successfully, you were right, thanks!
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.