From owner-freebsd-questions@FreeBSD.ORG Sat Sep 10 16:27:16 2005 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 737F616A41F for ; Sat, 10 Sep 2005 16:27:16 +0000 (GMT) (envelope-from dan@dan.emsphone.com) Received: from dan.emsphone.com (dan.emsphone.com [199.67.51.101]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6FC9F43D72 for ; Sat, 10 Sep 2005 16:27:05 +0000 (GMT) (envelope-from dan@dan.emsphone.com) Received: (from dan@localhost) by dan.emsphone.com (8.13.1/8.13.3) id j8AGR3Fp037642; Sat, 10 Sep 2005 11:27:03 -0500 (CDT) (envelope-from dan) Date: Sat, 10 Sep 2005 11:27:02 -0500 From: Dan Nelson To: Gerard Seibert Message-ID: <20050910162702.GJ84582@dan.emsphone.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-OS: FreeBSD 5.4-STABLE X-message-flag: Outlook Error User-Agent: Mutt/1.5.10i Cc: freebsd-questions Subject: Re: Restarting MySQL from CRON X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Sep 2005 16:27:16 -0000 In the last episode (Sep 10), Gerard Seibert said: > From time to time, I have found that MySQL has ceased to run. I have > a mailing program that requires that MySQL be running in order for it > to operate. > > Since I cannot seem to track down why it occasionally stops > functioning, and since the program that depends on it is started via > CRON, would it be advisable to put an entry into the CRON that would > restart MYSQL prior to the other program running. > > I was thinking of using this: > > 0 0 * * * /usr/local/etc/rc.d/mysql-server.sh restart > > Would that work, or is there a better way? "start" is better than "restart", since that won't cause an existing mysqld to exit. But the startup script runs a script called mysqld_safe, which automatically restarts mysqld if it crashes anyway. You might want to check your mysql .err log; maybe someone with the SHUTDOWN privilege is doing a clean shutdown. -- Dan Nelson dnelson@allantgroup.com