# Amavisd stopping/restarting

## yaman666

Around 3:40 in the morning amavisd stopped working and all the postfix messages started getting queued up instead of being delivered with the error message:

```
Nov 15 03:39:04 rum postfix/lmtp[6601]: F19E36C4CB: to=<xx@xxxxxxxxxxx.com>, relay=none, delay=1, status=deferred (connect to 127.0.0.1[127.0.0.1]: Connection refused)
```

Restarting amavis seemed to help. The only relevant log entry I could find is :

```
Nov 15 03:37:40 rum rc-scripts: ERROR:  amavisd failed to stop
```

Any ideas what may have tried to stop it?

Thanks!

----------

## defenderBG

can you post your firewall config pls

probably the loopback address is not fully enabled...

if you allow all traffic goind from lo to lo it might work

----------

## elgato319

 *Quote:*   

> 
> 
> Any ideas what may have tried to stop it? 
> 
> 

 

maybe logrotate tried to stop it?

cron.daily should start around that time

----------

## yaman666

I thought about that and checked logrotate config files but none of them list amavisd. The only thing they restart is syslog-ng, and I doubt it has amavisd as a dependency.

----------

## richard.scott

Hi,

i've been having the exact same problem.  :Crying or Very sad: 

I've figured it out to be caused by rulesdujour wanting to reload amavisd when it downloads new config files for spamassassin.

I'd changed the following in my /etc/rulesdujour/config form this:

```
SA_RESTART="/etc/init.d/spamd restart"
```

to this:

```
SA_RESTART="/etc/init.d/amavisd restart"
```

For some reason tho, the daemon doesn't seem to shutdown correctly!

I think I'm going to remove that and write a restart script of my own that checks the daemon comes back up again.  :Wink: 

----------

## richard.scott

ok, just been hunting on the forums and found this command:

```
/usr/sbin/amavisd reload
```

I'm going to change my SA_RESTART config to use that instead

```
SA_RESTART="/usr/sbin/amavisd reload"
```

fingers crossed   :Rolling Eyes: 

----------

## yaman666

I thought about the possibility of rulesdujour but didn't realize they were restarting amavis. I thought they simply updated themselves via cron job. I will definitely take a look at it - thanks for the tip!  :Smile: 

----------

## hanj

 *richard.scott wrote:*   

> ok, just been hunting on the forums and found this command:
> 
> ```
> /usr/sbin/amavisd reload
> ```
> ...

 

Reload doesn't appear to be a valid arg...

```
Feb 11 09:30:57 comp rc-scripts: ERROR: wrong args ( reload )

Feb 11 09:30:57 comp rc-scripts: Usage: amavisd {start|stop|restart }

Feb 11 09:30:57 comp rc-scripts:        amavisd without arguments for full help
```

hanji

----------

## bunder

amavis takes forever to shut down.  try running /etc/init.d/amavisd-new stop twice.  the second time it should stop.

cheers

----------

