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


Reply via email to