Rebooting from PuTTY / SSH

I've been doing the initial setup on an Ubuntu Linode, updated, upgraded, rebooted. And once I rebooted, it "took" a really long time to reboot, long enough for me to get on the Linode Manager, I rebooted from there and thats when it finally booted up again.

Reading around, there are a lot of pointers of doing it via an API call or through the CLI, tried rebooting through PuTTY a few times again and the behaviour is the same.

So my question is, can I reboot it from there? Or does it have to be an through API call?

If so, how would I schedule reboots, since I like to do it via a cronjob

4 Replies

From an ssh session or a cron job, the command is

sudo reboot

See: https://linux.die.net/man/8/reboot

It prob would be best if you installed an /etc/sudoers entry to allow whatever user's crontab initiates the reboot to do that without entering a password. See: https://linux.die.net/man/5/sudoers

<imho>
Unless you are building kernels or some such, scheduled reboots are a waste of yours and your VPSs time and those all-important electrons that make the whole thing work (conservation of energy and mass and all that)…

Just restart the services you're modifying. See: https://www.linux.org/docs/man1/systemctl.html
</imho>

-- sw

Yeah the scheduling a reboot is a bad practice I've been dragging for a long time now, but the issue arose when I rebooted to apply updates and got worried I had to go through the manager every time I'd want to reboot in any given case.

It's working now, I don't know what happened yesterday that even the LISH console was showing that there were no screens to be attached, and it didn't change until I rebooted through the option on the Linode Manager

Thank you

Usually, when I do reboots for upgrades, to speed things up I will log in through Lish, detach from the Linode, then issue a reboot job by entering reboot and pressing enter. This will issue a shutdown and boot job that are entered into the queue. At the moment, this is the fastest way I know of to do reboots. This is what the cloud manager does when you reboot the server from there, also.

It's working now, I don't know what happened yesterday that even the LISH console was showing that there were no screens to be attached, and it didn't change until I rebooted through the option on the Linode Manager

Linodes use a boot-monitor system called lassie to relay is-it-booting status to the Linode Manager. Sometimes it's not the fastest responder in the world…it catches up eventually but sometimes it just takes a few minutes/seconds.

For example, sometimes when I reboot, lassie and the Linode Manager show the Linode as "Running" when, according to the console output, it is in fact still booting.

Just one of those things, I suppose…I've never been much concerned about it.

-- sw

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