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

Cannot execute commands reload / restart #11

Open
fguay opened this issue Feb 17, 2015 · 3 comments
Open

Cannot execute commands reload / restart #11

fguay opened this issue Feb 17, 2015 · 3 comments

Comments

@fguay
Copy link

fguay commented Feb 17, 2015

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.

@Seb-Solon
Copy link
Contributor

It reminds me this : shinken-solutions/shinken#1488

Can you try without sudo and edit the sudoers properly?

@fguay
Copy link
Author

fguay commented Feb 18, 2015

Hi Seb,

So, I changed the command file reload-shinken like this :

[root@hapi-fgu-shinken-1 centos]# more /etc/shinken/commands/reload-shinken.cfg 
define command {
    command_name        reload-shinken
    command_line           /etc/init.d/shinken reload
}

And it work fine.
I didn't really understood why, but it works.

Thanks for your help and your job on this mod.

@fguay
Copy link
Author

fguay commented Feb 18, 2015

Idem for /etc/shinken/commands/restart-shinken.cfg.
It works fine without sudo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants