Re: shutdown script

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



On Fri, 3 Dec 2010, m.roth@xxxxxxxxx wrote:

> To: CentOS mailing list <centos@xxxxxxxxxx>
> From: m.roth@xxxxxxxxx
> Subject: Re:  shutdown script
> 
> Michael D. Berger wrote:
>> I have a daemon that throws an exception whenever I shutdown or
>> reboot.  However, stopping it with kill -15, or calling the
>> stop command in its start stop script (in /etc/init.d/) results
>> in correct termination.
>>
>> Therefore, might it be that shutdown or reboot call an initial script
>> in which I can stop the daemon, and then delay a little?

Is this any good?

#! /bin/bash

# Bash script to perform a gracefull shutdown of apache web server
# called from /root/root-admin-scripts/databases/fedora-8-mysql/
# backup-mysql-databases.php
# DO NOT DELETE!
#------------------------------------------------------#

# seconds to wait for apache to shutdown
APACHE_GRACE_TIME=10

# output the current version of apache
apachectl -v
echo ""

# gracefully shut-down the apache web server
apachectl graceful-stop

echo "Shutting down Apache web server..."
echo "Waiting $APACHE_GRACE_TIME seconds for Apache web 
server to finish..."

# wait for apache to shutdown properly
sleep $APACHE_GRACE_TIME

exit 0

#------------------------------------------------------#

I wanted to shutdown Apache so it was not updating MySQL 
databases when the backup script ran ;)

Regards,

Keith Roberts

-- 
In theory, theory and practice are the same;
in practice they are not.

This email was sent from my laptop with Centos 5.5
_______________________________________________
CentOS mailing list
CentOS@xxxxxxxxxx
http://lists.centos.org/mailman/listinfo/centos


[Index of Archives]     [CentOS]     [CentOS Announce]     [CentOS Development]     [CentOS ARM Devel]     [CentOS Docs]     [CentOS Virtualization]     [Carrier Grade Linux]     [Linux Media]     [Asterisk]     [DCCP]     [Netdev]     [Xorg]     [Linux USB]
  Powered by Linux