[python-win32] NT Service not re-startable after reboot

Robert Brewer fumanchu at amor.org
Fri Mar 17 00:53:14 CET 2006


FWIW, here's the output from win32\test\testall.py (I don't know if I
should assume that all should pass or not). This is on a Win2k Server
with Python 2.4.2 and pywin32 build 207:

C:\Python24\Lib\site-packages\win32\test>python testall.py
............................................................E.....EExcep
tion in thread Thread-3:
Traceback (most recent call last):
  File "C:\Python24\lib\threading.py", line 442, in __bootstrap
    self.run()
  File "C:\Python24\lib\threading.py", line 422, in run
    self.__target(*self.__args, **self.__kwargs)
  File "C:\Python24\Lib\site-packages\win32\test\test_win32pipe.py",
line 13, in _workerThread
    data = win32pipe.CallNamedPipe(self.pipename,"foo\0bar", 1024,
win32pipe.NMPWAIT_WAIT_FOREVER)
error: (231, 'CallNamedPipe', 'All pipe instances are busy.')

...Trying:
    import win32timezone, datetime
Expecting nothing
ok
Trying:
    assert 'Mountain Standard Time' in win32timezone.GetTimeZoneNames()
Expecting nothing
ok
Trying:
    tzi = TimeZoneInfo( 'Mountain Standard Time' )
Expecting nothing
ok
Trying:
    now = datetime.datetime.now( tzi )
Expecting nothing
ok
Trying:
    now.utcoffset() in ( datetime.timedelta(-1, 61200),
datetime.timedelta(-1, 64800) )
Expecting:
    True
ok
Trying:
    now = datetime.datetime.now( TimeZoneInfo( 'Mountain Standard Time',
True ) )
Expecting nothing
ok
Trying:
    now.utcoffset()
Expecting:
    datetime.timedelta(-1, 61200)
ok
Trying:
    aug2 = datetime.datetime( 2003, 8, 2, tzinfo = tzi )
Expecting nothing
ok
Trying:
    aug2.utctimetuple()
Expecting:
    (2003, 8, 2, 6, 0, 0, 5, 214, 0)
ok
Trying:
    nov2 = datetime.datetime( 2003, 11, 2, tzinfo = tzi )
Expecting nothing
ok
Trying:
    nov2.utctimetuple()
Expecting:
    (2003, 11, 2, 7, 0, 0, 6, 306, 0)
ok
Trying:
    aug2.isoformat()
Expecting:
    '2003-08-02T00:00:00-06:00'
ok
Trying:
    aug2est = aug2.astimezone( win32timezone.TimeZoneInfo( 'Eastern
Standard Time' ) )
Expecting nothing
ok
Trying:
    aug2est.isoformat()
Expecting:
    '2003-08-02T02:00:00-04:00'
ok
Trying:
    est = win32timezone.TimeZoneInfo( 'Eastern Standard Time' )
Expecting nothing
ok
Trying:
    est.displayName
Expecting:
    u'(GMT-05:00) Eastern Time (US & Canada)'
ok
Trying:
    gmt = win32timezone.TimeZoneInfo( 'GMT Standard Time', True )
Expecting nothing
ok
Trying:
    gmt.displayName
Expecting:
    u'(GMT) Greenwich Mean Time : Dublin, Edinburgh, Lisbon, London'
ok
Trying:
    import pickle
Expecting nothing
ok
Trying:
    tz = win32timezone.TimeZoneInfo( 'China Standard Time' )
Expecting nothing
ok
Trying:
    tz == pickle.loads( pickle.dumps( tz ) )
Expecting:
    True
ok
Trying:
    localTZ = GetLocalTimeZone()
Expecting nothing
ok
Trying:
    nowLoc = datetime.datetime.now( localTZ )
Expecting nothing
ok
Trying:
    nowUTC = datetime.datetime.utcnow( )
Expecting nothing
ok
Trying:
    ( nowUTC - nowLoc ) < datetime.timedelta( seconds = 5 )
Expecting:
    Traceback (most recent call last):
      ...
    TypeError: can't subtract offset-naive and offset-aware datetimes
ok
Trying:
    nowUTC = nowUTC.replace( tzinfo = TimeZoneInfo( 'GMT Standard Time',
True ) )
Expecting nothing
ok
Trying:
    ( nowUTC - nowLoc ) < datetime.timedelta( seconds = 5 )
Expecting:
    True
ok
25 items had no tests:
    win32timezone.GetIndexedTimeZoneNames
    win32timezone.GetSortedTimeZoneNames
    win32timezone.GetTimeZoneNames
    win32timezone.TimeZoneInfo
    win32timezone.TimeZoneInfo.GetDSTEndTime
    win32timezone.TimeZoneInfo.GetDSTStartTime
    win32timezone.TimeZoneInfo._FindTimeZoneKey
    win32timezone.TimeZoneInfo._LoadInfoFromKey
    win32timezone.TimeZoneInfo._LocateDay
    win32timezone.TimeZoneInfo.__cmp__
    win32timezone.TimeZoneInfo.__getinitargs__
    win32timezone.TimeZoneInfo.__init__
    win32timezone.TimeZoneInfo.__repr__
    win32timezone.TimeZoneInfo.__str__
    win32timezone.TimeZoneInfo._getDaylightBias
    win32timezone.TimeZoneInfo._getStandardBias
    win32timezone.TimeZoneInfo.daylightBias
    win32timezone.TimeZoneInfo.dst
    win32timezone.TimeZoneInfo.standardBias
    win32timezone.TimeZoneInfo.tzname
    win32timezone.TimeZoneInfo.utcoffset
    win32timezone._RegEnumerator
    win32timezone._RegKeyDict
    win32timezone._RegKeyEnumerator
    win32timezone._RegValueEnumerator
2 items passed all tests:
  21 tests in win32timezone
   6 tests in win32timezone.GetLocalTimeZone
27 tests in 27 items.
27 passed and 0 failed.
Test passed.
...............
======================================================================
ERROR: testFtpCommand (test_win32inet.TestNetwork)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\Python24\Lib\site-packages\win32\test\test_win32inet.py",
line 44, in testFtpCommand
    INTERNET_SERVICE_FTP, 0, 0)
error: (12029, 'InternetConnect', 'A connection with the server could
not be established')

======================================================================
ERROR: testCallNamedPipe (test_win32pipe.CurrentUserTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\Python24\Lib\site-packages\win32\test\test_win32pipe.py",
line 37, in testCallNamedPipe
    win32file.WriteFile(pipeHandle, "bar\0foo")
error: (109, 'WriteFile', 'The pipe has been ended.')

----------------------------------------------------------------------
Ran 85 tests in 9.719s

FAILED (errors=2)


This would be nice to fix, but it's not the end of the world. If I can't
get it working here, I'll just move it to a Linux box and go on my merry
way... ;)


Robert Brewer
System Architect
Amor Ministries
fumanchu at amor.org

 

> -----Original Message-----
> From: Mark Hammond [mailto:mhammond at skippinet.com.au] 
> Sent: Thursday, March 16, 2006 2:18 PM
> To: Robert Brewer; python-win32 at python.org
> Subject: RE: [python-win32] NT Service not re-startable after reboot
> 
> I'm afraid I've no idea.  The first thing to check is that username
> configured to use the service, and check that the service 
> does not rely on
> any network shares or similar.  Most service problems relate 
> to this (eg,
> trying to run a service from a mapped drive as the LocalSystem account
> doomed to failure.
> 
> After that, I'd suggest importing win32traceutil early in 
> your program and
> trying to determine if you module is being entered at all.  
> However, that
> seems unlikely - once the service framework gets to the point 
> it tries to
> import your module, it should also be at the point where it 
> can correctly
> log any Python errors caused by the import and write them to 
> the event log.
> 
> Good luck!
> 
> Mark
> 
> > -----Original Message-----
> > From: python-win32-bounces at python.org
> > [mailto:python-win32-bounces at python.org]On Behalf Of Robert Brewer
> > Sent: Friday, 17 March 2006 7:26 AM
> > To: python-win32 at python.org
> > Subject: [python-win32] NT Service not re-startable after reboot
> >
> >
> > I have a Python service (vmpro_pager.py) which worked fine 
> when I wrote
> > it a month ago. You can see the complete source code here:
> > http://projects.amor.org/misc/browser/vmpro_pager.py It runs an SMTP
> > proxy to clean up SMTP messages from a sender which is not compliant
> > with the SMTP spec. Today, we found out that the service was not
> > running, and had not been running for some time; my best 
> guess is since
> > the first reboot after the service was installed.
> >
> > Attempts to remove the service via "vmpro_pager.py remove" failed,
> > complaining that no such service was installed. After 
> manually deleting
> > the appropriate registry keys, I am able to run 
> "vmpro_pager.py install"
> > with no problems. However, starting the service from Windows Service
> > Manager fails with the message, "Windows could not start 
> the Voicemail
> > Pro Email Fixup service on Local Computer. For more 
> information, review
> > the System Event Log. If this is a non-Microsoft service, 
> contact the
> > service vendor, and refer to service-specific error code 
> 1." The Event
> > Log contains a single Error event with the Description: 
> "The Voicemail
> > Pro Email Fixup service terminated with service-specific 
> error 1." The
> > PYS_SERVICE_STARTED message from SvcDoRun is *not* in the Event Log.
> >
> > Running the service via "vmpro_pager.py debug", however, works
> > perfectly.
> >
> > Although I'm certainly open to answers of the type, "here's your
> > problem..." ;) I'd like to also where I can insert hooks to 
> return an
> > error code more-meaningful than "1" in the future.
> >
> >
> > Robert Brewer
> > System Architect
> > Amor Ministries
> > fumanchu at amor.org
> >
> > _______________________________________________
> > Python-win32 mailing list
> > Python-win32 at python.org
> > http://mail.python.org/mailman/listinfo/python-win32
> >
> 
> 


More information about the Python-win32 mailing list