noog Posted October 9, 2004 Share 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 Link to comment
MTA Team Blokker_1999 Posted October 9, 2004 MTA Team Share Posted October 9, 2004 trough a cron job that checks if it still runs and if not restarts it. Link to comment
Nutz Posted October 13, 2004 Share 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 Link to comment
Si|ent Posted October 13, 2004 Share Posted October 13, 2004 Thanks for that Nutz, I shall rename this topic slightly and move it to the Useful Topics section. Link to comment
Guest Posted May 20, 2006 Share 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] Link to comment
Jani Posted June 12, 2006 Share Posted June 12, 2006 I have a good script, add me on msn if you want me to send you it. Link to comment
Harry Posted June 13, 2006 Share Posted June 13, 2006 Why dont you just post it, or use the method above? Link to comment
Jani Posted June 13, 2006 Share Posted June 13, 2006 Very well. http://dedicated.janipewter.net/mta_run Link to comment
Tommis Posted February 1, 2007 Share 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 Link to comment
Recommended Posts