<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugzilla.yoctoproject.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugzilla.yoctoproject.org/"
          
          maintainer="it-coreprojects-helpdesk@linuxfoundation.org"
>

    <bug>
          <bug_id>9035</bug_id>
          
          <creation_ts>2016-02-02 13:42:08 +0000</creation_ts>
          <short_desc>bitbake-prserv not exiting on SIGTERM when run in daemon mode</short_desc>
          <delta_ts>2016-02-11 20:59:00 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>7</classification_id>
          <classification>Build System, Metadata &amp; Runtime</classification>
          <product>BitBake</product>
          <component>bitbake</component>
          <version>2.0.2</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>Medium</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>2.1 M3</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Diego Santa cruz">Diego.SantaCruz</reporter>
          <assigned_to name="Richard Purdie">richard.purdie</assigned_to>
          <cc>poky.bs.watcher</cc>
    
    <cc>poky.watcher</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>No (bug/feature does not impact docs)</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>58445</commentid>
    <comment_count>0</comment_count>
      <attachid>2963</attachid>
    <who name="Diego Santa cruz">Diego.SantaCruz</who>
    <bug_when>2016-02-02 13:42:08 +0000</bug_when>
    <thetext>Created attachment 2963
Fix for SIGTERM handling in daemon mode

I am running bitbake-prserv in daemon mode and noticed that it does not exit when a SIGTERM is sent to it.

Using &quot;bitbake-prserv --stop&quot; works fine, but sending a SIGTERM to the pid of the daemonized bitbake-prserv hungs it and then even a &quot;bitbake-prserv --stop&quot; is not able to stop it.

The problem seems to be that the handler thread is not signaled to quit, so it stays there doing its work, as it is not a daemon thread (i.e. the python thread is created in non-daemon mode).

The attached patch fixes this by setting the quit variable instead. The patch also does not raise the SystemExit exception any longer but instead leaves the quit flag to do its job and do a clean exit. This way the PID file is properly removed.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>58923</commentid>
    <comment_count>1</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2016-02-11 20:59:00 +0000</bug_when>
    <thetext>Thanks for the patches! http://git.yoctoproject.org/cgit.cgi/poky/commit/?id=abf8a8fbc35c8d45c2357701400477792e39f80e</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>2963</attachid>
            <date>2016-02-02 13:42:08 +0000</date>
            <delta_ts>2016-02-02 13:42:08 +0000</delta_ts>
            <desc>Fix for SIGTERM handling in daemon mode</desc>
            <filename>0001-bitbake-prserv-SIGTERM-handling-hung-process.patch</filename>
            <type>text/plain</type>
            <size>1289</size>
            <attacher name="Diego Santa cruz">Diego.SantaCruz</attacher>
            
              <data encoding="base64">RnJvbSAxOWZhNTJkNTFkYjM4MGRjNmZkNDZhMDJjZjQ0N2U2N2MwMjkxN2Y4IE1vbiBTZXAgMTcg
MDA6MDA6MDAgMjAwMQpGcm9tOiBEaWVnbyBTYW50YSBDcnV6IDxEaWVnby5TYW50YUNydXpAc3Bp
bmV0aXguY29tPgpEYXRlOiBUdWUsIDIgRmViIDIwMTYgMTM6MDU6NTAgKzAxMDAKU3ViamVjdDog
W1BBVENIXSBiaXRiYWtlOiBwcnNlcnY6IFNJR1RFUk0gaGFuZGxpbmcgaHVuZyBwcm9jZXNzCgpU
aGUgY3VycmVudCBTSUdURVJNIGhhbmRsZXIgaHVuZ3MgdGhlIHByb2Nlc3MgaW5zdGVhZCBv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