[Buildbot-devel] interrupting a sudo job...

Vitali Lovich vlovich at gmail.com
Tue Apr 14 11:45:41 UTC 2015


From process/buildstep.py

551     @defer.inlineCallbacks                                                                                                                                                                                                                                 
552     def runCommand(self, command):                                                                                                                                                                                                                         
553         self.cmd = command                                                                                                                                                                                                                                 
554         command.buildslave = self.buildslave                                                                                                                                                                                                               
555         try:                                                                                                                                                                                                                                               
556             res = yield command.run(self, self.remote)                                                                                                                                                                                                     
557         finally:                                                                                                                                                                                                                                           
558             self.cmd = None                                                                                                                                                                                                                                
559         defer.returnValue(res)                                                                                                                                                                                                                             

This is part of the BuildStep.  I think it depends on if you have a new-style or old-style step.
You are correct that for old-style steps this used to be part of LoggingBuildStep.

I’m primarily using ShellMixin but I also have RemoteCommand instances that I invoke via self.runCommand.

-Vitali

> On Apr 13, 2015, at 9:46 PM, Jared Grubb <jared.grubb at gmail.com> wrote:
> 
> Hm, that doesnt sound right. 
> 
> BuildStep is the base-class and really wouldnt understand anything about remote-slave commands (the “self.cmd” property is added by LoggingBuildStep).
> 
> Based on your description, you are inheriting from BuildStep but not LoggingBuildStep .. but running remote commands. Are you manually invoking RemoteShellCommand yourself? Are you using ShellMixin?
> 
> Jared
> 
>> On Apr 13, 2015, at 21:19, Vitali Lovich <vlovich at gmail.com <mailto:vlovich at gmail.com>> wrote:
>> 
>> Figured it out.  Turns out that BuildStep isn’t interruptible by default even though it should be:
>> http://trac.buildbot.net/ticket/3248 <http://trac.buildbot.net/ticket/3248>
>> 
>> Either inherit from LoggingBuildStep, monkey-patch BuildStep or write your own version that implements interruption.
>> 
>> -Vitali
>> 
>>> On Apr 4, 2015, at 2:04 AM, Vitali Lovich <vlovich at gmail.com <mailto:vlovich at gmail.com>> wrote:
>>> 
>>> I have also tried usePTY=True to no avail.
>>> 
>>>> On Apr 4, 2015, at 12:10 AM, Vitali Lovich <vlovich at gmail.com <mailto:vlovich at gmail.com>> wrote:
>>>> 
>>>> Hi,
>>>> 
>>>> It seems like buildbot can’t kill a long-running job that was invoked via sudo.
>>>> Is there any kind of workaround?  Am I doing something wrong?
>>>> 
>>>> The command I’m invoking is something like:
>>>> 
>>>> sudo -E wrapper_exe sudo -E -u <username> <real command>
>>>> 
>>>> The reason is that wrapper_exe needs sudo permissions to setup the environment.
>>>> Then it drops back into the real permissions to invoke the real command.
>>>> 
>>>> Thanks,
>>>> Vitali
>>> 
>> 
>> ------------------------------------------------------------------------------
>> BPM Camp - Free Virtual Workshop May 6th at 10am PDT/1PM EDT
>> Develop your own process in accordance with the BPMN 2 standard
>> Learn Process modeling best practices with Bonita BPM through live exercises
>> http://www.bonitasoft.com/be-part-of-it/events/bpm-camp-virtual- <http://www.bonitasoft.com/be-part-of-it/events/bpm-camp-virtual-> event?utm_
>> source=Sourceforge_BPM_Camp_5_6_15&utm_medium=email&utm_campaign=VA_SF_______________________________________________
>> Buildbot-devel mailing list
>> Buildbot-devel at lists.sourceforge.net <mailto:Buildbot-devel at lists.sourceforge.net>
>> https://lists.sourceforge.net/lists/listinfo/buildbot-devel <https://lists.sourceforge.net/lists/listinfo/buildbot-devel>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://buildbot.net/pipermail/devel/attachments/20150414/f40bb0b9/attachment.html>


More information about the devel mailing list