"mailscanner reload" for Solaris?

Jeff A. Earickson jaearick at COLBY.EDU
Fri Aug 12 12:05:52 IST 2005


Hi,
    My script (before yesterday) used pgrep and/or pkill.  "pgrep
MailScanner" gives all of the process numbers.  For a reload, I only
wanted the group leader.  I contemplated the "-o" option of pgrep/pkill
to only give me the oldest process to HUP.  But it makes more sense
(to me anyway) to use the info in the MailScanner.pid file.

Jeff Earickson

On Thu, 11 Aug 2005, Randy Fishel wrote:

> Date: Thu, 11 Aug 2005 23:05:08 -0700
> From: Randy Fishel <randyf at SIBERNET.COM>
> Reply-To: MailScanner mailing list <MAILSCANNER at JISCMAIL.AC.UK>
> To: MAILSCANNER at JISCMAIL.AC.UK
> Subject: Re: "mailscanner reload" for Solaris?
>
>  Solaris, for several releases now, has had a "pkill" command, such
> that:
>
>     pkill -HUP MailScanner
>
> will do the same thing without having to grep the process.  This is how
> my S10 SMF refresh method restarts MailScanner (though it handles the
> sendmail part by using the /var/run pid file).
>
> rf
>
> On Thu, 2005-08-11 at 21:16 +0100, Julian Field wrote:
>> Jeff A. Earickson wrote:
>>
>>> Julian,
>>>
>>> I was looking at Steve Swaney's Rules_Du_Jour install script,
>>> and his script does "/etc/init.d/MailScanner reload", probably
>>> in Linux-land.  My Solaris /etc/init.d script is attached, having
>>> not been touched in a long time.  What would a "reload" action
>>> be in Solaris?  Does MailScanner catch signals?
>>
>> Yes.
>>
>> Find the PID of MailScanner from the PID File setting in MailScanner.conf.
>> If this PID is 123 then do
>>
>> kill -HUP -123
>>
>> Note the -123 as opposed to 123. This will HUP the whole process group,
>> which all the children will catch and commit suicide. They are then
>> respawned by the parent, which ignores the HUP itself.
>>
>>
>>> #!/sbin/sh
>>> #
>>>
>>> #---prevent core dumps
>>> /usr/bin/ulimit -c 0
>>>
>>> case "$1" in
>>> start)
>>> 	#---v4
>>> 	(/opt/MailScanner/bin/check_mailscanner > /dev/null) && echo "mailscanner started"
>>> 	status=$?
>>> 	;;
>>> stop)
>>> 	kill `pgrep MailScanner` && echo "mailscanner stopped"
>>> 	status=$?
>>> 	;;
>>> *)
>>> 	echo "Usage: $0 {start|stop}"
>>> 	exit 1
>>> 	;;
>>> esac
>>>
>>> if [ $status != 0 ]; then
>>> 	echo "$status"
>>> 	exit 1
>>> fi
>>> exit 0
>>>
>>>
>>
>
> ------------------------ MailScanner list ------------------------
> To unsubscribe, email jiscmail at jiscmail.ac.uk with the words:
> 'leave mailscanner' in the body of the email.
> Before posting, read the Wiki (http://wiki.mailscanner.info/) and
> the archives (http://www.jiscmail.ac.uk/lists/mailscanner.html).
>
> Support MailScanner development - buy the book off the website!
>

------------------------ MailScanner list ------------------------
To unsubscribe, email jiscmail at jiscmail.ac.uk with the words:
'leave mailscanner' in the body of the email.
Before posting, read the Wiki (http://wiki.mailscanner.info/) and
the archives (http://www.jiscmail.ac.uk/lists/mailscanner.html).

Support MailScanner development - buy the book off the website!



More information about the MailScanner mailing list