checkprocess.sh – Check process & restart

Posted on .

I have a process that has been crashing every few days, but needs to be running 24/7 to be effective. Until I find the time to seek out the cause, I need the process to be restarted.

This short SH script uses PS to check that the process is running, and if not, runs the given init-script to restart the service.

Syntax:

checkprocess.sh [process] [init-script]

Example:

checkprocess.sh myprocess /etc/init.d/myprocess

checkprocess.sh writes a log at /var/log/checkprocess.log, and sends an alert mail to root should the process require restarting.

Put the checkprocess.sh command into crontab to check regular for the crashed process. For debian the crontab entry would look similar to:
*/1 * * * * root /usr/local/bin/checkprocess.sh mythbackend /etc/init.d/myth-backend

Download
  checkprocess.sh (723 bytes, 2,377 hits)

exiv2 — compile issue

Posted on .

Being given a DVD of photos, I ran my exifsort script to sort the images into date stamped folders and found the camera that had taken the pictures had the year set to 2026.

I came accross a handy utility to modify the EXIF timestamp of the images called exiv2 at www.exiv2.org. Unfortunately Debians repository is horribly out of date, so I grabbed the source from their site.

I began with a ./configure and came accross this error:

configure: error: either specify a valid expat installation with --with-expat=DIR or disable XMP support with --disable-xmp

It was easily fixed by installing the libexpat1-dev package,
apt-get install libexpat1-dev

Exiv2 compiled nicely after that.

Battlefield 2 Widescreen Resolution

Posted on .

Out of the box, Battlefield 2 doesn’t support widescreen resolutions. However it does support setting the resolution on the command-line.

Modify the shortcut to add +szx and +szy resolution parameters,
"C:\Games\Battlefield 2\BF2.exe" +menu 1 +fullscreen 1 +szx 1680 +szy 1050

It also works with 1920×1200 resolution.