summaryrefslogtreecommitdiffstats
path: root/glusterfs.spec.in
diff options
context:
space:
mode:
authorAravinda VK <avishwan@redhat.com>2016-10-18 14:57:47 +0530
committerAravinda VK <avishwan@redhat.com>2016-10-20 22:34:08 -0700
commitee4c768dafda992ab6bf3787b4efc8b0f330623e (patch)
tree7adca00750786dd93a1b64befd96442d3ed428f7 /glusterfs.spec.in
parent8f8e23b0142a21779648802664db5b3d5253e4e0 (diff)
eventsapi/packaging: Fix wrong usage of %post
%postun was used for events package instead of %post. eventsd service should be restarted only after install/upgrade and not during uninstallation(%postun) BUG: 1386141 Change-Id: Iae3eab06d02c5f4134b3de09f040123bed053bb8 Signed-off-by: Aravinda VK <avishwan@redhat.com> Reviewed-on: http://review.gluster.org/15670 Smoke: Gluster Build System <jenkins@build.gluster.org> CentOS-regression: Gluster Build System <jenkins@build.gluster.org> Reviewed-by: Niels de Vos <ndevos@redhat.com> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
Diffstat (limited to 'glusterfs.spec.in')
-rw-r--r--glusterfs.spec.in25
1 files changed, 18 insertions, 7 deletions
diff --git a/glusterfs.spec.in b/glusterfs.spec.in
index e70ec0cdfb3..3753651df4a 100644
--- a/glusterfs.spec.in
+++ b/glusterfs.spec.in
@@ -111,6 +111,7 @@
# can't seem to make a generic macro that works
%global _init_glusterd %{_unitdir}/glusterd.service
%global _init_glusterfsd %{_unitdir}/glusterfsd.service
+%global _init_glustereventsd %{_unitdir}/glustereventsd.service
%else
%global _init_enable() /sbin/chkconfig --add %1 ;
%global _init_disable() /sbin/chkconfig --del %1 ;
@@ -121,6 +122,7 @@
# can't seem to make a generic macro that works
%global _init_glusterd %{_sysconfdir}/init.d/glusterd
%global _init_glusterfsd %{_sysconfdir}/init.d/glusterfsd
+%global _init_glustereventsd %{_sysconfdir}/init.d/glustereventsd
%endif
%if ( 0%{_for_fedora_koji_builds} )
@@ -775,6 +777,11 @@ exit 0
%post api
/sbin/ldconfig
+%if ( 0%{!?_without_events:1} )
+%post events
+%_init_restart glustereventsd
+%endif
+
%if ( 0%{?rhel} == 5 )
%post fuse
modprobe fuse
@@ -871,6 +878,17 @@ exit 0
##-----------------------------------------------------------------------------
## All %%preun should be placed here and keep them sorted
##
+%if ( 0%{!?_without_events:1} )
+%preun events
+if [ $1 -eq 0 ]; then
+ if [ -f %_init_glustereventsd ]; then
+ %_init_stop glustereventsd
+ %_init_disable glustereventsd
+ fi
+fi
+exit 0
+%endif
+
%preun server
if [ $1 -eq 0 ]; then
if [ -f %_init_glusterfsd ]; then
@@ -904,13 +922,6 @@ exit 0
%postun api
/sbin/ldconfig
-%postun events
-%if ( 0%{!?_without_events:1} )
-%if ( 0%{?fedora} ) || ( 0%{?rhel} && 0%{?rhel} >= 6 )
-%_init_restart glustereventsd
-%endif
-%endif
-
%postun libs
/sbin/ldconfig
d='n226' href='#n226'>226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473