[Buildbot-devel] Fwd: buildbot as a service on windows 7

tom fogal tfogal at sci.utah.edu
Tue Mar 23 21:51:13 UTC 2010


Welp, apologies for all the spam.  I finally figured this out.

I was trying to add a string "Parameters" with a value of my directory,
under "Buildbot".  Rather, there is a *key* under "Buildbot" named
"Parameters", and one needs to create a new string under "Parameters",
named "directories", and fill it with the list of slave directories you
care about.  Whew.

It would be great if creating the service did this automagically;
actually, I'm betting it does, but due to whatever quirk, I didn't
get "Parameters".  Probably it was just a permissions issue.  Maybe
creating the service could automatically give "Full control" to the
user given as the "--user" argument to buildbot_service.py?

Again, apologies for the spam,

-tom

------- Forwarded Message

Reply-To: tfogal at alumni.unh.edu
From: tom fogal <tfogal at sci.utah.edu>
To: buildbot-devel at lists.sourceforge.net
Subject: Fwd: buildbot as a service on windows 7
Date: Tue, 23 Mar 2010 15:41:15 -0600

Apologies for the fwd.  I wanted to reply to my own mail, but haven't
received it yet.

I think I've gotten around this problem.  Just right click the
"Buildbot" key in the registry, and then add your non-privileged user
to the list, and grant them "Full control".

I no longer get the error, but now I get:

  You must specify the buildbot directories as parameters to the service.
  Stopping the service.

This message clearly comes from the next lines in buildbot_service.py,
so it looks as if the RegCreateKey is now succeeding, but for some
reason the result of the win32 call is 'None', since the "if not
dir_string" is firing.  Hrm...

- -tom

- ------- Forwarded Message

Reply-To: tfogal at sci.utah.edu
From: tom fogal <tfogal at alumni.unh.edu>
To: buildbot-devel at lists.sf.net
Subject: buildbot as a service on windows 7
Date: Tue, 23 Mar 2010 15:29:18 -0600

I'm trying to setup a buildbot slave as a service on Windows 7.  I've
had this running as administrator before, but I'm trying to be a good
boy and run it as a non-privileged user now.  Unfortunately, it wants
to create a registry key during startup, and can't:

  Traceback (most recent call last):
    File "C:\Python26\lib\site-packages\win32\lib\win32serviceutil.py", line 806,
  in SvcRun
      self.SvcDoRun()
    File "C:\python26\scripts\buildbot_service.py", line 217, in SvcDoRun
      if not self._checkConfig():
    File "C:\python26\scripts\buildbot_service.py", line 177, in _checkConfig
      "directories")
    File "C:\Python26\lib\site-packages\win32\lib\win32serviceutil.py", line 265,
  in GetServiceCustomOption
      key = win32api.RegCreateKey(win32con.HKEY_LOCAL_MACHINE,
  "System\\CurrentControlSet\\Services\\%s\\Parameters" % serviceName)
  error: (5, 'RegCreateKey', 'Access is denied.')

I attempted to create the registry key manually, but the code
(GetServiceCustomOption) attempts to create the key without checking
if it already exists.  Or, maybe the API works in such a way that one
needs to create the key before you can query its existence; I'm not all
that familiar with windows.

This seems like a generic pywin32 issue, not bbot specific, and yet I
cannot find any threads about it.  Perhaps people just aren't using
python-based services on Windows 7?  Anyway, an acceptable solution
for me would be to grant my user registry-key-creation privileges, but
I can't seem to figure out how to allow that without making them a
full-on administrator (defeats the whole point, really).  Ideas?

- - -tom

- ------- End of Forwarded Message

------- End of Forwarded Message





More information about the devel mailing list