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?
Buy a KVM switch. I've got a Belkin Omni 4-port. Now when I need to, I switch over to the server. No more fuddling with cables try to reach around to the back of the server box and all that. It's already plugged into my current keyboard/mouse/monitor.
http://slashdot.org/~tf23/journal
(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?
I'm not sure but i think what he's looking for is something that doesn't require a reboot, since most machines won't boot without a keyboard/monitor. I really think what you're looking for here is debian, granted you won't be able to upgrade the kernel without rebooting, you'll still have a quick and easy way to upgrade the entire distrobution(-kernel) without rebooting or attaching a keyboard/monitor. Also with debian there's no need to download all the packages yourself, apt does that for you: apt-get update apt-get upgrade
Debian has great support for over-the-network upgrades, since it doesn't require (nor have...) many graphical upgrade or installation programs. For the paranoid, who want to see what happens to the machine after a reboot, the standard Serial Console support of the kernel and LILO are great. For a quick reference on setting these up, there's a file in the kernel DOCUMENTATION directory. BIOS changes are not possible without some special hardware, but everything else works. This is also a must if all of your expansion slots are used...
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
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
I'd go with (and do) Debian GNU/Linux. Besides the fact I'm addicted to it, it is the most stable and can be easily upgraded (minus kernel) without rebooting.
/etc/apt/sources.list with your favorite editor to make it point to whichever release you want.
Here is what you will want to do once you've got Debian GNU/Linux installed:
edit
apt-get clean (to purge already downloaded and probably outdated files)
apt-get update (to update the packages list)
apt-get -f upgrade (to upgrade most packages, skipping things like major libs - the -f tells apt it should try to fix dependancies)
apt-get -f dist-upgrade (to do a full system-wide upgrade of all packages)
logout, login. done! (unless you upgraded the kernel, then you'll have to reboot).
Enjoy!
{Free,Net,Open}BSD all support serial port consoles during the boot phase, something that Linux has been lacking. Just plug in a serial cable to one of your favorite /dev/cuaa* ports and there you go.
I'll try the rpm methods of upgrading the redhat distro. But, for the longer term, I'll take a look at debian (I know I left that test partition on one of these drives...). Then maybe I'll post a HOWTO.
- Paul