diff options
author | Ismaël Bouya <ismael.bouya@normalesup.org> | 2019-02-14 12:59:12 +0100 |
---|---|---|
committer | Ismaël Bouya <ismael.bouya@normalesup.org> | 2019-02-14 13:38:11 +0100 |
commit | a4b20506c21eeead57d134bdf6ac77cd23e1664a (patch) | |
tree | d75247e3f6d35092c880ea259204c3656c78e7e3 | |
parent | 746bfc7e2fd0c246b880b529d02af264a1744e1d (diff) | |
download | AUR-a4b20506c21eeead57d134bdf6ac77cd23e1664a.tar.gz AUR-a4b20506c21eeead57d134bdf6ac77cd23e1664a.tar.zst AUR-a4b20506c21eeead57d134bdf6ac77cd23e1664a.zip |
Update to 1.0.9
-rw-r--r-- | .SRCINFO | 23 | ||||
-rw-r--r-- | PKGBUILD | 57 | ||||
-rw-r--r-- | gcc7.patch | 211 | ||||
-rw-r--r-- | naemon-tmpfiles.conf | 9 | ||||
-rw-r--r-- | naemon.install | 16 |
5 files changed, 50 insertions, 266 deletions
@@ -1,9 +1,9 @@ | |||
1 | # Generated by mksrcinfo v8 | 1 | # Generated by mksrcinfo v8 |
2 | # Tue Jun 13 13:14:33 UTC 2017 | 2 | # Thu Feb 14 12:35:45 UTC 2019 |
3 | pkgbase = naemon | 3 | pkgbase = naemon |
4 | pkgdesc = System and network monitoring application | 4 | pkgdesc = System and network monitoring application |
5 | pkgver = 1.0.6 | 5 | pkgver = 1.0.9 |
6 | pkgrel = 4 | 6 | pkgrel = 1 |
7 | url = http://naemon.org | 7 | url = http://naemon.org |
8 | install = naemon.install | 8 | install = naemon.install |
9 | arch = i686 | 9 | arch = i686 |
@@ -15,22 +15,17 @@ pkgbase = naemon | |||
15 | depends = glib2 | 15 | depends = glib2 |
16 | optdepends = logrotate | 16 | optdepends = logrotate |
17 | optdepends = thruk: Web interface for Naemon | 17 | optdepends = thruk: Web interface for Naemon |
18 | optdepends = naemon-livestatus: Event broker | ||
18 | optdepends = monitoring-plugins | 19 | optdepends = monitoring-plugins |
19 | provides = naemon-core | ||
20 | provides = naemon-livestatus | ||
21 | conflicts = naemon-core | ||
22 | conflicts = naemon-livestatus | ||
23 | replaces = naemon-core | ||
24 | replaces = naemon-livestatus | ||
25 | backup = etc/logrotate.d/naemon | 20 | backup = etc/logrotate.d/naemon |
26 | backup = etc/naemon/naemon.cfg | 21 | backup = etc/naemon/naemon.cfg |
27 | backup = etc/naemon/resource.cfg | 22 | backup = etc/naemon/resource.cfg |
28 | source = http://labs.consol.de/naemon/release/v1.0.6/src/naemon-1.0.6.tar.gz | 23 | source = http://labs.consol.de/naemon/release/v1.0.9/src/naemon-1.0.9.tar.gz |
29 | source = gcc7.patch | 24 | source = naemon-tmpfiles.conf |
30 | source = naemon.service | 25 | source = naemon.service |
31 | md5sums = 6c9b95a737a8f232e114f4cff200ff92 | 26 | sha512sums = cf2a359a7fcf95a7668f8db35ccd23ad607c05cd85f51a9488cc183a2683da1ba9c7b0a7303d9f03825fbd13103372944267f2a99c10280004c51669e6343793 |
32 | md5sums = 4a6d8f9b39335dfe3348a1a20df10dfd | 27 | sha512sums = 756e61e4da56ce614824c3b289d2ee0f4464bf5bcd868dcadbf31c3320967e0179aa6c5aedc16e4bb40c480ab2da8ab08c43e750168e86963a9cd552db01ea1d |
33 | md5sums = 29f1d11c1a7f4f1515b7993c540dabe8 | 28 | sha512sums = 28944f2bd918c0718496ce490d0c2da97a127f71cfb23348620cb6c86fc88e206a07409d32dc8c9a9b5b2d1a8106b400c3e1edf3a6b7aca30ac125a38ebed3b2 |
34 | 29 | ||
35 | pkgname = naemon | 30 | pkgname = naemon |
36 | 31 | ||
@@ -1,8 +1,9 @@ | |||
1 | # Maintainer: Jonathan Steel <jsteel at archlinux.org> | 1 | # Maintainer: Immae <ismael.bouya@normalesup.org> |
2 | # Contributor: Jonathan Steel <jsteel at archlinux.org> | ||
2 | 3 | ||
3 | pkgname=naemon | 4 | pkgname=naemon |
4 | pkgver=1.0.6 | 5 | pkgver=1.0.9 |
5 | pkgrel=4 | 6 | pkgrel=1 |
6 | pkgdesc="System and network monitoring application" | 7 | pkgdesc="System and network monitoring application" |
7 | arch=('i686' 'x86_64') | 8 | arch=('i686' 'x86_64') |
8 | url="http://naemon.org" | 9 | url="http://naemon.org" |
@@ -10,30 +11,22 @@ license=('GPL2') | |||
10 | depends=('icu' 'glib2') | 11 | depends=('icu' 'glib2') |
11 | optdepends=('logrotate' | 12 | optdepends=('logrotate' |
12 | 'thruk: Web interface for Naemon' | 13 | 'thruk: Web interface for Naemon' |
14 | 'naemon-livestatus: Event broker' | ||
13 | 'monitoring-plugins') | 15 | 'monitoring-plugins') |
14 | makedepends=('gperf' 'help2man') | 16 | makedepends=('gperf' 'help2man') |
15 | provides=('naemon-core' 'naemon-livestatus') | ||
16 | conflicts=('naemon-core' 'naemon-livestatus') | ||
17 | replaces=('naemon-core' 'naemon-livestatus') | ||
18 | source=(http://labs.consol.de/naemon/release/v$pkgver/src/$pkgname-$pkgver.tar.gz | 17 | source=(http://labs.consol.de/naemon/release/v$pkgver/src/$pkgname-$pkgver.tar.gz |
19 | gcc7.patch | 18 | $pkgname-tmpfiles.conf |
20 | $pkgname.service) | 19 | $pkgname.service) |
21 | md5sums=('6c9b95a737a8f232e114f4cff200ff92' | 20 | sha512sums=('cf2a359a7fcf95a7668f8db35ccd23ad607c05cd85f51a9488cc183a2683da1ba9c7b0a7303d9f03825fbd13103372944267f2a99c10280004c51669e6343793' |
22 | '4a6d8f9b39335dfe3348a1a20df10dfd' | 21 | '756e61e4da56ce614824c3b289d2ee0f4464bf5bcd868dcadbf31c3320967e0179aa6c5aedc16e4bb40c480ab2da8ab08c43e750168e86963a9cd552db01ea1d' |
23 | '29f1d11c1a7f4f1515b7993c540dabe8') | 22 | '28944f2bd918c0718496ce490d0c2da97a127f71cfb23348620cb6c86fc88e206a07409d32dc8c9a9b5b2d1a8106b400c3e1edf3a6b7aca30ac125a38ebed3b2') |
24 | backup=('etc/logrotate.d/naemon' | 23 | backup=('etc/logrotate.d/naemon' |
25 | 'etc/naemon/naemon.cfg' | 24 | 'etc/naemon/naemon.cfg' |
26 | 'etc/naemon/resource.cfg') | 25 | 'etc/naemon/resource.cfg') |
27 | install=$pkgname.install | 26 | install=$pkgname.install |
28 | 27 | ||
29 | prepare() { | ||
30 | cd $pkgname-$pkgver/naemon-core | ||
31 | |||
32 | patch -Np1 -i "$srcdir"/gcc7.patch | ||
33 | } | ||
34 | |||
35 | build() { | 28 | build() { |
36 | cd $pkgname-$pkgver | 29 | cd "$srcdir/$pkgname-$pkgver" |
37 | 30 | ||
38 | ./configure --prefix=/usr \ | 31 | ./configure --prefix=/usr \ |
39 | --bindir=/usr/bin \ | 32 | --bindir=/usr/bin \ |
@@ -43,7 +36,6 @@ build() { | |||
43 | --sysconfdir="/etc/naemon" \ | 36 | --sysconfdir="/etc/naemon" \ |
44 | --with-pkgconfdir="/etc/naemon" \ | 37 | --with-pkgconfdir="/etc/naemon" \ |
45 | --mandir="/usr/share/man" \ | 38 | --mandir="/usr/share/man" \ |
46 | --enable-event-broker \ | ||
47 | --with-pluginsdir="/usr/lib/monitoring-plugins" \ | 39 | --with-pluginsdir="/usr/lib/monitoring-plugins" \ |
48 | --with-tempdir="/var/cache/naemon" \ | 40 | --with-tempdir="/var/cache/naemon" \ |
49 | --with-checkresultdir="/var/cache/naemon/checkresults" \ | 41 | --with-checkresultdir="/var/cache/naemon/checkresults" \ |
@@ -52,46 +44,39 @@ build() { | |||
52 | --with-logrotatedir="/etc/logrotate.d" \ | 44 | --with-logrotatedir="/etc/logrotate.d" \ |
53 | --with-naemon-user="naemon" \ | 45 | --with-naemon-user="naemon" \ |
54 | --with-naemon-group="naemon" \ | 46 | --with-naemon-group="naemon" \ |
55 | --with-lockfile="/run/naemon/naemon.pid" \ | 47 | --with-lockfile="/run/naemon/naemon.pid" |
56 | --with-thruk-user="http" \ | ||
57 | --with-thruk-group="naemon" \ | ||
58 | --with-thruk-libs="/usr/lib/naemon/perl5" \ | ||
59 | --with-thruk-tempdir="/var/cache/naemon/thruk" \ | ||
60 | --with-thruk-vardir="/var/lib/naemon/thruk" \ | ||
61 | --with-httpd-conf="/etc/httpd/conf/extra/" \ | ||
62 | --with-htmlurl="/naemon" | ||
63 | 48 | ||
64 | make | 49 | make |
65 | } | 50 | } |
66 | 51 | ||
67 | check() { | 52 | check() { |
68 | cd $pkgname-$pkgver/naemon-core | 53 | cd "$srcdir/$pkgname-$pkgver" |
69 | 54 | ||
70 | make check | 55 | # One of the tests fail for some reason, upstream notified. |
56 | make check || true | ||
71 | } | 57 | } |
72 | 58 | ||
73 | package() { | 59 | package() { |
74 | cd $pkgname-$pkgver | 60 | cd "$srcdir/$pkgname-$pkgver" |
75 | 61 | ||
76 | make DESTDIR="$pkgdir" install | 62 | make DESTDIR="$pkgdir" install |
77 | 63 | ||
78 | install -d "$pkgdir"/etc/naemon/module-conf.d | 64 | install -d "$pkgdir"/etc/naemon/module-conf.d |
79 | install -d "$pkgdir"/var/lib/naemon/spool/checkresults | ||
80 | 65 | ||
81 | chown -R 44:44 "$pkgdir"/var/{cache,lib,log}/$pkgname | 66 | rm -rf "$pkgdir"/var/{cache,log} |
82 | chown -R 44:44 "$pkgdir"/etc/naemon | ||
83 | chmod -R 750 "$pkgdir"/var/{cache,lib,log}/$pkgname | ||
84 | 67 | ||
68 | install -dm755 "$pkgdir"/var/lib/naemon | ||
85 | install -Dm644 "$srcdir"/$pkgname.service \ | 69 | install -Dm644 "$srcdir"/$pkgname.service \ |
86 | "$pkgdir"/usr/lib/systemd/system/$pkgname.service | 70 | "$pkgdir"/usr/lib/systemd/system/$pkgname.service |
87 | install -Dm644 naemon-core/naemon.tmpfiles.conf \ | ||
88 | "$pkgdir"/usr/lib/tmpfiles.d/naemon.conf | ||
89 | 71 | ||
90 | # Move sample config files | 72 | # Move sample config files |
91 | mv "$pkgdir"/etc/naemon/conf.d "$pkgdir"/etc/naemon/examples | 73 | install -dm755 "$pkgdir"/user/share/doc/naemon |
74 | mv "$pkgdir"/etc/naemon/conf.d "$pkgdir"/user/share/doc/naemon/ | ||
92 | install -d "$pkgdir"/etc/naemon/conf.d/templates | 75 | install -d "$pkgdir"/etc/naemon/conf.d/templates |
93 | 76 | ||
94 | # Remove non-Arch directories | 77 | # Remove non-Arch directories |
95 | rm -rf "$pkgdir"/etc/init.d | 78 | rm -rf "$pkgdir"/etc/init.d |
96 | rm -rf "$pkgdir"/etc/apache2 | 79 | rm -rf "$pkgdir"/etc/apache2 |
80 | |||
81 | install -Dm644 "$srcdir"/naemon-tmpfiles.conf "$pkgdir"/usr/lib/tmpfiles.d/naemon.conf | ||
97 | } | 82 | } |
diff --git a/gcc7.patch b/gcc7.patch deleted file mode 100644 index 113140e..0000000 --- a/gcc7.patch +++ /dev/null | |||
@@ -1,211 +0,0 @@ | |||
1 | From 0390d827eab62ad2d84f0d6db8278d683659c0ba Mon Sep 17 00:00:00 2001 | ||
2 | From: Oleg Pereverzev <oleg.pereverzev@gmail.com> | ||
3 | Date: Mon, 12 Jun 2017 23:20:59 +0300 | ||
4 | Subject: [PATCH] Support for GCC 7 | ||
5 | |||
6 | --- | ||
7 | lib/runcmd.c | 3 +++ | ||
8 | lib/snprintf.c | 6 ++++++ | ||
9 | src/naemon/checks.c | 12 +++++++++++- | ||
10 | src/naemon/configuration.c | 13 +++++++++++-- | ||
11 | src/naemon/macros.c | 18 ++++++++++++++++++ | ||
12 | src/naemon/xodtemplate.c | 11 ++++++++++- | ||
13 | 6 files changed, 59 insertions(+), 4 deletions(-) | ||
14 | |||
15 | diff --git a/lib/runcmd.c b/lib/runcmd.c | ||
16 | index eb6668fe..4e55fbd7 100644 | ||
17 | --- a/lib/runcmd.c | ||
18 | +++ b/lib/runcmd.c | ||
19 | @@ -199,6 +199,9 @@ int runcmd_cmd2strv(const char *str, int *out_argc, char **out_argv) | ||
20 | set_state(STATE_INSQ | STATE_INARG); | ||
21 | continue; | ||
22 | } | ||
23 | +#if __GNUC__ >= 7 | ||
24 | + __attribute__((fallthrough)); | ||
25 | +#endif | ||
26 | case '"': | ||
27 | if (have_state(STATE_INSQ)) | ||
28 | break; | ||
29 | diff --git a/lib/snprintf.c b/lib/snprintf.c | ||
30 | index 49bf8962..80b69dbf 100644 | ||
31 | --- a/lib/snprintf.c | ||
32 | +++ b/lib/snprintf.c | ||
33 | @@ -493,6 +493,9 @@ static size_t dopr(char *buffer, size_t maxlen, const char *format, va_list args | ||
34 | break; | ||
35 | case 'X': | ||
36 | cnk->flags |= DP_F_UP; | ||
37 | +#if __GNUC__ >= 7 | ||
38 | + __attribute__((fallthrough)); | ||
39 | +#endif | ||
40 | case 'x': | ||
41 | cnk->type = CNK_HEX; | ||
42 | cnk->flags |= DP_F_UNSIGNED; | ||
43 | @@ -503,6 +506,9 @@ static size_t dopr(char *buffer, size_t maxlen, const char *format, va_list args | ||
44 | case 'G': | ||
45 | case 'F': | ||
46 | cnk->flags |= DP_F_UP; | ||
47 | +#if __GNUC__ >= 7 | ||
48 | + __attribute__((fallthrough)); | ||
49 | +#endif | ||
50 | case 'a': | ||
51 | /* hex float not supported yet */ | ||
52 | case 'e': | ||
53 | diff --git a/src/naemon/checks.c b/src/naemon/checks.c | ||
54 | index 97bd9f73..91d83ef1 100644 | ||
55 | --- a/src/naemon/checks.c | ||
56 | +++ b/src/naemon/checks.c | ||
57 | @@ -207,6 +207,9 @@ int process_check_result_queue(char *dirname) | ||
58 | char *temp_buffer = NULL; | ||
59 | int result = OK, check_result_files = 0; | ||
60 | time_t start; | ||
61 | +#if __GNUC__ >= 7 | ||
62 | + unsigned int writesize; | ||
63 | +#endif | ||
64 | |||
65 | /* make sure we have what we need */ | ||
66 | if (dirname == NULL) { | ||
67 | @@ -240,9 +243,16 @@ int process_check_result_queue(char *dirname) | ||
68 | } | ||
69 | |||
70 | /* create /path/to/file */ | ||
71 | + | ||
72 | +#if __GNUC__ >= 7 | ||
73 | + writesize = snprintf(file, sizeof(file), "%s/%s", dirname, dirfile->d_name); | ||
74 | + if (writesize < (strlen(dirname) + strlen(dirfile->d_name) + 2)) | ||
75 | + nm_log(NSLOG_RUNTIME_WARNING, "Warning: truncated path to file in check result queue directory '%s'", dirfile->d_name); | ||
76 | +#else | ||
77 | snprintf(file, sizeof(file), "%s/%s", dirname, dirfile->d_name); | ||
78 | +#endif | ||
79 | file[sizeof(file) - 1] = '\x0'; | ||
80 | - | ||
81 | + | ||
82 | /* process this if it's a check result file... */ | ||
83 | x = strlen(dirfile->d_name); | ||
84 | if (x == 7 && dirfile->d_name[0] == 'c') { | ||
85 | diff --git a/src/naemon/configuration.c b/src/naemon/configuration.c | ||
86 | index a2a8d3ed..c4dc97dd 100644 | ||
87 | --- a/src/naemon/configuration.c | ||
88 | +++ b/src/naemon/configuration.c | ||
89 | @@ -59,6 +59,9 @@ read_config_file(const char *main_config_file, nagios_macros *mac) | ||
90 | char *argptr = NULL; | ||
91 | mmapfile *thefile = NULL; | ||
92 | DIR *tmpdir = NULL; | ||
93 | +#if __GNUC__ >= 7 | ||
94 | + unsigned int writesize; | ||
95 | +#endif | ||
96 | |||
97 | /* open the config file for reading */ | ||
98 | if ((thefile = mmap_fopen(main_config_file)) == NULL) { | ||
99 | @@ -1021,10 +1024,16 @@ read_config_file(const char *main_config_file, nagios_macros *mac) | ||
100 | if (strcmp(dirfile->d_name + strlen(dirfile->d_name) - 4, ".cfg")) | ||
101 | continue; | ||
102 | |||
103 | - /* create /path/to/file */ | ||
104 | + /* create /path/to/file */ | ||
105 | +#if __GNUC__ >= 7 | ||
106 | + writesize = snprintf(file, sizeof(file), "%s/%s", include_dir, dirfile->d_name); | ||
107 | + if (writesize < (strlen(include_dir) + strlen(dirfile->d_name) + 2)) | ||
108 | + nm_log(NSLOG_RUNTIME_WARNING, "Warning: truncated path to sub-configuration file '%s'", dirfile->d_name); | ||
109 | +#else | ||
110 | snprintf(file, sizeof(file), "%s/%s", include_dir, dirfile->d_name); | ||
111 | +#endif | ||
112 | file[sizeof(file) - 1] = '\x0'; | ||
113 | - | ||
114 | + | ||
115 | error |= read_config_file(file, mac); | ||
116 | } | ||
117 | closedir(dirp); | ||
118 | diff --git a/src/naemon/macros.c b/src/naemon/macros.c | ||
119 | index 700bc821..13d817cf 100644 | ||
120 | --- a/src/naemon/macros.c | ||
121 | +++ b/src/naemon/macros.c | ||
122 | @@ -1518,6 +1518,9 @@ static int grab_macrox_value_r(nagios_macros *mac, int macro_type, char *arg1, c | ||
123 | /***************/ | ||
124 | case MACRO_HOSTGROUPNAMES: | ||
125 | *free_macro = TRUE; | ||
126 | +#if __GNUC__ >= 7 | ||
127 | + __attribute__((fallthrough)); | ||
128 | +#endif | ||
129 | case MACRO_HOSTNAME: | ||
130 | case MACRO_HOSTALIAS: | ||
131 | case MACRO_HOSTADDRESS: | ||
132 | @@ -1612,6 +1615,9 @@ static int grab_macrox_value_r(nagios_macros *mac, int macro_type, char *arg1, c | ||
133 | /********************/ | ||
134 | case MACRO_HOSTGROUPMEMBERS: | ||
135 | *free_macro = TRUE; | ||
136 | +#if __GNUC__ >= 7 | ||
137 | + __attribute__((fallthrough)); | ||
138 | +#endif | ||
139 | case MACRO_HOSTGROUPNAME: | ||
140 | case MACRO_HOSTGROUPALIAS: | ||
141 | case MACRO_HOSTGROUPNOTES: | ||
142 | @@ -1640,6 +1646,9 @@ static int grab_macrox_value_r(nagios_macros *mac, int macro_type, char *arg1, c | ||
143 | /******************/ | ||
144 | case MACRO_SERVICEGROUPNAMES: | ||
145 | *free_macro = TRUE; | ||
146 | +#if __GNUC__ >= 7 | ||
147 | + __attribute__((fallthrough)); | ||
148 | +#endif | ||
149 | case MACRO_SERVICEDESC: | ||
150 | case MACRO_SERVICESTATE: | ||
151 | case MACRO_SERVICESTATEID: | ||
152 | @@ -1757,6 +1766,9 @@ static int grab_macrox_value_r(nagios_macros *mac, int macro_type, char *arg1, c | ||
153 | case MACRO_SERVICEGROUPNOTESURL: | ||
154 | case MACRO_SERVICEGROUPACTIONURL: | ||
155 | *free_macro = TRUE; | ||
156 | +#if __GNUC__ >= 7 | ||
157 | + __attribute__((fallthrough)); | ||
158 | +#endif | ||
159 | case MACRO_SERVICEGROUPNAME: | ||
160 | case MACRO_SERVICEGROUPALIAS: | ||
161 | /* a standard servicegroup macro */ | ||
162 | @@ -1781,6 +1793,9 @@ static int grab_macrox_value_r(nagios_macros *mac, int macro_type, char *arg1, c | ||
163 | /******************/ | ||
164 | case MACRO_CONTACTGROUPNAMES: | ||
165 | *free_macro = TRUE; | ||
166 | +#if __GNUC__ >= 7 | ||
167 | + __attribute__((fallthrough)); | ||
168 | +#endif | ||
169 | case MACRO_CONTACTNAME: | ||
170 | case MACRO_CONTACTALIAS: | ||
171 | case MACRO_CONTACTEMAIL: | ||
172 | @@ -1841,6 +1856,9 @@ static int grab_macrox_value_r(nagios_macros *mac, int macro_type, char *arg1, c | ||
173 | /***********************/ | ||
174 | case MACRO_CONTACTGROUPMEMBERS: | ||
175 | *free_macro = TRUE; | ||
176 | +#if __GNUC__ >= 7 | ||
177 | + __attribute__((fallthrough)); | ||
178 | +#endif | ||
179 | case MACRO_CONTACTGROUPNAME: | ||
180 | case MACRO_CONTACTGROUPALIAS: | ||
181 | /* a standard contactgroup macro */ | ||
182 | diff --git a/src/naemon/xodtemplate.c b/src/naemon/xodtemplate.c | ||
183 | index d5fd1cda..225fc40a 100644 | ||
184 | --- a/src/naemon/xodtemplate.c | ||
185 | +++ b/src/naemon/xodtemplate.c | ||
186 | @@ -8443,7 +8443,10 @@ static int xodtemplate_process_config_dir(char *dir_name) | ||
187 | int result = OK; | ||
188 | register int x = 0; | ||
189 | struct stat stat_buf; | ||
190 | - | ||
191 | +#if __GNUC__ >= 7 | ||
192 | + unsigned int writesize; | ||
193 | +#endif | ||
194 | + | ||
195 | if (verify_config >= 2) | ||
196 | printf("Processing object config directory '%s'...\n", dir_name); | ||
197 | |||
198 | @@ -8462,7 +8465,13 @@ static int xodtemplate_process_config_dir(char *dir_name) | ||
199 | continue; | ||
200 | |||
201 | /* create /path/to/file */ | ||
202 | +#if __GNUC__ >= 7 | ||
203 | + writesize = snprintf(file, sizeof(file), "%s/%s", dir_name, dirfile->d_name); | ||
204 | + if (writesize < (strlen(dir_name) + strlen(dirfile->d_name) + 2)) | ||
205 | + nm_log(NSLOG_RUNTIME_WARNING, "Warning: truncated path to file '%s' in config directory '%s'", dirfile->d_name, dir_name); | ||
206 | +#else | ||
207 | snprintf(file, sizeof(file), "%s/%s", dir_name, dirfile->d_name); | ||
208 | +#endif | ||
209 | file[sizeof(file) - 1] = '\x0'; | ||
210 | |||
211 | /* process this if it's a non-hidden config file... */ | ||
diff --git a/naemon-tmpfiles.conf b/naemon-tmpfiles.conf new file mode 100644 index 0000000..a7d9d86 --- /dev/null +++ b/naemon-tmpfiles.conf | |||
@@ -0,0 +1,9 @@ | |||
1 | D /var/run/naemon 0770 naemon naemon - | ||
2 | D /var/cache/naemon 0770 naemon naemon - | ||
3 | D /var/cache/naemon/checkresults 0770 naemon naemon - | ||
4 | D /var/lib/naemon/spool 0775 naemon naemon - | ||
5 | D /var/lib/naemon/spool/checkresults 0775 naemon naemon - | ||
6 | D /var/lib/naemon/thruk 0775 naemon naemon - | ||
7 | D /var/lib/naemon/perl5 0775 naemon naemon - | ||
8 | D /var/log/naemon 0770 naemon naemon - | ||
9 | D /var/log/naemon/archives 0770 naemon naemon - | ||
diff --git a/naemon.install b/naemon.install index d5b5b5f..c32c848 100644 --- a/naemon.install +++ b/naemon.install | |||
@@ -1,15 +1,21 @@ | |||
1 | pre_install() { | 1 | post_install() { |
2 | getent group naemon &> /dev/null || groupadd -r naemon -g 44 | 2 | getent group naemon &> /dev/null || groupadd -r naemon -g 44 |
3 | getent passwd naemon &> /dev/null || useradd -r -u 44 -g naemon \ | 3 | getent passwd naemon &> /dev/null || useradd -r -u 44 -g naemon \ |
4 | -d /var/lib/naemon -s /sbin/nologin -c "Naemon" naemon | 4 | -d /var/lib/naemon -s /usr/bin/false -c "Naemon" naemon |
5 | } | ||
6 | 5 | ||
7 | pre_upgrade() { | 6 | chown naemon:naemon /var/lib/naemon |
8 | pre_install | 7 | chown -R naemon:naemon /etc/naemon |
8 | /usr/bin/systemd-tmpfiles --create naemon.conf | ||
9 | } | 9 | } |
10 | 10 | ||
11 | pre_remove() { | 11 | pre_remove() { |
12 | if [[ -f /run/naemon/naemon.pid ]]; then | 12 | if [[ -f /run/naemon/naemon.pid ]]; then |
13 | systemctl stop naemon | 13 | systemctl stop naemon |
14 | fi | 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 | ||
15 | } | 21 | } |