[rhn-users] shutdown services when upgrading
Rich Graves
rcgraves at brandeis.edu
Fri Jun 10 21:11:13 UTC 2005
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
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.
[root]# up2date --get httpd
[root]# -qp --scripts /var/spool/up2date/httpd-2.0.46-46.ent.i386.rpm
preinstall scriptlet (using /bin/sh):
# Add the "apache" user
/usr/sbin/useradd -c "Apache" -u 48 \
-s /sbin/nologin -r -d /var/www apache 2> /dev/null || :
# Prevent removal of index.html on upgrades from 1.3
postinstall scriptlet (using /bin/sh):
# Register the httpd service
/sbin/chkconfig --add httpd
preuninstall scriptlet (using /bin/sh):
if [ $1 = 0 ]; then
/sbin/service httpd stop > /dev/null 2>&1
/sbin/chkconfig --del httpd
fi
--
Rich Graves <rcgraves at brandeis.edu>
UNet Systems Administrator
More information about the rhn-users
mailing list