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

Re: Question about the SPEC file %pre section.



On 10/13/05, Ray Charles <raycharles_man yahoo com> wrote:
> Hi,
> Didn't hear anything from my original post so i am at
> the well again....
>
> I am building a new squid rpm and I want the rpm to
> gracefully (rather than just kill -9) shutdown the
> current running squid daemon, when the admins do the
> upgrade of squid using my new squid.rpm.  This is on a
> redhat-el-3.4 box.
>
> Will doing something in the %pre section like this
> acheive what i want??
> /sbin/service squid stop
> sleep 300
Sure, but 5 minutes is a long time.  A better approach would be to
monitor the squid daemon (or daemons, I've never used) via ps in a
while loop until they are all gone.  Something like:

while ps -ef squidd   # Don't know the daemon name
do
    sleep 1
done

This way it should only wait as long as it really takes to shut it
down, and if it happens to take longer than 5 minutes you'll handle
that also.

Cheers...james
>
> I need this because Squid takes a long time, about
> 3minutes to clean up after itself before it shuts
> down.
>
> Thanks in advance folks!
>
>
>
>
>
> __________________________________
> Yahoo! Mail - PC Magazine Editors' Choice 2005
> http://mail.yahoo.com
>
> _______________________________________________
> Rpm-list mailing list
> Rpm-list redhat com
> https://www.redhat.com/mailman/listinfo/rpm-list
>


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