service <service> restart does not use an updated job configuration

Bug #707479 reported by Thomas Schweikle
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
upstart
Won't Fix
Undecided
Unassigned
upstart (Ubuntu)
Fix Released
Medium
Unassigned

Bug Description

Binary package hint: upstart

start a system using upstart. "ps axf" gives for one service converted to upstart:
  862 ? Sl 0:00 /usr/sbin/libvirtd -d

now change /etc/init/libvirt-bin to exec "/usr/sbin/libvirtd -d" to "/usr/sbin/libvirtd -d --listen". Afterwards:
# service libvirt-bin restart
libvirt-bin start/running, process 895
# ps axf | grep libvirtd
  895 ? Sl 0:00 /usr/sbin/libvirtd -d

You'll have to stop, then start libvirt-bin, to have the change made have any effect:
# service libvirt-bin stop
libvirt-bin stop/waiting
# service libvirt-bin start
# service libvirt-bin start
libvirt-bin start/running, process 928
# ps axf | grep libvirt
  928 ? Sl 0:00 /usr/sbin/libvirtd -d --listen

ProblemType: Bug
DistroRelease: Ubuntu 10.10
Package: upstart 0.6.6-3
Uname: Linux 2.6.36.3 x86_64
Architecture: amd64
Date: Tue Jan 25 16:26:04 2011
ProcEnviron:
 PATH=(custom, user)
 LANG=de_DE.utf8
 SHELL=/bin/bash
SourcePackage: upstart

Related branches

Revision history for this message
Thomas Schweikle (tps) wrote :
Revision history for this message
Clint Byrum (clint-fewbar) wrote :

Thomas, I have confirmed this on natty:

upstart:
  Installed: 0.6.7-5
  Candidate: 0.6.7-6
  Version table:
     0.6.7-6 0
        500 http://us.archive.ubuntu.com/ubuntu/ natty/main amd64 Packages
 *** 0.6.7-5 0
        100 /var/lib/dpkg/status

I believe this happens because of the way restart happens in a single event which changes the job's goal from stop, to start. At no point is a new job object created, so the newly parsed configuration is not present. This also probably has a lot to do with bug #703800 which causes restart to not work if there is a pre-stop. I imagine they will have the same fix, but are not the same bug.

Changed in upstart (Ubuntu):
status: New → Triaged
importance: Undecided → Medium
summary: - service <service> restart does nothing if service running
+ service <service> restart does not use an updated job configuration
Revision history for this message
Scott James Remnant (scott) wrote :

This is this way by design, it allows for services to be restarted without a change of configuration.

If you want to adopt the new configuration use:

  stop service ; start service

Changed in upstart:
status: New → Won't Fix
Revision history for this message
Thomas Schweikle (tps) wrote :

restart -> stop engine, start engine
reload -> reload engine (what ever this means)

To "restart" someting means starting all over.
This is a bug --- at least one about meaning of words.

Revision history for this message
Scott James Remnant (scott) wrote : Re: [Bug 707479] Re: service <service> restart does not use an updated job configuration

No, restart means to restart what you already have.

If you restart a game, it means going back to the beginning of the game and
starting it again. It doesn't mean potentially starting a new completely
different game.

Scott

On Fri, Feb 18, 2011 at 7:10 AM, Thomas Schweikle <<email address hidden>
> wrote:

> restart -> stop engine, start engine
> reload -> reload engine (what ever this means)
>
> To "restart" someting means starting all over.
> This is a bug --- at least one about meaning of words.
>
> --
> You received this bug notification because you are a member of Upstart
> Developers, which is subscribed to upstart .
> https://bugs.launchpad.net/bugs/707479
>
> Title:
> service <service> restart does not use an updated job configuration
>
> Status in Upstart:
> Won't Fix
> Status in “upstart” package in Ubuntu:
> Triaged
>
> Bug description:
> Binary package hint: upstart
>
> start a system using upstart. "ps axf" gives for one service converted to
> upstart:
> 862 ? Sl 0:00 /usr/sbin/libvirtd -d
>
> now change /etc/init/libvirt-bin to exec "/usr/sbin/libvirtd -d" to
> "/usr/sbin/libvirtd -d --listen". Afterwards:
> # service libvirt-bin restart
> libvirt-bin start/running, process 895
> # ps axf | grep libvirtd
> 895 ? Sl 0:00 /usr/sbin/libvirtd -d
>
> You'll have to stop, then start libvirt-bin, to have the change made have
> any effect:
> # service libvirt-bin stop
> libvirt-bin stop/waiting
> # service libvirt-bin start
> # service libvirt-bin start
> libvirt-bin start/running, process 928
> # ps axf | grep libvirt
> 928 ? Sl 0:00 /usr/sbin/libvirtd -d --listen
>
> ProblemType: Bug
> DistroRelease: Ubuntu 10.10
> Package: upstart 0.6.6-3
> Uname: Linux 2.6.36.3 x86_64
> Architecture: amd64
> Date: Tue Jan 25 16:26:04 2011
> ProcEnviron:
> PATH=(custom, user)
> LANG=de_DE.utf8
> SHELL=/bin/bash
> SourcePackage: upstart
>

Revision history for this message
Clint Byrum (clint-fewbar) wrote :

I have opened bug #731225 upstream to fix the documentation of restart. Meanwhile we will need to fix anything that uses 'restart' to use 'stop/start' where it may have assumed restart was reloading job configuration. I think the first place to start is the restart stanza of upstart-job, which does run 'start' on the job if its not running (another side effect of the $0 stop ; $0 start convention), but if the job is running, will still not reload the job config file.

Changed in upstart (Ubuntu):
status: Triaged → Fix Committed
Revision history for this message
Steve Langasek (vorlon) wrote :

> I have opened bug #731225 upstream to fix the documentation of restart.
> Meanwhile we will need to fix anything that uses 'restart' to use 'stop/start'
> where it may have assumed restart was reloading job configuration. I think
> the first place to start is the restart stanza of upstart-job, which does run
> 'start' on the job if its not running (another side effect of the $0 stop ; $0
> start convention), but if the job is running, will still not reload the job
> config file.

/lib/init/upstart-job already does this from natty on:

restart)
[...]
    if status "$JOB" 2>/dev/null | grep -q ' start/'; then
        RUNNING=1
    fi
    if [ -n "$RUNNING" ] ; then
        stop "$JOB"
    fi
    start "$JOB"
    ;;

Marking as fixed.

Changed in upstart (Ubuntu):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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