mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Merge pull request #37218 from darkalia/37187_supervisor_2016.3
Issue #37187 Do not parse first /proc/1/cmdline binary if it's not *b…
This commit is contained in:
commit
d1a6bb72ac
1 changed files with 3 additions and 1 deletions
|
@ -1218,7 +1218,7 @@ def os_data():
|
|||
with salt.utils.fopen('/proc/1/cmdline') as fhr:
|
||||
init_cmdline = fhr.read().replace('\x00', ' ').split()
|
||||
init_bin = salt.utils.which(init_cmdline[0])
|
||||
if init_bin is not None:
|
||||
if init_bin is not None and init_bin.endswith('bin/init'):
|
||||
supported_inits = (six.b('upstart'), six.b('sysvinit'), six.b('systemd'))
|
||||
edge_len = max(len(x) for x in supported_inits) - 1
|
||||
try:
|
||||
|
@ -1247,6 +1247,8 @@ def os_data():
|
|||
'Unable to read from init_bin ({0}): {1}'
|
||||
.format(init_bin, exc)
|
||||
)
|
||||
elif salt.utils.which('supervisord') in init_cmdline:
|
||||
grains['init'] = 'supervisord'
|
||||
else:
|
||||
log.error(
|
||||
'Could not determine init location from command line: ({0})'
|
||||
|
|
Loading…
Add table
Reference in a new issue