FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > CentOS > CentOS

 
 
LinkBack Thread Tools
 
Old 12-03-2010, 07:36 PM
"Michael D. Berger"
 
Default shutdown script

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?

Thanks,
Mike.

_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 
Old 12-03-2010, 07:43 PM
 
Default 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?

Wait - what I get from what you say, above, is that it's not killed by its
script in /etc/init.d: why not? What's the output from chkconfig --list
<servicename>?

mark

_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 
Old 12-03-2010, 08:10 PM
"Michael D. Berger"
 
Default shutdown script

On Fri, 03 Dec 2010 15:43:10 -0500, m.roth-x6lchVBUigD1P9xLtpHBDw wrote:

> 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?
>
> Wait - what I get from what you say, above, is that it's not killed by
> its script in /etc/init.d: why not? What's the output from chkconfig
> --list <servicename>?
>
> mark

No, chkconfig returns the correct result, and the proper links appear
in /etc/rc.d/... . The daemon is complex, and there is plenty
that might slow down a shutdown. BTW, its control script contains:

# chkconfig: 35 97 3

so am giving it plenty of time, but perhaps not enough. Furthermore,
the daemon name appears in the shutdown listing in the expected way.

Mike.

_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 
Old 12-03-2010, 10:20 PM
Keith Roberts
 
Default shutdown script

On Fri, 3 Dec 2010, m.roth@5-cent.us wrote:

> To: CentOS mailing list <centos@centos.org>
> From: m.roth@5-cent.us
> Subject: Re: [CentOS] 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@centos.org
http://lists.centos.org/mailman/listinfo/centos
 
Old 12-03-2010, 10:45 PM
"Michael D. Berger"
 
Default shutdown script

On Fri, 03 Dec 2010 23:20:17 +0000, Keith Roberts wrote:

> On Fri, 3 Dec 2010, m.roth@5-cent.us
> wrote:
>
[...]
> 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

I could write a script that shuts down my client and then calls
shutdown, but I was hoping to call a script from the shutdown
procedure that would complete before the rest of the shutdown.

Mike.

_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 

Thread Tools




All times are GMT. The time now is 07:03 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org