Re: rpm scripts for daemons, advice please
Axel Thimm <[email protected]> Mon, 19 Jul 2004 10:54:38 +0200
| Newsgroups | gmane.linux.redhat.rpm.atrpms.repo-coordination |
|---|---|
| Message-ID | <[email protected]> |
Hi Bent, On Mon, Jul 19, 2004 at 09:53:04AM +0200, Bent Terp wrote: > I'm working on packaging Torque, a batch queue system, Yes, please!!! :) :) :) > and have received some feedback I don't agree with. > > > Don't stop daemons (at least, not when upgrading), > > Is that normal? To keep version X of a daemon running and in memory, > while version X+1 is on disk? I assume everybody on this list will have a different opinion ;) I'd say in general one should assume misoperation of the old daemon running with "new" support files/folders, so the cleanest method would be to stop it before the files are blown away, and restart it after the files have been upgraded and the old one removed (you would have to save this condition on disk to be able to use it across scriplets). Especially if the daemon has deinitialization sequences (like writing queue data back to disk?), or the upgrade requires migration of state data this is a must. Second to that an /etc/init.d/daemon condrestart (or similar) in %post seems good enough. :) The argument of "don't stop a daemon when upgrading, let the user do it" is in general wrong. You should have user intervention when deciding to upgrade the daemon, not when deciding to restart it. Of course there are exceptions of > Would it be wrong to stop the service in %preun, and resume it in %post? > There will be a short disruption of service while files are being > replaced, but it sort of makes sense to me that while it is undefined > which version of files are in place, we don't really want to use them. > > Or should I just leave it running and do either a start or a restart in > %post? > > I thought the scripts were applied like this: > > rpm --install: %pre, install, %post > rpm --erase: %preun, erase, %postun > rpm --upgrade: old %preun, erase, old %postun, new %pre install, new > %post. > > But this isn't spelled out in explicit detail in the RPM Guide, and > given my very limited experience, I may well have gotten it all > upside-down. This essay is very illuminating: http://www-106.ibm.com/developerworks/linux/library/l-rpm3.html -- Axel.Thimm at ATrpms.net _______________________________________________ repo-coord mailing list [email protected] http://lists.atrpms.net/mailman/listinfo/repo-coord
signature.asc
(application/pgp-signature, 189 B)
-----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (GNU/Linux) iD8DBQFA+4xOQBVS1GOamfERAnZXAJ9DtXQD8VnQSi0wBWuZPpVy+u0BqQCfWcuQ F2V49gSW8FS2r+5fDcpKu9g= =2NMK -----END PGP SIGNATURE-----