Find the answer to your Linux question:
Results 1 to 7 of 7
Greetings. I currently have my Ubuntu 8.04 box running openssh-server (ssh) and a copy of the half life dedicated server (the server). As I type this, the server is running ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Sep 2003
    Location
    New Jersey, USA
    Posts
    94

    Use ssh to login to a specific tty


    Greetings.

    I currently have my Ubuntu 8.04 box running openssh-server (ssh) and a copy of the half life dedicated server (the server). As I type this, the server is running on tty2.

    I have no trouble if I want to connect remotely with ssh and start the server. However, if my ssh connection times out, my server gets terminated. What I'd like to be able to do is either leave the server running on tty2 and use ssh to connect to that specific tty# OR have a way to start the server in ssh and not have the server be killed when the ssh session is terminated.

    Any assistance is greatly appreciated.

  2. #2
    Linux Engineer Segfault's Avatar
    Join Date
    Jun 2008
    Location
    Acadiana
    Posts
    877
    Can this server be run in daemon mode? Did you see the documentation?
    There is a number of ways how to leave process running after logout. NOHUP for instance. You can also run it inside of a screen session.

  3. #3
    Just Joined!
    Join Date
    Sep 2003
    Location
    New Jersey, USA
    Posts
    94
    This is about the best information I can find regarding whether or not the HLDS can be run as a daemon. I wouldn't have found it if you didn't mention daemons. It seems like this script is part of what I need. I'll have to read through the thread and get a handle on it.

    The biggest problem I have is that there doesn't seem to be official documentation for the server itself. There are countless forums but forums aren't a reliable source of information 100% of the time.

    Source Dedicated Server daemon script - Steam Users' Forums

    I will look into NOHUP.

  4. #4
    Just Joined!
    Join Date
    Sep 2003
    Location
    New Jersey, USA
    Posts
    94
    Quote Originally Posted by Segfault View Post
    There is a number of ways how to leave process running after logout. NOHUP for instance. You can also run it inside of a screen session.
    Ok so if I understand this correctly, I want to use NOHUP to start a server and direct the output to Screen so I can pull the screen up upon ssh reconnection? I also want to detach the Screen so I can disconnect and not have a SIGHUP sent to Screen?

    Please let me know if I'm understanding this correctly. I'm trying to make sense of the Screen manpage.

  5. #5
    Linux Engineer Segfault's Avatar
    Join Date
    Jun 2008
    Location
    Acadiana
    Posts
    877
    Screen is really simple.

    0. You start it by typing screen and tapping enter;
    1. You'll get new prompt, there you start your app;
    2. Ctrl+A+D key combination exits screen and leaves process running.

    That's it. You can log off. Later you can log in again [from some machine] and type screen -r to get back to your program.

    NOHUP is different animal, to be used separately.

    All that said, using a script to run it as any other daemon (and have it started at bootup) is more elegant solution indeed.

  6. #6
    Just Joined!
    Join Date
    Sep 2003
    Location
    New Jersey, USA
    Posts
    94
    That works perfectly for my purposes. Thank you very much for your help. I'll definitely remember this for next time as well.

    Quote Originally Posted by Segfault View Post
    All that said, using a script to run it as any other daemon (and have it started at bootup) is more elegant solution indeed.
    And I imagine that using this solution I can still start the server with a Screen so I can bring up the server's console? I think what I would have to do is contain the start script within a script with Screen and pass it the Control+A+D. I remember seeing in the manpage that you have to use carot notation to pass control keystrokes. Does that sound right?

  7. #7
    Linux Engineer Segfault's Avatar
    Join Date
    Jun 2008
    Location
    Acadiana
    Posts
    877
    You are welcome!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •