Mythruna
August 11, 2022, 11:30:40 PM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Welcome to the new forums. See "Announcements" for a note for new users.
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Stand-Alone Server Daemon Mode  (Read 5679 times)
pjoseph
Newbie
*
Posts: 3


View Profile
« on: February 03, 2013, 06:47:24 PM »

Greetings,

I am running the stand-alone server on Ubuntu Server 12.04 LTS.  I have been successful in having clients from Windows and Linux desktops connect.  Yeah.

When I launch the server with -nogui, it starts and leaves me at a console prompt mythruna>  I see a number of commands that can be issued on this console.  However, I would like to leave the server running in daemon mode -- unattended.  Is there a daemon mode option?  I have tried just moving the server process into a background process, but then the console auto closes and shuts the server back down.

For those not familiar with a Linux server, I execute ssh from my desktop and remotely login to the server.  While logged in, I can start up processes on the server.  When I end my ssh session, the server kills all processes in the foreground.  Those processes that were started in daemon mode or in the background continue to run even though I have ended my remote session.  Without a daemon mode option, I have to leave the remote session open in order to let the Mythruna server continue to run.

Thanks.

Paul



Logged
pspeed
Administrator
Hero Member
*****
Posts: 5610



View Profile
« Reply #1 on: February 03, 2013, 07:12:45 PM »

I guess there is no daemon mode at the moment.  I don't even know if you can run it and then ctrl-z out of it.

It uses stdin and stdout out for the server console so maybe there is a way to fool it into thinking one is still there.
Logged
pjoseph
Newbie
*
Posts: 3


View Profile
« Reply #2 on: February 03, 2013, 07:15:22 PM »

Yes, I have been trying to "fool" it into thinking stdin and stdout are still there.  So far, it sees through all my attempts and neatly shuts down the server.

I'll keep experimenting.
Logged
pspeed
Administrator
Hero Member
*****
Posts: 5610



View Profile
« Reply #3 on: February 03, 2013, 07:32:33 PM »

Brute force approach maybe:
write a shell script that echos a line feed every 60 seconds or something.
pipe its output into the server as a background command.
Logged
pjoseph
Newbie
*
Posts: 3


View Profile
« Reply #4 on: February 03, 2013, 08:06:43 PM »

The console exits when it sees an EOF at stdin or stdout.

The following solution should prevent it from seeing such on a linux machine, and thus creating a de facto daemon mode:

Code:
cd /opt/mythruna/Mythruna-Server-20120627-Linux
rm -rf /tmp/srv-stdin
mkfifo /tmp/srv-stdin
cat > /tmp/srv-stdin &
cat /tmp/srv-stdin | ./Mythruna-Server-20120627.sh &

And the ability to shutdown the server with:

Code:
echo "exit" > /tmp/srv-stdin

But, alas, I still have something amiss.  If I end the remote session, the "cat > /tmp/srv-stdin &" still exits, and thus sends an EOF to the console.

I will keep trying.
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.20 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!