Archive for June 21st, 2010

rewrite_subject and subject_tag has been substituted for spamassassin version 3.x to rewrite_header Subject

Monday, June 21st, 2010

While I was checking one of the spamassassin daemon that I have installed in the past for configuration errors in loca.cf and the other loaded spamassassin conf rules file, I have faced the following error:

This warnings appeared when I was checking my spamassassin configuration using the command:

debian-server:~# spamassassin --lint

Issuing the up-mentioned command returned the following warnings:

[18056] warn: config: failed to parse line, skipping, in “/etc/spamassassin/local.cf”: rewrite_subject 1[18056] warn: config: failed to parse line, skipping, in “/etc/spamassassin/local.cf”: subject_tag [SPAM found in message][18056] warn: lint: 2 issues detected, please rerun with debug enabled for more information

A quick search in google for the error opened my eyes that actually I’m using old and obsolete spamassassin directives in my /etc/mail/spamassassin/local.cf

Starting with version 3.x of spamassassin different syntax is used to tag cought spam messages and substitute them for a different custom selected header.

1. To solve the issue all I had to edit my /etc/mail/spamassassin/local.cf

2. Comment out or delete in the local.cf file:

rewrite_subject 1
subject_tag [SPAM found in message]

So after the change the two directives should be with the shebang shebang, e.g.:

#rewrite_subject 1
#subject_tag [SPAM found in message]

3. Now include the spamassassin substitute for rewrite_subject and subject_tag rewrite_header Subject

For instance put in local.cf something like:

rewrite_header Subject *****SPAM*****
Now restart your spamassassin either by invoking /etc/init.d/spamassassin restart if it’s running as a stand alone daemon or if it’s ran through daemontools my will have to restart it with svc, like for instance:

debian-server:~# svc -d /service/spamd
debian-server:~# svc -t /service/spamd
debian-server:~# svc -u /service/spamd

The warning messages:

[18056] warn: config: failed to parse line, skipping, in “/etc/spamassassin/local.cf”: rewrite_subject 1[18056] warn: config: failed to parse line, skipping, in “/etc/spamassassin/local.cf”: subject_tag [SPAM found in message][18056] warn: lint: 2 issues detected, please rerun with debug enabled for more informationshould no longer appear whilst you check your spamassassin configuration 🙂

How to automatically reboot (restart) Debian GNU Lenny / Squeeze Linux on kernel panic, some general CPU overload or system crash

Monday, June 21st, 2010

If you are a system administrator, you have probably wondered at least once ohw to configure your Linux server to automatically reboot itself if it crashes, is going through a mass CPU overload, e.g. the server load average “hits the sky”.
I just learned from a nice article found here that there is a kernel variable which when enabled takes care to automatically restart a crashed server with the terrible Kernel Panic message we all know.

The variable I’m taking about is kernel.panic for instance kernel.panic = 20 would instruct your GNU Linux kernel to automatically reboot if it experiences a kernel panic system crash within a time limit of 20 seconds.

To start using the auto-reboot linux capabilities on a kernel panic occurance just set the variable to /etc/sysctl.conf

debian-server:~# echo 'kernel.panic = 20' >> /etc/sysctl.conf

Now we will also have to enable the variable to start being use on the system, so execute:

debian-server:~# sysctl -p There you go automatic system reboots on kernel panics is now on.
Now to further assure yourself the linux server you’re responsible of will automatically restart itself on a emergency situation like a system overload I suggest you check Watchdog

You might consider checking out this auto reboot tutorial which explains in simple words how watchdog is installed and configured.
On Debian installing and maintaining watchdog is really simple and comes to installing and enabling the watchdog system service, right afteryou made two changes in it’s configuration file /etc/watchdog.conf

To do so execute:

debian-server:~# apt-get install watchdog
debian-server:~# echo "file = /var/log/messages" >> /etc/watchdog.conf
debian-server:~# echo "watchdog-device = /dev/watchdog" >> /etc/watchdog.conf

Well that should be it, you might also need to load some kernel module to monitor your watchdog.
On my system the kernel modules related to watchdog are located in:

/lib/modules/2.6.26-2-amd64/kernel/drivers/watchdog/
If not then you should certainly try the software watchdog linux kernel module called softdog , to do so issue:
debian-server:~# /sbin/modprobe softdog

It’s best if you load the module while the softdog daemon is disabled.
If you consider auto loadig the softdog software watchdog kernel driver you should exec:

debian-server:~# echo 'softdog' >> /etc/modules

Finally a start of the watchdog is necessery:

 


debian-server:~# /etc/init.d/watchdog start
Stopping watchdog keepalive daemon....
Starting watchdog daemon....

That should be all your automatic system reboots should be now on! 🙂