services should not restart on SIGHUP when running in the foreground

Bug #1263122 reported by Doug Hellmann
26
This bug affects 8 people
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Undecided
Unassigned
devstack
Invalid
Undecided
Unassigned
oslo-incubator
Fix Released
High
Doug Hellmann

Bug Description

As reported on the mailing list (http://lists.openstack.org/pipermail/openstack-dev/2013-December/022796.html) the behavior of the ServiceLauncher has changed in a way that breaks devstack.

The work for blueprint https://blueprints.launchpad.net/oslo/+spec/cfg-reload-config-files introduced changes to have the process "restart" on SIGHUP, but screen under devstack also uses that signal to kill the services. That means lots of developers are having to manually kill services to avoid having multiple copies running.

To fix the problem we should only restart on SIGHUP when not running in the foreground. There are a few suggestions for detecting foreground operation on http://stackoverflow.com/questions/2425005/how-do-i-know-if-an-c-programs-executable-is-run-in-foreground-or-background

Changed in oslo:
status: New → Triaged
importance: Undecided → High
Changed in oslo:
milestone: none → icehouse-2
Revision history for this message
Clint Byrum (clint-fewbar) wrote :

The simplest way to go is to just have a --foreground command line option which puts the process in this mode where SIGHUP will kill it.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to oslo-incubator (master)

Fix proposed to branch: master
Review: https://review.openstack.org/63444

Changed in oslo:
assignee: nobody → Sean Dague (sdague)
status: Triaged → In Progress
Revision history for this message
Adalberto Medeiros (adalbas) wrote :

For devstack , refer to comments on bug 1254795

Changed in devstack:
status: New → Confirmed
Changed in oslo:
assignee: Sean Dague (sdague) → Doug Hellmann (doug-hellmann)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to oslo-incubator (master)

Reviewed: https://review.openstack.org/63444
Committed: https://git.openstack.org/cgit/openstack/oslo-incubator/commit/?id=37e46bbfe47eaa019689869a1947b0fc63f0f367
Submitter: Jenkins
Branch: master

commit 37e46bbfe47eaa019689869a1947b0fc63f0f367
Author: Sean Dague <email address hidden>
Date: Fri Dec 20 11:17:18 2013 -0500

    disable SIGHUP restart behavior in foreground

    SIGHUP should only be a restart action for a daemonized processs,
    when used on a console process SIGHUP should == SIGTERM. Add
    detection for whether this service is actually daemonized.

    Change-Id: I2a73d3872a302fcfac1a6ee844a44faa9569b3dd
    Fixes-Bug: #1263122

Changed in oslo:
status: In Progress → Fix Committed
Changed in nova:
assignee: nobody → Doug Hellmann (doug-hellmann)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (master)

Fix proposed to branch: master
Review: https://review.openstack.org/63511

Changed in nova:
status: New → In Progress
Changed in nova:
assignee: Doug Hellmann (doug-hellmann) → nobody
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix merged to nova (master)

Reviewed: https://review.openstack.org/63495
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=bf44d83188a360197d90fa6774b8b7ca8bf1a6d0
Submitter: Jenkins
Branch: master

commit bf44d83188a360197d90fa6774b8b7ca8bf1a6d0
Author: Sean Dague <email address hidden>
Date: Fri Dec 20 14:56:13 2013 -0500

    sync oslo service to fix SIGHUP handling

    this is a sync of the oslo service code to fix a bug found in
    the sighup handling. Previously it was not possible to use
    devstack's unstack.sh because the service module would always
    restart under a SIGHUP, not only when the process was running as
    a service. SIGHUP on a non-detached process should act like
    SIGTERM. This change fixes that.

    Change-Id: Ib260d82519fde5c5cb24a2c0c8a7cccd0b96b84f
    Related-Bug: #1263122

Revision history for this message
Swapnil Kulkarni (coolsvap-deactivatedaccount) wrote :

The change has been merged in nova with https://review.openstack.org/63495

Changed in nova:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in nova:
milestone: none → icehouse-2
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in oslo:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in oslo:
milestone: icehouse-2 → 2014.1
Thierry Carrez (ttx)
Changed in nova:
milestone: icehouse-2 → 2014.1
Revision history for this message
Sean Dague (sdague) wrote :

This devstack bug was last updated over 180 days ago, as devstack
is a fast moving project and we'd like to get the tracker down to
currently actionable bugs, this is getting marked as Invalid. If the
issue still exists, please feel free to reopen it.

Changed in devstack:
status: Confirmed → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.