Reloading config

James Gray james_gray at
Tue Feb 22 10:39:31 GMT 2005

    [ The following text is in the "iso-8859-1" character set. ]
    [ Your display is set for the "US-ASCII" character set.  ]
    [ Some characters may be displayed incorrectly. ]

On Tue, 22 Feb 2005 07:44 pm, Magnus Morén wrote:
> Hi,
> As a part of my "/etc/init.d/mailscanner" script i have the following
> lines for reloading the config (p334 in "The book"):
> 'reload')
>     echo "Reloading MailScanner config"
>     kill -HUP `cat /opt/MailScanner/var/`
>     ;;
> But when I run a "/etc/init.d/mailscanner reload" the config is not
> reloading and no signs of this in the log files. Nothing is happening
> when i run the kill on a command line either.

Where is you PID file in MailScanner.conf?  Mine says:
PID file = /var/run/

Are you sure `cat /opt/MailScanner/var/` isn't catting a 
non-existent file??  This may or may not generate an error depending on how 
the script is written... my init scripts only dump errors to syslog unless 
something catastrophic happens :P

> A "/etc/init.d/mailscanner restart" (-TERM) is needed to get the new
> config running.
> Am I missing something?

What does "ps" say?  (Column names inserted manually for Linux)

#ps -ef|grep MailScanner
User PID    PPID  C Date  TTY STIME    Command line
mail 19221     1  0 Feb18 ?   00:00:00 /usr/bin/perl \ 
        -I/opt/MailScanner/lib /opt/MailScanner/bin/MailScanner /opt/MailScanner/etc/MailScanner.conf
mail 29815 19221  1 21:17 ?   00:00:09 /usr/bin/perl \ 
        -I/opt/MailScanner/lib /opt/MailScanner/bin/MailScanner /opt/MailScanner/etc/MailScanner.conf

Notice the first process is the parent of the second (PPID = parent PID).  So 
in my case (above) PID #1 (init) spawned the MailScanner parent on PID 19221, 
then PID 19221 spawned the only MailScanner child this server runs on PID 
29815.  Your script should be finding the *FIRST* MailScanner PID (19221 in 
my case) when catting the PID file.  eg,

#cat /var/run/

Make sense?



------------------------ MailScanner list ------------------------
To unsubscribe, email jiscmail at with the words:
'leave mailscanner' in the body of the email.
Before posting, read the MAQ ( and
the archives (

Support MailScanner development - buy the book off the website!

More information about the MailScanner mailing list