shutdown

I've been using "shutdown -r" on my linodes and it seems to be working fine. Is it okay to restart this way, or are there reasons we should use the dashboard/lish?

9 Replies

@kipkoan:

I've been using "shutdown -r" on my linodes and it seems to be working fine. Is it okay to restart this way, or are there reasons we should use the dashboard/lish?
Holy necromancy, Batman.

I think the reason it's 'working fine' is that Lassie is configured to reboot your node automatically when it unexpectedly shuts down. No harm done, but you might as well do it the 'proper' way.

How is rebooting in the dashboard anymore proper? Doing a reboot from within the linode does a safe shutdown, and lets lassie simulate the BIOS doing a soft reboot…

I'm not about to try this right now, but if you have Lassie enabled, wouldn't it start your Linode back up as soon as you shut it down from inside? On the other hand, if you shut it down from the Dashboard, Lassie will know that you don't want it rebooted. So there might be a difference if you're trying to turn your Linode off for a while and resize disk images, etc.

But again, this is just speculation because I'm not going to try it right now 8)

@hybinet:

… if you have Lassie enabled, wouldn't it start your Linode back up as soon as you shut it down from inside?
Yes – 'shutdown -h' from inside your Linode causes a reboot if Lassie is enabled. If Lassie is disabled, 'shutdown -r' powers off your Linode. Lassie-dependent 'not what it says on the tin'.

Right, and Lassie, which is enabled by default, unless I'm mistaken, is simulating the behaviour of a real computer for reboots…

I usually do sudo shutdown.

@Guspaz:

Right, and Lassie, which is enabled by default, unless I'm mistaken, is simulating the behaviour of a real computer for reboots…
Only if you have a real computer that always reboots regardless of how you shut down the system. Lassie is an unconditional restart if it sees the guest go down (without a manager shutdown job). Most regular systems need the reboot to be initiated by the same process doing the shut down. Lassie is more akin to a hardware power switch with watchdog wired up to a real computer.

Thus, as pclissold pointed out, you can do a regular shutdown (no reboot) from the guest, and Lassie will still initiate a restart. That caught me by surprise once with my first Linode when I did a shutdown from the guest so I could work with the disks, and didn't expect the Lassie restart, since I erroneously considered it a proper (not unexpected) shutdown. I'm not sure if the manager had the text it now does explaining that unexpected meant no prior shutdown job in the manager itself. (it's certainly plausible it did and I just missed it)

Anyway, essentially a maintenance shutdown has to be done from the manager (if Lassie is enabled). Though if you want the reboot, a guest shutdown (with Lassie) is certainly fine and as clean as through the manager. In that case the shutdown options won't matter - you're going to get a reboot regardless. A guest initiated shutdown is faster (in my experience) than a manager shutdown, but the Lassie restart is then slower than the restart job a manager reboot queues up, so not sure which reboot approach is faster overall.

– David

@Guspaz:

Right, and Lassie, which is enabled by default, unless I'm mistaken, is simulating the behaviour of a real computer for reboots…
'shutdown -h' halts the processor on a real computer – you have to power cycle it or do a hardware reset to restart it. Lassie starts it regardless.

That's still not really a reason not to use 'shutdown -r' or 'reboot'. Remember, we're talking about reboots here, not shutdowns.

That said, there's no particular reason you couldn't write a shell script to do reboots from inside a linode using the API. If you wanted to get fancy, you could even replace the system default shutdown command with a shell script that mapped it to Linode API equivalents.

Perhaps this is something Linode should do as one of the "xenify distro" options.

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct