Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 04 May 98 12:23:42 -0400
From:      "A. Ling" <aling@alum.mit.edu>
To:        "FreeBSD-questions" <freebsd-questions@FreeBSD.ORG>
Subject:   automatic SQL daemon shutdown?
Message-ID:  <199805041623.MAA28608@min.net>

next in thread | raw e-mail | index | archive | help
   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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199805041623.MAA28608>