|
@@ -16,6 +16,7 @@ import pkg_resources
|
|
|
import select
|
|
|
import glob
|
|
|
import platform
|
|
|
+import warnings
|
|
|
|
|
|
from fcntl import fcntl
|
|
|
from fcntl import F_SETFL, F_GETFL
|
|
@@ -64,6 +65,7 @@ class Options:
|
|
|
stderr = sys.stderr
|
|
|
stdout = sys.stdout
|
|
|
exit = sys.exit
|
|
|
+ warnings = warnings
|
|
|
|
|
|
uid = gid = None
|
|
|
|
|
@@ -279,6 +281,16 @@ class Options:
|
|
|
self._set(name, value, 1)
|
|
|
|
|
|
if self.configfile is None:
|
|
|
+ if os.getuid() == 0: # pragma: no cover
|
|
|
+ self.warnings.warn(
|
|
|
+ 'Supervisord is running as root and it is searching '
|
|
|
+ 'for its configuration file in default locations '
|
|
|
+ '(including its current working directory); you '
|
|
|
+ 'probably want to specify a "-c" argument specifying an '
|
|
|
+ 'absolute path to a configuration file for improved '
|
|
|
+ 'security.'
|
|
|
+ )
|
|
|
+
|
|
|
self.configfile = self.default_configfile()
|
|
|
|
|
|
self.process_config_file()
|