salt-minion 963 B

123456789101112131415161718192021222324252627
  1. #!/usr/bin/env python3
  2. """
  3. This script is used to kick off a salt minion daemon
  4. """
  5. from multiprocessing import freeze_support
  6. import salt.utils.platform
  7. from salt.scripts import salt_minion
  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()