ANN: psutil 4.2.0 with Windows service support is out

2016-05-15 Thread Giampaolo Rodola'
Full blog post: http://grodola.blogspot.com/2016/05/psutil-420-windows-services-and-python.html -- Giampaolo - http://grodola.blogspot.com -- https://mail.python.org/mailman/listinfo/python-list

ANN: psutil 4.2.0 with Windows service support is out

2016-05-15 Thread Giampaolo Rodola'
Full blog post: http://grodola.blogspot.com/2016/05/psutil-420-windows-services-and-python.html -- Giampaolo - http://grodola.blogspot.com -- https://mail.python.org/mailman/listinfo/python-list

smtplib not working when python run under windows service via Local System account

2016-05-05 Thread loial
I have a python 2.7.10 script which is being run under a windows service on windows 2012 server . The python script uses smtplib to send an email. It works fine when the windows service is run as a local user, but not when the windows service is configured to run as Local System account. I get

Re: Windows service in production?

2015-03-20 Thread Raymond Cote
. Alternatively, you may want to look at a service manager such as: https://nssm.cc This allows you to run a standard executable as a Windows Service. We’ve just started looking down this path ourselves since we’re looking to move to Python 3.x and want to reduce our dependencies as much as possible. —Ray

Re: Windows service in production?

2015-03-19 Thread Michiel Overtoom
On Mar 19, 2015, at 08:00, [email protected] wrote: > file_path = "D:\Tarang\Project\form1.py" Use either slashes (/), raw strings, or double backslashes: file_path = "D:/Tarang/Project/form1.py" file_path = r"D:\Tarang\Project\form1.py"

Re: Windows service in production?

2015-03-19 Thread CHIN Dihedral
Please check wxpython and there was an example. -- https://mail.python.org/mailman/listinfo/python-list

Re: Windows service in production?

2015-03-19 Thread jyothi . nadu
On Tuesday, August 16, 2011 at 1:22:37 PM UTC+5:30, Tim Golden wrote: > On 16/08/2011 05:32, snorble wrote: > > Anyone know of a Python application running as a Windows service in > > production? I'm planning a network monitoring application that runs as > > a servi

Re: Windows service in production?

2015-03-19 Thread jyothi . nadu
On Tuesday, August 16, 2011 at 10:02:02 AM UTC+5:30, snorble wrote: > Anyone know of a Python application running as a Windows service in > production? I'm planning a network monitoring application that runs as > a service and reports back to the central server. Sort of a heartbeat &

Re: Python as Windows Service

2014-09-25 Thread Zachary Ware
On Thu, Sep 25, 2014 at 9:33 AM, Nagy László Zsolt wrote: > By the way, do we have support for creating a Windows Service for Python 3 > already? I know it was not working about 6 months ago. Does pywin32 > (PythonService.exe ?) still lack this feautue? I can confirm that a Windows se

Re: Python as Windows Service

2014-09-25 Thread Nagy László Zsolt
*De :*Gmail [mailto:[email protected]] *Envoyé :* Wednesday, September 24, 2014 2:41 PM *À :* Arulnambi Nandagoban *Objet :* Re: Python as Windows Service Also, this may work for you <http://nssm.cc/description> <http://nssm.cc/usage> NSSM installs an existing app as a servi

RE: Python as Windows Service

2014-09-24 Thread Arulnambi Nandagoban
De : Gmail [mailto:[email protected]] Envoyé : Wednesday, September 24, 2014 2:41 PM À : Arulnambi Nandagoban Objet : Re: Python as Windows Service Also, this may work for you <http://nssm.cc/description> <http://nssm.cc/usage> NSSM installs an existing app as a serv

Re: tcp server as windows service

2014-09-23 Thread Johannes Findeisen
Hi, On Tue, 23 Sep 2014 15:56:41 +0200 Arulnambi Nandagoban wrote: > Hello all, > > > > I developed a multithreaded tcp server with python and I converted into a > windows executable using pyinstaller. > > I would like to run the server as a windows service

tcp server as windows service

2014-09-23 Thread Arulnambi Nandagoban
Hello all, I developed a multithreaded tcp server with python and I converted into a windows executable using pyinstaller. I would like to run the server as a windows service so that server restarts whenever pc restarts without doing it manually . Help me out with some sample code

Re: Windows service in production?

2011-08-18 Thread Adam Jorgensen
August 2011 07:00, Stephen Hansen wrote: > On 8/15/11 9:32 PM, snorble wrote: > > Anyone know of a Python application running as a Windows service in > > production? I'm planning a network monitoring application that runs as > > a service and reports back to the central s

Re: Windows service in production?

2011-08-18 Thread Stephen Hansen
On 8/15/11 9:32 PM, snorble wrote: > Anyone know of a Python application running as a Windows service in > production? I'm planning a network monitoring application that runs as > a service and reports back to the central server. Sort of a heartbeat > type agent to assist with &qu

Re: [Python] Re: Windows service in production?

2011-08-18 Thread Chris Gonnerman
Chiming in late here, but I've been running a very simple Python service for some time now on a number of computers. It's my Raw Print Server, available at http://newcenturycomputers.net/projects/rawprintserver.html, and I have instructions on the page for installing the Windo

Re: Windows service in production?

2011-08-18 Thread Grummble
On 08/16/2011 12:32 AM, snorble wrote: Anyone know of a Python application running as a Windows service in production? I'm planning a network monitoring application that runs as a service and reports back to the central server. Sort of a heartbeat type agent to assist with "this serv

Re: [Python] Re: Windows service in production?

2011-08-18 Thread Chris Gonnerman
Chiming in late here, but I've been running a very simple Python service for some time now on a number of computers. It's my Raw Print Server, available at http://newcenturycomputers.net/projects/rawprintserver.html, and I have instructions on the page for installing the Windo

Re: Windows service in production?

2011-08-17 Thread Tim Golden
On 16/08/2011 15:46, snorble wrote: Interesting. Normally I would use py2exe then do "myapp.exe -install" to install the app as a service. How do you handle installing the service? Also what does the service show under the properties, for the executable? "python.exe script.py" or something else?

Re: Windows service in production?

2011-08-16 Thread snorble
On Aug 16, 2:52 am, Tim Golden wrote: > On 16/08/2011 05:32, snorble wrote: > > > Anyone know of a Python application running as a Windows service in > > production? I'm planning a network monitoring application that runs as > > a service and reports back to

Re: Windows service in production?

2011-08-16 Thread aspineux
On Aug 16, 6:32 am, snorble wrote: > Anyone know of a Python application running as a Windows service in > production? I'm planning a network monitoring application that runs as > a service and reports back to the central server. Sort of a heartbeat > type agent to assist wit

Re: Windows service in production?

2011-08-16 Thread alex23
snorble wrote: > If using Visual Studio and C# is the more reliable way, then I'll go > that route. I love Python, but everything I read about Python services > seems to have workarounds ahoy for various situations (or maybe that's > just Windows services in general?). What workarounds do you mea

Re: Windows service in production?

2011-08-16 Thread Tim Golden
On 16/08/2011 05:32, snorble wrote: Anyone know of a Python application running as a Windows service in production? I'm planning a network monitoring application that runs as a service and reports back to the central server. Sort of a heartbeat type agent to assist with "this server i

Windows service in production?

2011-08-15 Thread snorble
Anyone know of a Python application running as a Windows service in production? I'm planning a network monitoring application that runs as a service and reports back to the central server. Sort of a heartbeat type agent to assist with "this server is down, go check on it" type

Re: Help needed with Windows Service in Python

2010-09-23 Thread Aahz
In article , Ian Hobson wrote: > >I am attempting to create a Windows Service in Python. BTW, you probably want to subscribe to http://mail.python.org/mailman/listinfo/python-win32 -- Aahz ([email protected]) <*> http://www.pythoncraft.com/ "If you thi

Re: redirecting stdout and stderr for a windows service

2010-09-06 Thread Ian
On 06/09/2010 15:29, Ian Hobson wrote: Hi all, Forget this. The problem is that it is a Windows Service, so it is not initialised in the normal way. PythonService.exe loads other code (named __main__) that loads the service proper, so the if test was never true! Regards Ian -- http

Re: redirecting stdout and stderr for a windows service

2010-09-06 Thread Ulrich Eckhardt
Ian Hobson wrote: > sys.stdout = sys.stderr = open("d:\logfile.txt", "a") "\l" is probably not what you want. Consider using "\\l" or r"\l" instead. Uli -- Sator Laser GmbH Geschäftsführer: Thorsten Föcking, Amtsgericht Hamburg HR B62 932 -- http://mail.python.org/mailman/listinfo/python

redirecting stdout and stderr for a windows service

2010-09-06 Thread Ian Hobson
Hi all, I am trying to redirect stdout and stderr on a python windows service, so that the service will not stall after 256 chars is written, and so I can use print for simple debugging. I have the following 4 lines (copy/pasted) in the source of my code. if __name__ == '__m

Re: Help needed with Windows Service in Python

2010-09-03 Thread Ian
On 02/09/2010 20:55, Edward Kozlowski wrote: On Sep 2, 2:38 pm, Ian wrote: On 02/09/2010 20:06, Edward Kozlowski wrote: On Sep 2, 10:22 am, Ian Hobsonwrote: Hi All, I am attempting to create a Windows Service in Python. I have the framework (from Mark Hammond and Andy Robinason&#

Re: Help needed with Windows Service in Python

2010-09-03 Thread Ian
On 03/09/2010 01:38, Mark Hammond wrote: I expect that the Windows Event Log might have some clues, as would attempting to use it in "debug" mode. Thanks Mark. The error log holds the trackback - it identified the line with the typo. Now the typo is fixed, the service starts and stops proper

Re: Help needed with Windows Service in Python

2010-09-02 Thread Mark Hammond
On 3/09/2010 1:22 AM, Ian Hobson wrote: Hi All, I am attempting to create a Windows Service in Python. I have the framework (from Mark Hammond and Andy Robinason's book) running - see below. It starts fine - but it will not stop. :( net stop "Python Service" and using the se

Re: Help needed with Windows Service in Python

2010-09-02 Thread Edward Kozlowski
On Sep 2, 2:38 pm, Ian wrote: >   On 02/09/2010 20:06, Edward Kozlowski wrote: > > > > > On Sep 2, 10:22 am, Ian Hobson  wrote: > >> Hi All, > > >> I am attempting to create a Windows Service in Python. > > >> I have the framework (from Mark Ha

Re: Help needed with Windows Service in Python

2010-09-02 Thread Ian
On 02/09/2010 20:06, Edward Kozlowski wrote: On Sep 2, 10:22 am, Ian Hobson wrote: Hi All, I am attempting to create a Windows Service in Python. I have the framework (from Mark Hammond and Andy Robinason's book) running - see below. It starts fine - but it will not stop. :( net

Re: Help needed with Windows Service in Python

2010-09-02 Thread Edward Kozlowski
On Sep 2, 10:22 am, Ian Hobson wrote: > Hi All, > > I am attempting to create a Windows Service in Python. > > I have the framework (from Mark Hammond and Andy Robinason's book) > running - see below. It starts fine - but it will not stop. :( > > net stop "

Re: Help needed with Windows Service in Python

2010-09-02 Thread Ian
On 02/09/2010 18:03, David wrote: Il Thu, 02 Sep 2010 16:22:04 +0100, Ian Hobson ha scritto: self.ReportServiceStatus(win32service.SERVICE_STOP_PENDING) You may try to give a WaitHint parameter to ReportServiceStatus call, otherwise the Service Manager will expect the service is stopped istan

Re: Help needed with Windows Service in Python

2010-09-02 Thread [email protected]
Well for one, if you're writing with pywin32, you certainly don't need the shbang line. #! /usr/bin/env is purely a POSIX thing. -- http://mail.python.org/mailman/listinfo/python-list

Re: Help needed with Windows Service in Python

2010-09-02 Thread David
Il Thu, 02 Sep 2010 16:22:04 +0100, Ian Hobson ha scritto: > self.ReportServiceStatus(win32service.SERVICE_STOP_PENDING) You may try to give a WaitHint parameter to ReportServiceStatus call, otherwise the Service Manager will expect the service is stopped istantly. self.ReportServiceStatus(win32

Help needed with Windows Service in Python

2010-09-02 Thread Ian Hobson
Hi All, I am attempting to create a Windows Service in Python. I have the framework (from Mark Hammond and Andy Robinason's book) running - see below. It starts fine - but it will not stop. :( net stop "Python Service" and using the services GUI both leave the service

Re: Executing Commands From Windows Service

2010-02-12 Thread T
On Feb 11, 8:21 am, "Martin P. Hellwig" wrote: > On 02/07/10 19:02, T wrote: > > > I have a script, which runs as a Windows service under the LocalSystem > > account, that I wish to have execute some commands.  Specifically, the > > program will call plink.

Re: Executing Commands From Windows Service

2010-02-12 Thread T
On Feb 11, 4:10 am, Tim Golden wrote: > On 10/02/2010 22:55, T wrote: > > > Great suggestions once again - I did verify that it was at least > > running the plink.exe binary when under LocalSystem by having the > > service run "plink.exe>  C:\plinkoutput.txt" - this worked fine.  And, > > as I men

Re: Executing Commands From Windows Service

2010-02-11 Thread Martin P. Hellwig
On 02/07/10 19:02, T wrote: I have a script, which runs as a Windows service under the LocalSystem account, that I wish to have execute some commands. Specifically, the program will call plink.exe to create a reverse SSH tunnel. Right now I'm using subprocess.Popen to do so. When I r

Re: Executing Commands From Windows Service

2010-02-11 Thread Tim Golden
On 10/02/2010 22:55, T wrote: Great suggestions once again - I did verify that it was at least running the plink.exe binary when under LocalSystem by having the service run "plink.exe> C:\plinkoutput.txt" - this worked fine. And, as I mentioned, it's now working just fine when running under a r

Re: Executing Commands From Windows Service

2010-02-10 Thread T
On Feb 9, 4:25 pm, David Bolen wrote: > David Bolen writes: > > Not from my past experience - the system account (LocalSystem for > > services) can be surprising, in that it's pretty much unlimited access > > to all local resources, but severely limited in a handful of cases, > > one of which is

Re: Executing Commands From Windows Service

2010-02-09 Thread David Bolen
David Bolen writes: > Not from my past experience - the system account (LocalSystem for > services) can be surprising, in that it's pretty much unlimited access > to all local resources, but severely limited in a handful of cases, > one of which is any attempt to access the network. I can't reca

Re: Executing Commands From Windows Service

2010-02-09 Thread David Bolen
T writes: > The more testing I do, I think you may be right..I was able to get it > to work under a local admin account, and it worked under debug mode > (which would also have been running as this user). I'm a bit > surprised though - I was under the assumption that LocalSystem had > rights to

Re: Executing Commands From Windows Service

2010-02-09 Thread Sean DiZazzo
On Feb 9, 6:52 am, T wrote: > On Feb 8, 2:25 pm, David Bolen wrote: > > > > > T writes: > > > I have a script, which runs as a Windows service under the LocalSystem > > > account, that I wish to have execute some commands.  Specifically, the > > > pr

Re: Executing Commands From Windows Service

2010-02-09 Thread David Bolen
T writes: > I have a script, which runs as a Windows service under the LocalSystem > account, that I wish to have execute some commands. Specifically, the > program will call plink.exe to create a reverse SSH tunnel. Right now > I'm using subprocess.Popen to do so. When I run

Re: Executing Commands From Windows Service

2010-02-09 Thread T
On Feb 8, 2:25 pm, David Bolen wrote: > T writes: > > I have a script, which runs as a Windows service under the LocalSystem > > account, that I wish to have execute some commands.  Specifically, the > > program will call plink.exe to create a reverse SSH tunnel.  Ri

Re: Executing Commands From Windows Service

2010-02-08 Thread T
vany.exe, which allows you to > > run any EXE as a Windows service.  I've done this in the past, but > > it's more of a "hack"..so this go around (since I will be distributing > > this program), I wanted to go the more professional route..which, > > unfortun

Re: Executing Commands From Windows Service

2010-02-08 Thread Sean DiZazzo
> > It's working fine when I run it via " debug" - that's how > I was testing before.  It's when I start the service that it fails - > and you can see that, when you run it with debug, plink.exe runs under > my username.  When I run it as a service, it runs under System... You can have the servic

Re: Executing Commands From Windows Service

2010-02-08 Thread T
Thanks for the suggestions - I think my next step is to try running it under an admin user account, as you guys both mentioned. Alf - you're absolutely right, Microsoft has srvany.exe, which allows you to run any EXE as a Windows service. I've done this in the past, but it's

Re: Executing Commands From Windows Service

2010-02-07 Thread Sean DiZazzo
On Feb 7, 4:57 pm, T wrote: > Thanks for the suggestions -  I think my next step is to try running > it under an admin user account, as you guys both mentioned.  Alf - > you're absolutely right, Microsoft has srvany.exe, which allows you to > run any EXE as a Windows service.  

Re: Executing Commands From Windows Service

2010-02-07 Thread Alf P. Steinbach
* T: On Feb 7, 4:43 pm, Sean DiZazzo wrote: On Feb 7, 11:02 am, T wrote: I have a script, which runs as a Windows service under the LocalSystem account, that I wish to have execute some commands. Specifically, the program will call plink.exe to create a reverse SSH tunnel. Right now I&#

Re: Executing Commands From Windows Service

2010-02-07 Thread T
On Feb 7, 4:43 pm, Sean DiZazzo wrote: > On Feb 7, 11:02 am, T wrote: > > > I have a script, which runs as a Windows service under the LocalSystem > > account, that I wish to have execute some commands.  Specifically, the > > program will call plink.exe to create a revers

Re: Executing Commands From Windows Service

2010-02-07 Thread Sean DiZazzo
On Feb 7, 11:02 am, T wrote: > I have a script, which runs as a Windows service under the LocalSystem > account, that I wish to have execute some commands.  Specifically, the > program will call plink.exe to create a reverse SSH tunnel.  Right now > I'm using subprocess.Popen

Re: Executing Commands From Windows Service

2010-02-07 Thread Stephen Hansen
On Sun, Feb 7, 2010 at 11:02 AM, T wrote: > I have a script, which runs as a Windows service under the LocalSystem > account, that I wish to have execute some commands. Specifically, the > program will call plink.exe to create a reverse SSH tunnel. Right now > I'm using subpr

Executing Commands From Windows Service

2010-02-07 Thread T
I have a script, which runs as a Windows service under the LocalSystem account, that I wish to have execute some commands. Specifically, the program will call plink.exe to create a reverse SSH tunnel. Right now I'm using subprocess.Popen to do so. When I run it interactively via an

Re: capture stdout and stderror from within a Windows Service?

2009-05-15 Thread Tim Golden
Chris Curvey wrote: Ahhh, Blake put me on the right track. If you want any of the streams, you have to supply values for all of them, like so: p = subprocess.Popen(step, shell=True stdout=subprocess.PIPE, stdin=subprocess.PIPE, stderr=subprocess.PIPE) (stdout, stderr) = p.com

Re: capture stdout and stderror from within a Windows Service?

2009-05-15 Thread Chris Curvey
On May 14, 11:57 am, Chris Curvey wrote: > I'm trying to get this invocation right, and it is escaping me.  How > can I capture the stdout and stderr if I launch a subprocess using > subprocess.check_call()?  The twist here is that the call is running > from within a Windows

Re: capture stdout and stderror from within a Windows Service?

2009-05-14 Thread David Lyon
wist here is that the call is running >> from within a Windows service. >> >> I've tried: >> >> check_call("mycmd.exe", stdout=subprocess.PIPE) [raises an exception >> "An integer is required"] >> >> check_call("mycmd.e

Re: capture stdout and stderror from within a Windows Service?

2009-05-14 Thread norseman
Chris Curvey wrote: I'm trying to get this invocation right, and it is escaping me. How can I capture the stdout and stderr if I launch a subprocess using subprocess.check_call()? The twist here is that the call is running from within a Windows service. I've tried: check_call(

Re: capture stdout and stderror from within a Windows Service?

2009-05-14 Thread Grant Edwards
On 2009-05-14, Chris Curvey wrote: > I'm trying to get this invocation right, and it is escaping me. How > can I capture the stdout and stderr if I launch a subprocess using > subprocess.check_call()? The twist here is that the call is running > from within a Windows servic

Re: capture stdout and stderror from within a Windows Service?

2009-05-14 Thread Chris Rebert
On Thu, May 14, 2009 at 8:57 AM, Chris Curvey wrote: > I'm trying to get this invocation right, and it is escaping me.  How > can I capture the stdout and stderr if I launch a subprocess using > subprocess.check_call()?  The twist here is that the call is running > from within

capture stdout and stderror from within a Windows Service?

2009-05-14 Thread Chris Curvey
I'm trying to get this invocation right, and it is escaping me. How can I capture the stdout and stderr if I launch a subprocess using subprocess.check_call()? The twist here is that the call is running from within a Windows service. I've tried: check_call("mycmd.exe", st

Re: Using multiprocessing from a Windows service

2009-02-06 Thread Mark Hammond
On 6/02/2009 4:21 PM, Volodymyr Orlenko wrote: In the patch I submitted, I simply check if the name of the supposed module ends with ".exe". It works fine for my case, but maybe this is too general. Is there a chance that a Python module would end in ".exe"? IIRC, py2exe may create executables

Re: Using multiprocessing from a Windows service

2009-02-05 Thread Volodymyr Orlenko
On 05/02/2009 9:54 PM, James Mills wrote: On Fri, Feb 6, 2009 at 3:21 PM, Volodymyr Orlenko wrote: [...] Maybe there's another way to fix the forking module? I believe the best way to fix this is to fix the underlying issue that Mark has pointed out (monkey-patching mp won't do).

Re: Using multiprocessing from a Windows service

2009-02-05 Thread James Mills
On Fri, Feb 6, 2009 at 3:21 PM, Volodymyr Orlenko wrote: > In the patch I submitted, I simply check if the name of the supposed module > ends with ".exe". It works fine for my case, but maybe this is too general. > Is there a chance that a Python module would end in ".exe"? If so, maybe we > shoul

Re: Using multiprocessing from a Windows service

2009-02-05 Thread Volodymyr Orlenko
On 05/02/2009 8:26 PM, Mark Hammond wrote: On 6/02/2009 2:50 PM, Mark Hammond wrote: On 6/02/2009 11:37 AM, Volodya wrote: Hi all, I think I've found a small bug with multiprocessing package on Windows. I'd actually argue its a bug in pythonservice.exe - it should set sys.argv[] to resembl

Re: Using multiprocessing from a Windows service

2009-02-05 Thread Mark Hammond
On 6/02/2009 2:50 PM, Mark Hammond wrote: On 6/02/2009 11:37 AM, Volodya wrote: Hi all, I think I've found a small bug with multiprocessing package on Windows. I'd actually argue its a bug in pythonservice.exe - it should set sys.argv[] to resemble a normal python process with argv[0] being t

Re: Using multiprocessing from a Windows service

2009-02-05 Thread Mark Hammond
On 6/02/2009 11:37 AM, Volodya wrote: Hi all, I think I've found a small bug with multiprocessing package on Windows. I'd actually argue its a bug in pythonservice.exe - it should set sys.argv[] to resemble a normal python process with argv[0] being the script. I'll fix it... Cheers, Mar

Using multiprocessing from a Windows service

2009-02-05 Thread Volodya
Hi all, I think I've found a small bug with multiprocessing package on Windows. If you try to start a multiprocessing.Process from a Python- based Windows service, the child process will fail to run. When running the parent process as a regular Python program, everything works as expected.

Re: Using subprocess.Popen() in a Windows service

2008-11-05 Thread yomgui
shell=False, cwd=lNetworkDir) else: net.processWithoutGui = Popen( [self.temporaryFilename,'-w'], shell=False, cwd=lNetworkDir) hope it helps yomgui Mark Shewfelt wrote: Hello, I am attempting to use Popen() in a Windows

Using subprocess.Popen() in a Windows service

2008-11-05 Thread Mark Shewfelt
Hello, I am attempting to use Popen() in a Windows service. I have a small Win32 .exe that I normally run through the os.popen2() function. I've written a class to work with the input and output parameters that are passed and captured from this exe. When I use the class outside of a service

Re: Running compiled windows service python script

2008-05-13 Thread Mike Driscoll
On May 13, 5:15 am, Aspersieman <[EMAIL PROTECTED]> wrote: > Hi All > > I have a windows service (attached file). I basically just calls another > script every 60 seconds. I can install, start and stop this service as > expected with: >     ParseMailboxService.py instal

Running compiled windows service python script

2008-05-13 Thread Aspersieman
Hi All I have a windows service (attached file). I basically just calls another script every 60 seconds. I can install, start and stop this service as expected with: ParseMailboxService.py install | start | stop The problem is: if I create an exe of this script (all required modules are

Re: windows service

2008-01-08 Thread kyosohma
going as a service, test it as just a regular Python script. I've created local servers using CherryPy before and been able to test them. I recommend you do the same with yours before changing it to a service. If you have a firewall installed (which you should), you may need to allow your progr

windows service

2008-01-07 Thread Michael Chesterton
I'm trying to get a program that uses M2Crypto ThreadingSSLServer to run in windows as a service. I have a few problem, it doesn't listen on its port and I don't know how to debug it. I used the pipeservice example as a framework to get it running as a service def SvcDoRun(self):

Re: a bug in python windows service?

2007-05-28 Thread momobear
> def SvcStop(self): > self.hWaitStop.set() > > def SvcDoRun(self): > self.thread.start() > self.hWaitStop.wait() > self.thread.join() > > if __name__ == '__main__': > win32serviceutil.HandleCommandLine(testTime) > > -- > Gabriel Genellina Great! thanks, now I understand the real work of the python windows service. -- http://mail.python.org/mailman/listinfo/python-list

Re: a bug in python windows service?

2007-05-27 Thread Gabriel Genellina
En Sun, 27 May 2007 09:07:36 -0300, momobear <[EMAIL PROTECTED]> escribió: >> Instead of extending join(), write a specific method to signal the >> quitEvent or just let the caller signal it. And I don't see in this >> example why do you need two different events (one on the thread, another >> on

Re: a bug in python windows service?

2007-05-27 Thread momobear
> Instead of extending join(), write a specific method to signal the > quitEvent or just let the caller signal it. And I don't see in this > example why do you need two different events (one on the thread, another > on the service controller), a single event would suffice. I don't think a single

Re: a bug in python windows service?

2007-05-27 Thread momobear
> No, this is not a bug. You must not call Thread.run(), use Thread.start() > instead - else your code won't run in a different thread of execution. See > http://docs.python.org/lib/thread-objects.htmlon how to use Thread > objects - and note that you should *only* override __init__ and run, if

Re: a bug in python windows service?

2007-05-26 Thread Gabriel Genellina
En Sat, 26 May 2007 23:00:45 -0300, momobear <[EMAIL PROTECTED]> escribió: > I feel really puzzled about fellowing code, please help me finger out > what problem here. > > import threading > > class workingthread(threading.Thread): > def __init__(self): > self.quitEvent = threadi

a bug in python windows service?

2007-05-26 Thread momobear
I feel really puzzled about fellowing code, please help me finger out what problem here. import threading class workingthread(threading.Thread): def __init__(self): self.quitEvent = threading.Event() self.waitTime = 10 threading.Thread.__init__(self)

Stopping pythoncom.PumpMessages in a windows service

2007-04-29 Thread Gheorghe Postelnicu
Hi, I am trying to create a windows service that will process some keyboard events. For that, i am trying to use pyHook and pythoncom, which work great in a stand-alone application. However, when in a service, the first problem I encounter is that the SvcStop part doesn't seem to be respo

Re: Windows service and pyc files

2007-04-05 Thread Laszlo Nagy
> With a bit of guessing, I think I've found what's happening. > Since you don't provide a value for stdin, None is used. Inside > subprocess.py, method _get_handles, line 670, GetStdHandle *may* return > None; in that case _make_inheritable fails. > If you print the value of p2cread in line 6

Re: Windows service and pyc files

2007-04-05 Thread Laszlo Nagy
>> 1. subprocess.Popen cannot redirect stderr and stdout when called from a >> win32 service. This is not documented, and makes debugging almost >> impossible. >> > > Without the patch menctioned in my previous message, you must redirect all > stdin, stdout AND stderr (because the child can

Re: Windows service and pyc files

2007-04-05 Thread Gabriel Genellina
En Thu, 05 Apr 2007 13:50:16 -0300, Laszlo Nagy <[EMAIL PROTECTED]> escribió: > 1. subprocess.Popen cannot redirect stderr and stdout when called from a > win32 service. This is not documented, and makes debugging almost > impossible. Without the patch menctioned in my previous message, you mus

Re: Windows service and pyc files

2007-04-05 Thread Gabriel Genellina
En Thu, 05 Apr 2007 13:00:52 -0300, Laszlo Nagy <[EMAIL PROTECTED]> escribió: > p = subprocess.Popen(params, bufsize=1, stdout=fout.fileno(), > stderr=fout.fileno()) > > When I call spawn() from a service, this is written into the logfile: > > 2007-04-05 17:52:53,828 INFO .Spawner Spawing > ['C:

Re: Windows service and pyc files

2007-04-05 Thread Laszlo Nagy
> When I call spawn() from a service, this is written into the logfile: > > 2007-04-05 17:52:53,828 INFO .Spawner Spawing > ['C:\\Python25\\lib\\site-packages\\win32\\PythonService.exe', > 'T:\\Python\\Projects\\Test\\Application.py'] > 2007-04-05 17:52:53,828 ERROR .Spawner Traceback (most rece

Re: Windows service and pyc files

2007-04-05 Thread Laszlo Nagy
> > Have you tried the subprocess module for this rather than os.system? > You might be able to pipe errors to a file with it. You might be able > to use the traceback module for more verbose error catching too. > Okay, I'm tried this instead of os.system: def dumpexc(e): import sys,traceback,

Re: Windows service and pyc files

2007-04-04 Thread kyosohma
On Apr 4, 10:48 am, Laszlo Nagy <[EMAIL PROTECTED]> wrote: > Hello, > > I have a win32 service written in Python that starts a plain > application, written in Python. > > The win32 service tries to launch the application in a while loop and > logs the return value of the os.system call. That's all

Windows service and pyc files

2007-04-04 Thread Laszlo Nagy
Hello, I have a win32 service written in Python that starts a plain application, written in Python. The win32 service tries to launch the application in a while loop and logs the return value of the os.system call. That's all. The application is a simple Python program that connects to an ht

Re: How to build a Windows service using win32?

2007-03-08 Thread Giles Brown
On 7 Mar, 16:45, "Gregor Mosheh" <[EMAIL PROTECTED]> wrote: > Giles Brown wrote: > > Yeah. You've cleverly decided to simplify the "smallest > > possible python service" by removing the > > if __name__ == '__main__': > > Ha ha. :) > Seriously, though, I removed that long after it was failing to wo

Re: How to build a Windows service using win32?

2007-03-07 Thread Gabriel Genellina
En Wed, 07 Mar 2007 13:45:44 -0300, Gregor Mosheh <[EMAIL PROTECTED]> escribió: > Now, I did stumble upon the solution to this one this morning, after a > fresh night of sleep: I re-ran "python tester.py install" I got a message > that the service had been updated, and now it runs! Hooray! > > A

Re: How to build a Windows service using win32?

2007-03-07 Thread Gregor Mosheh
Giles Brown wrote: > Yeah. You've cleverly decided to simplify the "smallest > possible python service" by removing the > if __name__ == '__main__': Ha ha. :) Seriously, though, I removed that long after it was failing to work, and have since replaced it and it didn't affect a thing. Gabriel Ge

Re: How to build a Windows service using win32?

2007-03-07 Thread Gregor Mosheh
Giles Brown wrote: > Yeah. You've cleverly decided to simplify the "smallest possible > python service" by removing the > if __name__ == '__main__': Ha ha. :) Seriously, though, I removed that long after it was failing to work, and have since replaced it and it didn't affect a thing. Gabriel G

Re: How to build a Windows service using win32?

2007-03-07 Thread Giles Brown
On 7 Mar, 10:25, "Gregor Mosheh" <[EMAIL PROTECTED]> wrote: > I'm trying to write a Win32 service. The following is straight from Python > Programming on Win32 and it doesn't work. Is that book out of date; is > there a new way to do services? I searched Google for hours trying to find > any other

Re: How to build a Windows service using win32?

2007-03-07 Thread Gabriel Genellina
En Wed, 07 Mar 2007 07:25:56 -0300, Gregor Mosheh <[EMAIL PROTECTED]> escribió: > I'm trying to write a Win32 service. The following is straight from > Python > Programming on Win32 and it doesn't work. Is that book out of date; is > there a new way to do services? I searched Google for hours

How to build a Windows service using win32?

2007-03-07 Thread Gregor Mosheh
I'm trying to write a Win32 service. The following is straight from Python Programming on Win32 and it doesn't work. Is that book out of date; is there a new way to do services? I searched Google for hours trying to find any other method, and have been beating on this one for 5 more hours. The pre

Re: how to make a python windows service know it's own identity

2007-02-01 Thread Larry Bates
Chris Curvey wrote: > On Feb 1, 2:10 pm, Larry Bates <[EMAIL PROTECTED]> wrote: >> Chris Curvey wrote: >>> Hi all, >>> I have used the win32com libraries to set up a service called >>> MyService under Windows. So far, so good. Now I need to run multiple >>> copies of the service on the same machi

  1   2   >