diff options
author | André Fabian Silva Delgado <emulatorman@parabola.nu> | 2015-05-19 18:40:50 -0300 |
---|---|---|
committer | André Fabian Silva Delgado <emulatorman@parabola.nu> | 2015-05-19 18:40:50 -0300 |
commit | cea8490173dfafe478f0feb3d01311ff0d42408a (patch) | |
tree | 30cbf0bf32d48971140634bb863840a6bc779365 /pcr/icinga2/icinga2.install | |
parent | a41018125d32a20b644ff10836d1e737cd0dfa67 (diff) |
icinga2: add new package to [pcr] -> https://labs.parabola.nu/issues/724
Diffstat (limited to 'pcr/icinga2/icinga2.install')
-rw-r--r-- | pcr/icinga2/icinga2.install | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/pcr/icinga2/icinga2.install b/pcr/icinga2/icinga2.install new file mode 100644 index 000000000..86ea3d4bc --- /dev/null +++ b/pcr/icinga2/icinga2.install @@ -0,0 +1,52 @@ +post_install() { + /usr/bin/getent group icinga &> /dev/null || /usr/bin/groupadd -r icinga &> /dev/null + /usr/bin/getent group icingacmd &> /dev/null || /usr/bin/groupadd -r icingacmd &> /dev/null + /usr/bin/getent passwd icinga &> /dev/null || /usr/bin/useradd -r -c "icinga" -M -d /var/spool/icinga2 -g icinga -G icingacmd -s /usr/bin/nologin icinga &> /dev/null + + /usr/bin/chown -R icinga:icinga \ + /etc/icinga2 \ + /var/lib/icinga2 \ + /var/spool/icinga2 + + /usr/bin/chown -R icinga:icingacmd \ + /var/cache/icinga2 \ + /var/log/icinga2 + + /usr/bin/systemd-tmpfiles --create icinga2.conf + + /usr/bin/icinga2 feature enable checker &> /dev/null + /usr/bin/icinga2 feature enable mainlog &> /dev/null + /usr/bin/icinga2 feature enable notification &> /dev/null +} + +pre_upgrade() { + /usr/bin/chown -R root:root \ + /etc/icinga2 \ + /var/lib/icinga2 \ + /var/spool/icinga2 \ + /var/cache/icinga2 \ + /var/log/icinga2 +} + +post_upgrade() { + /usr/bin/chown -R icinga:icinga \ + /etc/icinga2 \ + /var/lib/icinga2 \ + /var/spool/icinga2 + + /usr/bin/chown -R icinga:icingacmd \ + /var/cache/icinga2 \ + /var/log/icinga2 +} + +pre_remove() { + [ -f "/etc/icinga2/features-enabled/checker.conf" ] && /usr/bin/icinga2 feature disable checker &> /dev/null + [ -f "/etc/icinga2/features-enabled/mainlog.conf" ] && /usr/bin/icinga2 feature disable mainlog &> /dev/null + [ -f "/etc/icinga2/features-enabled/notification.conf" ] && /usr/bin/icinga2 feature disable notification &> /dev/null +} + +post_remove() { + /usr/bin/getent passwd icinga &> /dev/null && /usr/bin/userdel icinga &> /dev/null + /usr/bin/getent group icinga &> /dev/null && /usr/bin/groupdel icinga &> /dev/null + /usr/bin/getent group icingacmd &> /dev/null && /usr/bin/groupdel icingacmd &> /dev/null +} |