blob: 86ea3d4bc0dd30613c1627e2911c94721aeaab30 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
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
}
|