[rhn-users] shutdown services when upgrading

Curtis Doty Curtis at GreenKey.net
Fri Jun 10 22:00:32 UTC 2005


Rich Graves wrote:

>On Fri, 10 Jun 2005, Jim Pelton wrote:
>  
>
>>So I'm trying to develop a good strategy for updating (with up2date) 
>>some web servers and several other production level boxes.  My question 
>>arose out of the need to update httpd on the web farm.  If I go ahead 
>>and update, will the rpm %pre and %post scripts (or whatever does this 
>>type of thing) shutdown the httpd service, update and then bring it back 
>>up?
>>    
>>
>You can choose not to run scripts by giving rpm the --noscripts option.
>
>I'm not entirely sure what the $1 below refers to. I do know that just
>  
>
Wrongheaded.

>about every time I update bind, it has done the wrong thing, both stopping
>the service and removing it with chkconfig. So I'd test it if I were you.
>
>preuninstall scriptlet (using /bin/sh):
>if [ $1 = 0 ]; then
>        /sbin/service httpd stop > /dev/null 2>&1
>        /sbin/chkconfig --del httpd
>fi
>  
>
The $1 is the first positional parameter passed to the script. Which is 
defined as the number of instances of the httpd rpm currently 
installed--*after* the old instance is removed. Therefore $1 will never 
equal 0 when you are updating.

../C

-- 
These are not the droids you're looking for. - Obi-Wan Kenobi




More information about the rhn-users mailing list