noog Posted October 9, 2004 Posted October 9, 2004 anyone know how i can get my (linux) mta server to automatically restart? it's been dying on it's own every now and again and I could do with a way of keeping it up (excuse the pun) so i dont have to login and start it Thanks
MTA Team Blokker_1999 Posted October 9, 2004 MTA Team Posted October 9, 2004 trough a cron job that checks if it still runs and if not restarts it.
Nutz Posted October 13, 2004 Posted October 13, 2004 This is the script I use to start mta, save logfiles and automatically restart when it dies (or is killed): #!/bin/sh log=watchdog.log dat=`date` mtavc="/home/mta/mtavc/MTAServer0.4.1" echo "${dat} watchdog script starting." >>${log} while true do if [ `ps -ax | grep -c '/home/mta/mtavc/MTAServer0.4.1'` -eq 0 ] then echo "${dat} Server exited, restarting..." >>${log} datstr=`date "+%Y-%m-%d-%H%M%S"` mv mtaserver.log ${datstr}.log ${mtavc} >/dev/null 2>&1 & fi sleep 30 done
Si|ent Posted October 13, 2004 Posted October 13, 2004 Thanks for that Nutz, I shall rename this topic slightly and move it to the Useful Topics section.
Guest Posted May 20, 2006 Posted May 20, 2006 anyone know how i can get my (linux) mta server to automatically restart? it's been dying on it's own every now and again and I could do with a way of keeping it up (excuse the pun) so i dont have to login and start it Thanks script is needed. if y didn't managed to do it, ask -- [email protected]
Jani Posted June 12, 2006 Posted June 12, 2006 I have a good script, add me on msn if you want me to send you it.
Tommis Posted February 1, 2007 Posted February 1, 2007 Hey, I know there is a couple downsides to "sleep", but it works fine for me. Using it with screen works perfectly, where you can just close the screen when your done with it. Take a look at "sleep" on good for more info Cya, Tommis
Recommended Posts