reboot: should imply --force during shutdown

Bug #388738 reported by Casey Dahlin on 2009-06-18
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Scott James Remnant (Canonical)
upstart (Fedora)
Fix Released
upstart (Ubuntu)

Bug Description explains. When running halt/reboot while shutting down --force should be implicit. Patch should go to 0.3.11, I tagged for everything else since I'm not sure if this is still present.

If you attempt to shutdown/reboot/halt, the halt script just ends up looping


Have we decided if patching killall5 will work for this?

It doesn't loop any more, but it doesn't do the right thing either.

This is an upstart bug, at least as far as SysV compatibility goes.

halt/reboot under SysV check the runlevel when they run - if it's 0 or 6
(reboot/halt), then 'force' is implied. upstart's versions don't have that code,
so they just call shutdown again, which starts the loop/hangs.

Patch attached momentarily.

Created attachment 295051
check runlevel in halt/reboot, set --force accordingly

Do we want to apply just this patch to upstart, or both this patch and the
no-kill-init sysv patch?

I'll roll this in to the rpm tonight. Scott, care to weigh in?

That patch is definitely the right solution ;)

It didn't affect us because our sysv scripts called halt/reboot with --force anyway

Well played then :) Rebuilt upstart package is in koji.

We still end up re-executing init on shutdown, but this no longer creates this
issue. I may open another bug about that but for now its no big deal.

Casey Dahlin (cjdahlin) wrote :
tags: added: target-milestone-0.3
removed: target-release-0.3
Casey Dahlin (cjdahlin) on 2009-06-18
tags: removed: target-milestone-0.3
description: updated
Changed in upstart (Ubuntu):
importance: Undecided → Low
status: New → Triaged
Changed in upstart (Fedora):
status: Unknown → Fix Released

This looks like basically the right approach to me, grab the RUNLEVEL environment variable, otherwise look in utmp.

It'd be nice to make that a bit more generic, I think runlevel and telinit need the same code for things?

summary: - halt on shutdown should imply --force
+ reboot/poweroff/halt during shutdown should imply --force
summary: - reboot/poweroff/halt during shutdown should imply --force
+ reboot: should imply --force during shutdown

Won't fix this in 0.3 or 0.5, the fixed code has been committed (along with writing a shutdown wtmp record) to trunk.

Preparing packages of Upstart 0.6.0 for karmic

Changed in upstart (Ubuntu):
status: Triaged → In Progress
Changed in upstart:
milestone: none → 0.6.0
Download full text (6.7 KiB)

This has been fixed in Upstart 0.6.0.

0.6.0 2009-07-09 "How appropriate, you fight like a cow"

 * The licence for Upstart has been changed back to version 2 of the

 * D-Bus 1.2.15 is now required, this is the current GIT HEAD
   pending a 1.2.16 release.

 * Configuration paths have changed. Global configuration now
   resides in "/etc/init.conf" while jobs are now configured in

 * Job configuration filenames must now end in ".conf"

 * Default configuration files are now supplied in the "conf"
   sub-directory of the source, and installed into "/etc/init".

   These match the Debian/Ubuntu sysvinit configuration so may
   require some tweaking for other distributions, but provide an
   excellent base.

   The old example-jobs tarballs are deprecated.

 * The D-Bus interface remains unstable, to reflect this the current
   interface name has changed to "com.ubuntu.Upstart0_6" and the
   name of the job and instance interfaces have changed to match.

 * The "EmitEvent" D-Bus method gains a wait argument, when given
   as TRUE (the recommended setting) the method call will be blocked
   until all effects of the event have finished. When FALSE the
   method call will return once the event has been queued.

 * The "Start", "Stop" and "Restart" D-Bus methods of jobs and
   instances gain a similar wait argument.

 * The Upstart D-Bus object now has "version" and "log_priority"
   properties. The former is to obtain the version of the init daemon,
   the latter allows you to obtain and change the logging priority.

 * Job D-Bus objects now have "name", "description", "author" and
   "version" properties to obtain the job name and the contents of
   the equivalent job file fields for the others.

 * Instance D-Bus objects now have "name", "goal", "state" and
   "processes" properties to obtain the instance name, goal, state
   and list of running processes and their pids respectively.

 * The default D-Bus security policy now permits use of the "Get"
   methods by all users, including obtaining values of properties.

 * initctl has been rewritten with functionality more along the
   lines of Upstart 0.3.x than before; since many distributions are
   still shipping 0.3.x the summary of changes for the tool reflects
   both changes from 0.3.x and 0.5.x

 * The global "-p"/"--pid" argument has been dropped, since
   communication is over D-Bus. New "--system" and "--dest" arguments
   have been added to force communication over the system bus, and
   specify the destination, instead of using the private socket (this
   is the default when run as non-root to permit "list" and "status"
   to work for ordinary users).

 * The "-i"/"--id" and "--show-ids" options to commands have been
   dropped since jobs no longer have ids.

 * Since instances may now have names, these will be displayed in
   brackets after the job name when one is present. The output of
   the goal and state are now expressed as "start/running" instead
   of "(start) running" to disambiguate.

 * initctl "start" and "stop" now only output the final state of
   the job, not inte...


Changed in upstart:
assignee: nobody → Scott James Remnant (scott)
status: Fix Committed → Fix Released
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package upstart - 0.6.0-1

upstart (0.6.0-1) karmic; urgency=low

  * New upstream release ("How appropriate, you fight like a cow")
    - my customary changes list since pointless, it's basically a
      complete rewrite.
    - Handles /bin/sh symlink disappearing. LP: #65024.
    - Boot parameters may be passed to init scripts. LP: #74664.
    - reboot implies --force during shutdown. LP: #388738.
    - reboot no longer iterates /proc/ide. LP: #92685.
    - much improved documentation. LP: #60429, #72058, #388715.

  * Merge the various upstart packages into a single package, it makes
    little sense to have it all spread out.

 -- Scott James Remnant <email address hidden> Wed, 08 Jul 2009 23:12:03 +0100

Changed in upstart (Ubuntu):
status: In Progress → Fix Released
Changed in upstart (Fedora):
importance: Unknown → Low
To post a comment you must log in.
This report contains Public information  Edit
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.