From owner-freebsd-questions Mon May 4 09:24:13 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id JAA29263 for freebsd-questions-outgoing; Mon, 4 May 1998 09:24:13 -0700 (PDT) (envelope-from owner-freebsd-questions@FreeBSD.ORG) Received: from min.net (root@min.net [208.222.210.18]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id JAA29128 for ; Mon, 4 May 1998 09:23:52 -0700 (PDT) (envelope-from aling@alum.mit.edu) Received: from localhost (outpost.cc.nih.gov [137.187.245.138]) by min.net (8.8.7/8.7.3) with SMTP id MAA28608 for ; Mon, 4 May 1998 12:23:51 -0400 (EDT) Message-Id: <199805041623.MAA28608@min.net> From: "A. Ling" To: "FreeBSD-questions" Date: Mon, 04 May 98 12:23:42 -0400 Reply-To: "A. Ling" X-Mailer: Alexander Ling's Registered PMMail 1.53 For OS/2 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Subject: automatic SQL daemon shutdown? Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG I would like to have my Apache & MySQL servers exit gracefully whenever shutdown(8) runs, since MySQL documentation emphasizes that database corruption is likely whenever the daemon is not properly shut down. The init(8) man page talks about running /etc/rc.shutdown if it exists. Mine looks like this: #! /bin/sh # these lines are just a test to see if script ever given control /etc/logtest # Stop processing web requests kill -TERM `cat /usr/local/etc/httpd/logs/httpd.pid` # then stop MySQL daemon /usr/local/bin/mysqladmin -ppassword shutdown In turn /etc/logtest has only #! /bin/sh touch /var/log/testlog echo Check timestamp for last access >> /var/log/testlog The permissions look like this: -rwxr-xr-- 1 aling users 91 May 4 11:47 /etc/logtest -rwxr-x--- 1 root wheel 245 May 4 11:49 /etc/rc.shutdown I can manually invoke (as root) /etc/logtest, then find /var/log/testlog with appropriate contents & timestamp. But if I instead do shutdown -r +1, /var/log/testlog is never created. Anyone with suggestions as to what I'm doing wrong? I think /var should still be mounted when rc.shutdown gets control, and that /etc/rc.shutdown will be run as root. Just as I was surprised to find that entries in /usr/local/etc/rc.d need to be called *.sh (rather than just be executable), I imagine it's some little tidbit I've overlooked. FWIW, this is a 2.2.6R system. I've rebuilt the kernel, but only to enable ipfw(8). To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message