Re: [Nagios-devel] coredumps
Posted: Wed Dec 05, 2007 4:22 am
Andrew Ivanov wrote:
> Andreas Ericsson wrote:
>> It goes in the wrong direction compared to just about everything else that
>> works on Unixy systems, where you have a config-file to set your normal
>> parameters (usually requiring root to change them), and the environment
>> to override some of that if you need to test something.
>>
>> With your patch, "HOME=/put/core-dumps/here nagios -f nagios.cfg" would
>> no longer put core dumps in /put/core-dumps/here. That'd be a sad thing.
>> If you really want this functionality you should write it as a NEB-module
>> instead. It's really quite easy.
>
> Can it be that many Nagios community people have to set $HOME to
> ~nagios because of no homedir determination?
>
> $HOME points to ~root unless explicitly set, and surely nagios can't write
> there.
The point is that when run as root, nagios really shouldn't dump core,
and especially not if it has read anything in /etc, since the coredump
can then contain snippets of files best kept for the eyes of root only.
> And.. I was confused with the fact that '$HOME' is not nagios's home.
>
You don't have to start nagios as root. You can do
su - nagios -c "nagios -f nagios.cfg"
in your startup script.
> I just wanted to make things a little easier to configure.
>
In that case, make it a config variable in nagios.cfg. Something along
the lines of "runtime_directory" or something should work ok, and make
nagios bail if it can't change to that directory when daemonizing. It
doesn't change directory at all unless it goes into daemon mode.
--
Andreas Ericsson [email protected]
OP5 AB www.op5.se
Tel: +46 8-230225 Fax: +46 8-230231
This post was automatically imported from historical nagios-devel mailing list archives
Original poster: [email protected]
> Andreas Ericsson wrote:
>> It goes in the wrong direction compared to just about everything else that
>> works on Unixy systems, where you have a config-file to set your normal
>> parameters (usually requiring root to change them), and the environment
>> to override some of that if you need to test something.
>>
>> With your patch, "HOME=/put/core-dumps/here nagios -f nagios.cfg" would
>> no longer put core dumps in /put/core-dumps/here. That'd be a sad thing.
>> If you really want this functionality you should write it as a NEB-module
>> instead. It's really quite easy.
>
> Can it be that many Nagios community people have to set $HOME to
> ~nagios because of no homedir determination?
>
> $HOME points to ~root unless explicitly set, and surely nagios can't write
> there.
The point is that when run as root, nagios really shouldn't dump core,
and especially not if it has read anything in /etc, since the coredump
can then contain snippets of files best kept for the eyes of root only.
> And.. I was confused with the fact that '$HOME' is not nagios's home.
>
You don't have to start nagios as root. You can do
su - nagios -c "nagios -f nagios.cfg"
in your startup script.
> I just wanted to make things a little easier to configure.
>
In that case, make it a config variable in nagios.cfg. Something along
the lines of "runtime_directory" or something should work ok, and make
nagios bail if it can't change to that directory when daemonizing. It
doesn't change directory at all unless it goes into daemon mode.
--
Andreas Ericsson [email protected]
OP5 AB www.op5.se
Tel: +46 8-230225 Fax: +46 8-230231
This post was automatically imported from historical nagios-devel mailing list archives
Original poster: [email protected]