Upgrading A Headless Server?
Paul Bristow writes "I've been using a Headless Linux server at home for years and years, but I always find myself putting off doing a distro upgrade. It always means digging out the old graphics card, keyboard and monitor, dusting them off and plugging them in, just so I can have a console to upgrade on. Are there any linux distributions that will allow remote upgrades? You know, log in as root viua ssh, webmin, whatever, run upgrade prog, remotely reboot, off we go. ;-) I know I'm not the only one running a headless server, and I *know* how stable it is, but occasionally RedHat (in my case) come out with a nice new feature that I might want to upgrade for. Also, with just one server it might just be possible, but how do you upgrade a headless server farm?"
Nik posted this relevant article back in March about the PC Weasel, which sounds like a good way to do this, at the cost of a small hardware investment per box. Are there better ones?
(insertyoureditorhere,soidon'tstartaflamewaraboute ditors) /etc/apt/sources.list, change to what version you want
:P
apt-get update
apt-get upgrade
done.
you want debian
The distro you're looking for is Debian. The APT tools provide automated upgrading and installing without downtime or rebooting.
I haven't actually done it headless (as in no video card), yet, but I have completely re-installed without using the keyboard, mouse, video, or any serial port. The way I did this was the way I layed out the system in the first place. Partition 1 has a 63meg self-contained rescue/maintenance system. The remainder of the drive is partitioned for the primary OS. Scripts included in the rescue/maintenance system can do the partitioning, reboot to see the new partitions, format the new partitions, and load the new OS file tree from over the network.
Unfortunately, this isn't helpful for your existing Redhat system. But it shows some ideas for things that can be done.
now we need to go OSS in diesel cars
One "apt-get dist-upgrade" and you're away!
You can do it exactly like you said in your example in FreeBSD (I'm sure Open and Net are the same). Just SSH in, su to root, CVSup source, make world, build an updated kernel, and reboot. The last time I upgraded one of my webservers I did it (sorta) this way even though that machine does have a little mono monitor. I'm not aware of any Linux distro's that you can upgrade like this, but any BSD users with headless servers may be interested...
Seems like a null-modem and a laptop (or another box) acting as a temporary serial console is the trick. I could have sworn RH had support for upgrades over a serial console, but I can't seem to find any info. Anyone know more?
set video to none, in your bios. most of the time, it'll run without a video card in it then.
Debian can do this, as others have said, and I have actually DONE this with Debian (slink to potato) over ssh. You must remember to have _at least_ two ssh sessions open as root, I kept three just in case. The sshd upgrade was what scared me, but it handed off just fine. Of course, I had other problems...
I guess you could also create a Kickstart disk for Redhat and have it automatically install the newer Redhat.
I also have to ask: Why do you want to upgrade your headless box? It works, right?
-Percival
I don't know what distro you're using, but since there's a lot of debain-related info out there, there's also fezbox, a tool that lets you use the "kickstart" option of redhat.
:-(
Essentially, once you've used fezbox to create a kickstart install script, all you have to do is put the cd and a floppy disk with the config files in the pc, reboot it, and it just gets done. Again, I don't know if a PC will boot with no video/keyboard/etc, but there might be some way to disable this in the BIOS. worth a try...
btw, cheap linux cdz from cheapbytes.com, linuxmall.com, in case ur like me and don't have broadband
Have done this several times myself.
Just run rpm -Fhv *.rpm in your newer distro's RPM directory (e.g., /mnt/cdrom/RedHat/RPMS) and it will only upgrade those componenets that are install.
Heck, sometimes you don't even need to reboot! (although expect a few library issues until you do)
-- Bryan "TheBS" Smith
-- Bryan "TheBS" Smith
Independent Author, Consultant and Trainer
What you describe is exactly how my Linux (redhat) machine is set up. It has a video card, but no monitor and no keyboard (not even a switchbox) attached. The BIOS is set to "Halt on Critical Only (No KB)," and if yours doesn't have that setting, many BIOSes have a "Halt on No Errors" setting. It doesn't seem to care about video, and the only complaint I ever get from Linux are a couple messages in the bootup log saying "keyboard: Too many NACKs -- noisy kbd cable?"
---
I've got the same situation at my place. My main linux server is hidden behind the TV so that it's Ricochet wireless modem can get a good signal at the window (I live in a basement).
;-}
As long as your computer can boot by itself, i.e. no booting problems and it brings up the network you're golden.
Your RPMs are easy to upgrade - just 'rpm -Uvh pkgname'. No need to reboot, but I do say damn the uptime and reboot if you've seriously just changed every piece of code in the box
Kernel can be a bit trickier. Telnet in, and patch it first thing (Oh wait, you've got a stock redhat kernel? You could rpm -Uvh it, but i've got a certain fondness for going to ftp.kernel.org and grabbing the newest stable kernel(2.2.16 I believe). Then you can just patch it and recompile whenever you want - no icky redhatness to deal with.) After it's patched - either login through an X terminal and 'make xconfig'. If you're using telnet 'make menuconfig'.
I'm hoping you know what to do after that, but if you don't - drop by the linux document project. They've got a mirror at www.linuxhq.com. There's a Kernel-Upgrading HOWTO which pretty much says everything i've said - and more
slashdot username - at - email.domain.name