Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[dev.icinga.com #11076] Reload on stoppped instance always successful #3894

Closed
icinga-migration opened this issue Feb 3, 2016 · 5 comments
Closed
Labels
bug Something isn't working

Comments

@icinga-migration
Copy link

This issue has been migrated from Redmine: https://dev.icinga.com/issues/11076

Created by bazz on 2016-02-03 10:02:30 +00:00

Assignee: formorer
Status: Resolved (closed on 2016-02-03 10:47:46 +00:00)
Target Version: (none)
Last Update: 2016-02-03 10:47:46 +00:00 (in Redmine)

Icinga Version: 2.4.1-1
Backport?: No
Include in Changelog: 0

Steps to reproduce:

  1. service icinga2 stop - stop service
  2. service icinga2 reload - returns OK
    What expected - service reload should generate an error or start service.
    What actual - nothing - we just say "OK", that service is down.

Icinga2 version - r2.4.1-1
OS Ubuntu 14.04.3 LTS

Quick and dirty fix:

root@mon:~# diff -U 10 icinga2 /etc/init.d/icinga2 
--- icinga2 2016-02-03 04:59:48.700144999 -0500
+++ /etc/init.d/icinga2 2016-02-03 04:30:27.540144999 -0500
@@ -116,21 +116,21 @@

 #
 # Function that sends a SIGHUP to the daemon/service
 #
 do_reload() {
   #
   # If the daemon can reload its configuration without
   # restarting (for example, when it is sent a SIGHUP),
   # then implement that here.
   #
-  start-stop-daemon --stop --signal 1 --quiet --pidfile $PIDFILE --name $NAME
+  start-stop-daemon --stop --signal 1 --quiet --pidfile $PIDFILE --name $NAME || do_start
   #echo start-stop-daemon --stop --signal 1 --quiet --pidfile $PIDFILE --name $NAME
   return 0
 }
@icinga-migration
Copy link
Author

Updated by mfriedrich on 2016-02-03 10:04:08 +00:00

  • Category set to Installation
  • Status changed from New to Assigned
  • Assigned to set to formorer

@alex

Please look into that, this affects the Debian/Ubuntu specific initscript.

@icinga-migration
Copy link
Author

Updated by formorer@formorer.de on 2016-02-03 10:09:26 +00:00

On Wed, 03 Feb 2016, development@icinga.org wrote:

Issue #11076 has been updated by dnsmichi.

Category set to Installation
Status changed from New to Assigned
Assignee set to formorer

@alex

Please look into that, this affects the Debian/Ubuntu specific initscript.
Sorry, but I completly disagrees on the proposed logic. A reload should not
start the service. An error would be ok.


Bug #11076: Reload on stoppped instance always successful
https://dev.icinga.org/issues/11076#change-47490

* Author: bazz
* Status: Assigned
* Priority: Normal
* Assignee: formorer
* Category: Installation
* Target version:
* Icinga Version: 2.4.1-1
* Package Repository:
* Backport?: Not yet backported
* Include in Changelog: Yes

Steps to reproduce:

  1. service icinga2 stop - stop service
  2. service icinga2 reload - returns OK
    What expected - service reload should generate an error or start service.
    What actual - nothing - we just say "OK", that service is down.

Icinga2 version - r2.4.1-1
OS Ubuntu 14.04.3 LTS

Quick and dirty fix:

root@mon:~# diff -U 10 icinga2 /etc/init.d/icinga2 
> --- icinga2   2016-02-03 04:59:48.700144999 -0500
> +++ /etc/init.d/icinga2   2016-02-03 04:30:27.540144999 -0500
> @@ -116,21 +116,21 @@
>  
>  #
>  # Function that sends a SIGHUP to the daemon/service
>  #
>  do_reload() {
>    #
>    # If the daemon can reload its configuration without
>    # restarting (for example, when it is sent a SIGHUP),
>    # then implement that here.
>    #
> -  start-stop-daemon --stop --signal 1 --quiet --pidfile $PIDFILE --name $NAME
> +  start-stop-daemon --stop --signal 1 --quiet --pidfile $PIDFILE --name $NAME || do_start
>    #echo start-stop-daemon --stop --signal 1 --quiet --pidfile $PIDFILE --name $NAME
>    return 0
>  }
> 
> 
> 

--
You have received this notification because you have either subscribed to it, or are involved in it.
To change your notification preferences, please click here: https://dev.icinga.org

@icinga-migration
Copy link
Author

Updated by bazz on 2016-02-03 10:41:28 +00:00

formorer@formorer.de wrote:

Sorry, but I completly disagrees on the proposed logic. A reload should not
start the service. An error would be ok.

I agree with you, but for me, if icinga is down, right behaviour - try to up it.
If it would raise error - is also ok.
for raising error init script might be changed this way:

>-    return 0
>+    return $?

@icinga-migration
Copy link
Author

Updated by formorer@formorer.de on 2016-02-03 10:46:28 +00:00

On Wed, 03 Feb 2016, development@icinga.org wrote:

Issue #11076 has been updated by bazz.

formorer@formorer.de wrote:
> Sorry, but I completly disagrees on the proposed logic. A reload should not
> start the service. An error would be ok.

I agree with you, but for me, if icinga is down, right behaviour - try to up it.
If it would raise error - is also ok.
for raising error init script might be changed this way:

> >-    return 0
> >+    return $?
> 

I committed this in the meanwhile:

diff --git a/debian/icinga2-common.icinga2.init b/debian/icinga2-common.icinga2.init
index 5000454..1b2e6a7 100644
--- a/debian/icinga2-common.icinga2.init

**+ b/debian/icinga2-common.icinga2.init
@ -197,6 +197,7 @ case "$1" in
;;
reload|force-reload)
do_check_config

  • status_of_proc -p "$PIDFILE" "$DAEMON" "$NAME" || exit $?
    log_daemon_msg "Reloading $DESC" "$NAME"
    do_reload
    log_end_msg $?

Alex

@icinga-migration
Copy link
Author

Updated by formorer on 2016-02-03 10:47:46 +00:00

  • Status changed from Assigned to Resolved
  • Backport? changed from Not yet backported to No
  • Include in Changelog changed from 1 to 0

Fix committed in git.

@icinga-migration icinga-migration added bug Something isn't working Installation labels Jan 17, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant