Juju-reboot hook tool works on ubuntu but not on centos

I have created a simple test charm, using ubuntu focal and the lxd provider, and can verify that juju-reboot works as expected in that configuration.

Moving over to a MAAS cloud, and using centos7 as the os/series, juju-reboot seems to shut down the unit-agents, but doesn’t reboot the node.

24%20PM

juju-reboot and juju-reboot --now yield the same result, with the node never rebooting.

Any ideas on what is going on here, or how I might go about introspecting this further?

EDIT:

I ran another test, deploying my reboot test charm on a centos7 and on ubuntu focal using MAAS, and found that the focal node reboots as expected and the centos7 node (as expected) does not reboot.

41%20PM

1 Like

juju-reboot ends up calling at -f reboot.sh now, with reboot.sh being

#!/bin/bash
sleep 15
shutdown -r now

I don’t have CentOS but I imagine this is rather Debian-specific. Maybe it needs updating to call systemctl if systemd is pid 1.

@chipaca thanks for the response. bug filed here

thank you

shutdown is a pretty old command. I just spun up a CentOS machine and ran “shutdown -r now” on it, and all was well.

Something else must be breaking w/ juju reboot. :-/

Thanks. I verified this command works on centos7/8 boxes also.

The problem turns out how juju runs the shutdown command, not the command itself. Juju is running:
at -f <script> now. “at” is not installed on centos7 in my testing. After installing “at” and starting the service, juju-reboot worked for me.

sudo yum install at
sudo systemctl start atd

Working on the bug now to resolve. And find out why we didn’t surface any errors.

Update: An error was logged, but not in an expected way. juju debug-log did not work. Nor did checking logs on the controller. But a message did exist on the unit in /var/log/juju/machine-#.log:
machine-0.log:2020-10-22 20:08:11 INFO juju.cmd.jujud machine.go:649 Reboot: Error executing reboot: exec: "at": executable file not found in $PATH.
Needs improvement.

1 Like