SiriServerCore icon indicating copy to clipboard operation
SiriServerCore copied to clipboard

daemon option

Open cytec opened this issue 12 years ago • 3 comments

are there any plans to implement a daemon option so one can run the server easy in backround mode?

atm i'm useing screen to do this, but i think a daemon is more comfortable and may be more secure?

im not verry advanced in python but may this is usefull: http://code.activestate.com/recipes/278731-creating-a-daemon-the-python-way/

basicly it forks the process and runs it in the background, logging should be automaticly "redirected" to file output (maybe SiriServer.log in main dir?)

cytec avatar Mar 12 '12 10:03 cytec

I usually just run the server in a screen.

  screen -R SiriServer
  python SiriServer.py
  [PRESS CTRL+A+D]

you can reattach using

  screen -R SiriServer

or list all screens

  screen -ls

logging can already be redirected into a logfile, see --help

I'm currently not planing on creating a daemon

janrueth avatar Mar 12 '12 13:03 janrueth

like i said, i already run it in screen... just wanted to ask if u have plans to implement a daemon in the future ;)

cytec avatar Mar 12 '12 13:03 cytec

ok i played around a little bit, seems like ive got it working...

this is what i got so far: https://gist.github.com/2022356

if no logfile is given "SiriServer.log" is taken by default, also the pid is written to SiriServer.pid

EDIT: also added a kill option to kill the daemon if its running

cytec avatar Mar 12 '12 14:03 cytec