I am using nagios 2.0 on gentoo since rc stage ebuilds All time I have one problem - after I emerge new version of ebuild or reemerge same ebuild I got lost /var/nagios/rw directory - a have to setup this directory and external command file manually. Today I look at nagios-core-2.2.ebuild and found that my problem disappear after I move lines keepdir from pkg_preinst() function to the end of src_install() fi + keepdir /etc/nagios + keepdir /var/nagios + keepdir /var/nagios/archives + keepdir /usr/nagios/share/ssi + keepdir /var/nagios/rw for dir in etc/nagios usr/nagios var/nagios ; do chown -R nagios:nagios ${D}/${dir} || die "Failed chown of ${D}/ {dir}" done } pkg_preinst() { - keepdir /etc/nagios - keepdir /var/nagios - keepdir /var/nagios/archives - keepdir /usr/nagios/share/ssi - keepdir /var/nagios/rw if use noweb; then Is keepdir allowed inside pkg_preinst() function?
There's no problem with either, though I looked around and seems it is used on src_install. Tested with binary install as well and this works when moved to src_install. I fixed this for all the versions in portage. (1.2-r4, 1.3, 2.0, 2.1, 2.2) in CVS.