1
0

salt-minion 961 B

1234567891011121314151617181920212223242526
  1. #!/usr/bin/env python
  2. '''
  3. This script is used to kick off a salt minion daemon
  4. '''
  5. import salt.utils.platform
  6. from salt.scripts import salt_minion
  7. from multiprocessing import freeze_support
  8. if __name__ == '__main__':
  9. if salt.utils.platform.is_windows():
  10. # Since this file does not have a '.py' extension, when running on
  11. # Windows, spawning any addional processes will fail due to Python
  12. # not being able to load this 'module' in the new process.
  13. # Work around this by creating a '.pyc' file which will enable the
  14. # spawned process to load this 'module' and proceed.
  15. import os.path
  16. import py_compile
  17. cfile = os.path.splitext(__file__)[0] + '.pyc'
  18. if not os.path.exists(cfile):
  19. py_compile.compile(__file__, cfile)
  20. # This handles the bootstrapping code that is included with frozen
  21. # scripts. It is a no-op on unfrozen code.
  22. freeze_support()
  23. salt_minion()