aboutsummaryrefslogtreecommitdiff
path: root/naemon/naemon.install
diff options
context:
space:
mode:
Diffstat (limited to 'naemon/naemon.install')
-rw-r--r--naemon/naemon.install21
1 files changed, 21 insertions, 0 deletions
diff --git a/naemon/naemon.install b/naemon/naemon.install
new file mode 100644
index 0000000..c32c848
--- /dev/null
+++ b/naemon/naemon.install
@@ -0,0 +1,21 @@
1post_install() {
2 getent group naemon &> /dev/null || groupadd -r naemon -g 44
3 getent passwd naemon &> /dev/null || useradd -r -u 44 -g naemon \
4 -d /var/lib/naemon -s /usr/bin/false -c "Naemon" naemon
5
6 chown naemon:naemon /var/lib/naemon
7 chown -R naemon:naemon /etc/naemon
8 /usr/bin/systemd-tmpfiles --create naemon.conf
9}
10
11pre_remove() {
12 if [[ -f /run/naemon/naemon.pid ]]; then
13 systemctl stop naemon
14 fi
15 /usr/bin/systemd-tmpfiles --remove naemon.conf
16
17 userdel naemon &> /dev/null
18 groupdel naemon &> /dev/null
19
20 rm -rf /var/lib/naemon
21}