A while back, I found myself running out of hardware and wanting to host more sites than I currently was. In addition, I wanted to create a little bit more redundancy for some of the services I host.
At the time, I was hosting a number of services with Xen. One physical server hosted 3 or 4 virtual servers. After a certain amount of reading over different solutions, I decided to convert all my production virtual servers to Linux-vserver. I’m not advocating either solution here. I’m simply going to point out my reasons for changing and hopefully help my readers understand the issue more.
Continue reading “Linux-Vserver vs Xen”
Have you ever had a process that dies on occasion? For me, I hate that situation and prefer to fix the software as opposed to have a monitor that restarts the process when it dies. I’ve run into a case lately however, that has defied me for a solution to my dying process. I think it may be a hardware related issue but haven’t tracked down the cause yet. Anyhow, I read an email on the Provo Linux User Group in which the poster referred to PS-Watcher. I thought I’d give it a try for kicks.
After installing the program and reading through the documentation, I found that PS-Watcher is really quite nice. In addition to monitoring the results of the ps command, you can add custom actions that occur at the beginning or ending of the monitor cycle ($PROLOG and $EPILOG). You can also customize actions to be taken based on the number of processes, memory size, and a few other useful metrics.
For most situations where you want to monitor a process and take action, I think PS-Watcher will probably do the job nicely. After all this however, I decided what I really wanted was a little script that did a custom restart of my particular web server when the test URL wasn’t functioning properly. I decided to simply run it on a scheduled interval with cron. I’ve placed the script below for all to glean information from or make fun of as appropriate. Feel free to provide some additional tips as I don’t claim to be a “Bash Jedi Master”. The following script sends a request to the web server and parses the response for a string that lets us know the server is working properly.
user="<the user my process is running under>"
okresp="^OK$" # I configured a test URL that returns OK if the server is up and running right.
# make a simple HTTP request to send
req="GET /lbuptest HTPP/1.0
# send it using netcat
resp=$(echo "$req" | nc localhost $port)
# test for the ok string
echo "$resp" | grep $okresp 2>&1 >> /dev/null && ok="1"
# you could really place whatever actions you want here.
if [[ $ok != "1" ]]; then
/etc/init.d/<my process init script> restart
The process I’m having trouble with is a TurboGears web application. I don’t think this is a Python problem however. Like I mentioned before, it only happens on this one server so I think I’ve got a hardware problem. Either way, if you found this page searching for TurboGears information, you might as well be interested in my TurboGears Init Scripts.
As of a couple days ago, ATI released their next drivers for Linux. The drivers were previously announced to be versioned 8.43.x but ATI has converted to a new numbering system that follows the popular YEAR.MONTH notation. The 7.11 drivers therefore accurately represent their release date in November, 2007 and are what would have been 8.43.x.
Anyway, there isn’t a Gentoo ebuild for these drivers and there may never be one. When I checked, there wasn’t even a bug filed to have one created. The 8.42.3 drivers eventually made it into portage as a masked package (~x86) with the consensus that they will never be marked stable. The 7.11 drivers will probably not even make it that far since the list of changes is rather minimal and nobody has posted any benefit to upgrading to them. You can read the Gentoo forum on the subject for more details if you like.
Anyway, it looks like we’ll be waiting for 8.1, or whatever the next release date happens to be, to find out if we finally get a faster AIGLX implementation for X.org.
Update: Well, I guess I called that one wrong. This morning my portage update contained an ebuild for ati-driver 8.433, which is the 7.11 driver I talked about in the article. I still don’t think there is much benefit to upgrading though.
If you run Gentoo Linux for your desktop, and you happen to favor the Gnome desktop environment, you may have noticed the incredible number of packages that need to be installed in order to install the gnome ebuild. The ability to pick and choose just those components you need for a system is one of the reasons I personally haven’t switched away from Gentoo to another Linux distribution. This ebuild however, seems to me to go somewhat against the original intent of the OS.
Continue reading “The perennially late Gentoo gnome-light ebuilds”
As part of a recent project, I had installed a lot of packages on a separate machine to test my configuration. As is common, with Gentoo, you want to run the following before you actually emerge anything:
emerge -p <package_name>
In this particular case, I noticed the dependency list was pretty long (50 packages to be exact). Instead of going ahead with the emerge, I first recorded the package list to a file for later reference:
emerge -p <package_name> --nospinner > dep.list
Now that I’m done with the project, I can clean up the packages I no longer need like this:
emerge -aC `cat dep.list | grep 'ebuild N' | cut -d ' ' -f 8`
Notice the grep. That is because a couple of the packages were simply upgraded and I don’t know that they aren’t needed. After a quick scan of the resulting list to see what is going to be uninstalled, I let emerge do the rest of the work.
Walla, no more 50 extra packages on that machine.