By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,035 Members | 1,995 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,035 IT Pros & Developers. It's quick & easy.

win32serviceutil won't start

P: n/a
I have a very simple win32serviceutil script:
import win32serviceutil, time

win32serviceutil.StartService("burek", "localhost")

time.sleep(10)

exit()

It successfuly imports win32serviceutil, and chokes on StartService:
Traceback (most recent call last):
File "foobar.py", line 3, in ?
win32serviceutil.StartService("burek", "localhost")
File "C:\Python24\Lib\site-packages\win32\lib\win32serviceutil.py", line
399, in StartService
hs = SmartOpenService(hscm, serviceName, win32service.SERVICE_ALL_ACCESS)
File "C:\Python24\Lib\site-packages\win32\lib\win32serviceutil.py", line
76, in SmartOpenService
return win32service.OpenService(hscm, name, access)
pywintypes.error: (1060, 'OpenService', 'The specified service does not
exist as an installed service.')

What does that mean?

--
"Now the storm has passed over me
I'm left to drift on a dead calm sea
And watch her forever through the cracks in the beams
Nailed across the doorways of the bedrooms of my dreams"
Nov 25 '07 #1
Share this Question
Share on Google+
5 Replies


P: n/a
On Nov 25, 2:40 pm, Nikola Skoric <nick-n...@net4u.hrwrote:
I have a very simple win32serviceutil script:
import win32serviceutil, time

win32serviceutil.StartService("burek", "localhost")

time.sleep(10)

exit()

It successfuly imports win32serviceutil, and chokes on StartService:
Traceback (most recent call last):
File "foobar.py", line 3, in ?
win32serviceutil.StartService("burek", "localhost")
File "C:\Python24\Lib\site-packages\win32\lib\win32serviceutil.py", line
399, in StartService
hs = SmartOpenService(hscm, serviceName, win32service.SERVICE_ALL_ACCESS)
File "C:\Python24\Lib\site-packages\win32\lib\win32serviceutil.py", line
76, in SmartOpenService
return win32service.OpenService(hscm, name, access)
pywintypes.error: (1060, 'OpenService', 'The specified service does not
exist as an installed service.')

What does that mean?

--
"Now the storm has passed over me
I'm left to drift on a dead calm sea
And watch her forever through the cracks in the beams
Nailed across the doorways of the bedrooms of my dreams"
Looks like Microsoft thinks you mis-spelled it.

http://www.microsoft.com/technet/pro....mspx?mfr=true

I would check and see if that service is installed on your PC. You can
go to Start --Run and type services.msc

Scroll through there and see if your service is listed. You might
check to see if you can enable/disable it via that console as well.

Mike
Nov 25 '07 #2

P: n/a
Dana Sun, 25 Nov 2007 13:52:35 -0800 (PST),
ky******@gmail.com <ky******@gmail.comkaze:
Looks like Microsoft thinks you mis-spelled it.

http://www.microsoft.com/technet/pro....mspx?mfr=true

I would check and see if that service is installed on your PC. You can
go to Start --Run and type services.msc

Scroll through there and see if your service is listed. You might
check to see if you can enable/disable it via that console as well.
Seems like I misunderstood Windows services (I'm porting UNIX daemon
to Windows so I'm thinking in UNIX terms). I didn't know I have to
_install_ a service before I _start_ it. How do I install a service?

--
"Now the storm has passed over me
I'm left to drift on a dead calm sea
And watch her forever through the cracks in the beams
Nailed across the doorways of the bedrooms of my dreams"
Nov 25 '07 #3

P: n/a
On Nov 25, 5:11 pm, Nikola Skoric <nick-n...@net4u.hrwrote:
Dana Sun, 25 Nov 2007 13:52:35 -0800 (PST),
kyoso...@gmail.com <kyoso...@gmail.comkaze:
Looks like Microsoft thinks you mis-spelled it.
http://www.microsoft.com/technet/pro...0serv/reskit/w...
I would check and see if that service is installed on your PC. You can
go to Start --Run and type services.msc
Scroll through there and see if your service is listed. You might
check to see if you can enable/disable it via that console as well.

Seems like I misunderstood Windows services (I'm porting UNIX daemon
to Windows so I'm thinking in UNIX terms). I didn't know I have to
_install_ a service before I _start_ it. How do I install a service?

--
"Now the storm has passed over me
I'm left to drift on a dead calm sea
And watch her forever through the cracks in the beams
Nailed across the doorways of the bedrooms of my dreams"
Sorry I didn't reply sooner. If you're creating a service based on a
Python file, check out the following links in addition to the book
Wolfgang mentioned:

http://agiletesting.blogspot.com/200...s-windows.html
http://www.thescripts.com/forum/thread595660.html
http://essiene.blogspot.com/2005/04/...-services.html

That should get you started. Hope it helps!

Mike
Nov 26 '07 #4

P: n/a
Dana Mon, 26 Nov 2007 08:50:23 -0800 (PST),
ky******@gmail.com <ky******@gmail.comkaze:
Sorry I didn't reply sooner. If you're creating a service based on a
Python file, check out the following links in addition to the book
Wolfgang mentioned:

http://agiletesting.blogspot.com/200...s-windows.html
http://www.thescripts.com/forum/thread595660.html
http://essiene.blogspot.com/2005/04/...-services.html

That should get you started. Hope it helps!
Huh. Thank you guys a lot. I took a glance (albeit a rather long one)
and decided that my users will have to install cygwin if they want to
use my script. Service handling is just a bit to complicated (after
creating UNIX daemon with 2 consecutive forks), and I'm not going to
be paid for this :-D

--
"Now the storm has passed over me
I'm left to drift on a dead calm sea
And watch her forever through the cracks in the beams
Nailed across the doorways of the bedrooms of my dreams"
Nov 28 '07 #5

P: n/a
On Nov 28, 1:59 pm, Nikola Skoric <nick-n...@net4u.hrwrote:
Dana Mon, 26 Nov 2007 08:50:23 -0800 (PST),
kyoso...@gmail.com <kyoso...@gmail.comkaze:
Sorry I didn't reply sooner. If you're creating a service based on a
Python file, check out the following links in addition to the book
Wolfgang mentioned:
http://agiletesting.blogspot.com/200...-script-as-win...
http://www.thescripts.com/forum/thread595660.html
http://essiene.blogspot.com/2005/04/...-services.html
That should get you started. Hope it helps!

Huh. Thank you guys a lot. I took a glance (albeit a rather long one)
and decided that my users will have to install cygwin if they want to
use my script. Service handling is just a bit to complicated (after
creating UNIX daemon with 2 consecutive forks), and I'm not going to
be paid for this :-D

--
"Now the storm has passed over me
I'm left to drift on a dead calm sea
And watch her forever through the cracks in the beams
Nailed across the doorways of the bedrooms of my dreams"
Yeah...a lot of things on Windows is just too complicated for its own
good. Every now and again you'll stumble across something that's
pretty elegant though.

Mike
Nov 28 '07 #6

This discussion thread is closed

Replies have been disabled for this discussion.