Skip to content

Cannot execute commands reload / restart #11

@fguay

Description

@fguay

Hello,

I use shinken 2.2 with ws-arbiter in receiver daemon. When I try to use WS-Arbiter with reload ws

curl -d '' http://172.23.114.12:7760/reload

I have that in the log :

==> /var/log/shinken/receiverd.log <==
[1424160740] WARNING: [receiver-master] [WS_Arbiter] command: [1424160740] RELOAD_CONFIG


==> /var/log/shinken/arbiterd.log <==
[1424160740] DEBUG: [Shinken] Posting to http://localhost:7772/push_broks: 14B
[1424160740] EXTERNAL COMMAND: [1424160740] RELOAD_CONFIG
[1424160740] DEBUG: [Shinken] mode= dispatcher, global= True
[1424160740] DEBUG: [Shinken] Got commands RELOAD_CONFIG []
[1424160740] WARNING: [Shinken] RELOAD command : sudo /etc/init.d/shinken reload
[1424160740] ERROR: [Shinken] Cannot reload Shinken configuration: the 'reload-shinken' command failed with the error code '1' and the text ''.

I have strictly the same with restart ws.

==> /var/log/shinken/receiverd.log <==
[1424161029] WARNING: [receiver-master] [WS_Arbiter] command: [1424161029] RESTART_PROGRAM

==> /var/log/shinken/arbiterd.log <==
[1424161029] DEBUG: [Shinken] Posting to http://localhost:7772/push_broks: 14B
[1424161030] DEBUG: [Shinken] Posting to http://localhost:7772/push_broks: 14B
[1424161030] EXTERNAL COMMAND: [1424161029] RESTART_PROGRAM
[1424161030] DEBUG: [Shinken] mode= dispatcher, global= True
[1424161030] DEBUG: [Shinken] Got commands RESTART_PROGRAM []
[1424161030] WARNING: [Shinken] RESTART command : sudo /etc/init.d/shinken restart
[1424161030] ERROR: [Shinken] Cannot restart Shinken : the 'restart-shinken' command failed with the error code '1' and the text ''.

I try the target command directly with my user shinken and it's work fine :

[root@hapi-fgu-shinken-1 shinken]# su - shinken
Dernière connexion : lundi 16 février 2015 à 17:45:08 CET sur pts/0
-bash-4.2$ sudo /etc/init.d/shinken reload
Reloading arbiter
Doing config check                                                 [  OK  ]

I put the daemon in debug mode but I didn't have more information.

I checked the issue #8 but my command reload/restart are correctly in directory /etc/shinken/commands and seems to be correct.

-bash-4.2$ ll /etc/shinken/commands/
total 84
....
-rw-r--r--. 1 shinken shinken 115 Feb 16 18:13 reload-shinken.cfg
-rw-r--r--. 1 shinken shinken 117 Feb 16 16:22 restart-shinken.cfg
-bash-4.2$ more /etc/shinken/commands/*-shinken.cfg 
::::::::::::::
/etc/shinken/commands/reload-shinken.cfg
::::::::::::::
define command {
    command_name        reload-shinken
    command_line        sudo /etc/init.d/shinken reload
}

::::::::::::::
/etc/shinken/commands/restart-shinken.cfg
::::::::::::::
define command {
    command_name        restart-shinken
    command_line        sudo /etc/init.d/shinken restart
}

Last idea, I checked selinux audit log and there are nothing about this command and my shinken user is sudoers.

Thanks for your help.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions