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

./sbin/icinga2 feature enable need run as root #5240

Closed
Esteban2812 opened this issue May 10, 2017 · 1 comment
Closed

./sbin/icinga2 feature enable need run as root #5240

Esteban2812 opened this issue May 10, 2017 · 1 comment

Comments

@Esteban2812
Copy link

Expected Behavior

I expect to enable feature without being root user.

Current Behavior

When I'm logged with non-root user "icinga" for example, I perform following command and I got message error:

su - icinga
cd /apps/opt/icingadir2
-bash-4.1$ ./sbin/icinga2 feature enable ido-mysql
critical/cli: This command must be run as root.

Possible Solution

The solution that worked for me is to allow icinga to sudo the binary command /apps/opt/icingadir2/lib64/icinga2/sbin/icinga2

visudo
icinga ALL=(root) NOPASSWD:/apps/opt/icingadir2/lib64/icinga2/sbin/icinga2

and change last line in the script ./sbin/icinga2 to use sudo
exec sudo $ICINGA2_BIN "$@"

Steps to Reproduce (for bugs)

1. su - icinga
2. cd /apps/opt/icingadir2
3. -bash-4.1$ ./sbin/icinga2 feature enable ido-mysql
    critical/cli: This command must be run as root.

Context

This is custom installation from source.

Your Environment

  • Version used (icinga2 --version):
    icinga2 - The Icinga 2 network monitoring daemon (version: r2.6.3-1)
  • Operating System and version:
    Linux version 2.6.32-642.11.1.el6.x86_64 (mockbuild@c1bm.rdu2.centos.org) (gcc version 4.4.7 20120313 (Red Hat 4.4.7-17) (GCC) ) Add notes about certificate permission  #1 SMP Fri Nov 18 19:25:05 UTC 2016
  • Enabled features (icinga2 feature list):
    Disabled features: api command compatlog debuglog gelf graphite influxdb livestatus logstash opentsdb perfdata redis statusdata syslog
    Enabled features: checker ido-mysql mainlog notification

Concern

As I compiled source with no-root user,
could you tell me why /apps/opt/icingadir2/lib64/icinga2/sbin/icinga2 is required to run as root?
I asked because for sure my SA (System Administrator) will ask.

@dnsmichi
Copy link
Contributor

Icinga 2 isn't built for custom environments which don't require root permissions. There's an ongoing discussion about changing this in #4947. Don't expect it to happen any time soon as our officially supported packages work just fine. I'm closing this as duplicate.

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