Re: [Nagios-devel] Nagios fails on empty config file

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
Guest

Re: [Nagios-devel] Nagios fails on empty config file

Post by Guest »


--=-XsMo8Pq2Y6688YIFmrWA
Content-Type: text/plain
Content-Transfer-Encoding: quoted-printable

On Wed, 2006-08-23 at 11:04 +0200, Andreas Ericsson wrote:
> Having investigated a bit further, it seems the mmap() call is the=20
> culprit in case the system doesn't support zero-length mmaps (many=20
> systems don't), in which case a simple "echo > config_file" would do the=20
> trick. Marc, can you verify if this is the case?
>=20
> The simplest solution in this case would be to just skip the mmap() step=20
> in case of zero-length files, as they're closed before real operations=20
> commence anyways, and I think it's safe to assume most systems can spare=20
> the 100 bytes or so of memory that are lost during the config reading.

i would second this suggestion. while from a development point of view
it might make sense to fail in this situation, it makes life very
difficult for packagers. also, since reading config files is a one-time
cost and the extra overhead of doing a stat+checking size seems minimal,
i don't see the harm in doing so.


sean

--=-XsMo8Pq2Y6688YIFmrWA
Content-Type: application/pgp-signature; name=signature.asc
Content-Description: This is a digitally signed message part

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.2 (GNU/Linux)

iD8DBQBE7DZPynjLPm522B0RAgeGAJ9rS6SzFdixyt+GeITPHn0QPfzh4wCfVTRe
jt+dTqtFFi+sPpRFYHmIHW4=
=Tj/Q
-----END PGP SIGNATURE-----

--=-XsMo8Pq2Y6688YIFmrWA--






This post was automatically imported from historical nagios-devel mailing list archives
Original poster: [email protected]
Locked