summaryrefslogtreecommitdiff
path: root/pcr/nagios/nagios.install
diff options
context:
space:
mode:
authorOmar Vega Ramos <ovruni@gnu.org.pe>2015-05-02 03:15:30 -0500
committerOmar Vega Ramos <ovruni@gnu.org.pe>2015-05-02 03:15:30 -0500
commit78d69d1d94fb3516e85983e97370a3d368c44661 (patch)
tree92d74b3d88c851599cad3bf284d0d3f18ad8b9c4 /pcr/nagios/nagios.install
parent072b82ba0f190dcb18fee51a8046f7f967664d3f (diff)
downloadabslibre-78d69d1d94fb3516e85983e97370a3d368c44661.tar.gz
abslibre-78d69d1d94fb3516e85983e97370a3d368c44661.tar.bz2
abslibre-78d69d1d94fb3516e85983e97370a3d368c44661.zip
nagios-4.0.8-1: add new package to [pcr]
Diffstat (limited to 'pcr/nagios/nagios.install')
-rw-r--r--pcr/nagios/nagios.install41
1 files changed, 41 insertions, 0 deletions
diff --git a/pcr/nagios/nagios.install b/pcr/nagios/nagios.install
new file mode 100644
index 000000000..36f038c0d
--- /dev/null
+++ b/pcr/nagios/nagios.install
@@ -0,0 +1,41 @@
+# arg 1: the new package version
+
+post_install() {
+ cat <<EOM
+
+--> Sample config files are installed with .sample extension.
+--> Remember, these are *SAMPLE* config files. You'll need to read
+--> the documentation for more information on how to actually define
+--> services, hosts, etc. to fit your particular needs.
+
+EOM
+
+ getent group nagios > /dev/null || groupadd -g 30 nagios > /dev/null
+ getent passwd nagios > /dev/null || useradd -u 30 -g nagios -d /dev/null -s /bin/false nagios > /dev/null
+}
+
+pre_upgrade() {
+
+ _httpdconf="/etc/httpd/conf/extra/nagios.conf"
+ if [ -f $_httpdconf ]; then
+ cp $_httpdconf $_httpdconf.pacsave
+ fi
+
+}
+
+post_upgrade() {
+
+ post_install
+
+ find /var/nagios -user nobody -exec chown nagios.nagios {} \;
+ if [ -f /var/log/nagios.log ]; then
+ chown nagios /var/log/nagios.log
+ fi
+
+ _httpdconf="/etc/httpd/conf/extra/nagios.conf"
+ if [ ! -f $_httpdconf -a -f $_httpdconf.pacsave ]; then
+ cp $_httpdconf.pacsave $_httpdconf
+ fi
+
+}
+