diff --git a/etc/icinga2/init.conf.cmake b/etc/icinga2/init.conf.cmake index 50e7caeed..9f57bca82 100644 --- a/etc/icinga2/init.conf.cmake +++ b/etc/icinga2/init.conf.cmake @@ -1,2 +1,7 @@ +/** + * This file is read by Icinga 2 before the main + * configuration file (icinga2.conf) is processed. + */ + const RunAsUser = "@ICINGA2_USER@" const RunAsGroup = "@ICINGA2_GROUP@" diff --git a/icinga-app/icinga.cpp b/icinga-app/icinga.cpp index fb92037c7..5de35067c 100644 --- a/icinga-app/icinga.cpp +++ b/icinga-app/icinga.cpp @@ -132,12 +132,7 @@ int Main(void) ("define,D", po::value >(), "define a constant") ("library,l", po::value >(), "load a library") ("include,I", po::value >(), "add include search directory") - ("log-level,x", po::value(), "specify the log level for the console log") -#ifndef _WIN32 - ("user,u", po::value(), "user to run Icinga as") - ("group,g", po::value(), "group to run Icinga as") -#endif /* _WIN32 */ - ; + ("log-level,x", po::value(), "specify the log level for the console log"); po::options_description hiddenDesc("Hidden options"); @@ -179,12 +174,6 @@ int Main(void) } } - if (vm.count("group")) - ScriptVariable::Set("RunAsGroup", String(vm["group"].as())); - - if (vm.count("user")) - ScriptVariable::Set("RunAsUser", String(vm["user"].as())); - #ifndef _WIN32 String group = Application::GetRunAsGroup();