My experience updating ubuntu servers

Wednesday, September 1st, 2010

I had a contract to update three linux servers at various locations for my client. Each server presented a different set of issues.

Ubuntu has really made these updates easy with the do-release-upgrade command, part of the update-manager-core package. Running the command does pretty well everything for you, and all you have to do is follow a couple of on-screen instructions.

The first server to update was a public webserver. It sits in the datacenter at Xmission, and houses several websites, a database server, and some dns services. This was on ubuntu 8.04, and I was migrating it to 10.04. I logged in from my house via SSH, ran the do-release-upgrade command and we were off to the races. I rebooted afterwards, and waited about 5 minutes. Sure enough I can even SSH back into the box. Then I realize that the upgrade removed my MTA and Database server as part of cleaning up unused packages. Really seems silly to me that is would do that. Thankfully just installing the database was enough, all the databases and users, etc. were still there. Then a fight with apache to actually read the virtualhosts and serve them right. I don’t know what I changed, but it worked.

The second was a backup server onsite. It was at ubuntu 9.04, but with two release upgrades I was running strong on the LTS. Everything else just seemed to work, so that was an easy done.

Last machine was an internal webserver, running some intercompany webapps. It also served as a MTA for the office, allowing copy machines to send mail. It has been the real pain. Upgraded remotely via ssh and it never came back after the reboot. When I physically got to the machine to check it out it was saying something I have never seen before. Grub was complaining that it couldn’t find /dev/mapper/root-device and would drop me to a busybox shell. But I could see /dev/mapper/root-device from the shell. I fought with this for a while. After something like 100 restarts I got the bright idea and just typed ‘exit’ at the busybox shell. Guess what!!! The machine started fine! I have no idea what the machines damage is, but from now on I just type exit when restarting the machine. Thankfully the server doesn’t restart very often, in fact, this update was the first time in 1 1/2 years that I have restarted it. But my trial was not over then. Last large issue was the /etc/network/interfaces file. It kept the old file, but then would not work right. Weirdest symptoms, I could get to the machine fine from 2 of our 5 subnets and the computer could not get to the outside world. I fought with it a while and finally just disabled one of the interfaces and renamed some of the alias’ and away we ran.

I guess the moral of the story is, no server update ever goes smooth. Thankfully I am done for two years.

Best FTP client ever

Saturday, December 6th, 2008

So, I have used all sorts of different FTP clients. I use them at work to get stuff to and from our web-server as I make changes to our website. So, just to show the list here are the names that I can think of: FireFTP, WsFTP, lftp, ftp (the actual cli), jftp, macromedia’s built in ftp client, and some others that I can’t remember the name of. But the one that I use now is yafc.

yafc stands for Yet Another FTP Client. But it really is good. Some of the features that I like are:
* Tab completion for both client side content and server side content. The server side is a little slow the first time, but after that it is really easy to move around with the tab completion stuff.
* Implied mput and mget. So, put actually puts all the listed files. Some with get. And, get * will get everything. Further get -r * will recursively get all directories so if you are picking up a new site this is an easy way to grab it all.
* Overwrite conformation. If I put a file that is already there it asks me if I really want to do that. I think this is nice for a couple of things. First, it tells you the date and time of the modifications for both the local and remote files. So, if multiple people are working on the site you would know if they made the change.
* Shows working path. Now there may be a sort of .bashrc file for ftp but, I like that is shows at the cursor my working path.

So, for what it is worth, I am thinking yafc is the best ftp client ever.

X11 forwarding over SSH

Monday, January 14th, 2008

Like most of us I have certain things on my home machine that I don’t have on the laptop, maybe a file, or I just like to manage things remotely so I can stay logged into chat. SSH with a Screen session has been awesome, and something that I have really liked. But, sometimes, editing a spreadsheet for example, it is really nice to just have a gui and use OOo.

Now I have used Vino (or VNC), and NX Machine, but those are insecure and have some slowdown to them. So, my brother-in-law sent me the following link: http://infectedproject.com/2007/07/09/forwarding-gnome-via-ssh/

It took me 4 minutes to set up because I already had SSH installed. I had to modify 6 characters and I was done! It only uses the SSH port and the standard X11 port (port 6000) to work. (That is one issue I had with NX Machine is it uses ports in the 1000 range to transfer session information in addition to ports 22 and 6000. )

So after the short modifications and a restart of the ssh deamon I ssh’d into my home machine with the laptop and then typed ‘gnome-session’ and away that we ran! It was quick, and didn’t pop up another window, was just exactly like I was at my desktop. Now, There are some draw backs that I haven’t overcome, and some things I haven’t tested. The sound is not brought to the remote machine. Also, it starts a new session. I have not figured out yet how to attach to a current running session, but I am sure that it would use the –choose-session parameter somehow. If anyone has anymore info there please feel free to leave a comment.

New love: SCREEN

Tuesday, October 9th, 2007

I decided to change the blog a little bit. I felt that the scope of the blog was too narrow, and I wasn’t really taking time with some of the subject matter (FreeBSD, I’m sorry). So, because I am always trying out new programs that I hear about I thought that I would share my experience on those also.

So todays subject: screen. This has got to be one of the coolest programs that I have run across in the open source world. Most will know what screens is, so I won’t take the time to go through it entirely. Just the brief: you can have multiple command lines each on their own “window”; or you can split that window into various “regions” to have a very interactive shell. So what you say, you can do that now with tabs. Here is the supper thing. You can then detach this screen session and re-attach it to a different machine. It is like you never left. You can also use it to have two computers hooked to the same shell. Great for tutorials and stuff. Also, ever run a server were you want a gui just for xterm so you can have the tabs. This is the way to go!

Now another cool thing, it is probably already installed on your system. It came by default on my ubuntu, Fedora 7, and openSUSE 10.3 machines.

For practical uses I have been playing around with irssi and centericq (thoughts pending on those) and while at work I ssh into my home box and us my chat/irc clients, run updates, download what I need, etc. Then at the end of the work day, I can disconnect the screen session, come home, reattach it on my home computer, and not miss a thing. Everything still running, downloads still going, nothing missed. Very cool.

In short, screen is awesome! To learn more use “man screen”