The problem definitely isn't with Python itself.  I run scripts in the
background and in screen all of the time.  I suspect the problem is by
design of the programs author.
If you look at the bottom of the file in the "main" function there is a call
to raw_input which then kills the server once it completes.  I'd recommend
removing this line and moving the two lines after it into the except block.
 This way the server will just keep running, until you hit ctrl-c.  At that
point it will shut itself down.
____________________________
Sean O'Connor
http://seanoc.com


On Wed, Feb 11, 2009 at 8:53 AM, John Mort <[email protected]> wrote:

> I'm hoping this is just a Python problem. I have a Python script that I got
> from:
> http://returnbooleantrue.blogspot.com/2009/01/eye-fi-standalone-server.html
> The script itself:
> http://www.darkeneddesire.com/EyeFiServer/EyeFiServer.py
>
> It's an Eye-Fi server that, with only one small modification, works quite
> well on my linux machine.  The problem is, when I run the script, it tells
> me to hit return to stop the script.  I'd like this thing to run all the
> time, and I suspect that this "hit return" thing is preventing me from
> doing
> so.
>
> Initially I tried: python EyeFiServer.py &
> But apparently, as soon as I hit enter after typing exit (or any other
> command for that matter), the script stops.
>
> So I tried starting screen, running the same command there, then killing
> screen, but this appears to stop the script as well.  I've also tried
> preappending nohup to the command, both with and without screen, with the
> same results.
>
> Is there some kind of simple trick to daemonizing python scripts? Or am I
> about to spend a lot of time learning Python?
>
> --
> John D. Mort
> http://john.mort.net
> _______________________________________________
> Mid-Hudson Valley Linux Users Group                  http://mhvlug.org
> http://mhvlug.org/cgi-bin/mailman/listinfo/mhvlug
> Upcoming Meetings (6pm - 8pm)                         MHVLS Auditorium
>  Mar 4 - TBD - 6th Birthday
>  Mar 7 - Web Hack-a-thon - SUNY Newpaltz
>  Apr 1 - TBD
>
_______________________________________________
Mid-Hudson Valley Linux Users Group                  http://mhvlug.org
http://mhvlug.org/cgi-bin/mailman/listinfo/mhvlug
Upcoming Meetings (6pm - 8pm)                         MHVLS Auditorium
  Mar 4 - TBD - 6th Birthday
  Mar 7 - Web Hack-a-thon - SUNY Newpaltz
  Apr 1 - TBD

Reply via email to