salt-proxy 1.0 KB

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