mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 09:23:56 +00:00
Merge pull request #1265 from UtahDave/develop
Fixes for bugs causing minion to crash on Windows.
This commit is contained in:
commit
1336a2f225
@ -6,4 +6,4 @@ def shell():
|
||||
'''
|
||||
# Provides:
|
||||
# shell
|
||||
return {'shell': os.environ.get('SHELL', '/bin/sh'}
|
||||
return {'shell': os.environ.get('SHELL', '/bin/sh')}
|
||||
|
@ -55,10 +55,11 @@ def _run(cmd,
|
||||
# of the user salt-minion is running as. Default: /root
|
||||
if not cwd:
|
||||
cwd = os.path.expanduser('~{0}'.format('' if not runas else runas))
|
||||
|
||||
if not os.path.isfile(shell) or not os.access(shell, os.X_OK):
|
||||
msg = 'The shell {0} is not available'.format(shell)
|
||||
raise CommandExecutionError(msg)
|
||||
|
||||
if 'os' in os.environ and not os.environ['os'].startswith('Windows'):
|
||||
if not os.path.isfile(shell) or not os.access(shell, os.X_OK):
|
||||
msg = 'The shell {0} is not available'.format(shell)
|
||||
raise CommandExecutionError(msg)
|
||||
|
||||
# TODO: Figure out the proper way to do this in windows
|
||||
disable_runas = [
|
||||
|
@ -40,4 +40,7 @@ def enable_sigusr1_handler():
|
||||
Pretty print a stack trace to the console or a debug log under /tmp
|
||||
when any of the salt daemons such as salt-master are sent a SIGUSR1
|
||||
'''
|
||||
signal.signal(signal.SIGUSR1, _handle_sigusr1)
|
||||
# Skip setting up this signal on Windows
|
||||
# SIGUSR1 doesn't exist on Windows and causes the minion to crash
|
||||
if 'os' in os.environ and not os.environ['os'].startswith('Windows'):
|
||||
signal.signal(signal.SIGUSR1, _handle_sigusr1)
|
||||
|
Loading…
Reference in New Issue
Block a user