[Bug 1670291] Re: Landscape: Upgrade 14.04.5 to 16.04.2 fails unable to reboot

Dave Jones dave.jones at canonical.com
Tue Sep 4 10:35:57 UTC 2018


> /sbin/shutdown, post upgrade not working, imho is a severe bug

I suspect no-one's bothered to report it because as soon as the machine
is (somehow) rebooted, the issue goes away (and reproduction then
involves the pain of going through a trusty install + xenial upgrade
cycle). Still, I'm not entirely convinced this *is* a bug; I'll come
back to this in a bit below...

> I guess the scheduling of timeout is failing, but /sbin/shutdown now
works?

I thought I'd tested this and concluded it didn't, but it turns out I
just didn't wait long enough. When trying "shutdown -r now" there's a
fair delay, then it complains about a connection time out, exits with an
error, and the system reboots anyway!

    ubuntu at client1:~$ sudo shutdown -r now
    Failed to start reboot.target: Connection timed out
    See system logs and 'systemctl status reboot.target' for details.
    ubuntu at client1:~$ packet_write_wait: Connection to 10.123.236.170 port 22: Broken pipe

So, it is mostly likely the scheduling portion that's failing, and if
given an immediate request the operation does still work. I haven't got
time to test the -h switch as well, but I'd assume it's probably a
similar story.

Now consider those two cases from the perspective of a human
administrator:

If you've typed "shutdown -r now" you're expecting an immediate reboot.
Even if some bits of the shutdown command fail, you still expect it to
do what you asked: reboot immediately. However, if you've just typed
"shutdown -r +5" you're expecting a 5 minute delay before reboot. If it
can't schedule that delay would you rather it exit with an error and
tell you, or just immediately reboot the system? Probably the former
given you're not expecting an immediate reboot.

The issue in this case was that it isn't a human scheduling the reboot
(directly) and the only reason landscape uses the schedule at all is to
determine whether the shutdown command has (likely) worked. Which is a
bit of an abuse of the shutdown command's scheduling facility, but I
can't think of a better way off the top of my head (that'll reliably
work in all implementations).

Anyway, in landscape's case we *would* rather the system immediately
reboots when shutdown fails because the delay's only there for the
Landscape client's benefit, and we can't guarantee the administrator has
any other means of accessing the system for the purpose of rebooting it.
So in a sense we're dealing with an interface mismatch: shutdown is
(understandably) written for the (direct) use of a human administrator,
and landscape is (ab)using it to provide reboot/poweroff facilities on
(indirect) behalf of a human administrator.

So we come back to "I can't think of a better way of doing it" (that'll
reliably work in all our aforementioned scenarios of upstart, systemd,
and post-upgrade-almost-sort-of-systemd).

> Re differences between halt & poweroff, in systemd, eventually it results in:
> [snip]

Yes, but have a look at the arg parsing earlier on
(https://github.com/systemd/systemd/blob/master/src/systemctl/systemctl.c#L8069):

    case 'h':
            if (arg_action != ACTION_HALT)
                    arg_action = ACTION_POWEROFF;
            break;

In systemd, the -H and --halt options mean halt, but -h is just an alias
for -P and --poweroff (unless -H or --halt also appear in the argument
list ... which looks a bit weird to me, but it is what their man-page
states as well, so I guess it's intentional?). I haven't dug into
upstart's implementation but I assume from your comments that it's
different, and that -h actually means halt.

Thanks for the link on the differences between halt and power-off - I'd
not seen that before!

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to systemd in Ubuntu.
https://bugs.launchpad.net/bugs/1670291

Title:
  Landscape: Upgrade 14.04.5 to 16.04.2 fails unable to reboot

Status in landscape-client package in Ubuntu:
  Fix Committed
Status in systemd package in Ubuntu:
  Incomplete
Status in landscape-client source package in Xenial:
  Confirmed
Status in systemd source package in Xenial:
  Incomplete

Bug description:
  Used Landscape (Paid Canonical Subscription) to upgrade one of my
  machines.

  Landscape only shows "In Progress" for more than 8 hours now and asked
  for a reboot of the machine in a second alert.

  In the reboot attempt I get the message:
  =========================
  Failed to set wall message, ignoring: Method "SetWallMessage" with signature "sb" on interface "org.freedesktop.login1.Manager" doesn't exist
  Failed to call ScheduleShutdown in logind, proceeding with immediate shutdown: Method "ScheduleShutdown" with signature "st" on interface "org.freedesktop.login1.Manager" doesn't exist
  =========================

  Steps to reproduce:
  * Fully updated 14.04.5 machine
  * Open Landscape
  * Choose the machine
  * Choose Packages
  * This computer can be upgraded to a newer release
  * Apply
  * Wait 2 hours
  * Alert comes in a seperate Landscape message Machine is ready for reboot
  * Choose Info... Power
  * Deliver to selected computers as soon as possible
  * Error message

  I found this thread on reddit about this issue maybe the solution can be built into the upgrade script
  https://www.reddit.com/r/linuxquestions/comments/4wy3go/trying_to_run_as_user_instance_but_the_system_has/

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/landscape-client/+bug/1670291/+subscriptions



More information about the foundations-bugs mailing list