You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@spamassassin.apache.org by Joseph Acquisto <jo...@j4computers.com> on 2012/10/29 14:50:10 UTC

sa-update via cron

I get this error running sa-update via cron

"service: no such service /etc/init.d/spamd"

This appears to happen only when sa-update actually does an update.   I was running it twice a day, once at 00:30 and again at 06:00 (or so) and only the 00:30 would report this error.   The error show up in my email, as an admin/root message from the box.   Happened every day.

I commented out the 00:30 line and now the 06:00 one fails.   Tells me the one updating is the one failing. 

The actual cron command line is:

"/usr/bin/sa-update && /sbin/service /etc/init.d/spamd restart"


SA 3.3.2, opensuse 12.2

joe a.


Re: sa-update via cron

Posted by Martin Gregorie <ma...@gregorie.org>.
On Mon, 2012-10-29 at 09:50 -0400, Joseph Acquisto wrote:
> I get this error running sa-update via cron
> 
> "service: no such service /etc/init.d/spamd"
> 
> This appears to happen only when sa-update actually does an update.
> I was running it twice a day, once at 00:30 and again at 06:00 (or so)
> and only the 00:30 would report this error.   The error show up in my
> email, as an admin/root message from the box.   Happened every day.
> 
> I commented out the 00:30 line and now the 06:00 one fails.   Tells me
> the one updating is the one failing. 
> 
> The actual cron command line is:
> 
> "/usr/bin/sa-update && /sbin/service /etc/init.d/spamd restart"
> 
I use a special cron script, which I put into /etc/cron.daily 
It contains the following (between the '====' lines, obviously):

================================================================
#!/bin/bash
#
# Update the Spamassassin rules
#
sau=/usr/bin/sa-update

if [ -x $sau ]
then
	$sau
	err=$?
        case $err in
	0)	echo "Spamassassin rules update completed.";
		service spamassassin restart;
	        echo "Spamassassin restarted." ;;

	1)	echo "No Spamassassin rule updates available.";;

	2)	echo "Spamassassin rules updates available";
                echo "Site pre files lint check failed.";
		echo "Fix the files and try again.";;

	*)	echo "Spamassassin rules update failed: error=$err"
	esac
else
	echo "Error: $sau does not exist"
	exit 0
fi
================================================================

In my (Fedora 16) system the command to restart spamd is:
 
	service spamassassin restart

The 'spamassassin' script accepts the usual start|stop|restart arguments
and is kept in /etc/init.d

>From the looks of what you've tried, my script should work for you once
the spamd restart line is modified to suit SUSE. The line restarting
spamd is the second line in case 0 of the case structure and should
contain whatever command that, when run from a command line as root,
will restart spamd. I'd guess that "service spamd restart" should do the
trick for you, but try it out when logged in as root and then modify
that line accordingly.


Martin



Re: sa-update via cron

Posted by Bowie Bailey <Bo...@BUC.com>.
On 10/29/2012 9:50 AM, Joseph Acquisto wrote:
> I get this error running sa-update via cron
>
> "service: no such service /etc/init.d/spamd"
>
> This appears to happen only when sa-update actually does an update.   I was running it twice a day, once at 00:30 and again at 06:00 (or so) and only the 00:30 would report this error.   The error show up in my email, as an admin/root message from the box.   Happened every day.
>
> I commented out the 00:30 line and now the 06:00 one fails.   Tells me the one updating is the one failing.
>
> The actual cron command line is:
>
> "/usr/bin/sa-update && /sbin/service /etc/init.d/spamd restart"
>
>
> SA 3.3.2, opensuse 12.2

You don't provide a path to spamd.  Command should be:

"/usr/bin/sa-update && /sbin/service spamd restart"

-- 
Bowie