I think I can make that a little clearer. All of the below could be
compiled into one 'install-linux' script for distribution with the full
package.
1: type "ren /usr/local/assp/rc/start.dat
/usr/local/assp/rc/asspstart.dat". Do the same for stop.dat
1: type "ln -s /usr/local/assp/rc/*.dat /etc/init.d/"
2: type "chmod +x /usr/local/assp/rc/*.dat"
3: Open the assp web interface, goto: "Network Setup" and check "As a
Daemon". Click "Apply Changes"
Here is are a couple useful scripts for *nix utilizing the configuration
above:
A quick restartassp script:
1: edit a new file called /usr/local/assp/restartassp
2: put the lines "/etc/init.d/asspstop.dat", and
"/etc/init.d/asspstart.dat" in it.
3: save and type "chmod +x /usr/local/assp/restartassp"
4: type "ln -s /usr/local/assp/restartassp /usr/bin" to put it in your
system path.
Restarting all mail services.
1: edit a new file called /usr/local/assp/restartallmail
2: Do the same as above, replacing the command in step 2 with those
below. You will need to change the sendmail lines, replacing them with
whatever MTA you have. Remove the SMA line if you do not use sendmail.
3: repeat steps 3 and 4 above using the related script name.
/etc/init.d/crond stop
/etc/init.d/sendmail stop
/etc/init.d/clamsmtpd stop
/etc/init.d/asspstop.dat
killall sendmail
killall -w sma
killall -w perl
/etc/init.d/asspstart.dat
/etc/init.d/sendmail start
/etc/init.d/clamsmtpd start
/etc/init.d/crond start
Check to see if ASSP is running, and if not, restart. NOTE: this only
works if assp is the only perl process on the server.
1: Follow all steps above, placing the commands below in a new file
called "/usr/local/assp/checkprocess".
*NOTE* the line beginning with "echo" and ending with ",$OPSEMAIL" is
all one line. Make sure it is saved as such/no line wrap.
2: Configure cron to run this process every five minutes(or more
frequently if you like). Cron configuration varies by distribution, and
is beyond the scope of these instruction. A suggested place to start
looking is in "/etc/crontab". Also run "man crontab" for crontab
documentation.
#!/bin/sh
# This file checks for clam av, and any other process you want, to see
if it is running. It will restart it if it is not.
checkproc()
{
# checkproc <process name> <restart command>
BASEN=`/bin/basename $1`
if [ $# -lt 2 ]
then
echo "Not enough parmeters passed to $0"
else
PK=`ps -ax | grep -v grep | grep -c "$1"`
if [ "$PK" == "0" ]
then
if [ -f /var/run/checkprocess/$BASEN ]
then
CNT=`cat /var/run/checkprocess/$BASEN`
if [ "$CNT" == "" ]
then
CNT=0
fi
else
CNT=0
fi
if [ $CNT -gt $RESTARTLIMIT ]
then
echo "We have attempted to restart the
process $1 on `/bin/hostname` at least $CNT times but it does not appear
to be running still. Please check into this on `/bin/hostname`" |
/bin/mail -s "Error restarting process: $1 at `/bin/date` on
`/bin/hostname`" $ALERTEMAIL,$OPSEMAIL
/usr/bin/logger -t "$0" "Process not
running: $1 - Restart limit reached - $CNT"
else
$2 | mail -s "$1 was not running at
`/bin/date` on `/bin/hostname`. Process restarted" $ALERTEMAIL
/usr/bin/logger -t "$0" "Process not
running: $1 - Attempted automatic restart"
CNT=`/usr/bin/expr $CNT + 1`
fi
else
CNT=0
fi
echo $CNT > /var/run/checkprocess/$BASEN
fi
}
# start of main - #
export [EMAIL PROTECTED]
export [EMAIL PROTECTED]
export RESTARTLIMIT=10
if [ ! -f /var/run/checkprocess ]
then
mkdir -p /var/run/checkprocess
fi
checkproc clamd "/etc/rc.d/init.d/clamav restart"
#checkproc clamav-milter "/etc/rc.d/init.d/clamav restart"
#checkproc clamsmtpd "/usr/local/bin/restartclamsmtpd"
checkproc freshclam "/etc/rc.d/init.d/clamav restart"
checkproc perl "/etc/init.d/assprestart.dat"
checkproc sendmail "/etc/rc.d/init.d/sendmail restart"
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Micheal
Espinola Jr
Sent: Thursday, November 30, 2006 12:55 PM
To: Questions and Answers for users of ASSP Anti-Spam SMTP Proxy
Subject: Re: [Assp-user] how to use assp such as service on linux
This would be great as part of a Quick Start article on the Wiki.
For instance:
http://www.asspsmtp.org/wiki/Quick_Start_for_Linux?action=edit
You could use the Win32 article as a reference for format, etc:
http://www.asspsmtp.org/wiki/Quick_Start_for_Win32
Graziano wrote:
> For me this works perfectly
>
> -requirements
> assp should be installed on /usr/local/assp
>
>
> 1) upload start and stop on /usr/local/assp
> 2) chmod 755 start and stop
> 3) upload assp on /etc/rc.d/init.d 4) chmod 755 assp
> 5) on assp web interface select to run assp as a demom
> 6) kill all assp processes
>
> now try if it works with
> service assp start
> and
> service assp status
> and
> service assp restart
>
> 7) if all works you can add to your startup list with
> chkconfig --add assp
>
> done.
>
> I am writing this guide because the files on /usr/local/assp/rc seems
> to be outdated and didn't work for me.
>
> Graziano
>
>
>
>
------------------------------------------------------------------------
>
> #!/bin/sh
> #
> # 'stop' - Shell script a la RedHat initialization routines
> # R. Toth - May/2003
> # V1.00 - Initial attempt at creating a fully compatible and compliant
> # shutdown script that's called out of '/etc/init.d' (linked
appropriately
> # to the rc-level you are running in. You can link this as 'K31assp',
so that ASSP is
> # terminated just after 'sendmail', in case you are also
> # running sendmail locally for your Email needs.
> #
>
> if [ "$1" = "" ]
> then
> BASE=/usr/local/assp;
> else
> BASE=$1;
> fi
> export BASE
> echo Starting ASSP Anti-SPAM Proxy server in $BASE
> trap '' 1
> LANG=
> export LANG
> exec /usr/bin/perl $BASE/assp.pl $BASE
>
>
------------------------------------------------------------------------
>
> #!/bin/sh
> if [ "$1" = "" ]
> then
> BASE=/usr/local/assp;
> else
> BASE=$1;
> fi
> export BASE
> echo Stopping ASSP Anti-SPAM Proxy server in $BASE
> pidfile=$BASE/pid
> kill `cat $pidfile`
>
>
------------------------------------------------------------------------
>
>
------------------------------------------------------------------------
-
> Take Surveys. Earn Cash. Influence the Future of IT
> Join SourceForge.net's Techsay panel and you'll get the chance to
share your
> opinions on IT & business topics through brief surveys - and earn cash
>
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDE
V
>
------------------------------------------------------------------------
>
> _______________________________________________
> Assp-user mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/assp-user
>
------------------------------------------------------------------------
-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share
your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDE
V
_______________________________________________
Assp-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/assp-user
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Assp-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/assp-user