[rhn-users] shutdown services when upgrading

Jim Pelton jpelton at noaa.gov
Fri Jun 10 22:50:19 UTC 2005


Curtis and Rich,

Thanks for your help, that answered some questions about rpm I've been 
wondering about for a while. Of course, the answers where just a man 
page away! Thanks again, have a nice weekend.
--Jim

Curtis Doty wrote:

> 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
>
Thank you very much! Monday morning




More information about the rhn-users mailing list