Mythruna

General Category => Tech Support => Topic started by: pjoseph on February 03, 2013, 06:47:24 PM



Title: Stand-Alone Server Daemon Mode
Post by: pjoseph 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





Title: Re: Stand-Alone Server Daemon Mode
Post by: pspeed 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.


Title: Re: Stand-Alone Server Daemon Mode
Post by: pjoseph 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.


Title: Re: Stand-Alone Server Daemon Mode
Post by: pspeed 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.


Title: [SOLVED] Re: Stand-Alone Server Daemon Mode
Post by: pjoseph 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.