Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
 Post subject: Scheduling a reboot
PostPosted: Fri Jan 07, 2011 10:45 am 
Offline
Newbie

Joined: Fri Jan 07, 2011 7:49 am
Posts: 2
Website: http://plasticboy.com/
When my Linode needs a reboot due to, say, a kernel upgrade, I'd like to be able to schedule that to happen at a convenient time. I think I should be able to do this with the "at" command like so:
Code:
echo "reboot" | at 06:00

However, whenever I use "reboot" or "shutdown -r 0", my Linode just shuts down, doesn't reboot, and I have to boot it manually from the Linode manager. Is this normal? How can I get my Linode to boot back up automatically?

I'm running Ubuntu 10.10


Top
   
 Post subject:
PostPosted: Fri Jan 07, 2011 10:50 am 
Offline
Senior Newbie

Joined: Wed Dec 29, 2010 5:39 pm
Posts: 12
did you enable Lassie in your Linode's settings? it will automatically reboot your server if it ever powers off.

_________________
nope


Top
   
 Post subject:
PostPosted: Fri Jan 07, 2011 11:43 am 
Offline
Newbie

Joined: Fri Jan 07, 2011 7:49 am
Posts: 2
Website: http://plasticboy.com/
Aha, thanks, that's exactly what I needed. I never noticed Lassie before.


Top
   
 Post subject:
PostPosted: Fri Jan 07, 2011 2:13 pm 
Offline
Senior Member
User avatar

Joined: Sat Aug 30, 2008 1:55 pm
Posts: 1739
Location: Rochester, New York
Also, you can call shutdown with a time:

shutdown -r 06:00
or:
shutdown -r +60 # to do it 60 minutes from now

And an optional message:

shutdown -r 06:00 "Reticulating splines"

If you have folks that use the shell, it will give them reminders that it is going down, and it will also prevent logins during the final 5 minutes.

(Lassie still applies, however :-)

_________________
Code:
/* TODO: need to add signature to posts */


Top
   
 Post subject:
PostPosted: Thu Jan 13, 2011 9:39 am 
Offline
Senior Member
User avatar

Joined: Mon Dec 10, 2007 4:30 pm
Posts: 341
Website: http://markwalling.org
Also, you can use ssh and Lish to send a reboot command right to the host. Just set up ssh keys to Lish, and vollia!

http://library.linode.com/eUmqlq explains more


Top
   
 Post subject:
PostPosted: Thu Jan 13, 2011 11:28 am 
Offline
Senior Member
User avatar

Joined: Tue May 26, 2009 3:29 pm
Posts: 1691
Location: Montreal, QC
I used to have such fun reticulating splines... The llamas were an obstacle, though, I must admit.

Why do you need to reboot nightly? Are you sure you need to reboot? You may be doing something that you think needs a reboot but which can actually be done without reboots.


Top
   
 Post subject:
PostPosted: Thu Jan 13, 2011 2:27 pm 
Offline
Senior Member

Joined: Fri Dec 07, 2007 1:37 am
Posts: 385
Location: NC, USA
Guspaz wrote:
Why do you need to reboot nightly? Are you sure you need to reboot? You may be doing something that you think needs a reboot but which can actually be done without reboots.

plasticboy wrote:
When my Linode needs a reboot due to, say, a kernel upgrade, I'd like to be able to schedule that to happen at a convenient time.


Top
   
 Post subject:
PostPosted: Fri Jan 14, 2011 11:23 am 
Offline
Senior Member
User avatar

Joined: Tue May 26, 2009 3:29 pm
Posts: 1691
Location: Montreal, QC
/me facepalms

Don't know how I missed that. There's also ksplice, which will get you kernel updates without rebooting. There's another thread somewhere around here about a guy who set it up on his linode. It does mean switching away from Linode's kernel, though.


Top
   
 Post subject:
PostPosted: Fri Jan 14, 2011 10:58 pm 
Offline
Senior Member

Joined: Sun Aug 02, 2009 1:32 pm
Posts: 222
Website: https://www.barkerjr.net
Location: Connecticut, USA
Why doesn't the server come back up after a reboot? Is there something wrong with the kernel that it's not sending the right signal to the host?


Top
   
 Post subject:
PostPosted: Sat Jan 15, 2011 9:13 am 
Offline
Senior Member
User avatar

Joined: Tue Nov 24, 2009 1:59 pm
Posts: 362
From what I've seen, "kernel shutdown" always powers down your Linode. No matter if you use shutdown -r/-h/-P (reboot/halt/poweroff), it ends up in a powerdown.
If you want a reboot, you can use the "reboot" command in Lish, which signals your init to do a graceful reboot just like the in-system "reboot" command does and restarts the Linode afterwards, or make sure you have Lassie enabled, and accept a bit longer delay before the system coming back up.
Lassie re-starts a Linode that has been powered off "from the inside" (as opposed to LISH or the manager interface), but it does it after a few minutes of delay.

PS. I heard you could use Linode API to issue a reboot command in an unattended way, but I don't know the details.

_________________
rsk, providing useless advice on the Internet since 2005.


Top
   
 Post subject:
PostPosted: Sat Jan 15, 2011 10:57 am 
Offline
Senior Member
User avatar

Joined: Sat Aug 30, 2008 1:55 pm
Posts: 1739
Location: Rochester, New York
Replacing $LINODE_API_KEY with your API key and $LINODE_ID with your Linode's numeric ID (LINODE_ID="12345"):

curl https://api.linode.com/?api_key=$LINODE_API_KEY\&api_action=linode.reboot\&linodeid=$LINODE_ID

I haven't tested this.

EDIT: or, of course, you can "ssh linode${LINODE_ID}@${LINODE_HOST}.linode.com reboot", but that requires knowledge of the Linode host server and pre-negotiated credentials.

_________________
Code:
/* TODO: need to add signature to posts */


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 9 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group