nrpe_utils.py: ensure permission for /var/lib/nagios
This nrpe charm will install nagios-nrpe-server deb package.
In its preinst script[0], it will add nagios user and create `/var/lib/nagios` as home dir.
When other charm like hw-health relates to this charm, they will:
1) setup cronjob to run script
2) generate output file into /var/lib/nagios
3) read output file from /var/lib/nagios
Before, these are all done via root user, so no permission issue.
But recently, the cronjob user is switched from root to nagios, which caused following issues:
1) original output file was created by root, cronjob script by nagios user can not write to it.
2) In some situation, owner of `/var/lib/nagios/` is changed to root, cronjob script can not write file into this dir.
related bugs:
LP: #1906991
LP: #1904045
LP: #1866382
In this patch, we:
1) ensure `/var/lib/nagios` is owned by nagios user
2) setgid on dir group, to ensure any new created file in `/var/lib/nagios` has group `nagios`.
NOTE: this patch avoids to chown recursively, which implies, if there is a legacy output file
owned by root, we have to fix it manually, or fix it from the related charm side.
[0]: https://git.launchpad.net/ubuntu/+source/nagios-nrpe/tree/debian/nagios-nrpe-server.preinst#n28
Signed-off-by: Joe Guo <email address hidden>
allow direct includes from /etc/rsync-juju.d
This allows *.inc files to be added that override global settings.
For example, the ubuntu-mirror charm wants to be able to set "motd file",
and currently it can only do this by overwriting /etc/rsyncd.conf.
The *.conf files processed by &include can set defaults at top-level
that affect the rest of the modules in that file, but they cannot
affect the rest of the configuration, or change global options.