diff options
author | Ismaël Bouya <ismael.bouya@normalesup.org> | 2019-02-14 14:18:04 +0100 |
---|---|---|
committer | Ismaël Bouya <ismael.bouya@normalesup.org> | 2019-02-14 14:18:04 +0100 |
commit | 872e3678865d0da64a2110b3595f47f0bf3f8ab0 (patch) | |
tree | f896cdc8448d0f5037599617f028dbe46c87c10c /naemon/naemon.install | |
parent | 9fdac65911c67456485615088b8291b97cf72c99 (diff) | |
parent | a4b20506c21eeead57d134bdf6ac77cd23e1664a (diff) | |
download | AUR-872e3678865d0da64a2110b3595f47f0bf3f8ab0.tar.gz AUR-872e3678865d0da64a2110b3595f47f0bf3f8ab0.tar.zst AUR-872e3678865d0da64a2110b3595f47f0bf3f8ab0.zip |
Add 'naemon/' from commit 'a4b20506c21eeead57d134bdf6ac77cd23e1664a'
git-subtree-dir: naemon
git-subtree-mainline: 9fdac65911c67456485615088b8291b97cf72c99
git-subtree-split: a4b20506c21eeead57d134bdf6ac77cd23e1664a
Diffstat (limited to 'naemon/naemon.install')
-rw-r--r-- | naemon/naemon.install | 21 |
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 @@ | |||
1 | post_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 | |||
11 | pre_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 | } | ||